| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type OptionalKeysOf<Type extends object> = Type extends unknown |
| ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type |
| : never; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type RequiredKeysOf<Type extends object> = Type extends unknown |
| ? Exclude<keyof Type, OptionalKeysOf<Type>> : never; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type IsNever<T> = [T] extends [never] ? true : false; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = If<IsAny<T>, IfAny, If<IsNever<T>, IfNever, IfNotAnyOrNever>>; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {}; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false; |
| |
| type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] }; |
| |
| |
| |
| type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Merge<Destination, Source> = Destination extends unknown |
| ? Source extends unknown |
| ? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never |
| : never; |
| |
| type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> extends infer Result extends Required<Options> |
| ? Result : never; |
| type _ApplyDefaultOptions<Options, Defaults, SpecifiedOptions> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Merge<Defaults, { [Key in keyof SpecifiedOptions as undefined extends Required<Options>[Key & keyof Options] ? Key : undefined extends SpecifiedOptions[Key] ? never : Key]: SpecifiedOptions[Key] }>>>; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType); |
| type ExceptOptions = { |
| |
| |
| |
| |
| |
| requireExactProps?: boolean; |
| }; |
| type DefaultExceptOptions = { |
| requireExactProps: false; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>; |
| type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType] } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {}); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>; |
| type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { |
| |
| [Key in KeysType]-?: Required<Pick<ObjectType, Key>> |
| & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>; |
| |
| |
| |
| |
| |
| type TokenType = BooleanToken | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken; |
| interface BaseToken extends Span { |
| value: string; |
| regex: undefined; |
| } |
| interface BooleanToken extends BaseToken { |
| type: "Boolean"; |
| } |
| interface IdentifierToken extends BaseToken { |
| type: "Identifier"; |
| } |
| interface JSXIdentifierToken extends BaseToken { |
| type: "JSXIdentifier"; |
| } |
| interface JSXTextToken extends BaseToken { |
| type: "JSXText"; |
| } |
| interface KeywordToken extends BaseToken { |
| type: "Keyword"; |
| } |
| interface NullToken extends BaseToken { |
| type: "Null"; |
| } |
| interface NumericToken extends BaseToken { |
| type: "Numeric"; |
| } |
| interface PrivateIdentifierToken extends BaseToken { |
| type: "PrivateIdentifier"; |
| } |
| interface PunctuatorToken extends BaseToken { |
| type: "Punctuator"; |
| } |
| interface RegularExpressionToken extends Span { |
| type: "RegularExpression"; |
| value: string; |
| regex: { |
| pattern: string; |
| flags: string; |
| }; |
| } |
| interface StringToken extends BaseToken { |
| type: "String"; |
| } |
| interface TemplateToken extends BaseToken { |
| type: "Template"; |
| } |
| |
| |
| |
| |
| type BivarianceHackHandler<Handler extends (...args: any) => any> = { |
| bivarianceHack(...args: Parameters<Handler>): ReturnType<Handler>; |
| }["bivarianceHack"]; |
| interface StrictVisitorObject { |
| DebuggerStatement?: (node: DebuggerStatement) => void; |
| "DebuggerStatement:exit"?: (node: DebuggerStatement) => void; |
| EmptyStatement?: (node: EmptyStatement) => void; |
| "EmptyStatement:exit"?: (node: EmptyStatement) => void; |
| Literal?: (node: BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral) => void; |
| "Literal:exit"?: (node: BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral) => void; |
| PrivateIdentifier?: (node: PrivateIdentifier) => void; |
| "PrivateIdentifier:exit"?: (node: PrivateIdentifier) => void; |
| Super?: (node: Super) => void; |
| "Super:exit"?: (node: Super) => void; |
| TemplateElement?: (node: TemplateElement) => void; |
| "TemplateElement:exit"?: (node: TemplateElement) => void; |
| ThisExpression?: (node: ThisExpression) => void; |
| "ThisExpression:exit"?: (node: ThisExpression) => void; |
| JSXClosingFragment?: (node: JSXClosingFragment) => void; |
| "JSXClosingFragment:exit"?: (node: JSXClosingFragment) => void; |
| JSXEmptyExpression?: (node: JSXEmptyExpression) => void; |
| "JSXEmptyExpression:exit"?: (node: JSXEmptyExpression) => void; |
| JSXIdentifier?: (node: JSXIdentifier) => void; |
| "JSXIdentifier:exit"?: (node: JSXIdentifier) => void; |
| JSXOpeningFragment?: (node: JSXOpeningFragment) => void; |
| "JSXOpeningFragment:exit"?: (node: JSXOpeningFragment) => void; |
| JSXText?: (node: JSXText) => void; |
| "JSXText:exit"?: (node: JSXText) => void; |
| TSAnyKeyword?: (node: TSAnyKeyword) => void; |
| "TSAnyKeyword:exit"?: (node: TSAnyKeyword) => void; |
| TSBigIntKeyword?: (node: TSBigIntKeyword) => void; |
| "TSBigIntKeyword:exit"?: (node: TSBigIntKeyword) => void; |
| TSBooleanKeyword?: (node: TSBooleanKeyword) => void; |
| "TSBooleanKeyword:exit"?: (node: TSBooleanKeyword) => void; |
| TSIntrinsicKeyword?: (node: TSIntrinsicKeyword) => void; |
| "TSIntrinsicKeyword:exit"?: (node: TSIntrinsicKeyword) => void; |
| TSJSDocUnknownType?: (node: JSDocUnknownType) => void; |
| "TSJSDocUnknownType:exit"?: (node: JSDocUnknownType) => void; |
| TSNeverKeyword?: (node: TSNeverKeyword) => void; |
| "TSNeverKeyword:exit"?: (node: TSNeverKeyword) => void; |
| TSNullKeyword?: (node: TSNullKeyword) => void; |
| "TSNullKeyword:exit"?: (node: TSNullKeyword) => void; |
| TSNumberKeyword?: (node: TSNumberKeyword) => void; |
| "TSNumberKeyword:exit"?: (node: TSNumberKeyword) => void; |
| TSObjectKeyword?: (node: TSObjectKeyword) => void; |
| "TSObjectKeyword:exit"?: (node: TSObjectKeyword) => void; |
| TSStringKeyword?: (node: TSStringKeyword) => void; |
| "TSStringKeyword:exit"?: (node: TSStringKeyword) => void; |
| TSSymbolKeyword?: (node: TSSymbolKeyword) => void; |
| "TSSymbolKeyword:exit"?: (node: TSSymbolKeyword) => void; |
| TSThisType?: (node: TSThisType) => void; |
| "TSThisType:exit"?: (node: TSThisType) => void; |
| TSUndefinedKeyword?: (node: TSUndefinedKeyword) => void; |
| "TSUndefinedKeyword:exit"?: (node: TSUndefinedKeyword) => void; |
| TSUnknownKeyword?: (node: TSUnknownKeyword) => void; |
| "TSUnknownKeyword:exit"?: (node: TSUnknownKeyword) => void; |
| TSVoidKeyword?: (node: TSVoidKeyword) => void; |
| "TSVoidKeyword:exit"?: (node: TSVoidKeyword) => void; |
| AccessorProperty?: (node: AccessorProperty) => void; |
| "AccessorProperty:exit"?: (node: AccessorProperty) => void; |
| ArrayExpression?: (node: ArrayExpression) => void; |
| "ArrayExpression:exit"?: (node: ArrayExpression) => void; |
| ArrayPattern?: (node: ArrayPattern) => void; |
| "ArrayPattern:exit"?: (node: ArrayPattern) => void; |
| ArrowFunctionExpression?: (node: ArrowFunctionExpression) => void; |
| "ArrowFunctionExpression:exit"?: (node: ArrowFunctionExpression) => void; |
| AssignmentExpression?: (node: AssignmentExpression) => void; |
| "AssignmentExpression:exit"?: (node: AssignmentExpression) => void; |
| AssignmentPattern?: (node: AssignmentPattern) => void; |
| "AssignmentPattern:exit"?: (node: AssignmentPattern) => void; |
| AwaitExpression?: (node: AwaitExpression) => void; |
| "AwaitExpression:exit"?: (node: AwaitExpression) => void; |
| BinaryExpression?: (node: BinaryExpression) => void; |
| "BinaryExpression:exit"?: (node: BinaryExpression) => void; |
| BlockStatement?: (node: BlockStatement) => void; |
| "BlockStatement:exit"?: (node: BlockStatement) => void; |
| BreakStatement?: (node: BreakStatement) => void; |
| "BreakStatement:exit"?: (node: BreakStatement) => void; |
| CallExpression?: (node: CallExpression) => void; |
| "CallExpression:exit"?: (node: CallExpression) => void; |
| CatchClause?: (node: CatchClause) => void; |
| "CatchClause:exit"?: (node: CatchClause) => void; |
| ChainExpression?: (node: ChainExpression) => void; |
| "ChainExpression:exit"?: (node: ChainExpression) => void; |
| ClassBody?: (node: ClassBody) => void; |
| "ClassBody:exit"?: (node: ClassBody) => void; |
| ClassDeclaration?: (node: Class) => void; |
| "ClassDeclaration:exit"?: (node: Class) => void; |
| ClassExpression?: (node: Class) => void; |
| "ClassExpression:exit"?: (node: Class) => void; |
| ConditionalExpression?: (node: ConditionalExpression) => void; |
| "ConditionalExpression:exit"?: (node: ConditionalExpression) => void; |
| ContinueStatement?: (node: ContinueStatement) => void; |
| "ContinueStatement:exit"?: (node: ContinueStatement) => void; |
| Decorator?: (node: Decorator) => void; |
| "Decorator:exit"?: (node: Decorator) => void; |
| DoWhileStatement?: (node: DoWhileStatement) => void; |
| "DoWhileStatement:exit"?: (node: DoWhileStatement) => void; |
| ExportAllDeclaration?: (node: ExportAllDeclaration) => void; |
| "ExportAllDeclaration:exit"?: (node: ExportAllDeclaration) => void; |
| ExportDefaultDeclaration?: (node: ExportDefaultDeclaration) => void; |
| "ExportDefaultDeclaration:exit"?: (node: ExportDefaultDeclaration) => void; |
| ExportNamedDeclaration?: (node: ExportNamedDeclaration) => void; |
| "ExportNamedDeclaration:exit"?: (node: ExportNamedDeclaration) => void; |
| ExportSpecifier?: (node: ExportSpecifier) => void; |
| "ExportSpecifier:exit"?: (node: ExportSpecifier) => void; |
| ExpressionStatement?: (node: ExpressionStatement) => void; |
| "ExpressionStatement:exit"?: (node: ExpressionStatement) => void; |
| ForInStatement?: (node: ForInStatement) => void; |
| "ForInStatement:exit"?: (node: ForInStatement) => void; |
| ForOfStatement?: (node: ForOfStatement) => void; |
| "ForOfStatement:exit"?: (node: ForOfStatement) => void; |
| ForStatement?: (node: ForStatement) => void; |
| "ForStatement:exit"?: (node: ForStatement) => void; |
| FunctionDeclaration?: (node: Function$1) => void; |
| "FunctionDeclaration:exit"?: (node: Function$1) => void; |
| FunctionExpression?: (node: Function$1) => void; |
| "FunctionExpression:exit"?: (node: Function$1) => void; |
| Identifier?: (node: IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName) => void; |
| "Identifier:exit"?: (node: IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName) => void; |
| IfStatement?: (node: IfStatement) => void; |
| "IfStatement:exit"?: (node: IfStatement) => void; |
| ImportAttribute?: (node: ImportAttribute) => void; |
| "ImportAttribute:exit"?: (node: ImportAttribute) => void; |
| ImportDeclaration?: (node: ImportDeclaration) => void; |
| "ImportDeclaration:exit"?: (node: ImportDeclaration) => void; |
| ImportDefaultSpecifier?: (node: ImportDefaultSpecifier) => void; |
| "ImportDefaultSpecifier:exit"?: (node: ImportDefaultSpecifier) => void; |
| ImportExpression?: (node: ImportExpression) => void; |
| "ImportExpression:exit"?: (node: ImportExpression) => void; |
| ImportNamespaceSpecifier?: (node: ImportNamespaceSpecifier) => void; |
| "ImportNamespaceSpecifier:exit"?: (node: ImportNamespaceSpecifier) => void; |
| ImportSpecifier?: (node: ImportSpecifier) => void; |
| "ImportSpecifier:exit"?: (node: ImportSpecifier) => void; |
| LabeledStatement?: (node: LabeledStatement) => void; |
| "LabeledStatement:exit"?: (node: LabeledStatement) => void; |
| LogicalExpression?: (node: LogicalExpression) => void; |
| "LogicalExpression:exit"?: (node: LogicalExpression) => void; |
| MemberExpression?: (node: MemberExpression) => void; |
| "MemberExpression:exit"?: (node: MemberExpression) => void; |
| MetaProperty?: (node: MetaProperty) => void; |
| "MetaProperty:exit"?: (node: MetaProperty) => void; |
| MethodDefinition?: (node: MethodDefinition) => void; |
| "MethodDefinition:exit"?: (node: MethodDefinition) => void; |
| NewExpression?: (node: NewExpression) => void; |
| "NewExpression:exit"?: (node: NewExpression) => void; |
| ObjectExpression?: (node: ObjectExpression) => void; |
| "ObjectExpression:exit"?: (node: ObjectExpression) => void; |
| ObjectPattern?: (node: ObjectPattern) => void; |
| "ObjectPattern:exit"?: (node: ObjectPattern) => void; |
| ParenthesizedExpression?: (node: ParenthesizedExpression) => void; |
| "ParenthesizedExpression:exit"?: (node: ParenthesizedExpression) => void; |
| Program?: (node: Program) => void; |
| "Program:exit"?: (node: Program) => void; |
| Property?: (node: ObjectProperty | AssignmentTargetProperty | AssignmentTargetPropertyProperty | BindingProperty) => void; |
| "Property:exit"?: (node: ObjectProperty | AssignmentTargetProperty | AssignmentTargetPropertyProperty | BindingProperty) => void; |
| PropertyDefinition?: (node: PropertyDefinition) => void; |
| "PropertyDefinition:exit"?: (node: PropertyDefinition) => void; |
| RestElement?: (node: AssignmentTargetRest | BindingRestElement | FormalParameterRest) => void; |
| "RestElement:exit"?: (node: AssignmentTargetRest | BindingRestElement | FormalParameterRest) => void; |
| ReturnStatement?: (node: ReturnStatement) => void; |
| "ReturnStatement:exit"?: (node: ReturnStatement) => void; |
| SequenceExpression?: (node: SequenceExpression) => void; |
| "SequenceExpression:exit"?: (node: SequenceExpression) => void; |
| SpreadElement?: (node: SpreadElement) => void; |
| "SpreadElement:exit"?: (node: SpreadElement) => void; |
| StaticBlock?: (node: StaticBlock) => void; |
| "StaticBlock:exit"?: (node: StaticBlock) => void; |
| SwitchCase?: (node: SwitchCase) => void; |
| "SwitchCase:exit"?: (node: SwitchCase) => void; |
| SwitchStatement?: (node: SwitchStatement) => void; |
| "SwitchStatement:exit"?: (node: SwitchStatement) => void; |
| TaggedTemplateExpression?: (node: TaggedTemplateExpression) => void; |
| "TaggedTemplateExpression:exit"?: (node: TaggedTemplateExpression) => void; |
| TemplateLiteral?: (node: TemplateLiteral) => void; |
| "TemplateLiteral:exit"?: (node: TemplateLiteral) => void; |
| ThrowStatement?: (node: ThrowStatement) => void; |
| "ThrowStatement:exit"?: (node: ThrowStatement) => void; |
| TryStatement?: (node: TryStatement) => void; |
| "TryStatement:exit"?: (node: TryStatement) => void; |
| UnaryExpression?: (node: UnaryExpression) => void; |
| "UnaryExpression:exit"?: (node: UnaryExpression) => void; |
| UpdateExpression?: (node: UpdateExpression) => void; |
| "UpdateExpression:exit"?: (node: UpdateExpression) => void; |
| V8IntrinsicExpression?: (node: V8IntrinsicExpression) => void; |
| "V8IntrinsicExpression:exit"?: (node: V8IntrinsicExpression) => void; |
| VariableDeclaration?: (node: VariableDeclaration) => void; |
| "VariableDeclaration:exit"?: (node: VariableDeclaration) => void; |
| VariableDeclarator?: (node: VariableDeclarator) => void; |
| "VariableDeclarator:exit"?: (node: VariableDeclarator) => void; |
| WhileStatement?: (node: WhileStatement) => void; |
| "WhileStatement:exit"?: (node: WhileStatement) => void; |
| WithStatement?: (node: WithStatement) => void; |
| "WithStatement:exit"?: (node: WithStatement) => void; |
| YieldExpression?: (node: YieldExpression) => void; |
| "YieldExpression:exit"?: (node: YieldExpression) => void; |
| JSXAttribute?: (node: JSXAttribute) => void; |
| "JSXAttribute:exit"?: (node: JSXAttribute) => void; |
| JSXClosingElement?: (node: JSXClosingElement) => void; |
| "JSXClosingElement:exit"?: (node: JSXClosingElement) => void; |
| JSXElement?: (node: JSXElement) => void; |
| "JSXElement:exit"?: (node: JSXElement) => void; |
| JSXExpressionContainer?: (node: JSXExpressionContainer) => void; |
| "JSXExpressionContainer:exit"?: (node: JSXExpressionContainer) => void; |
| JSXFragment?: (node: JSXFragment) => void; |
| "JSXFragment:exit"?: (node: JSXFragment) => void; |
| JSXMemberExpression?: (node: JSXMemberExpression) => void; |
| "JSXMemberExpression:exit"?: (node: JSXMemberExpression) => void; |
| JSXNamespacedName?: (node: JSXNamespacedName) => void; |
| "JSXNamespacedName:exit"?: (node: JSXNamespacedName) => void; |
| JSXOpeningElement?: (node: JSXOpeningElement) => void; |
| "JSXOpeningElement:exit"?: (node: JSXOpeningElement) => void; |
| JSXSpreadAttribute?: (node: JSXSpreadAttribute) => void; |
| "JSXSpreadAttribute:exit"?: (node: JSXSpreadAttribute) => void; |
| JSXSpreadChild?: (node: JSXSpreadChild) => void; |
| "JSXSpreadChild:exit"?: (node: JSXSpreadChild) => void; |
| TSAbstractAccessorProperty?: (node: AccessorProperty) => void; |
| "TSAbstractAccessorProperty:exit"?: (node: AccessorProperty) => void; |
| TSAbstractMethodDefinition?: (node: MethodDefinition) => void; |
| "TSAbstractMethodDefinition:exit"?: (node: MethodDefinition) => void; |
| TSAbstractPropertyDefinition?: (node: PropertyDefinition) => void; |
| "TSAbstractPropertyDefinition:exit"?: (node: PropertyDefinition) => void; |
| TSArrayType?: (node: TSArrayType) => void; |
| "TSArrayType:exit"?: (node: TSArrayType) => void; |
| TSAsExpression?: (node: TSAsExpression) => void; |
| "TSAsExpression:exit"?: (node: TSAsExpression) => void; |
| TSCallSignatureDeclaration?: (node: TSCallSignatureDeclaration) => void; |
| "TSCallSignatureDeclaration:exit"?: (node: TSCallSignatureDeclaration) => void; |
| TSClassImplements?: (node: TSClassImplements) => void; |
| "TSClassImplements:exit"?: (node: TSClassImplements) => void; |
| TSConditionalType?: (node: TSConditionalType) => void; |
| "TSConditionalType:exit"?: (node: TSConditionalType) => void; |
| TSConstructSignatureDeclaration?: (node: TSConstructSignatureDeclaration) => void; |
| "TSConstructSignatureDeclaration:exit"?: (node: TSConstructSignatureDeclaration) => void; |
| TSConstructorType?: (node: TSConstructorType) => void; |
| "TSConstructorType:exit"?: (node: TSConstructorType) => void; |
| TSDeclareFunction?: (node: Function$1) => void; |
| "TSDeclareFunction:exit"?: (node: Function$1) => void; |
| TSEmptyBodyFunctionExpression?: (node: Function$1) => void; |
| "TSEmptyBodyFunctionExpression:exit"?: (node: Function$1) => void; |
| TSEnumBody?: (node: TSEnumBody) => void; |
| "TSEnumBody:exit"?: (node: TSEnumBody) => void; |
| TSEnumDeclaration?: (node: TSEnumDeclaration) => void; |
| "TSEnumDeclaration:exit"?: (node: TSEnumDeclaration) => void; |
| TSEnumMember?: (node: TSEnumMember) => void; |
| "TSEnumMember:exit"?: (node: TSEnumMember) => void; |
| TSExportAssignment?: (node: TSExportAssignment) => void; |
| "TSExportAssignment:exit"?: (node: TSExportAssignment) => void; |
| TSExternalModuleReference?: (node: TSExternalModuleReference) => void; |
| "TSExternalModuleReference:exit"?: (node: TSExternalModuleReference) => void; |
| TSFunctionType?: (node: TSFunctionType) => void; |
| "TSFunctionType:exit"?: (node: TSFunctionType) => void; |
| TSImportEqualsDeclaration?: (node: TSImportEqualsDeclaration) => void; |
| "TSImportEqualsDeclaration:exit"?: (node: TSImportEqualsDeclaration) => void; |
| TSImportType?: (node: TSImportType) => void; |
| "TSImportType:exit"?: (node: TSImportType) => void; |
| TSIndexSignature?: (node: TSIndexSignature) => void; |
| "TSIndexSignature:exit"?: (node: TSIndexSignature) => void; |
| TSIndexedAccessType?: (node: TSIndexedAccessType) => void; |
| "TSIndexedAccessType:exit"?: (node: TSIndexedAccessType) => void; |
| TSInferType?: (node: TSInferType) => void; |
| "TSInferType:exit"?: (node: TSInferType) => void; |
| TSInstantiationExpression?: (node: TSInstantiationExpression) => void; |
| "TSInstantiationExpression:exit"?: (node: TSInstantiationExpression) => void; |
| TSInterfaceBody?: (node: TSInterfaceBody) => void; |
| "TSInterfaceBody:exit"?: (node: TSInterfaceBody) => void; |
| TSInterfaceDeclaration?: (node: TSInterfaceDeclaration) => void; |
| "TSInterfaceDeclaration:exit"?: (node: TSInterfaceDeclaration) => void; |
| TSInterfaceHeritage?: (node: TSInterfaceHeritage) => void; |
| "TSInterfaceHeritage:exit"?: (node: TSInterfaceHeritage) => void; |
| TSIntersectionType?: (node: TSIntersectionType) => void; |
| "TSIntersectionType:exit"?: (node: TSIntersectionType) => void; |
| TSJSDocNonNullableType?: (node: JSDocNonNullableType) => void; |
| "TSJSDocNonNullableType:exit"?: (node: JSDocNonNullableType) => void; |
| TSJSDocNullableType?: (node: JSDocNullableType) => void; |
| "TSJSDocNullableType:exit"?: (node: JSDocNullableType) => void; |
| TSLiteralType?: (node: TSLiteralType) => void; |
| "TSLiteralType:exit"?: (node: TSLiteralType) => void; |
| TSMappedType?: (node: TSMappedType) => void; |
| "TSMappedType:exit"?: (node: TSMappedType) => void; |
| TSMethodSignature?: (node: TSMethodSignature) => void; |
| "TSMethodSignature:exit"?: (node: TSMethodSignature) => void; |
| TSModuleBlock?: (node: TSModuleBlock) => void; |
| "TSModuleBlock:exit"?: (node: TSModuleBlock) => void; |
| TSModuleDeclaration?: (node: TSModuleDeclaration | TSGlobalDeclaration) => void; |
| "TSModuleDeclaration:exit"?: (node: TSModuleDeclaration | TSGlobalDeclaration) => void; |
| TSNamedTupleMember?: (node: TSNamedTupleMember) => void; |
| "TSNamedTupleMember:exit"?: (node: TSNamedTupleMember) => void; |
| TSNamespaceExportDeclaration?: (node: TSNamespaceExportDeclaration) => void; |
| "TSNamespaceExportDeclaration:exit"?: (node: TSNamespaceExportDeclaration) => void; |
| TSNonNullExpression?: (node: TSNonNullExpression) => void; |
| "TSNonNullExpression:exit"?: (node: TSNonNullExpression) => void; |
| TSOptionalType?: (node: TSOptionalType) => void; |
| "TSOptionalType:exit"?: (node: TSOptionalType) => void; |
| TSParameterProperty?: (node: TSParameterProperty) => void; |
| "TSParameterProperty:exit"?: (node: TSParameterProperty) => void; |
| TSParenthesizedType?: (node: TSParenthesizedType) => void; |
| "TSParenthesizedType:exit"?: (node: TSParenthesizedType) => void; |
| TSPropertySignature?: (node: TSPropertySignature) => void; |
| "TSPropertySignature:exit"?: (node: TSPropertySignature) => void; |
| TSQualifiedName?: (node: TSQualifiedName) => void; |
| "TSQualifiedName:exit"?: (node: TSQualifiedName) => void; |
| TSRestType?: (node: TSRestType) => void; |
| "TSRestType:exit"?: (node: TSRestType) => void; |
| TSSatisfiesExpression?: (node: TSSatisfiesExpression) => void; |
| "TSSatisfiesExpression:exit"?: (node: TSSatisfiesExpression) => void; |
| TSTemplateLiteralType?: (node: TSTemplateLiteralType) => void; |
| "TSTemplateLiteralType:exit"?: (node: TSTemplateLiteralType) => void; |
| TSTupleType?: (node: TSTupleType) => void; |
| "TSTupleType:exit"?: (node: TSTupleType) => void; |
| TSTypeAliasDeclaration?: (node: TSTypeAliasDeclaration) => void; |
| "TSTypeAliasDeclaration:exit"?: (node: TSTypeAliasDeclaration) => void; |
| TSTypeAnnotation?: (node: TSTypeAnnotation) => void; |
| "TSTypeAnnotation:exit"?: (node: TSTypeAnnotation) => void; |
| TSTypeAssertion?: (node: TSTypeAssertion) => void; |
| "TSTypeAssertion:exit"?: (node: TSTypeAssertion) => void; |
| TSTypeLiteral?: (node: TSTypeLiteral) => void; |
| "TSTypeLiteral:exit"?: (node: TSTypeLiteral) => void; |
| TSTypeOperator?: (node: TSTypeOperator) => void; |
| "TSTypeOperator:exit"?: (node: TSTypeOperator) => void; |
| TSTypeParameter?: (node: TSTypeParameter) => void; |
| "TSTypeParameter:exit"?: (node: TSTypeParameter) => void; |
| TSTypeParameterDeclaration?: (node: TSTypeParameterDeclaration) => void; |
| "TSTypeParameterDeclaration:exit"?: (node: TSTypeParameterDeclaration) => void; |
| TSTypeParameterInstantiation?: (node: TSTypeParameterInstantiation) => void; |
| "TSTypeParameterInstantiation:exit"?: (node: TSTypeParameterInstantiation) => void; |
| TSTypePredicate?: (node: TSTypePredicate) => void; |
| "TSTypePredicate:exit"?: (node: TSTypePredicate) => void; |
| TSTypeQuery?: (node: TSTypeQuery) => void; |
| "TSTypeQuery:exit"?: (node: TSTypeQuery) => void; |
| TSTypeReference?: (node: TSTypeReference) => void; |
| "TSTypeReference:exit"?: (node: TSTypeReference) => void; |
| TSUnionType?: (node: TSUnionType) => void; |
| "TSUnionType:exit"?: (node: TSUnionType) => void; |
| } |
| type VisitorObject = { [K in keyof StrictVisitorObject]?: BivarianceHackHandler<Exclude<StrictVisitorObject[K], undefined>> | undefined } & Record<string, BivarianceHackHandler<(node: Node) => void> | undefined>; |
| |
| |
| type BeforeHook = () => boolean | void; |
| type AfterHook = () => void; |
| type VisitorWithHooks = VisitorObject & { |
| before?: BeforeHook; |
| after?: AfterHook; |
| }; |
| interface Node$1 extends Span {} |
| type NodeOrToken = Node$1 | TokenType | CommentType; |
| |
| |
| |
| |
| |
| type Range = [number, number]; |
| |
| |
| |
| interface Ranged { |
| range: Range; |
| } |
| |
| |
| |
| interface Span extends Ranged { |
| start: number; |
| end: number; |
| loc: Location; |
| } |
| |
| |
| |
| interface Location { |
| start: LineColumn; |
| end: LineColumn; |
| } |
| |
| |
| |
| |
| interface LineColumn { |
| line: number; |
| column: number; |
| } |
| |
| |
| |
| |
| |
| |
| declare function getLineColumnFromOffset(offset: number): LineColumn; |
| |
| |
| |
| |
| |
| |
| |
| declare function getOffsetFromLineColumn(loc: LineColumn): number; |
| |
| |
| |
| |
| |
| declare function getRange(nodeOrToken: NodeOrToken): Range; |
| |
| |
| |
| |
| |
| declare function getLoc(nodeOrToken: NodeOrToken): Location; |
| |
| |
| |
| |
| |
| declare function getNodeByRangeIndex(offset: number): Node | null; |
| |
| |
| |
| |
| |
| interface CommentType extends Span { |
| type: "Line" | "Block" | "Shebang"; |
| value: string; |
| } |
| |
| |
| interface Program extends Span { |
| type: "Program"; |
| body: Array<Directive$1 | Statement>; |
| sourceType: ModuleKind; |
| comments: CommentType[]; |
| tokens: TokenType[]; |
| parent: null; |
| } |
| type Expression = BooleanLiteral | NullLiteral | NumericLiteral | BigIntLiteral | RegExpLiteral | StringLiteral | TemplateLiteral | IdentifierReference | MetaProperty | Super | ArrayExpression | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | Class | ConditionalExpression | Function$1 | ImportExpression | LogicalExpression | NewExpression | ObjectExpression | ParenthesizedExpression | SequenceExpression | TaggedTemplateExpression | ThisExpression | UnaryExpression | UpdateExpression | YieldExpression | PrivateInExpression | JSXElement | JSXFragment | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | TSInstantiationExpression | V8IntrinsicExpression | MemberExpression; |
| interface IdentifierName extends Span { |
| type: "Identifier"; |
| decorators?: []; |
| name: string; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface IdentifierReference extends Span { |
| type: "Identifier"; |
| decorators?: []; |
| name: string; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface BindingIdentifier extends Span { |
| type: "Identifier"; |
| decorators?: []; |
| name: string; |
| optional?: false; |
| typeAnnotation?: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| interface LabelIdentifier extends Span { |
| type: "Identifier"; |
| decorators?: []; |
| name: string; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface ThisExpression extends Span { |
| type: "ThisExpression"; |
| parent: Node; |
| } |
| interface ArrayExpression extends Span { |
| type: "ArrayExpression"; |
| elements: Array<ArrayExpressionElement>; |
| parent: Node; |
| } |
| type ArrayExpressionElement = SpreadElement | null | Expression; |
| interface ObjectExpression extends Span { |
| type: "ObjectExpression"; |
| properties: Array<ObjectPropertyKind>; |
| parent: Node; |
| } |
| type ObjectPropertyKind = ObjectProperty | SpreadElement; |
| interface ObjectProperty extends Span { |
| type: "Property"; |
| kind: PropertyKind; |
| key: PropertyKey$1; |
| value: Expression; |
| method: boolean; |
| shorthand: boolean; |
| computed: boolean; |
| optional?: false; |
| parent: Node; |
| } |
| type PropertyKey$1 = IdentifierName | PrivateIdentifier | Expression; |
| type PropertyKind = "init" | "get" | "set"; |
| interface TemplateLiteral extends Span { |
| type: "TemplateLiteral"; |
| quasis: Array<TemplateElement>; |
| expressions: Array<Expression>; |
| parent: Node; |
| } |
| interface TaggedTemplateExpression extends Span { |
| type: "TaggedTemplateExpression"; |
| tag: Expression; |
| typeArguments?: TSTypeParameterInstantiation | null; |
| quasi: TemplateLiteral; |
| parent: Node; |
| } |
| interface TemplateElement extends Span { |
| type: "TemplateElement"; |
| value: TemplateElementValue; |
| tail: boolean; |
| parent: Node; |
| } |
| interface TemplateElementValue { |
| raw: string; |
| cooked: string | null; |
| } |
| type MemberExpression = ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression; |
| interface ComputedMemberExpression extends Span { |
| type: "MemberExpression"; |
| object: Expression; |
| property: Expression; |
| optional: boolean; |
| computed: true; |
| parent: Node; |
| } |
| interface StaticMemberExpression extends Span { |
| type: "MemberExpression"; |
| object: Expression; |
| property: IdentifierName; |
| optional: boolean; |
| computed: false; |
| parent: Node; |
| } |
| interface PrivateFieldExpression extends Span { |
| type: "MemberExpression"; |
| object: Expression; |
| property: PrivateIdentifier; |
| optional: boolean; |
| computed: false; |
| parent: Node; |
| } |
| interface CallExpression extends Span { |
| type: "CallExpression"; |
| callee: Expression; |
| typeArguments?: TSTypeParameterInstantiation | null; |
| arguments: Array<Argument>; |
| optional: boolean; |
| parent: Node; |
| } |
| interface NewExpression extends Span { |
| type: "NewExpression"; |
| callee: Expression; |
| typeArguments?: TSTypeParameterInstantiation | null; |
| arguments: Array<Argument>; |
| parent: Node; |
| } |
| interface MetaProperty extends Span { |
| type: "MetaProperty"; |
| meta: IdentifierName; |
| property: IdentifierName; |
| parent: Node; |
| } |
| interface SpreadElement extends Span { |
| type: "SpreadElement"; |
| argument: Expression; |
| parent: Node; |
| } |
| type Argument = SpreadElement | Expression; |
| interface UpdateExpression extends Span { |
| type: "UpdateExpression"; |
| operator: UpdateOperator; |
| prefix: boolean; |
| argument: SimpleAssignmentTarget; |
| parent: Node; |
| } |
| interface UnaryExpression extends Span { |
| type: "UnaryExpression"; |
| operator: UnaryOperator; |
| argument: Expression; |
| prefix: true; |
| parent: Node; |
| } |
| interface BinaryExpression extends Span { |
| type: "BinaryExpression"; |
| left: Expression; |
| operator: BinaryOperator; |
| right: Expression; |
| parent: Node; |
| } |
| interface PrivateInExpression extends Span { |
| type: "BinaryExpression"; |
| left: PrivateIdentifier; |
| operator: "in"; |
| right: Expression; |
| parent: Node; |
| } |
| interface LogicalExpression extends Span { |
| type: "LogicalExpression"; |
| left: Expression; |
| operator: LogicalOperator; |
| right: Expression; |
| parent: Node; |
| } |
| interface ConditionalExpression extends Span { |
| type: "ConditionalExpression"; |
| test: Expression; |
| consequent: Expression; |
| alternate: Expression; |
| parent: Node; |
| } |
| interface AssignmentExpression extends Span { |
| type: "AssignmentExpression"; |
| operator: AssignmentOperator; |
| left: AssignmentTarget; |
| right: Expression; |
| parent: Node; |
| } |
| type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern; |
| type SimpleAssignmentTarget = IdentifierReference | TSAsExpression | TSSatisfiesExpression | TSNonNullExpression | TSTypeAssertion | MemberExpression; |
| type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget; |
| interface ArrayAssignmentTarget extends Span { |
| type: "ArrayPattern"; |
| decorators?: []; |
| elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface ObjectAssignmentTarget extends Span { |
| type: "ObjectPattern"; |
| decorators?: []; |
| properties: Array<AssignmentTargetProperty | AssignmentTargetRest>; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface AssignmentTargetRest extends Span { |
| type: "RestElement"; |
| decorators?: []; |
| argument: AssignmentTarget; |
| optional?: false; |
| typeAnnotation?: null; |
| value?: null; |
| parent: Node; |
| } |
| type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget; |
| interface AssignmentTargetWithDefault extends Span { |
| type: "AssignmentPattern"; |
| decorators?: []; |
| left: AssignmentTarget; |
| right: Expression; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| type AssignmentTargetProperty = AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty; |
| interface AssignmentTargetPropertyIdentifier extends Span { |
| type: "Property"; |
| kind: "init"; |
| key: IdentifierReference; |
| value: IdentifierReference | AssignmentTargetWithDefault; |
| method: false; |
| shorthand: true; |
| computed: false; |
| optional?: false; |
| parent: Node; |
| } |
| interface AssignmentTargetPropertyProperty extends Span { |
| type: "Property"; |
| kind: "init"; |
| key: PropertyKey$1; |
| value: AssignmentTargetMaybeDefault; |
| method: false; |
| shorthand: false; |
| computed: boolean; |
| optional?: false; |
| parent: Node; |
| } |
| interface SequenceExpression extends Span { |
| type: "SequenceExpression"; |
| expressions: Array<Expression>; |
| parent: Node; |
| } |
| interface Super extends Span { |
| type: "Super"; |
| parent: Node; |
| } |
| interface AwaitExpression extends Span { |
| type: "AwaitExpression"; |
| argument: Expression; |
| parent: Node; |
| } |
| interface ChainExpression extends Span { |
| type: "ChainExpression"; |
| expression: ChainElement; |
| parent: Node; |
| } |
| type ChainElement = CallExpression | TSNonNullExpression | MemberExpression; |
| interface ParenthesizedExpression extends Span { |
| type: "ParenthesizedExpression"; |
| expression: Expression; |
| parent: Node; |
| } |
| type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | WithStatement | Declaration | ModuleDeclaration; |
| interface Directive$1 extends Span { |
| type: "ExpressionStatement"; |
| expression: StringLiteral; |
| directive: string; |
| parent: Node; |
| } |
| interface Hashbang extends Span { |
| type: "Hashbang"; |
| value: string; |
| parent: Node; |
| } |
| interface BlockStatement extends Span { |
| type: "BlockStatement"; |
| body: Array<Statement>; |
| parent: Node; |
| } |
| type Declaration = VariableDeclaration | Function$1 | Class | TSTypeAliasDeclaration | TSInterfaceDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSGlobalDeclaration | TSImportEqualsDeclaration; |
| interface VariableDeclaration extends Span { |
| type: "VariableDeclaration"; |
| kind: VariableDeclarationKind; |
| declarations: Array<VariableDeclarator>; |
| declare?: boolean; |
| parent: Node; |
| } |
| type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using"; |
| interface VariableDeclarator extends Span { |
| type: "VariableDeclarator"; |
| id: BindingPattern; |
| init: Expression | null; |
| definite?: boolean; |
| parent: Node; |
| } |
| interface EmptyStatement extends Span { |
| type: "EmptyStatement"; |
| parent: Node; |
| } |
| interface ExpressionStatement extends Span { |
| type: "ExpressionStatement"; |
| expression: Expression; |
| directive?: string | null; |
| parent: Node; |
| } |
| interface IfStatement extends Span { |
| type: "IfStatement"; |
| test: Expression; |
| consequent: Statement; |
| alternate: Statement | null; |
| parent: Node; |
| } |
| interface DoWhileStatement extends Span { |
| type: "DoWhileStatement"; |
| body: Statement; |
| test: Expression; |
| parent: Node; |
| } |
| interface WhileStatement extends Span { |
| type: "WhileStatement"; |
| test: Expression; |
| body: Statement; |
| parent: Node; |
| } |
| interface ForStatement extends Span { |
| type: "ForStatement"; |
| init: ForStatementInit | null; |
| test: Expression | null; |
| update: Expression | null; |
| body: Statement; |
| parent: Node; |
| } |
| type ForStatementInit = VariableDeclaration | Expression; |
| interface ForInStatement extends Span { |
| type: "ForInStatement"; |
| left: ForStatementLeft; |
| right: Expression; |
| body: Statement; |
| parent: Node; |
| } |
| type ForStatementLeft = VariableDeclaration | AssignmentTarget; |
| interface ForOfStatement extends Span { |
| type: "ForOfStatement"; |
| await: boolean; |
| left: ForStatementLeft; |
| right: Expression; |
| body: Statement; |
| parent: Node; |
| } |
| interface ContinueStatement extends Span { |
| type: "ContinueStatement"; |
| label: LabelIdentifier | null; |
| parent: Node; |
| } |
| interface BreakStatement extends Span { |
| type: "BreakStatement"; |
| label: LabelIdentifier | null; |
| parent: Node; |
| } |
| interface ReturnStatement extends Span { |
| type: "ReturnStatement"; |
| argument: Expression | null; |
| parent: Node; |
| } |
| interface WithStatement extends Span { |
| type: "WithStatement"; |
| object: Expression; |
| body: Statement; |
| parent: Node; |
| } |
| interface SwitchStatement extends Span { |
| type: "SwitchStatement"; |
| discriminant: Expression; |
| cases: Array<SwitchCase>; |
| parent: Node; |
| } |
| interface SwitchCase extends Span { |
| type: "SwitchCase"; |
| test: Expression | null; |
| consequent: Array<Statement>; |
| parent: Node; |
| } |
| interface LabeledStatement extends Span { |
| type: "LabeledStatement"; |
| label: LabelIdentifier; |
| body: Statement; |
| parent: Node; |
| } |
| interface ThrowStatement extends Span { |
| type: "ThrowStatement"; |
| argument: Expression; |
| parent: Node; |
| } |
| interface TryStatement extends Span { |
| type: "TryStatement"; |
| block: BlockStatement; |
| handler: CatchClause | null; |
| finalizer: BlockStatement | null; |
| parent: Node; |
| } |
| interface CatchClause extends Span { |
| type: "CatchClause"; |
| param: BindingPattern | null; |
| body: BlockStatement; |
| parent: Node; |
| } |
| interface DebuggerStatement extends Span { |
| type: "DebuggerStatement"; |
| parent: Node; |
| } |
| type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern; |
| interface AssignmentPattern extends Span { |
| type: "AssignmentPattern"; |
| decorators?: []; |
| left: BindingPattern; |
| right: Expression; |
| optional?: false; |
| typeAnnotation?: null; |
| parent: Node; |
| } |
| interface ObjectPattern extends Span { |
| type: "ObjectPattern"; |
| decorators?: []; |
| properties: Array<BindingProperty | BindingRestElement>; |
| optional?: false; |
| typeAnnotation?: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| interface BindingProperty extends Span { |
| type: "Property"; |
| kind: "init"; |
| key: PropertyKey$1; |
| value: BindingPattern; |
| method: false; |
| shorthand: boolean; |
| computed: boolean; |
| optional?: false; |
| parent: Node; |
| } |
| interface ArrayPattern extends Span { |
| type: "ArrayPattern"; |
| decorators?: []; |
| elements: Array<BindingPattern | BindingRestElement | null>; |
| optional?: false; |
| typeAnnotation?: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| interface BindingRestElement extends Span { |
| type: "RestElement"; |
| decorators?: []; |
| argument: BindingPattern; |
| optional?: false; |
| typeAnnotation?: TSTypeAnnotation | null; |
| value?: null; |
| parent: Node; |
| } |
| interface Function$1 extends Span { |
| type: FunctionType; |
| id: BindingIdentifier | null; |
| generator: boolean; |
| async: boolean; |
| declare?: boolean; |
| typeParameters?: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType?: TSTypeAnnotation | null; |
| body: FunctionBody | null; |
| expression: false; |
| parent: Node; |
| } |
| type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest; |
| type FunctionType = "FunctionDeclaration" | "FunctionExpression" | "TSDeclareFunction" | "TSEmptyBodyFunctionExpression"; |
| interface FormalParameterRest extends Span { |
| type: "RestElement"; |
| argument: BindingPattern; |
| decorators?: []; |
| optional?: boolean; |
| typeAnnotation?: TSTypeAnnotation | null; |
| value?: null; |
| parent: Node; |
| } |
| type FormalParameter = { |
| decorators?: Array<Decorator>; |
| } & BindingPattern; |
| interface TSParameterProperty extends Span { |
| type: "TSParameterProperty"; |
| accessibility: TSAccessibility | null; |
| decorators: Array<Decorator>; |
| override: boolean; |
| parameter: FormalParameter; |
| readonly: boolean; |
| static: boolean; |
| parent: Node; |
| } |
| interface FunctionBody extends Span { |
| type: "BlockStatement"; |
| body: Array<Directive$1 | Statement>; |
| parent: Node; |
| } |
| interface ArrowFunctionExpression extends Span { |
| type: "ArrowFunctionExpression"; |
| expression: boolean; |
| async: boolean; |
| typeParameters?: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType?: TSTypeAnnotation | null; |
| body: FunctionBody | Expression; |
| id: null; |
| generator: false; |
| parent: Node; |
| } |
| interface YieldExpression extends Span { |
| type: "YieldExpression"; |
| delegate: boolean; |
| argument: Expression | null; |
| parent: Node; |
| } |
| interface Class extends Span { |
| type: ClassType; |
| decorators: Array<Decorator>; |
| id: BindingIdentifier | null; |
| typeParameters?: TSTypeParameterDeclaration | null; |
| superClass: Expression | null; |
| superTypeArguments?: TSTypeParameterInstantiation | null; |
| implements?: Array<TSClassImplements>; |
| body: ClassBody; |
| abstract?: boolean; |
| declare?: boolean; |
| parent: Node; |
| } |
| type ClassType = "ClassDeclaration" | "ClassExpression"; |
| interface ClassBody extends Span { |
| type: "ClassBody"; |
| body: Array<ClassElement>; |
| parent: Node; |
| } |
| type ClassElement = StaticBlock | MethodDefinition | PropertyDefinition | AccessorProperty | TSIndexSignature; |
| interface MethodDefinition extends Span { |
| type: MethodDefinitionType; |
| decorators: Array<Decorator>; |
| key: PropertyKey$1; |
| value: Function$1; |
| kind: MethodDefinitionKind; |
| computed: boolean; |
| static: boolean; |
| override?: boolean; |
| optional?: boolean; |
| accessibility?: TSAccessibility | null; |
| parent: Node; |
| } |
| type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition"; |
| interface PropertyDefinition extends Span { |
| type: PropertyDefinitionType; |
| decorators: Array<Decorator>; |
| key: PropertyKey$1; |
| typeAnnotation?: TSTypeAnnotation | null; |
| value: Expression | null; |
| computed: boolean; |
| static: boolean; |
| declare?: boolean; |
| override?: boolean; |
| optional?: boolean; |
| definite?: boolean; |
| readonly?: boolean; |
| accessibility?: TSAccessibility | null; |
| parent: Node; |
| } |
| type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition"; |
| type MethodDefinitionKind = "constructor" | "method" | "get" | "set"; |
| interface PrivateIdentifier extends Span { |
| type: "PrivateIdentifier"; |
| name: string; |
| parent: Node; |
| } |
| interface StaticBlock extends Span { |
| type: "StaticBlock"; |
| body: Array<Statement>; |
| parent: Node; |
| } |
| type ModuleDeclaration = ImportDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | TSExportAssignment | TSNamespaceExportDeclaration; |
| type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty"; |
| interface AccessorProperty extends Span { |
| type: AccessorPropertyType; |
| decorators: Array<Decorator>; |
| key: PropertyKey$1; |
| typeAnnotation?: TSTypeAnnotation | null; |
| value: Expression | null; |
| computed: boolean; |
| static: boolean; |
| override?: boolean; |
| definite?: boolean; |
| accessibility?: TSAccessibility | null; |
| declare?: false; |
| optional?: false; |
| readonly?: false; |
| parent: Node; |
| } |
| interface ImportExpression extends Span { |
| type: "ImportExpression"; |
| source: Expression; |
| options: Expression | null; |
| phase: ImportPhase | null; |
| parent: Node; |
| } |
| interface ImportDeclaration extends Span { |
| type: "ImportDeclaration"; |
| specifiers: Array<ImportDeclarationSpecifier>; |
| source: StringLiteral; |
| phase: ImportPhase | null; |
| attributes: Array<ImportAttribute>; |
| importKind?: ImportOrExportKind; |
| parent: Node; |
| } |
| type ImportPhase = "source" | "defer"; |
| type ImportDeclarationSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier; |
| interface ImportSpecifier extends Span { |
| type: "ImportSpecifier"; |
| imported: ModuleExportName; |
| local: BindingIdentifier; |
| importKind?: ImportOrExportKind; |
| parent: Node; |
| } |
| interface ImportDefaultSpecifier extends Span { |
| type: "ImportDefaultSpecifier"; |
| local: BindingIdentifier; |
| parent: Node; |
| } |
| interface ImportNamespaceSpecifier extends Span { |
| type: "ImportNamespaceSpecifier"; |
| local: BindingIdentifier; |
| parent: Node; |
| } |
| interface ImportAttribute extends Span { |
| type: "ImportAttribute"; |
| key: ImportAttributeKey; |
| value: StringLiteral; |
| parent: Node; |
| } |
| type ImportAttributeKey = IdentifierName | StringLiteral; |
| interface ExportNamedDeclaration extends Span { |
| type: "ExportNamedDeclaration"; |
| declaration: Declaration | null; |
| specifiers: Array<ExportSpecifier>; |
| source: StringLiteral | null; |
| exportKind?: ImportOrExportKind; |
| attributes: Array<ImportAttribute>; |
| parent: Node; |
| } |
| interface ExportDefaultDeclaration extends Span { |
| type: "ExportDefaultDeclaration"; |
| declaration: ExportDefaultDeclarationKind; |
| exportKind?: "value"; |
| parent: Node; |
| } |
| interface ExportAllDeclaration extends Span { |
| type: "ExportAllDeclaration"; |
| exported: ModuleExportName | null; |
| source: StringLiteral; |
| attributes: Array<ImportAttribute>; |
| exportKind?: ImportOrExportKind; |
| parent: Node; |
| } |
| interface ExportSpecifier extends Span { |
| type: "ExportSpecifier"; |
| local: ModuleExportName; |
| exported: ModuleExportName; |
| exportKind?: ImportOrExportKind; |
| parent: Node; |
| } |
| type ExportDefaultDeclarationKind = Function$1 | Class | TSInterfaceDeclaration | Expression; |
| type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral; |
| interface V8IntrinsicExpression extends Span { |
| type: "V8IntrinsicExpression"; |
| name: IdentifierName; |
| arguments: Array<Argument>; |
| parent: Node; |
| } |
| interface BooleanLiteral extends Span { |
| type: "Literal"; |
| value: boolean; |
| raw: string | null; |
| parent: Node; |
| } |
| interface NullLiteral extends Span { |
| type: "Literal"; |
| value: null; |
| raw: "null" | null; |
| parent: Node; |
| } |
| interface NumericLiteral extends Span { |
| type: "Literal"; |
| value: number; |
| raw: string | null; |
| parent: Node; |
| } |
| interface StringLiteral extends Span { |
| type: "Literal"; |
| value: string; |
| raw: string | null; |
| parent: Node; |
| } |
| interface BigIntLiteral extends Span { |
| type: "Literal"; |
| value: bigint; |
| raw: string | null; |
| bigint: string; |
| parent: Node; |
| } |
| interface RegExpLiteral extends Span { |
| type: "Literal"; |
| value: RegExp | null; |
| raw: string | null; |
| regex: { |
| pattern: string; |
| flags: string; |
| }; |
| parent: Node; |
| } |
| interface JSXElement extends Span { |
| type: "JSXElement"; |
| openingElement: JSXOpeningElement; |
| children: Array<JSXChild>; |
| closingElement: JSXClosingElement | null; |
| parent: Node; |
| } |
| interface JSXOpeningElement extends Span { |
| type: "JSXOpeningElement"; |
| name: JSXElementName; |
| typeArguments?: TSTypeParameterInstantiation | null; |
| attributes: Array<JSXAttributeItem>; |
| selfClosing: boolean; |
| parent: Node; |
| } |
| interface JSXClosingElement extends Span { |
| type: "JSXClosingElement"; |
| name: JSXElementName; |
| parent: Node; |
| } |
| interface JSXFragment extends Span { |
| type: "JSXFragment"; |
| openingFragment: JSXOpeningFragment; |
| children: Array<JSXChild>; |
| closingFragment: JSXClosingFragment; |
| parent: Node; |
| } |
| interface JSXOpeningFragment extends Span { |
| type: "JSXOpeningFragment"; |
| attributes?: []; |
| selfClosing?: false; |
| parent: Node; |
| } |
| interface JSXClosingFragment extends Span { |
| type: "JSXClosingFragment"; |
| parent: Node; |
| } |
| type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression; |
| interface JSXNamespacedName extends Span { |
| type: "JSXNamespacedName"; |
| namespace: JSXIdentifier; |
| name: JSXIdentifier; |
| parent: Node; |
| } |
| interface JSXMemberExpression extends Span { |
| type: "JSXMemberExpression"; |
| object: JSXMemberExpressionObject; |
| property: JSXIdentifier; |
| parent: Node; |
| } |
| type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression; |
| interface JSXExpressionContainer extends Span { |
| type: "JSXExpressionContainer"; |
| expression: JSXExpression; |
| parent: Node; |
| } |
| type JSXExpression = JSXEmptyExpression | Expression; |
| interface JSXEmptyExpression extends Span { |
| type: "JSXEmptyExpression"; |
| parent: Node; |
| } |
| type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute; |
| interface JSXAttribute extends Span { |
| type: "JSXAttribute"; |
| name: JSXAttributeName; |
| value: JSXAttributeValue | null; |
| parent: Node; |
| } |
| interface JSXSpreadAttribute extends Span { |
| type: "JSXSpreadAttribute"; |
| argument: Expression; |
| parent: Node; |
| } |
| type JSXAttributeName = JSXIdentifier | JSXNamespacedName; |
| type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment; |
| interface JSXIdentifier extends Span { |
| type: "JSXIdentifier"; |
| name: string; |
| parent: Node; |
| } |
| type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild; |
| interface JSXSpreadChild extends Span { |
| type: "JSXSpreadChild"; |
| expression: Expression; |
| parent: Node; |
| } |
| interface JSXText extends Span { |
| type: "JSXText"; |
| value: string; |
| raw: string | null; |
| parent: Node; |
| } |
| interface TSThisParameter extends Span { |
| type: "Identifier"; |
| decorators: []; |
| name: "this"; |
| optional: false; |
| typeAnnotation: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| interface TSEnumDeclaration extends Span { |
| type: "TSEnumDeclaration"; |
| id: BindingIdentifier; |
| body: TSEnumBody; |
| const: boolean; |
| declare: boolean; |
| parent: Node; |
| } |
| interface TSEnumBody extends Span { |
| type: "TSEnumBody"; |
| members: Array<TSEnumMember>; |
| parent: Node; |
| } |
| interface TSEnumMember extends Span { |
| type: "TSEnumMember"; |
| id: TSEnumMemberName; |
| initializer: Expression | null; |
| computed: boolean; |
| parent: Node; |
| } |
| type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral; |
| interface TSTypeAnnotation extends Span { |
| type: "TSTypeAnnotation"; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| interface TSLiteralType extends Span { |
| type: "TSLiteralType"; |
| literal: TSLiteral; |
| parent: Node; |
| } |
| type TSLiteral = BooleanLiteral | NumericLiteral | BigIntLiteral | StringLiteral | TemplateLiteral | UnaryExpression; |
| type TSType = TSAnyKeyword | TSBigIntKeyword | TSBooleanKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSArrayType | TSConditionalType | TSConstructorType | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSLiteralType | TSMappedType | TSNamedTupleMember | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUnionType | TSParenthesizedType | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType; |
| interface TSConditionalType extends Span { |
| type: "TSConditionalType"; |
| checkType: TSType; |
| extendsType: TSType; |
| trueType: TSType; |
| falseType: TSType; |
| parent: Node; |
| } |
| interface TSUnionType extends Span { |
| type: "TSUnionType"; |
| types: Array<TSType>; |
| parent: Node; |
| } |
| interface TSIntersectionType extends Span { |
| type: "TSIntersectionType"; |
| types: Array<TSType>; |
| parent: Node; |
| } |
| interface TSParenthesizedType extends Span { |
| type: "TSParenthesizedType"; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| interface TSTypeOperator extends Span { |
| type: "TSTypeOperator"; |
| operator: TSTypeOperatorOperator; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| type TSTypeOperatorOperator = "keyof" | "unique" | "readonly"; |
| interface TSArrayType extends Span { |
| type: "TSArrayType"; |
| elementType: TSType; |
| parent: Node; |
| } |
| interface TSIndexedAccessType extends Span { |
| type: "TSIndexedAccessType"; |
| objectType: TSType; |
| indexType: TSType; |
| parent: Node; |
| } |
| interface TSTupleType extends Span { |
| type: "TSTupleType"; |
| elementTypes: Array<TSTupleElement>; |
| parent: Node; |
| } |
| interface TSNamedTupleMember extends Span { |
| type: "TSNamedTupleMember"; |
| label: IdentifierName; |
| elementType: TSTupleElement; |
| optional: boolean; |
| parent: Node; |
| } |
| interface TSOptionalType extends Span { |
| type: "TSOptionalType"; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| interface TSRestType extends Span { |
| type: "TSRestType"; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| type TSTupleElement = TSOptionalType | TSRestType | TSType; |
| interface TSAnyKeyword extends Span { |
| type: "TSAnyKeyword"; |
| parent: Node; |
| } |
| interface TSStringKeyword extends Span { |
| type: "TSStringKeyword"; |
| parent: Node; |
| } |
| interface TSBooleanKeyword extends Span { |
| type: "TSBooleanKeyword"; |
| parent: Node; |
| } |
| interface TSNumberKeyword extends Span { |
| type: "TSNumberKeyword"; |
| parent: Node; |
| } |
| interface TSNeverKeyword extends Span { |
| type: "TSNeverKeyword"; |
| parent: Node; |
| } |
| interface TSIntrinsicKeyword extends Span { |
| type: "TSIntrinsicKeyword"; |
| parent: Node; |
| } |
| interface TSUnknownKeyword extends Span { |
| type: "TSUnknownKeyword"; |
| parent: Node; |
| } |
| interface TSNullKeyword extends Span { |
| type: "TSNullKeyword"; |
| parent: Node; |
| } |
| interface TSUndefinedKeyword extends Span { |
| type: "TSUndefinedKeyword"; |
| parent: Node; |
| } |
| interface TSVoidKeyword extends Span { |
| type: "TSVoidKeyword"; |
| parent: Node; |
| } |
| interface TSSymbolKeyword extends Span { |
| type: "TSSymbolKeyword"; |
| parent: Node; |
| } |
| interface TSThisType extends Span { |
| type: "TSThisType"; |
| parent: Node; |
| } |
| interface TSObjectKeyword extends Span { |
| type: "TSObjectKeyword"; |
| parent: Node; |
| } |
| interface TSBigIntKeyword extends Span { |
| type: "TSBigIntKeyword"; |
| parent: Node; |
| } |
| interface TSTypeReference extends Span { |
| type: "TSTypeReference"; |
| typeName: TSTypeName; |
| typeArguments: TSTypeParameterInstantiation | null; |
| parent: Node; |
| } |
| type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression; |
| interface TSQualifiedName extends Span { |
| type: "TSQualifiedName"; |
| left: TSTypeName; |
| right: IdentifierName; |
| parent: Node; |
| } |
| interface TSTypeParameterInstantiation extends Span { |
| type: "TSTypeParameterInstantiation"; |
| params: Array<TSType>; |
| parent: Node; |
| } |
| interface TSTypeParameter extends Span { |
| type: "TSTypeParameter"; |
| name: BindingIdentifier; |
| constraint: TSType | null; |
| default: TSType | null; |
| in: boolean; |
| out: boolean; |
| const: boolean; |
| parent: Node; |
| } |
| interface TSTypeParameterDeclaration extends Span { |
| type: "TSTypeParameterDeclaration"; |
| params: Array<TSTypeParameter>; |
| parent: Node; |
| } |
| interface TSTypeAliasDeclaration extends Span { |
| type: "TSTypeAliasDeclaration"; |
| id: BindingIdentifier; |
| typeParameters: TSTypeParameterDeclaration | null; |
| typeAnnotation: TSType; |
| declare: boolean; |
| parent: Node; |
| } |
| type TSAccessibility = "private" | "protected" | "public"; |
| interface TSClassImplements extends Span { |
| type: "TSClassImplements"; |
| expression: IdentifierReference | ThisExpression | MemberExpression; |
| typeArguments: TSTypeParameterInstantiation | null; |
| parent: Node; |
| } |
| interface TSInterfaceDeclaration extends Span { |
| type: "TSInterfaceDeclaration"; |
| id: BindingIdentifier; |
| typeParameters: TSTypeParameterDeclaration | null; |
| extends: Array<TSInterfaceHeritage>; |
| body: TSInterfaceBody; |
| declare: boolean; |
| parent: Node; |
| } |
| interface TSInterfaceBody extends Span { |
| type: "TSInterfaceBody"; |
| body: Array<TSSignature>; |
| parent: Node; |
| } |
| interface TSPropertySignature extends Span { |
| type: "TSPropertySignature"; |
| computed: boolean; |
| optional: boolean; |
| readonly: boolean; |
| key: PropertyKey$1; |
| typeAnnotation: TSTypeAnnotation | null; |
| accessibility: null; |
| static: false; |
| parent: Node; |
| } |
| type TSSignature = TSIndexSignature | TSPropertySignature | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSMethodSignature; |
| interface TSIndexSignature extends Span { |
| type: "TSIndexSignature"; |
| parameters: Array<TSIndexSignatureName>; |
| typeAnnotation: TSTypeAnnotation; |
| readonly: boolean; |
| static: boolean; |
| accessibility: null; |
| parent: Node; |
| } |
| interface TSCallSignatureDeclaration extends Span { |
| type: "TSCallSignatureDeclaration"; |
| typeParameters: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| type TSMethodSignatureKind = "method" | "get" | "set"; |
| interface TSMethodSignature extends Span { |
| type: "TSMethodSignature"; |
| key: PropertyKey$1; |
| computed: boolean; |
| optional: boolean; |
| kind: TSMethodSignatureKind; |
| typeParameters: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType: TSTypeAnnotation | null; |
| accessibility: null; |
| readonly: false; |
| static: false; |
| parent: Node; |
| } |
| interface TSConstructSignatureDeclaration extends Span { |
| type: "TSConstructSignatureDeclaration"; |
| typeParameters: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| interface TSIndexSignatureName extends Span { |
| type: "Identifier"; |
| decorators: []; |
| name: string; |
| optional: false; |
| typeAnnotation: TSTypeAnnotation; |
| parent: Node; |
| } |
| interface TSInterfaceHeritage extends Span { |
| type: "TSInterfaceHeritage"; |
| expression: Expression; |
| typeArguments: TSTypeParameterInstantiation | null; |
| parent: Node; |
| } |
| interface TSTypePredicate extends Span { |
| type: "TSTypePredicate"; |
| parameterName: TSTypePredicateName; |
| asserts: boolean; |
| typeAnnotation: TSTypeAnnotation | null; |
| parent: Node; |
| } |
| type TSTypePredicateName = IdentifierName | TSThisType; |
| interface TSModuleDeclaration extends Span { |
| type: "TSModuleDeclaration"; |
| id: BindingIdentifier | StringLiteral | TSQualifiedName; |
| body: TSModuleBlock | null; |
| kind: TSModuleDeclarationKind; |
| declare: boolean; |
| global: false; |
| parent: Node; |
| } |
| type TSModuleDeclarationKind = "module" | "namespace"; |
| interface TSGlobalDeclaration extends Span { |
| type: "TSModuleDeclaration"; |
| id: IdentifierName; |
| body: TSModuleBlock; |
| kind: "global"; |
| declare: boolean; |
| global: true; |
| parent: Node; |
| } |
| interface TSModuleBlock extends Span { |
| type: "TSModuleBlock"; |
| body: Array<Directive$1 | Statement>; |
| parent: Node; |
| } |
| interface TSTypeLiteral extends Span { |
| type: "TSTypeLiteral"; |
| members: Array<TSSignature>; |
| parent: Node; |
| } |
| interface TSInferType extends Span { |
| type: "TSInferType"; |
| typeParameter: TSTypeParameter; |
| parent: Node; |
| } |
| interface TSTypeQuery extends Span { |
| type: "TSTypeQuery"; |
| exprName: TSTypeQueryExprName; |
| typeArguments: TSTypeParameterInstantiation | null; |
| parent: Node; |
| } |
| type TSTypeQueryExprName = TSImportType | TSTypeName; |
| interface TSImportType extends Span { |
| type: "TSImportType"; |
| source: StringLiteral; |
| options: ObjectExpression | null; |
| qualifier: TSImportTypeQualifier | null; |
| typeArguments: TSTypeParameterInstantiation | null; |
| parent: Node; |
| } |
| type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName; |
| interface TSImportTypeQualifiedName extends Span { |
| type: "TSQualifiedName"; |
| left: TSImportTypeQualifier; |
| right: IdentifierName; |
| parent: Node; |
| } |
| interface TSFunctionType extends Span { |
| type: "TSFunctionType"; |
| typeParameters: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType: TSTypeAnnotation; |
| parent: Node; |
| } |
| interface TSConstructorType extends Span { |
| type: "TSConstructorType"; |
| abstract: boolean; |
| typeParameters: TSTypeParameterDeclaration | null; |
| params: ParamPattern[]; |
| returnType: TSTypeAnnotation; |
| parent: Node; |
| } |
| interface TSMappedType extends Span { |
| type: "TSMappedType"; |
| key: BindingIdentifier; |
| constraint: TSType; |
| nameType: TSType | null; |
| typeAnnotation: TSType | null; |
| optional: TSMappedTypeModifierOperator | false; |
| readonly: TSMappedTypeModifierOperator | null; |
| parent: Node; |
| } |
| type TSMappedTypeModifierOperator = true | "+" | "-"; |
| interface TSTemplateLiteralType extends Span { |
| type: "TSTemplateLiteralType"; |
| quasis: Array<TemplateElement>; |
| types: Array<TSType>; |
| parent: Node; |
| } |
| interface TSAsExpression extends Span { |
| type: "TSAsExpression"; |
| expression: Expression; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| interface TSSatisfiesExpression extends Span { |
| type: "TSSatisfiesExpression"; |
| expression: Expression; |
| typeAnnotation: TSType; |
| parent: Node; |
| } |
| interface TSTypeAssertion extends Span { |
| type: "TSTypeAssertion"; |
| typeAnnotation: TSType; |
| expression: Expression; |
| parent: Node; |
| } |
| interface TSImportEqualsDeclaration extends Span { |
| type: "TSImportEqualsDeclaration"; |
| id: BindingIdentifier; |
| moduleReference: TSModuleReference; |
| importKind: ImportOrExportKind; |
| parent: Node; |
| } |
| type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName; |
| interface TSExternalModuleReference extends Span { |
| type: "TSExternalModuleReference"; |
| expression: StringLiteral; |
| parent: Node; |
| } |
| interface TSNonNullExpression extends Span { |
| type: "TSNonNullExpression"; |
| expression: Expression; |
| parent: Node; |
| } |
| interface Decorator extends Span { |
| type: "Decorator"; |
| expression: Expression; |
| parent: Node; |
| } |
| interface TSExportAssignment extends Span { |
| type: "TSExportAssignment"; |
| expression: Expression; |
| parent: Node; |
| } |
| interface TSNamespaceExportDeclaration extends Span { |
| type: "TSNamespaceExportDeclaration"; |
| id: IdentifierName; |
| parent: Node; |
| } |
| interface TSInstantiationExpression extends Span { |
| type: "TSInstantiationExpression"; |
| expression: Expression; |
| typeArguments: TSTypeParameterInstantiation; |
| parent: Node; |
| } |
| type ImportOrExportKind = "value" | "type"; |
| interface JSDocNullableType extends Span { |
| type: "TSJSDocNullableType"; |
| typeAnnotation: TSType; |
| postfix: boolean; |
| parent: Node; |
| } |
| interface JSDocNonNullableType extends Span { |
| type: "TSJSDocNonNullableType"; |
| typeAnnotation: TSType; |
| postfix: boolean; |
| parent: Node; |
| } |
| interface JSDocUnknownType extends Span { |
| type: "TSJSDocUnknownType"; |
| parent: Node; |
| } |
| type ModuleKind = "script" | "module" | "commonjs"; |
| type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??="; |
| type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "+" | "-" | "*" | "/" | "%" | "**" | "<<" | ">>" | ">>>" | "|" | "^" | "&" | "in" | "instanceof"; |
| type LogicalOperator = "||" | "&&" | "??"; |
| type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete"; |
| type UpdateOperator = "++" | "--"; |
| type Node = Program | IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | ThisExpression | ArrayExpression | ObjectExpression | ObjectProperty | TemplateLiteral | TaggedTemplateExpression | TemplateElement | ComputedMemberExpression | StaticMemberExpression | PrivateFieldExpression | CallExpression | NewExpression | MetaProperty | SpreadElement | UpdateExpression | UnaryExpression | BinaryExpression | PrivateInExpression | LogicalExpression | ConditionalExpression | AssignmentExpression | ArrayAssignmentTarget | ObjectAssignmentTarget | AssignmentTargetRest | AssignmentTargetWithDefault | AssignmentTargetPropertyIdentifier | AssignmentTargetPropertyProperty | SequenceExpression | Super | AwaitExpression | ChainExpression | ParenthesizedExpression | Directive$1 | Hashbang | BlockStatement | VariableDeclaration | VariableDeclarator | EmptyStatement | ExpressionStatement | IfStatement | DoWhileStatement | WhileStatement | ForStatement | ForInStatement | ForOfStatement | ContinueStatement | BreakStatement | ReturnStatement | WithStatement | SwitchStatement | SwitchCase | LabeledStatement | ThrowStatement | TryStatement | CatchClause | DebuggerStatement | AssignmentPattern | ObjectPattern | BindingProperty | ArrayPattern | BindingRestElement | Function$1 | FunctionBody | ArrowFunctionExpression | YieldExpression | Class | ClassBody | MethodDefinition | PropertyDefinition | PrivateIdentifier | StaticBlock | AccessorProperty | ImportExpression | ImportDeclaration | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportAttribute | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration | ExportSpecifier | V8IntrinsicExpression | BooleanLiteral | NullLiteral | NumericLiteral | StringLiteral | BigIntLiteral | RegExpLiteral | JSXElement | JSXOpeningElement | JSXClosingElement | JSXFragment | JSXOpeningFragment | JSXClosingFragment | JSXNamespacedName | JSXMemberExpression | JSXExpressionContainer | JSXEmptyExpression | JSXAttribute | JSXSpreadAttribute | JSXIdentifier | JSXSpreadChild | JSXText | TSThisParameter | TSEnumDeclaration | TSEnumBody | TSEnumMember | TSTypeAnnotation | TSLiteralType | TSConditionalType | TSUnionType | TSIntersectionType | TSParenthesizedType | TSTypeOperator | TSArrayType | TSIndexedAccessType | TSTupleType | TSNamedTupleMember | TSOptionalType | TSRestType | TSAnyKeyword | TSStringKeyword | TSBooleanKeyword | TSNumberKeyword | TSNeverKeyword | TSIntrinsicKeyword | TSUnknownKeyword | TSNullKeyword | TSUndefinedKeyword | TSVoidKeyword | TSSymbolKeyword | TSThisType | TSObjectKeyword | TSBigIntKeyword | TSTypeReference | TSQualifiedName | TSTypeParameterInstantiation | TSTypeParameter | TSTypeParameterDeclaration | TSTypeAliasDeclaration | TSClassImplements | TSInterfaceDeclaration | TSInterfaceBody | TSPropertySignature | TSIndexSignature | TSCallSignatureDeclaration | TSMethodSignature | TSConstructSignatureDeclaration | TSIndexSignatureName | TSInterfaceHeritage | TSTypePredicate | TSModuleDeclaration | TSGlobalDeclaration | TSModuleBlock | TSTypeLiteral | TSInferType | TSTypeQuery | TSImportType | TSImportTypeQualifiedName | TSFunctionType | TSConstructorType | TSMappedType | TSTemplateLiteralType | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | Decorator | TSExportAssignment | TSNamespaceExportDeclaration | TSInstantiationExpression | JSDocNullableType | JSDocNonNullableType | JSDocUnknownType | ParamPattern; |
| |
| |
| interface Scope { |
| type: ScopeType; |
| isStrict: boolean; |
| upper: Scope | null; |
| childScopes: Scope[]; |
| variableScope: Scope; |
| block: Node; |
| variables: Variable[]; |
| set: Map<string, Variable>; |
| references: Reference[]; |
| through: Reference[]; |
| functionExpressionScope: boolean; |
| implicit?: { |
| variables: Variable[]; |
| set: Map<string, Variable>; |
| }; |
| } |
| type ScopeType = "block" | "catch" | "class" | "class-field-initializer" | "class-static-block" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with"; |
| interface Variable { |
| name: string; |
| scope: Scope; |
| identifiers: Identifier[]; |
| references: Reference[]; |
| defs: Definition[]; |
| } |
| interface Reference { |
| identifier: Identifier; |
| from: Scope; |
| resolved: Variable | null; |
| writeExpr: Expression | null; |
| init: boolean; |
| isWrite(): boolean; |
| isRead(): boolean; |
| isReadOnly(): boolean; |
| isWriteOnly(): boolean; |
| isReadWrite(): boolean; |
| } |
| interface Definition { |
| type: DefinitionType; |
| name: Identifier; |
| node: Node; |
| parent: Node | null; |
| } |
| type DefinitionType = "CatchClause" | "ClassName" | "FunctionName" | "ImplicitGlobalVariable" | "ImportBinding" | "Parameter" | "Variable"; |
| type Identifier = IdentifierName | IdentifierReference | BindingIdentifier | LabelIdentifier | TSThisParameter | TSIndexSignatureName; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function isGlobalReference(node: Node): boolean; |
| |
| |
| |
| |
| |
| |
| declare function getDeclaredVariables(node: Node): Variable[]; |
| |
| |
| |
| |
| |
| declare function getScope(node: Node): Scope; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function markVariableAsUsed(name: string, refNode?: Node): boolean; |
| |
| |
| |
| |
| |
| |
| declare function getAllComments(): CommentType[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getCommentsBefore(nodeOrToken: NodeOrToken): CommentType[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getCommentsAfter(nodeOrToken: NodeOrToken): CommentType[]; |
| |
| |
| |
| |
| |
| declare function getCommentsInside(node: Node$1): CommentType[]; |
| |
| |
| |
| |
| |
| |
| declare function commentsExistBetween(nodeOrToken1: NodeOrToken, nodeOrToken2: NodeOrToken): boolean; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getJSDocComment(node: Node$1): CommentType | null; |
| |
| |
| type TokenOrComment = TokenType | CommentType; |
| |
| |
| |
| |
| |
| interface SkipOptions { |
| |
| skip?: number; |
| |
| includeComments?: boolean; |
| |
| filter?: FilterFn | null; |
| } |
| |
| |
| |
| interface CountOptions { |
| |
| count?: number; |
| |
| includeComments?: boolean; |
| |
| filter?: FilterFn | null; |
| } |
| |
| |
| |
| interface RangeOptions { |
| |
| includeComments?: boolean; |
| } |
| |
| |
| |
| type FilterFn = (token: TokenOrComment) => boolean; |
| |
| |
| |
| |
| |
| type MayIncludeComments<Options> = Options extends { |
| includeComments: false; |
| } ? false : "includeComments" extends keyof Options ? true : false; |
| |
| |
| |
| type TokenResult<Options> = MayIncludeComments<Options> extends true ? TokenOrComment : TokenType; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options, afterCount?: number | null): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getFirstToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node$1, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getFirstTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getLastToken<Options extends SkipOptions | number | FilterFn | null | undefined>(node: Node$1, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getLastTokens<Options extends CountOptions | number | FilterFn | null | undefined>(node: Node$1, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokenBefore<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokenOrCommentBefore(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokensBefore<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokenAfter<Options extends SkipOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokenOrCommentAfter(nodeOrToken: NodeOrToken, skip?: number): TokenOrComment | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokensAfter<Options extends CountOptions | number | FilterFn | null | undefined>(nodeOrToken: NodeOrToken, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getFirstTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getFirstTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getLastTokenBetween<Options extends SkipOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, skipOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function getLastTokensBetween<Options extends CountOptions | number | FilterFn | null | undefined>(left: NodeOrToken, right: NodeOrToken, countOptions?: Options): TokenResult<Options>[]; |
| |
| |
| |
| |
| |
| |
| declare function getTokenByRangeStart<Options extends RangeOptions | null | undefined>(offset: number, rangeOptions?: Options): TokenResult<Options> | null; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function isSpaceBetween(first: NodeOrToken, second: NodeOrToken): boolean; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| declare function isSpaceBetweenTokens(first: NodeOrToken, second: NodeOrToken): boolean; |
| |
| |
| interface Problem { |
| ruleId: string | null; |
| message: string; |
| loc: Location; |
| } |
| type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line"; |
| interface Directive { |
| type: DirectiveType; |
| node: CommentType; |
| value: string; |
| justification?: string; |
| } |
| declare function getDisableDirectives(): { |
| problems: Problem[]; |
| directives: Directive[]; |
| }; |
| |
| |
| |
| |
| |
| type JsonValue = JsonObject | JsonValue[] | string | number | boolean | null; |
| |
| |
| |
| type JsonObject = { |
| [key: string]: JsonValue; |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| type Globals$1 = Record<string, "readonly" | "writable" | "off">; |
| |
| |
| |
| |
| |
| type Envs$1 = Record<string, true>; |
| |
| |
| |
| |
| |
| |
| |
| |
| type JSONSchema4TypeName = "string" |
| | "number" | "integer" | "boolean" | "object" | "array" | "null" | "any"; |
| |
| |
| |
| type JSONSchema4Type = string |
| | number | boolean | JSONSchema4Object | JSONSchema4Array | null; |
| |
| interface JSONSchema4Object { |
| [key: string]: JSONSchema4Type; |
| } |
| |
| |
| interface JSONSchema4Array extends Array<JSONSchema4Type> {} |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type JSONSchema4Version = string; |
| |
| |
| |
| |
| interface JSONSchema4 { |
| id?: string | undefined; |
| $ref?: string | undefined; |
| $schema?: JSONSchema4Version | undefined; |
| |
| |
| |
| |
| |
| |
| title?: string | undefined; |
| |
| |
| |
| |
| |
| |
| description?: string | undefined; |
| default?: JSONSchema4Type | undefined; |
| multipleOf?: number | undefined; |
| maximum?: number | undefined; |
| exclusiveMaximum?: boolean | undefined; |
| minimum?: number | undefined; |
| exclusiveMinimum?: boolean | undefined; |
| maxLength?: number | undefined; |
| minLength?: number | undefined; |
| pattern?: string | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| additionalItems?: boolean | JSONSchema4 | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| items?: JSONSchema4 | JSONSchema4[] | undefined; |
| maxItems?: number | undefined; |
| minItems?: number | undefined; |
| uniqueItems?: boolean | undefined; |
| maxProperties?: number | undefined; |
| minProperties?: number | undefined; |
| |
| |
| |
| |
| |
| |
| |
| required?: boolean | string[] | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| additionalProperties?: boolean | JSONSchema4 | undefined; |
| definitions?: { |
| [k: string]: JSONSchema4; |
| } | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| properties?: { |
| [k: string]: JSONSchema4; |
| } | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| patternProperties?: { |
| [k: string]: JSONSchema4; |
| } | undefined; |
| dependencies?: { |
| [k: string]: JSONSchema4 | string[]; |
| } | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| enum?: JSONSchema4Type[] | undefined; |
| |
| |
| |
| type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined; |
| allOf?: JSONSchema4[] | undefined; |
| anyOf?: JSONSchema4[] | undefined; |
| oneOf?: JSONSchema4[] | undefined; |
| not?: JSONSchema4 | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| extends?: string | string[] | undefined; |
| |
| |
| |
| [k: string]: any; |
| format?: string | undefined; |
| } |
| |
| |
| |
| |
| |
| type Options = JsonValue[]; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type RuleOptionsSchema = JSONSchema4 | JSONSchema4[] | false; |
| |
| |
| type FixFn = (fixer: Fixer) => Fix | Array<Fix | null | undefined> | IterableIterator<Fix | null | undefined> | null | undefined; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| interface Fix { |
| range: Range; |
| text: string; |
| } |
| declare const FIXER: Readonly<{ |
| insertTextBefore(nodeOrToken: Ranged, text: string): Fix; |
| insertTextBeforeRange(range: Range, text: string): Fix; |
| insertTextAfter(nodeOrToken: Ranged, text: string): Fix; |
| insertTextAfterRange(range: Range, text: string): Fix; |
| remove(nodeOrToken: Ranged): Fix; |
| removeRange(range: Range): Fix; |
| replaceText(nodeOrToken: Ranged, text: string): Fix; |
| replaceTextRange(range: Range, text: string): Fix; |
| }>; |
| type Fixer = typeof FIXER; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Diagnostic = RequireAtLeastOne<RequireAtLeastOne<DiagnosticBase, "node" | "loc">, "message" | "messageId">; |
| interface DiagnosticBase { |
| message?: string | null | undefined; |
| messageId?: string | null | undefined; |
| node?: Ranged; |
| loc?: LocationWithOptionalEnd | LineColumn; |
| data?: DiagnosticData | null | undefined; |
| fix?: FixFn; |
| suggest?: Suggestion[] | null | undefined; |
| } |
| |
| |
| |
| interface LocationWithOptionalEnd { |
| start: LineColumn; |
| end?: LineColumn | null | undefined; |
| } |
| |
| |
| |
| type DiagnosticData = Record<string, string | number | boolean | bigint | null | undefined>; |
| |
| |
| |
| type Suggestion = RequireAtLeastOne<SuggestionBase, "desc" | "messageId">; |
| interface SuggestionBase { |
| desc?: string; |
| messageId?: string; |
| data?: DiagnosticData | null | undefined; |
| fix: FixFn; |
| } |
| |
| |
| |
| |
| |
| declare const SOURCE_CODE: Readonly<{ |
| |
| |
| |
| readonly text: string; |
| |
| |
| |
| readonly hasBOM: boolean; |
| |
| |
| |
| readonly ast: Program; |
| |
| |
| |
| isESTree: true; |
| |
| |
| |
| readonly scopeManager: Readonly<{ |
| readonly scopes: Scope[]; |
| readonly globalScope: Scope | null; |
| getDeclaredVariables(node: Node): Variable[]; |
| acquire(node: Node, inner?: boolean): Scope | null; |
| }>; |
| |
| |
| |
| readonly visitorKeys: Readonly<Record<string, readonly string[]>>; |
| |
| |
| |
| |
| |
| parserServices: Readonly<Record<string, unknown>>; |
| |
| |
| |
| readonly lines: string[]; |
| |
| |
| |
| |
| readonly lineStartIndices: number[]; |
| |
| |
| |
| readonly tokensAndComments: (TokenType | CommentType)[]; |
| |
| |
| |
| |
| |
| |
| |
| getText(node?: Ranged | null, beforeCount?: number | null, afterCount?: number | null): string; |
| |
| |
| |
| |
| |
| |
| getAncestors(node: Node$1): Node$1[]; |
| |
| |
| |
| getLines(): string[]; |
| getRange: typeof getRange; |
| getLoc: typeof getLoc; |
| getNodeByRangeIndex: typeof getNodeByRangeIndex; |
| getLocFromIndex: typeof getLineColumnFromOffset; |
| getIndexFromLoc: typeof getOffsetFromLineColumn; |
| getAllComments: typeof getAllComments; |
| getCommentsBefore: typeof getCommentsBefore; |
| getCommentsAfter: typeof getCommentsAfter; |
| getCommentsInside: typeof getCommentsInside; |
| commentsExistBetween: typeof commentsExistBetween; |
| getJSDocComment: typeof getJSDocComment; |
| isGlobalReference: typeof isGlobalReference; |
| getDeclaredVariables: typeof getDeclaredVariables; |
| getScope: typeof getScope; |
| markVariableAsUsed: typeof markVariableAsUsed; |
| getTokens: typeof getTokens; |
| getFirstToken: typeof getFirstToken; |
| getFirstTokens: typeof getFirstTokens; |
| getLastToken: typeof getLastToken; |
| getLastTokens: typeof getLastTokens; |
| getTokenBefore: typeof getTokenBefore; |
| getTokenOrCommentBefore: typeof getTokenOrCommentBefore; |
| getTokensBefore: typeof getTokensBefore; |
| getTokenAfter: typeof getTokenAfter; |
| getTokenOrCommentAfter: typeof getTokenOrCommentAfter; |
| getTokensAfter: typeof getTokensAfter; |
| getTokensBetween: typeof getTokensBetween; |
| getFirstTokenBetween: typeof getFirstTokenBetween; |
| getFirstTokensBetween: typeof getFirstTokensBetween; |
| getLastTokenBetween: typeof getLastTokenBetween; |
| getLastTokensBetween: typeof getLastTokensBetween; |
| getTokenByRangeStart: typeof getTokenByRangeStart; |
| isSpaceBetween: typeof isSpaceBetween; |
| isSpaceBetweenTokens: typeof isSpaceBetweenTokens; |
| getDisableDirectives: typeof getDisableDirectives; |
| }>; |
| type SourceCode = typeof SOURCE_CODE; |
| |
| |
| declare const FILE_CONTEXT: Readonly<{ |
| |
| |
| |
| readonly filename: string; |
| |
| |
| |
| |
| |
| getFilename(): string; |
| |
| |
| |
| readonly physicalFilename: string; |
| |
| |
| |
| |
| |
| getPhysicalFilename(): string; |
| |
| |
| |
| readonly cwd: string; |
| |
| |
| |
| |
| |
| getCwd(): string; |
| |
| |
| |
| readonly sourceCode: Readonly<{ |
| readonly text: string; |
| readonly hasBOM: boolean; |
| readonly ast: Program; |
| isESTree: true; |
| readonly scopeManager: Readonly<{ |
| readonly scopes: Scope[]; |
| readonly globalScope: Scope | null; |
| getDeclaredVariables(node: Node): Variable[]; |
| acquire(node: Node, inner?: boolean): Scope | null; |
| }>; |
| readonly visitorKeys: Readonly<Record<string, readonly string[]>>; |
| parserServices: Readonly<Record<string, unknown>>; |
| readonly lines: string[]; |
| readonly lineStartIndices: number[]; |
| readonly tokensAndComments: (TokenType | CommentType)[]; |
| getText(node?: Ranged | null, beforeCount?: number | null, afterCount?: number | null): string; |
| getAncestors(node: Node$1): Node$1[]; |
| getLines(): string[]; |
| getRange: typeof getRange; |
| getLoc: typeof getLoc; |
| getNodeByRangeIndex: typeof getNodeByRangeIndex; |
| getLocFromIndex: typeof getLineColumnFromOffset; |
| getIndexFromLoc: typeof getOffsetFromLineColumn; |
| getAllComments: typeof getAllComments; |
| getCommentsBefore: typeof getCommentsBefore; |
| getCommentsAfter: typeof getCommentsAfter; |
| getCommentsInside: typeof getCommentsInside; |
| commentsExistBetween: typeof commentsExistBetween; |
| getJSDocComment: typeof getJSDocComment; |
| isGlobalReference: typeof isGlobalReference; |
| getDeclaredVariables: typeof getDeclaredVariables; |
| getScope: typeof getScope; |
| markVariableAsUsed: typeof markVariableAsUsed; |
| getTokens: typeof getTokens; |
| getFirstToken: typeof getFirstToken; |
| getFirstTokens: typeof getFirstTokens; |
| getLastToken: typeof getLastToken; |
| getLastTokens: typeof getLastTokens; |
| getTokenBefore: typeof getTokenBefore; |
| getTokenOrCommentBefore: typeof getTokenOrCommentBefore; |
| getTokensBefore: typeof getTokensBefore; |
| getTokenAfter: typeof getTokenAfter; |
| getTokenOrCommentAfter: typeof getTokenOrCommentAfter; |
| getTokensAfter: typeof getTokensAfter; |
| getTokensBetween: typeof getTokensBetween; |
| getFirstTokenBetween: typeof getFirstTokenBetween; |
| getFirstTokensBetween: typeof getFirstTokensBetween; |
| getLastTokenBetween: typeof getLastTokenBetween; |
| getLastTokensBetween: typeof getLastTokensBetween; |
| getTokenByRangeStart: typeof getTokenByRangeStart; |
| isSpaceBetween: typeof isSpaceBetween; |
| isSpaceBetweenTokens: typeof isSpaceBetweenTokens; |
| getDisableDirectives: typeof getDisableDirectives; |
| }>; |
| |
| |
| |
| |
| |
| getSourceCode(): SourceCode; |
| |
| |
| |
| readonly languageOptions: Readonly<{ |
| |
| |
| |
| readonly sourceType: ModuleKind; |
| |
| |
| |
| ecmaVersion: number; |
| |
| |
| |
| parser: Readonly<{ |
| |
| |
| |
| name: "oxlint"; |
| |
| |
| |
| version: string; |
| |
| |
| |
| |
| |
| |
| parse(code: string, options?: Record<string, unknown>): Program; |
| |
| |
| |
| VisitorKeys: Readonly<{ |
| DebuggerStatement: readonly never[]; |
| EmptyStatement: readonly never[]; |
| Literal: readonly never[]; |
| PrivateIdentifier: readonly never[]; |
| Super: readonly never[]; |
| TemplateElement: readonly never[]; |
| ThisExpression: readonly never[]; |
| JSXClosingFragment: readonly never[]; |
| JSXEmptyExpression: readonly never[]; |
| JSXIdentifier: readonly never[]; |
| JSXOpeningFragment: readonly never[]; |
| JSXText: readonly never[]; |
| TSAnyKeyword: readonly never[]; |
| TSBigIntKeyword: readonly never[]; |
| TSBooleanKeyword: readonly never[]; |
| TSIntrinsicKeyword: readonly never[]; |
| TSJSDocUnknownType: readonly never[]; |
| TSNeverKeyword: readonly never[]; |
| TSNullKeyword: readonly never[]; |
| TSNumberKeyword: readonly never[]; |
| TSObjectKeyword: readonly never[]; |
| TSStringKeyword: readonly never[]; |
| TSSymbolKeyword: readonly never[]; |
| TSThisType: readonly never[]; |
| TSUndefinedKeyword: readonly never[]; |
| TSUnknownKeyword: readonly never[]; |
| TSVoidKeyword: readonly never[]; |
| AccessorProperty: readonly string[]; |
| ArrayExpression: readonly string[]; |
| ArrayPattern: readonly string[]; |
| ArrowFunctionExpression: readonly string[]; |
| AssignmentExpression: readonly string[]; |
| AssignmentPattern: readonly string[]; |
| AwaitExpression: readonly string[]; |
| BinaryExpression: readonly string[]; |
| BlockStatement: readonly string[]; |
| BreakStatement: readonly string[]; |
| CallExpression: readonly string[]; |
| CatchClause: readonly string[]; |
| ChainExpression: readonly string[]; |
| ClassBody: readonly string[]; |
| ClassDeclaration: readonly string[]; |
| ClassExpression: readonly string[]; |
| ConditionalExpression: readonly string[]; |
| ContinueStatement: readonly string[]; |
| Decorator: readonly string[]; |
| DoWhileStatement: readonly string[]; |
| ExportAllDeclaration: readonly string[]; |
| ExportDefaultDeclaration: readonly string[]; |
| ExportNamedDeclaration: readonly string[]; |
| ExportSpecifier: readonly string[]; |
| ExpressionStatement: readonly string[]; |
| ForInStatement: readonly string[]; |
| ForOfStatement: readonly string[]; |
| ForStatement: readonly string[]; |
| FunctionDeclaration: readonly string[]; |
| FunctionExpression: readonly string[]; |
| Identifier: readonly string[]; |
| IfStatement: readonly string[]; |
| ImportAttribute: readonly string[]; |
| ImportDeclaration: readonly string[]; |
| ImportDefaultSpecifier: readonly string[]; |
| ImportExpression: readonly string[]; |
| ImportNamespaceSpecifier: readonly string[]; |
| ImportSpecifier: readonly string[]; |
| LabeledStatement: readonly string[]; |
| LogicalExpression: readonly string[]; |
| MemberExpression: readonly string[]; |
| MetaProperty: readonly string[]; |
| MethodDefinition: readonly string[]; |
| NewExpression: readonly string[]; |
| ObjectExpression: readonly string[]; |
| ObjectPattern: readonly string[]; |
| ParenthesizedExpression: readonly string[]; |
| Program: readonly string[]; |
| Property: readonly string[]; |
| PropertyDefinition: readonly string[]; |
| RestElement: readonly string[]; |
| ReturnStatement: readonly string[]; |
| SequenceExpression: readonly string[]; |
| SpreadElement: readonly string[]; |
| StaticBlock: readonly string[]; |
| SwitchCase: readonly string[]; |
| SwitchStatement: readonly string[]; |
| TaggedTemplateExpression: readonly string[]; |
| TemplateLiteral: readonly string[]; |
| ThrowStatement: readonly string[]; |
| TryStatement: readonly string[]; |
| UnaryExpression: readonly string[]; |
| UpdateExpression: readonly string[]; |
| V8IntrinsicExpression: readonly string[]; |
| VariableDeclaration: readonly string[]; |
| VariableDeclarator: readonly string[]; |
| WhileStatement: readonly string[]; |
| WithStatement: readonly string[]; |
| YieldExpression: readonly string[]; |
| JSXAttribute: readonly string[]; |
| JSXClosingElement: readonly string[]; |
| JSXElement: readonly string[]; |
| JSXExpressionContainer: readonly string[]; |
| JSXFragment: readonly string[]; |
| JSXMemberExpression: readonly string[]; |
| JSXNamespacedName: readonly string[]; |
| JSXOpeningElement: readonly string[]; |
| JSXSpreadAttribute: readonly string[]; |
| JSXSpreadChild: readonly string[]; |
| TSAbstractAccessorProperty: readonly string[]; |
| TSAbstractMethodDefinition: readonly string[]; |
| TSAbstractPropertyDefinition: readonly string[]; |
| TSArrayType: readonly string[]; |
| TSAsExpression: readonly string[]; |
| TSCallSignatureDeclaration: readonly string[]; |
| TSClassImplements: readonly string[]; |
| TSConditionalType: readonly string[]; |
| TSConstructSignatureDeclaration: readonly string[]; |
| TSConstructorType: readonly string[]; |
| TSDeclareFunction: readonly string[]; |
| TSEmptyBodyFunctionExpression: readonly string[]; |
| TSEnumBody: readonly string[]; |
| TSEnumDeclaration: readonly string[]; |
| TSEnumMember: readonly string[]; |
| TSExportAssignment: readonly string[]; |
| TSExternalModuleReference: readonly string[]; |
| TSFunctionType: readonly string[]; |
| TSImportEqualsDeclaration: readonly string[]; |
| TSImportType: readonly string[]; |
| TSIndexSignature: readonly string[]; |
| TSIndexedAccessType: readonly string[]; |
| TSInferType: readonly string[]; |
| TSInstantiationExpression: readonly string[]; |
| TSInterfaceBody: readonly string[]; |
| TSInterfaceDeclaration: readonly string[]; |
| TSInterfaceHeritage: readonly string[]; |
| TSIntersectionType: readonly string[]; |
| TSJSDocNonNullableType: readonly string[]; |
| TSJSDocNullableType: readonly string[]; |
| TSLiteralType: readonly string[]; |
| TSMappedType: readonly string[]; |
| TSMethodSignature: readonly string[]; |
| TSModuleBlock: readonly string[]; |
| TSModuleDeclaration: readonly string[]; |
| TSNamedTupleMember: readonly string[]; |
| TSNamespaceExportDeclaration: readonly string[]; |
| TSNonNullExpression: readonly string[]; |
| TSOptionalType: readonly string[]; |
| TSParameterProperty: readonly string[]; |
| TSParenthesizedType: readonly string[]; |
| TSPropertySignature: readonly string[]; |
| TSQualifiedName: readonly string[]; |
| TSRestType: readonly string[]; |
| TSSatisfiesExpression: readonly string[]; |
| TSTemplateLiteralType: readonly string[]; |
| TSTupleType: readonly string[]; |
| TSTypeAliasDeclaration: readonly string[]; |
| TSTypeAnnotation: readonly string[]; |
| TSTypeAssertion: readonly string[]; |
| TSTypeLiteral: readonly string[]; |
| TSTypeOperator: readonly string[]; |
| TSTypeParameter: readonly string[]; |
| TSTypeParameterDeclaration: readonly string[]; |
| TSTypeParameterInstantiation: readonly string[]; |
| TSTypePredicate: readonly string[]; |
| TSTypeQuery: readonly string[]; |
| TSTypeReference: readonly string[]; |
| TSUnionType: readonly string[]; |
| }>; |
| |
| |
| |
| readonly Syntax: Readonly<Record<string, string>>; |
| |
| |
| |
| latestEcmaVersion: 17; |
| |
| |
| |
| supportedEcmaVersions: readonly number[]; |
| }>; |
| |
| |
| |
| parserOptions: Readonly<{ |
| |
| |
| |
| readonly sourceType: ModuleKind; |
| |
| |
| |
| ecmaFeatures: Readonly<{ |
| |
| |
| |
| readonly jsx: boolean; |
| |
| |
| |
| readonly globalReturn: boolean; |
| |
| |
| |
| readonly impliedStrict: boolean; |
| }>; |
| }>; |
| |
| |
| |
| readonly globals: Readonly<Globals$1>; |
| |
| |
| |
| readonly env: Readonly<Envs$1>; |
| }>; |
| |
| |
| |
| readonly settings: Readonly<JsonObject>; |
| |
| |
| |
| |
| |
| |
| |
| extend(this: FileContext, extension: Record<string | number | symbol, unknown>): FileContext; |
| |
| |
| |
| |
| readonly parserOptions: Record<string, unknown>; |
| |
| |
| |
| |
| readonly parserPath: string | undefined; |
| }>; |
| |
| |
| |
| |
| type FileContext = typeof FILE_CONTEXT; |
| |
| |
| |
| |
| interface Context extends FileContext { |
| |
| |
| |
| id: string; |
| |
| |
| |
| options: Readonly<Options>; |
| |
| |
| |
| report(this: void, diagnostic: Diagnostic): void; |
| } |
| |
| |
| |
| |
| |
| |
| interface RuleMeta { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type?: "problem" | "suggestion" | "layout"; |
| |
| |
| |
| docs?: RuleDocs; |
| |
| |
| |
| messages?: Record<string, string>; |
| |
| |
| |
| |
| fixable?: "code" | "whitespace" | null | undefined; |
| |
| |
| |
| |
| |
| hasSuggestions?: boolean; |
| |
| |
| |
| |
| schema?: RuleOptionsSchema; |
| |
| |
| |
| |
| defaultOptions?: Options; |
| |
| |
| |
| deprecated?: boolean | RuleDeprecatedInfo; |
| |
| |
| |
| |
| replacedBy?: readonly string[]; |
| } |
| |
| |
| |
| |
| |
| |
| interface RuleDocs { |
| |
| |
| |
| description?: string; |
| |
| |
| |
| recommended?: unknown; |
| |
| |
| |
| url?: string; |
| |
| |
| |
| [key: string]: unknown; |
| } |
| |
| |
| |
| |
| interface RuleDeprecatedInfo { |
| |
| |
| |
| message?: string; |
| |
| |
| |
| url?: string; |
| |
| |
| |
| |
| replacedBy?: RuleReplacedByInfo[]; |
| |
| |
| |
| deprecatedSince?: string; |
| |
| |
| |
| |
| |
| |
| availableUntil?: string | null; |
| } |
| |
| |
| |
| interface RuleReplacedByInfo { |
| |
| |
| |
| message?: string; |
| |
| |
| |
| url?: string; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| plugin?: RuleReplacedByExternalSpecifier; |
| |
| |
| |
| |
| rule?: RuleReplacedByExternalSpecifier; |
| } |
| |
| |
| |
| interface RuleReplacedByExternalSpecifier { |
| |
| |
| |
| |
| name?: string; |
| |
| |
| |
| url?: string; |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Rule = CreateRule | CreateOnceRule; |
| interface CreateRule { |
| meta?: RuleMeta; |
| create: (context: Context) => VisitorObject; |
| } |
| interface CreateOnceRule { |
| meta?: RuleMeta; |
| create?: (context: Context) => VisitorObject; |
| createOnce: (context: Context) => VisitorWithHooks; |
| } |
| |
| |
| |
| |
| |
| |
| |
| type Settings = JsonObject; |
| |
| |
| type DescribeFn = (text: string, fn: () => void) => void; |
| type ItFn = ((text: string, fn: () => void) => void) & { |
| only?: ItFn; |
| }; |
| |
| |
| |
| interface Config { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| eslintCompat?: boolean; |
| |
| |
| |
| languageOptions?: LanguageOptions; |
| |
| |
| |
| |
| cwd?: string; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| recursive?: boolean | number | null | undefined; |
| } |
| |
| |
| |
| interface LanguageOptions { |
| sourceType?: SourceType; |
| globals?: Globals; |
| env?: Envs; |
| parserOptions?: ParserOptions; |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type SourceType = "script" | "module" | "commonjs" | "unambiguous"; |
| |
| |
| |
| |
| |
| type GlobalValue = boolean | "true" | "writable" | "writeable" | "false" | "readonly" | "readable" | "off" | null; |
| |
| |
| |
| type Globals = Record<string, GlobalValue>; |
| |
| |
| |
| type Envs = Record<string, boolean>; |
| |
| |
| |
| interface ParserOptions { |
| ecmaFeatures?: EcmaFeatures; |
| |
| |
| |
| |
| |
| |
| lang?: Language; |
| |
| |
| |
| ignoreNonFatalErrors?: boolean; |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| interface EcmaFeatures { |
| |
| |
| |
| |
| |
| jsx?: boolean; |
| } |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| type Language = "js" | "jsx" | "ts" | "tsx" | "dts"; |
| |
| |
| |
| interface TestCase extends Config { |
| code: string; |
| name?: string; |
| only?: boolean; |
| filename?: string; |
| options?: Options; |
| settings?: Settings; |
| before?(this: this): void; |
| after?(this: this): void; |
| } |
| |
| |
| |
| interface ValidTestCase extends TestCase {} |
| |
| |
| |
| interface InvalidTestCase extends TestCase { |
| output?: string | null; |
| errors: number | ErrorEntry[]; |
| } |
| type ErrorEntry = Error | string | RegExp; |
| |
| |
| |
| type Error = RequireAtLeastOne<ErrorBase, "message" | "messageId">; |
| interface ErrorBase { |
| message?: string | RegExp; |
| messageId?: string; |
| data?: DiagnosticData; |
| line?: number; |
| column?: number; |
| endLine?: number | undefined; |
| endColumn?: number | undefined; |
| suggestions?: ErrorSuggestion[] | null; |
| } |
| |
| |
| |
| interface ErrorSuggestion { |
| desc?: string; |
| messageId?: string; |
| data?: DiagnosticData; |
| output: string; |
| } |
| |
| |
| |
| interface TestCases { |
| valid: (ValidTestCase | string)[]; |
| invalid: InvalidTestCase[]; |
| } |
| |
| |
| |
| declare class RuleTester { |
| #private; |
| |
| |
| |
| |
| constructor(config?: Config | null); |
| |
| |
| |
| |
| |
| static setDefaultConfig(config: Config): void; |
| |
| |
| |
| |
| static getDefaultConfig(): Config; |
| |
| |
| |
| |
| |
| static resetDefaultConfig(): void; |
| static get describe(): DescribeFn; |
| static set describe(value: DescribeFn); |
| static get it(): ItFn; |
| static set it(value: ItFn); |
| static get itOnly(): ItFn; |
| static set itOnly(value: ItFn); |
| |
| |
| |
| |
| |
| static only(item: string | TestCase): TestCase; |
| |
| |
| |
| |
| |
| |
| |
| |
| run(ruleName: string, rule: Rule, tests: TestCases): void; |
| } |
| type _Config = Config; |
| type _LanguageOptions = LanguageOptions; |
| type _Globals = Globals; |
| type _Envs = Envs; |
| type _ParserOptions = ParserOptions; |
| type _SourceType = SourceType; |
| type _Language = Language; |
| type _EcmaFeatures = EcmaFeatures; |
| type _DescribeFn = DescribeFn; |
| type _ItFn = ItFn; |
| type _ValidTestCase = ValidTestCase; |
| type _InvalidTestCase = InvalidTestCase; |
| type _TestCases = TestCases; |
| type _Error = Error; |
| type _ErrorSuggestion = ErrorSuggestion; |
| declare namespace RuleTester { |
| type Config = _Config; |
| type LanguageOptions = _LanguageOptions; |
| type Globals = _Globals; |
| type Envs = _Envs; |
| type ParserOptions = _ParserOptions; |
| type SourceType = _SourceType; |
| type Language = _Language; |
| type EcmaFeatures = _EcmaFeatures; |
| type DescribeFn = _DescribeFn; |
| type ItFn = _ItFn; |
| type ValidTestCase = _ValidTestCase; |
| type InvalidTestCase = _InvalidTestCase; |
| type TestCases = _TestCases; |
| type Error = _Error; |
| type ErrorSuggestion = _ErrorSuggestion; |
| } |
| |
| export { RuleTester }; |