| | |
| | | * Takes an array of `types` and flattens them, removing duplicates and |
| | | * returns a `UnionTypeAnnotation` node containing them. |
| | | */ |
| | | declare function createFlowUnionType<T extends FlowType>(types: [T] | Array<T>): T | UnionTypeAnnotation; |
| | | declare function createFlowUnionType<T extends FlowType>(types: [T] | T[]): T | UnionTypeAnnotation; |
| | | |
| | | /** |
| | | * Takes an array of `types` and flattens them, removing duplicates and |
| | | * returns a `UnionTypeAnnotation` node containing them. |
| | | */ |
| | | declare function createTSUnionType(typeAnnotations: Array<TSTypeAnnotation | TSType>): TSType; |
| | | declare function createTSUnionType(typeAnnotations: (TSTypeAnnotation | TSType)[]): TSType; |
| | | |
| | | interface BaseComment { |
| | | value: string; |
| | |
| | | type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | BinaryExpression | BindExpression | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | ExpressionStatement | File | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | LogicalExpression | MemberExpression | MetaProperty | MixedTypeAnnotation | ModuleExpression | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral$1 | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | PrivateName | Program | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral$1 | RestElement | RestProperty$1 | ReturnStatement | SequenceExpression | SpreadElement | SpreadProperty$1 | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSSatisfiesExpression | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnionTypeAnnotation | UpdateExpression | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidPattern | VoidTypeAnnotation | WhileStatement | WithStatement | YieldExpression; |
| | | interface ArrayExpression extends BaseNode { |
| | | type: "ArrayExpression"; |
| | | elements: Array<null | Expression | SpreadElement>; |
| | | elements: (null | Expression | SpreadElement)[]; |
| | | } |
| | | interface AssignmentExpression extends BaseNode { |
| | | type: "AssignmentExpression"; |
| | |
| | | } |
| | | interface BlockStatement extends BaseNode { |
| | | type: "BlockStatement"; |
| | | body: Array<Statement>; |
| | | directives: Array<Directive>; |
| | | body: Statement[]; |
| | | directives: Directive[]; |
| | | } |
| | | interface BreakStatement extends BaseNode { |
| | | type: "BreakStatement"; |
| | |
| | | interface CallExpression extends BaseNode { |
| | | type: "CallExpression"; |
| | | callee: Expression | Super | V8IntrinsicIdentifier; |
| | | arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>; |
| | | arguments: (Expression | SpreadElement | ArgumentPlaceholder)[]; |
| | | optional?: boolean | null; |
| | | typeArguments?: TypeParameterInstantiation | null; |
| | | typeParameters?: TSTypeParameterInstantiation | null; |
| | |
| | | interface File extends BaseNode { |
| | | type: "File"; |
| | | program: Program; |
| | | comments?: Array<CommentBlock | CommentLine> | null; |
| | | tokens?: Array<any> | null; |
| | | comments?: (CommentBlock | CommentLine)[] | null; |
| | | tokens?: any[] | null; |
| | | } |
| | | interface ForInStatement extends BaseNode { |
| | | type: "ForInStatement"; |
| | |
| | | interface FunctionDeclaration extends BaseNode { |
| | | type: "FunctionDeclaration"; |
| | | id?: Identifier | null; |
| | | params: Array<FunctionParameter>; |
| | | params: FunctionParameter[]; |
| | | body: BlockStatement; |
| | | generator: boolean; |
| | | async: boolean; |
| | |
| | | interface FunctionExpression extends BaseNode { |
| | | type: "FunctionExpression"; |
| | | id?: Identifier | null; |
| | | params: Array<FunctionParameter>; |
| | | params: FunctionParameter[]; |
| | | body: BlockStatement; |
| | | generator: boolean; |
| | | async: boolean; |
| | |
| | | interface Identifier extends BaseNode { |
| | | type: "Identifier"; |
| | | name: string; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | |
| | | interface NewExpression extends BaseNode { |
| | | type: "NewExpression"; |
| | | callee: Expression | Super | V8IntrinsicIdentifier; |
| | | arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>; |
| | | arguments: (Expression | SpreadElement | ArgumentPlaceholder)[]; |
| | | optional?: boolean | null; |
| | | typeArguments?: TypeParameterInstantiation | null; |
| | | typeParameters?: TSTypeParameterInstantiation | null; |
| | | } |
| | | interface Program extends BaseNode { |
| | | type: "Program"; |
| | | body: Array<Statement>; |
| | | directives: Array<Directive>; |
| | | body: Statement[]; |
| | | directives: Directive[]; |
| | | sourceType: "script" | "module"; |
| | | interpreter?: InterpreterDirective | null; |
| | | } |
| | | interface ObjectExpression extends BaseNode { |
| | | type: "ObjectExpression"; |
| | | properties: Array<ObjectMethod | ObjectProperty | SpreadElement>; |
| | | properties: (ObjectMethod | ObjectProperty | SpreadElement)[]; |
| | | } |
| | | interface ObjectMethod extends BaseNode { |
| | | type: "ObjectMethod"; |
| | | kind: "method" | "get" | "set"; |
| | | key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral; |
| | | params: Array<FunctionParameter>; |
| | | params: FunctionParameter[]; |
| | | body: BlockStatement; |
| | | computed: boolean; |
| | | generator: boolean; |
| | | async: boolean; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; |
| | | } |
| | |
| | | value: Expression | PatternLike; |
| | | computed: boolean; |
| | | shorthand: boolean; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | } |
| | | interface RestElement extends BaseNode { |
| | | type: "RestElement"; |
| | | argument: Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | |
| | | interface RestProperty$1 extends BaseNode { |
| | | type: "RestProperty"; |
| | | argument: Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | |
| | | } |
| | | interface SequenceExpression extends BaseNode { |
| | | type: "SequenceExpression"; |
| | | expressions: Array<Expression>; |
| | | expressions: Expression[]; |
| | | } |
| | | interface ParenthesizedExpression extends BaseNode { |
| | | type: "ParenthesizedExpression"; |
| | |
| | | interface SwitchCase extends BaseNode { |
| | | type: "SwitchCase"; |
| | | test?: Expression | null; |
| | | consequent: Array<Statement>; |
| | | consequent: Statement[]; |
| | | } |
| | | interface SwitchStatement extends BaseNode { |
| | | type: "SwitchStatement"; |
| | | discriminant: Expression; |
| | | cases: Array<SwitchCase>; |
| | | cases: SwitchCase[]; |
| | | } |
| | | interface ThisExpression extends BaseNode { |
| | | type: "ThisExpression"; |
| | |
| | | interface VariableDeclaration extends BaseNode { |
| | | type: "VariableDeclaration"; |
| | | kind: "var" | "let" | "const" | "using" | "await using"; |
| | | declarations: Array<VariableDeclarator>; |
| | | declarations: VariableDeclarator[]; |
| | | declare?: boolean | null; |
| | | } |
| | | interface VariableDeclarator extends BaseNode { |
| | |
| | | type: "AssignmentPattern"; |
| | | left: Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression; |
| | | right: Expression; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | | interface ArrayPattern extends BaseNode { |
| | | type: "ArrayPattern"; |
| | | elements: Array<null | PatternLike>; |
| | | decorators?: Array<Decorator> | null; |
| | | elements: (null | PatternLike)[]; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | | interface ArrowFunctionExpression extends BaseNode { |
| | | type: "ArrowFunctionExpression"; |
| | | params: Array<FunctionParameter>; |
| | | params: FunctionParameter[]; |
| | | body: BlockStatement | Expression; |
| | | async: boolean; |
| | | expression: boolean; |
| | |
| | | } |
| | | interface ClassBody extends BaseNode { |
| | | type: "ClassBody"; |
| | | body: Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>; |
| | | body: (ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock)[]; |
| | | } |
| | | interface ClassExpression extends BaseNode { |
| | | type: "ClassExpression"; |
| | | id?: Identifier | null; |
| | | superClass?: Expression | null; |
| | | body: ClassBody; |
| | | decorators?: Array<Decorator> | null; |
| | | implements?: Array<TSExpressionWithTypeArguments | ClassImplements> | null; |
| | | decorators?: Decorator[] | null; |
| | | implements?: (TSExpressionWithTypeArguments | ClassImplements)[] | null; |
| | | mixins?: InterfaceExtends | null; |
| | | superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; |
| | | typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; |
| | |
| | | id?: Identifier | null; |
| | | superClass?: Expression | null; |
| | | body: ClassBody; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | abstract?: boolean | null; |
| | | declare?: boolean | null; |
| | | implements?: Array<TSExpressionWithTypeArguments | ClassImplements> | null; |
| | | implements?: (TSExpressionWithTypeArguments | ClassImplements)[] | null; |
| | | mixins?: InterfaceExtends | null; |
| | | superTypeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null; |
| | | typeParameters?: TypeParameterDeclaration | TSTypeParameterDeclaration | Noop | null; |
| | |
| | | interface ExportAllDeclaration extends BaseNode { |
| | | type: "ExportAllDeclaration"; |
| | | source: StringLiteral; |
| | | attributes?: ImportAttribute[] | null; |
| | | /** @deprecated */ |
| | | assertions?: Array<ImportAttribute> | null; |
| | | attributes?: Array<ImportAttribute> | null; |
| | | assertions?: ImportAttribute[] | null; |
| | | exportKind?: "type" | "value" | null; |
| | | } |
| | | interface ExportDefaultDeclaration extends BaseNode { |
| | |
| | | interface ExportNamedDeclaration extends BaseNode { |
| | | type: "ExportNamedDeclaration"; |
| | | declaration?: Declaration | null; |
| | | specifiers: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>; |
| | | specifiers: (ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier)[]; |
| | | source?: StringLiteral | null; |
| | | attributes?: ImportAttribute[] | null; |
| | | /** @deprecated */ |
| | | assertions?: Array<ImportAttribute> | null; |
| | | attributes?: Array<ImportAttribute> | null; |
| | | assertions?: ImportAttribute[] | null; |
| | | exportKind?: "type" | "value" | null; |
| | | } |
| | | interface ExportSpecifier extends BaseNode { |
| | |
| | | } |
| | | interface ImportDeclaration extends BaseNode { |
| | | type: "ImportDeclaration"; |
| | | specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>; |
| | | specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[]; |
| | | source: StringLiteral; |
| | | attributes?: ImportAttribute[] | null; |
| | | /** @deprecated */ |
| | | assertions?: Array<ImportAttribute> | null; |
| | | attributes?: Array<ImportAttribute> | null; |
| | | assertions?: ImportAttribute[] | null; |
| | | importKind?: "type" | "typeof" | "value" | null; |
| | | module?: boolean | null; |
| | | phase?: "source" | "defer" | null; |
| | |
| | | type: "ClassMethod"; |
| | | kind: "get" | "set" | "method" | "constructor"; |
| | | key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression; |
| | | params: Array<FunctionParameter | TSParameterProperty>; |
| | | params: (FunctionParameter | TSParameterProperty)[]; |
| | | body: BlockStatement; |
| | | computed: boolean; |
| | | static: boolean; |
| | |
| | | abstract?: boolean | null; |
| | | access?: "public" | "private" | "protected" | null; |
| | | accessibility?: "public" | "private" | "protected" | null; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | override?: boolean; |
| | | returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | |
| | | } |
| | | interface ObjectPattern extends BaseNode { |
| | | type: "ObjectPattern"; |
| | | properties: Array<RestElement | ObjectProperty>; |
| | | decorators?: Array<Decorator> | null; |
| | | properties: (RestElement | ObjectProperty)[]; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | |
| | | } |
| | | interface TemplateLiteral extends BaseNode { |
| | | type: "TemplateLiteral"; |
| | | quasis: Array<TemplateElement>; |
| | | expressions: Array<Expression | TSType>; |
| | | quasis: TemplateElement[]; |
| | | expressions: (Expression | TSType)[]; |
| | | } |
| | | interface YieldExpression extends BaseNode { |
| | | type: "YieldExpression"; |
| | |
| | | interface OptionalCallExpression extends BaseNode { |
| | | type: "OptionalCallExpression"; |
| | | callee: Expression; |
| | | arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>; |
| | | arguments: (Expression | SpreadElement | ArgumentPlaceholder)[]; |
| | | optional: boolean; |
| | | typeArguments?: TypeParameterInstantiation | null; |
| | | typeParameters?: TSTypeParameterInstantiation | null; |
| | |
| | | key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression; |
| | | value?: Expression | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | computed: boolean; |
| | | static: boolean; |
| | | abstract?: boolean | null; |
| | |
| | | key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName; |
| | | value?: Expression | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | computed: boolean; |
| | | static: boolean; |
| | | abstract?: boolean | null; |
| | |
| | | type: "ClassPrivateProperty"; |
| | | key: PrivateName; |
| | | value?: Expression | null; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | static: boolean; |
| | | definite?: boolean | null; |
| | | optional?: boolean | null; |
| | |
| | | type: "ClassPrivateMethod"; |
| | | kind: "get" | "set" | "method"; |
| | | key: PrivateName; |
| | | params: Array<FunctionParameter | TSParameterProperty>; |
| | | params: (FunctionParameter | TSParameterProperty)[]; |
| | | body: BlockStatement; |
| | | static: boolean; |
| | | abstract?: boolean | null; |
| | |
| | | accessibility?: "public" | "private" | "protected" | null; |
| | | async?: boolean; |
| | | computed?: boolean; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | generator?: boolean; |
| | | optional?: boolean | null; |
| | | override?: boolean; |
| | |
| | | } |
| | | interface StaticBlock extends BaseNode { |
| | | type: "StaticBlock"; |
| | | body: Array<Statement>; |
| | | body: Statement[]; |
| | | } |
| | | interface ImportAttribute extends BaseNode { |
| | | type: "ImportAttribute"; |
| | |
| | | type: "DeclareClass"; |
| | | id: Identifier; |
| | | typeParameters?: TypeParameterDeclaration | null; |
| | | extends?: Array<InterfaceExtends> | null; |
| | | extends?: InterfaceExtends[] | null; |
| | | body: ObjectTypeAnnotation; |
| | | implements?: Array<ClassImplements> | null; |
| | | mixins?: Array<InterfaceExtends> | null; |
| | | implements?: ClassImplements[] | null; |
| | | mixins?: InterfaceExtends[] | null; |
| | | } |
| | | interface DeclareFunction extends BaseNode { |
| | | type: "DeclareFunction"; |
| | |
| | | type: "DeclareInterface"; |
| | | id: Identifier; |
| | | typeParameters?: TypeParameterDeclaration | null; |
| | | extends?: Array<InterfaceExtends> | null; |
| | | extends?: InterfaceExtends[] | null; |
| | | body: ObjectTypeAnnotation; |
| | | } |
| | | interface DeclareModule extends BaseNode { |
| | |
| | | interface DeclareExportDeclaration extends BaseNode { |
| | | type: "DeclareExportDeclaration"; |
| | | declaration?: Flow | null; |
| | | specifiers?: Array<ExportSpecifier | ExportNamespaceSpecifier> | null; |
| | | specifiers?: (ExportSpecifier | ExportNamespaceSpecifier)[] | null; |
| | | source?: StringLiteral | null; |
| | | attributes?: Array<ImportAttribute> | null; |
| | | attributes?: ImportAttribute[] | null; |
| | | /** @deprecated */ |
| | | assertions?: Array<ImportAttribute> | null; |
| | | assertions?: ImportAttribute[] | null; |
| | | default?: boolean | null; |
| | | } |
| | | interface DeclareExportAllDeclaration extends BaseNode { |
| | | type: "DeclareExportAllDeclaration"; |
| | | source: StringLiteral; |
| | | attributes?: Array<ImportAttribute> | null; |
| | | attributes?: ImportAttribute[] | null; |
| | | /** @deprecated */ |
| | | assertions?: Array<ImportAttribute> | null; |
| | | assertions?: ImportAttribute[] | null; |
| | | exportKind?: "type" | "value" | null; |
| | | } |
| | | interface DeclaredPredicate extends BaseNode { |
| | |
| | | interface FunctionTypeAnnotation extends BaseNode { |
| | | type: "FunctionTypeAnnotation"; |
| | | typeParameters?: TypeParameterDeclaration | null; |
| | | params: Array<FunctionTypeParam>; |
| | | params: FunctionTypeParam[]; |
| | | rest?: FunctionTypeParam | null; |
| | | returnType: FlowType; |
| | | this?: FunctionTypeParam | null; |
| | |
| | | type: "InterfaceDeclaration"; |
| | | id: Identifier; |
| | | typeParameters?: TypeParameterDeclaration | null; |
| | | extends?: Array<InterfaceExtends> | null; |
| | | extends?: InterfaceExtends[] | null; |
| | | body: ObjectTypeAnnotation; |
| | | } |
| | | interface InterfaceTypeAnnotation extends BaseNode { |
| | | type: "InterfaceTypeAnnotation"; |
| | | extends?: Array<InterfaceExtends> | null; |
| | | extends?: InterfaceExtends[] | null; |
| | | body: ObjectTypeAnnotation; |
| | | } |
| | | interface IntersectionTypeAnnotation extends BaseNode { |
| | | type: "IntersectionTypeAnnotation"; |
| | | types: Array<FlowType>; |
| | | types: FlowType[]; |
| | | } |
| | | interface MixedTypeAnnotation extends BaseNode { |
| | | type: "MixedTypeAnnotation"; |
| | |
| | | } |
| | | interface ObjectTypeAnnotation extends BaseNode { |
| | | type: "ObjectTypeAnnotation"; |
| | | properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty>; |
| | | indexers?: Array<ObjectTypeIndexer>; |
| | | callProperties?: Array<ObjectTypeCallProperty>; |
| | | internalSlots?: Array<ObjectTypeInternalSlot>; |
| | | properties: (ObjectTypeProperty | ObjectTypeSpreadProperty)[]; |
| | | indexers?: ObjectTypeIndexer[]; |
| | | callProperties?: ObjectTypeCallProperty[]; |
| | | internalSlots?: ObjectTypeInternalSlot[]; |
| | | exact: boolean; |
| | | inexact?: boolean | null; |
| | | } |
| | |
| | | } |
| | | interface TupleTypeAnnotation extends BaseNode { |
| | | type: "TupleTypeAnnotation"; |
| | | types: Array<FlowType>; |
| | | types: FlowType[]; |
| | | } |
| | | interface TypeofTypeAnnotation extends BaseNode { |
| | | type: "TypeofTypeAnnotation"; |
| | |
| | | } |
| | | interface TypeParameterDeclaration extends BaseNode { |
| | | type: "TypeParameterDeclaration"; |
| | | params: Array<TypeParameter>; |
| | | params: TypeParameter[]; |
| | | } |
| | | interface TypeParameterInstantiation extends BaseNode { |
| | | type: "TypeParameterInstantiation"; |
| | | params: Array<FlowType>; |
| | | params: FlowType[]; |
| | | } |
| | | interface UnionTypeAnnotation extends BaseNode { |
| | | type: "UnionTypeAnnotation"; |
| | | types: Array<FlowType>; |
| | | types: FlowType[]; |
| | | } |
| | | interface Variance extends BaseNode { |
| | | type: "Variance"; |
| | |
| | | } |
| | | interface EnumBooleanBody extends BaseNode { |
| | | type: "EnumBooleanBody"; |
| | | members: Array<EnumBooleanMember>; |
| | | members: EnumBooleanMember[]; |
| | | explicitType: boolean; |
| | | hasUnknownMembers: boolean; |
| | | } |
| | | interface EnumNumberBody extends BaseNode { |
| | | type: "EnumNumberBody"; |
| | | members: Array<EnumNumberMember>; |
| | | members: EnumNumberMember[]; |
| | | explicitType: boolean; |
| | | hasUnknownMembers: boolean; |
| | | } |
| | | interface EnumStringBody extends BaseNode { |
| | | type: "EnumStringBody"; |
| | | members: Array<EnumStringMember | EnumDefaultedMember>; |
| | | members: (EnumStringMember | EnumDefaultedMember)[]; |
| | | explicitType: boolean; |
| | | hasUnknownMembers: boolean; |
| | | } |
| | | interface EnumSymbolBody extends BaseNode { |
| | | type: "EnumSymbolBody"; |
| | | members: Array<EnumDefaultedMember>; |
| | | members: EnumDefaultedMember[]; |
| | | hasUnknownMembers: boolean; |
| | | } |
| | | interface EnumBooleanMember extends BaseNode { |
| | |
| | | type: "JSXElement"; |
| | | openingElement: JSXOpeningElement; |
| | | closingElement?: JSXClosingElement | null; |
| | | children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>; |
| | | children: (JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[]; |
| | | selfClosing?: boolean | null; |
| | | } |
| | | interface JSXEmptyExpression extends BaseNode { |
| | |
| | | interface JSXOpeningElement extends BaseNode { |
| | | type: "JSXOpeningElement"; |
| | | name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName; |
| | | attributes: Array<JSXAttribute | JSXSpreadAttribute>; |
| | | attributes: (JSXAttribute | JSXSpreadAttribute)[]; |
| | | selfClosing: boolean; |
| | | typeArguments?: TypeParameterInstantiation | null; |
| | | typeParameters?: TSTypeParameterInstantiation | null; |
| | |
| | | type: "JSXFragment"; |
| | | openingFragment: JSXOpeningFragment; |
| | | closingFragment: JSXClosingFragment; |
| | | children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>; |
| | | children: (JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[]; |
| | | } |
| | | interface JSXOpeningFragment extends BaseNode { |
| | | type: "JSXOpeningFragment"; |
| | |
| | | type: "Placeholder"; |
| | | expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern"; |
| | | name: Identifier; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | optional?: boolean | null; |
| | | typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null; |
| | | } |
| | |
| | | } |
| | | interface RecordExpression extends BaseNode { |
| | | type: "RecordExpression"; |
| | | properties: Array<ObjectProperty | SpreadElement>; |
| | | properties: (ObjectProperty | SpreadElement)[]; |
| | | } |
| | | interface TupleExpression extends BaseNode { |
| | | type: "TupleExpression"; |
| | | elements: Array<Expression | SpreadElement>; |
| | | elements: (Expression | SpreadElement)[]; |
| | | } |
| | | interface DecimalLiteral extends BaseNode { |
| | | type: "DecimalLiteral"; |
| | |
| | | type: "TSParameterProperty"; |
| | | parameter: Identifier | AssignmentPattern; |
| | | accessibility?: "public" | "private" | "protected" | null; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | override?: boolean | null; |
| | | readonly?: boolean | null; |
| | | } |
| | |
| | | type: "TSDeclareFunction"; |
| | | id?: Identifier | null; |
| | | typeParameters?: TSTypeParameterDeclaration | Noop | null; |
| | | params: Array<FunctionParameter>; |
| | | params: FunctionParameter[]; |
| | | returnType?: TSTypeAnnotation | Noop | null; |
| | | async?: boolean; |
| | | declare?: boolean | null; |
| | |
| | | } |
| | | interface TSDeclareMethod extends BaseNode { |
| | | type: "TSDeclareMethod"; |
| | | decorators?: Array<Decorator> | null; |
| | | decorators?: Decorator[] | null; |
| | | key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression; |
| | | typeParameters?: TSTypeParameterDeclaration | Noop | null; |
| | | params: Array<FunctionParameter | TSParameterProperty>; |
| | | params: (FunctionParameter | TSParameterProperty)[]; |
| | | returnType?: TSTypeAnnotation | Noop | null; |
| | | abstract?: boolean | null; |
| | | access?: "public" | "private" | "protected" | null; |
| | |
| | | interface TSCallSignatureDeclaration extends BaseNode { |
| | | type: "TSCallSignatureDeclaration"; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>; |
| | | parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | } |
| | | interface TSConstructSignatureDeclaration extends BaseNode { |
| | | type: "TSConstructSignatureDeclaration"; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>; |
| | | parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | } |
| | | interface TSPropertySignature extends BaseNode { |
| | |
| | | type: "TSMethodSignature"; |
| | | key: Expression; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>; |
| | | parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | computed?: boolean; |
| | | kind: "method" | "get" | "set"; |
| | |
| | | } |
| | | interface TSIndexSignature extends BaseNode { |
| | | type: "TSIndexSignature"; |
| | | parameters: Array<Identifier>; |
| | | parameters: Identifier[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | readonly?: boolean | null; |
| | | static?: boolean | null; |
| | |
| | | interface TSFunctionType extends BaseNode { |
| | | type: "TSFunctionType"; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>; |
| | | parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | } |
| | | interface TSConstructorType extends BaseNode { |
| | | type: "TSConstructorType"; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>; |
| | | parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[]; |
| | | typeAnnotation?: TSTypeAnnotation | null; |
| | | abstract?: boolean | null; |
| | | } |
| | |
| | | } |
| | | interface TSTypeLiteral extends BaseNode { |
| | | type: "TSTypeLiteral"; |
| | | members: Array<TSTypeElement>; |
| | | members: TSTypeElement[]; |
| | | } |
| | | interface TSArrayType extends BaseNode { |
| | | type: "TSArrayType"; |
| | |
| | | } |
| | | interface TSTupleType extends BaseNode { |
| | | type: "TSTupleType"; |
| | | elementTypes: Array<TSType | TSNamedTupleMember>; |
| | | elementTypes: (TSType | TSNamedTupleMember)[]; |
| | | } |
| | | interface TSOptionalType extends BaseNode { |
| | | type: "TSOptionalType"; |
| | |
| | | } |
| | | interface TSUnionType extends BaseNode { |
| | | type: "TSUnionType"; |
| | | types: Array<TSType>; |
| | | types: TSType[]; |
| | | } |
| | | interface TSIntersectionType extends BaseNode { |
| | | type: "TSIntersectionType"; |
| | | types: Array<TSType>; |
| | | types: TSType[]; |
| | | } |
| | | interface TSConditionalType extends BaseNode { |
| | | type: "TSConditionalType"; |
| | |
| | | } |
| | | interface TSTemplateLiteralType extends BaseNode { |
| | | type: "TSTemplateLiteralType"; |
| | | quasis: Array<TemplateElement>; |
| | | types: Array<TSType>; |
| | | quasis: TemplateElement[]; |
| | | types: TSType[]; |
| | | } |
| | | interface TSLiteralType extends BaseNode { |
| | | type: "TSLiteralType"; |
| | |
| | | type: "TSInterfaceDeclaration"; |
| | | id: Identifier; |
| | | typeParameters?: TSTypeParameterDeclaration | null; |
| | | extends?: Array<TSExpressionWithTypeArguments> | null; |
| | | extends?: TSExpressionWithTypeArguments[] | null; |
| | | body: TSInterfaceBody; |
| | | declare?: boolean | null; |
| | | } |
| | | interface TSInterfaceBody extends BaseNode { |
| | | type: "TSInterfaceBody"; |
| | | body: Array<TSTypeElement>; |
| | | body: TSTypeElement[]; |
| | | } |
| | | interface TSTypeAliasDeclaration extends BaseNode { |
| | | type: "TSTypeAliasDeclaration"; |
| | |
| | | } |
| | | interface TSEnumBody extends BaseNode { |
| | | type: "TSEnumBody"; |
| | | members: Array<TSEnumMember>; |
| | | members: TSEnumMember[]; |
| | | } |
| | | interface TSEnumDeclaration extends BaseNode { |
| | | type: "TSEnumDeclaration"; |
| | | id: Identifier; |
| | | members: Array<TSEnumMember>; |
| | | members: TSEnumMember[]; |
| | | body?: TSEnumBody | null; |
| | | const?: boolean | null; |
| | | declare?: boolean | null; |
| | |
| | | } |
| | | interface TSModuleBlock extends BaseNode { |
| | | type: "TSModuleBlock"; |
| | | body: Array<Statement>; |
| | | body: Statement[]; |
| | | } |
| | | interface TSImportType extends BaseNode { |
| | | type: "TSImportType"; |
| | |
| | | } |
| | | interface TSTypeParameterInstantiation extends BaseNode { |
| | | type: "TSTypeParameterInstantiation"; |
| | | params: Array<TSType>; |
| | | params: TSType[]; |
| | | } |
| | | interface TSTypeParameterDeclaration extends BaseNode { |
| | | type: "TSTypeParameterDeclaration"; |
| | | params: Array<TSTypeParameter>; |
| | | params: TSTypeParameter[]; |
| | | } |
| | | interface TSTypeParameter extends BaseNode { |
| | | type: "TSTypeParameter"; |
| | |
| | | |
| | | /** @deprecated */ declare function bigIntLiteral(value: string): BigIntLiteral; |
| | | declare function bigIntLiteral(value: bigint): BigIntLiteral; |
| | | declare function arrayExpression(elements?: Array<null | Expression | SpreadElement>): ArrayExpression; |
| | | declare function arrayExpression(elements?: (null | Expression | SpreadElement)[]): ArrayExpression; |
| | | declare function assignmentExpression(operator: string, left: LVal | OptionalMemberExpression, right: Expression): AssignmentExpression; |
| | | declare function binaryExpression(operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=" | "|>", left: Expression | PrivateName, right: Expression): BinaryExpression; |
| | | declare function interpreterDirective(value: string): InterpreterDirective; |
| | | declare function directive(value: DirectiveLiteral): Directive; |
| | | declare function directiveLiteral(value: string): DirectiveLiteral; |
| | | declare function blockStatement(body: Array<Statement>, directives?: Array<Directive>): BlockStatement; |
| | | declare function blockStatement(body: Statement[], directives?: Directive[]): BlockStatement; |
| | | declare function breakStatement(label?: Identifier | null): BreakStatement; |
| | | declare function callExpression(callee: Expression | Super | V8IntrinsicIdentifier, _arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>): CallExpression; |
| | | declare function callExpression(callee: Expression | Super | V8IntrinsicIdentifier, _arguments: (Expression | SpreadElement | ArgumentPlaceholder)[]): CallExpression; |
| | | declare function catchClause(param: Identifier | ArrayPattern | ObjectPattern | null | undefined, body: BlockStatement): CatchClause; |
| | | declare function conditionalExpression(test: Expression, consequent: Expression, alternate: Expression): ConditionalExpression; |
| | | declare function continueStatement(label?: Identifier | null): ContinueStatement; |
| | |
| | | declare function doWhileStatement(test: Expression, body: Statement): DoWhileStatement; |
| | | declare function emptyStatement(): EmptyStatement; |
| | | declare function expressionStatement(expression: Expression): ExpressionStatement; |
| | | declare function file(program: Program, comments?: Array<CommentBlock | CommentLine> | null, tokens?: Array<any> | null): File; |
| | | declare function file(program: Program, comments?: (CommentBlock | CommentLine)[] | null, tokens?: any[] | null): File; |
| | | declare function forInStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement): ForInStatement; |
| | | declare function forStatement(init: VariableDeclaration | Expression | null | undefined, test: Expression | null | undefined, update: Expression | null | undefined, body: Statement): ForStatement; |
| | | declare function functionDeclaration(id: Identifier | null | undefined, params: Array<FunctionParameter>, body: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; |
| | | declare function functionExpression(id: Identifier | null | undefined, params: Array<FunctionParameter>, body: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; |
| | | declare function functionDeclaration(id: Identifier | null | undefined, params: FunctionParameter[], body: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; |
| | | declare function functionExpression(id: Identifier | null | undefined, params: FunctionParameter[], body: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; |
| | | declare function identifier(name: string): Identifier; |
| | | declare function ifStatement(test: Expression, consequent: Statement, alternate?: Statement | null): IfStatement; |
| | | declare function labeledStatement(label: Identifier, body: Statement): LabeledStatement; |
| | |
| | | declare function regExpLiteral(pattern: string, flags?: string): RegExpLiteral; |
| | | declare function logicalExpression(operator: "||" | "&&" | "??", left: Expression, right: Expression): LogicalExpression; |
| | | declare function memberExpression(object: Expression | Super, property: Expression | Identifier | PrivateName, computed?: boolean, optional?: boolean | null): MemberExpression; |
| | | declare function newExpression(callee: Expression | Super | V8IntrinsicIdentifier, _arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>): NewExpression; |
| | | declare function program(body: Array<Statement>, directives?: Array<Directive>, sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program; |
| | | declare function objectExpression(properties: Array<ObjectMethod | ObjectProperty | SpreadElement>): ObjectExpression; |
| | | declare function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral, params: Array<FunctionParameter>, body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod; |
| | | declare function objectProperty(key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral | DecimalLiteral | PrivateName, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Array<Decorator> | null): ObjectProperty; |
| | | declare function newExpression(callee: Expression | Super | V8IntrinsicIdentifier, _arguments: (Expression | SpreadElement | ArgumentPlaceholder)[]): NewExpression; |
| | | declare function program(body: Statement[], directives?: Directive[], sourceType?: "script" | "module", interpreter?: InterpreterDirective | null): Program; |
| | | declare function objectExpression(properties: (ObjectMethod | ObjectProperty | SpreadElement)[]): ObjectExpression; |
| | | declare function objectMethod(kind: "method" | "get" | "set" | undefined, key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral, params: FunctionParameter[], body: BlockStatement, computed?: boolean, generator?: boolean, async?: boolean): ObjectMethod; |
| | | declare function objectProperty(key: Expression | Identifier | StringLiteral | NumericLiteral | BigIntLiteral | DecimalLiteral | PrivateName, value: Expression | PatternLike, computed?: boolean, shorthand?: boolean, decorators?: Decorator[] | null): ObjectProperty; |
| | | declare function restElement(argument: Identifier | ArrayPattern | ObjectPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression | RestElement | AssignmentPattern): RestElement; |
| | | declare function returnStatement(argument?: Expression | null): ReturnStatement; |
| | | declare function sequenceExpression(expressions: Array<Expression>): SequenceExpression; |
| | | declare function sequenceExpression(expressions: Expression[]): SequenceExpression; |
| | | declare function parenthesizedExpression(expression: Expression): ParenthesizedExpression; |
| | | declare function switchCase(test: Expression | null | undefined, consequent: Array<Statement>): SwitchCase; |
| | | declare function switchStatement(discriminant: Expression, cases: Array<SwitchCase>): SwitchStatement; |
| | | declare function switchCase(test: Expression | null | undefined, consequent: Statement[]): SwitchCase; |
| | | declare function switchStatement(discriminant: Expression, cases: SwitchCase[]): SwitchStatement; |
| | | declare function thisExpression(): ThisExpression; |
| | | declare function throwStatement(argument: Expression): ThrowStatement; |
| | | declare function tryStatement(block: BlockStatement, handler?: CatchClause | null, finalizer?: BlockStatement | null): TryStatement; |
| | | declare function unaryExpression(operator: "void" | "throw" | "delete" | "!" | "+" | "-" | "~" | "typeof", argument: Expression, prefix?: boolean): UnaryExpression; |
| | | declare function updateExpression(operator: "++" | "--", argument: Expression, prefix?: boolean): UpdateExpression; |
| | | declare function variableDeclaration(kind: "var" | "let" | "const" | "using" | "await using", declarations: Array<VariableDeclarator>): VariableDeclaration; |
| | | declare function variableDeclaration(kind: "var" | "let" | "const" | "using" | "await using", declarations: VariableDeclarator[]): VariableDeclaration; |
| | | declare function variableDeclarator(id: LVal | VoidPattern, init?: Expression | null): VariableDeclarator; |
| | | declare function whileStatement(test: Expression, body: Statement): WhileStatement; |
| | | declare function withStatement(object: Expression, body: Statement): WithStatement; |
| | | declare function assignmentPattern(left: Identifier | ObjectPattern | ArrayPattern | MemberExpression | TSAsExpression | TSSatisfiesExpression | TSTypeAssertion | TSNonNullExpression, right: Expression): AssignmentPattern; |
| | | declare function arrayPattern(elements: Array<null | PatternLike>): ArrayPattern; |
| | | declare function arrowFunctionExpression(params: Array<FunctionParameter>, body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; |
| | | declare function classBody(body: Array<ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock>): ClassBody; |
| | | declare function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassExpression; |
| | | declare function classDeclaration(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Array<Decorator> | null): ClassDeclaration; |
| | | declare function exportAllDeclaration(source: StringLiteral): ExportAllDeclaration; |
| | | declare function arrayPattern(elements: (null | PatternLike)[]): ArrayPattern; |
| | | declare function arrowFunctionExpression(params: FunctionParameter[], body: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; |
| | | declare function classBody(body: (ClassMethod | ClassPrivateMethod | ClassProperty | ClassPrivateProperty | ClassAccessorProperty | TSDeclareMethod | TSIndexSignature | StaticBlock)[]): ClassBody; |
| | | declare function classExpression(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Decorator[] | null): ClassExpression; |
| | | declare function classDeclaration(id: Identifier | null | undefined, superClass: Expression | null | undefined, body: ClassBody, decorators?: Decorator[] | null): ClassDeclaration; |
| | | declare function exportAllDeclaration(source: StringLiteral, attributes?: ImportAttribute[] | null): ExportAllDeclaration; |
| | | declare function exportDefaultDeclaration(declaration: TSDeclareFunction | FunctionDeclaration | ClassDeclaration | Expression): ExportDefaultDeclaration; |
| | | declare function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: Array<ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier>, source?: StringLiteral | null): ExportNamedDeclaration; |
| | | declare function exportNamedDeclaration(declaration?: Declaration | null, specifiers?: (ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier)[], source?: StringLiteral | null, attributes?: ImportAttribute[] | null): ExportNamedDeclaration; |
| | | declare function exportSpecifier(local: Identifier, exported: Identifier | StringLiteral): ExportSpecifier; |
| | | declare function forOfStatement(left: VariableDeclaration | LVal, right: Expression, body: Statement, _await?: boolean): ForOfStatement; |
| | | declare function importDeclaration(specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>, source: StringLiteral): ImportDeclaration; |
| | | declare function importDeclaration(specifiers: (ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier)[], source: StringLiteral, attributes?: ImportAttribute[] | null): ImportDeclaration; |
| | | declare function importDefaultSpecifier(local: Identifier): ImportDefaultSpecifier; |
| | | declare function importNamespaceSpecifier(local: Identifier): ImportNamespaceSpecifier; |
| | | declare function importSpecifier(local: Identifier, imported: Identifier | StringLiteral): ImportSpecifier; |
| | | declare function importExpression(source: Expression, options?: Expression | null): ImportExpression; |
| | | declare function metaProperty(meta: Identifier, property: Identifier): MetaProperty; |
| | | declare function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, params: Array<FunctionParameter | TSParameterProperty>, body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod; |
| | | declare function objectPattern(properties: Array<RestElement | ObjectProperty>): ObjectPattern; |
| | | declare function classMethod(kind: "get" | "set" | "method" | "constructor" | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, params: (FunctionParameter | TSParameterProperty)[], body: BlockStatement, computed?: boolean, _static?: boolean, generator?: boolean, async?: boolean): ClassMethod; |
| | | declare function objectPattern(properties: (RestElement | ObjectProperty)[]): ObjectPattern; |
| | | declare function spreadElement(argument: Expression): SpreadElement; |
| | | declare function _super(): Super; |
| | | |
| | |
| | | raw: string; |
| | | cooked?: string; |
| | | }, tail?: boolean): TemplateElement; |
| | | declare function templateLiteral(quasis: Array<TemplateElement>, expressions: Array<Expression | TSType>): TemplateLiteral; |
| | | declare function templateLiteral(quasis: TemplateElement[], expressions: (Expression | TSType)[]): TemplateLiteral; |
| | | declare function yieldExpression(argument?: Expression | null, delegate?: boolean): YieldExpression; |
| | | declare function awaitExpression(argument: Expression): AwaitExpression; |
| | | declare function _import(): Import; |
| | | |
| | | declare function exportNamespaceSpecifier(exported: Identifier): ExportNamespaceSpecifier; |
| | | declare function optionalMemberExpression(object: Expression, property: Expression | Identifier, computed: boolean | undefined, optional: boolean): OptionalMemberExpression; |
| | | declare function optionalCallExpression(callee: Expression, _arguments: Array<Expression | SpreadElement | ArgumentPlaceholder>, optional: boolean): OptionalCallExpression; |
| | | declare function classProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassProperty; |
| | | declare function classAccessorProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Array<Decorator> | null, computed?: boolean, _static?: boolean): ClassAccessorProperty; |
| | | declare function classPrivateProperty(key: PrivateName, value?: Expression | null, decorators?: Array<Decorator> | null, _static?: boolean): ClassPrivateProperty; |
| | | declare function classPrivateMethod(kind: "get" | "set" | "method" | undefined, key: PrivateName, params: Array<FunctionParameter | TSParameterProperty>, body: BlockStatement, _static?: boolean): ClassPrivateMethod; |
| | | declare function optionalCallExpression(callee: Expression, _arguments: (Expression | SpreadElement | ArgumentPlaceholder)[], optional: boolean): OptionalCallExpression; |
| | | declare function classProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Decorator[] | null, computed?: boolean, _static?: boolean): ClassProperty; |
| | | declare function classAccessorProperty(key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression | PrivateName, value?: Expression | null, typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null, decorators?: Decorator[] | null, computed?: boolean, _static?: boolean): ClassAccessorProperty; |
| | | declare function classPrivateProperty(key: PrivateName, value?: Expression | null, decorators?: Decorator[] | null, _static?: boolean): ClassPrivateProperty; |
| | | declare function classPrivateMethod(kind: "get" | "set" | "method" | undefined, key: PrivateName, params: (FunctionParameter | TSParameterProperty)[], body: BlockStatement, _static?: boolean): ClassPrivateMethod; |
| | | declare function privateName(id: Identifier): PrivateName; |
| | | declare function staticBlock(body: Array<Statement>): StaticBlock; |
| | | declare function staticBlock(body: Statement[]): StaticBlock; |
| | | declare function importAttribute(key: Identifier | StringLiteral, value: StringLiteral): ImportAttribute; |
| | | declare function anyTypeAnnotation(): AnyTypeAnnotation; |
| | | declare function arrayTypeAnnotation(elementType: FlowType): ArrayTypeAnnotation; |
| | |
| | | declare function booleanLiteralTypeAnnotation(value: boolean): BooleanLiteralTypeAnnotation; |
| | | declare function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; |
| | | declare function classImplements(id: Identifier, typeParameters?: TypeParameterInstantiation | null): ClassImplements; |
| | | declare function declareClass(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array<InterfaceExtends> | null | undefined, body: ObjectTypeAnnotation): DeclareClass; |
| | | declare function declareClass(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: InterfaceExtends[] | null | undefined, body: ObjectTypeAnnotation): DeclareClass; |
| | | declare function declareFunction(id: Identifier): DeclareFunction; |
| | | declare function declareInterface(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array<InterfaceExtends> | null | undefined, body: ObjectTypeAnnotation): DeclareInterface; |
| | | declare function declareInterface(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: InterfaceExtends[] | null | undefined, body: ObjectTypeAnnotation): DeclareInterface; |
| | | declare function declareModule(id: Identifier | StringLiteral, body: BlockStatement, kind?: "CommonJS" | "ES" | null): DeclareModule; |
| | | declare function declareModuleExports(typeAnnotation: TypeAnnotation): DeclareModuleExports; |
| | | declare function declareTypeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): DeclareTypeAlias; |
| | | declare function declareOpaqueType(id: Identifier, typeParameters?: TypeParameterDeclaration | null, supertype?: FlowType | null): DeclareOpaqueType; |
| | | declare function declareVariable(id: Identifier): DeclareVariable; |
| | | declare function declareExportDeclaration(declaration?: Flow | null, specifiers?: Array<ExportSpecifier | ExportNamespaceSpecifier> | null, source?: StringLiteral | null, attributes?: Array<ImportAttribute> | null): DeclareExportDeclaration; |
| | | declare function declareExportAllDeclaration(source: StringLiteral, attributes?: Array<ImportAttribute> | null): DeclareExportAllDeclaration; |
| | | declare function declareExportDeclaration(declaration?: Flow | null, specifiers?: (ExportSpecifier | ExportNamespaceSpecifier)[] | null, source?: StringLiteral | null, attributes?: ImportAttribute[] | null): DeclareExportDeclaration; |
| | | declare function declareExportAllDeclaration(source: StringLiteral, attributes?: ImportAttribute[] | null): DeclareExportAllDeclaration; |
| | | declare function declaredPredicate(value: Flow): DeclaredPredicate; |
| | | declare function existsTypeAnnotation(): ExistsTypeAnnotation; |
| | | declare function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: Array<FunctionTypeParam>, rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation; |
| | | declare function functionTypeAnnotation(typeParameters: TypeParameterDeclaration | null | undefined, params: FunctionTypeParam[], rest: FunctionTypeParam | null | undefined, returnType: FlowType): FunctionTypeAnnotation; |
| | | declare function functionTypeParam(name: Identifier | null | undefined, typeAnnotation: FlowType): FunctionTypeParam; |
| | | declare function genericTypeAnnotation(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): GenericTypeAnnotation; |
| | | declare function inferredPredicate(): InferredPredicate; |
| | | declare function interfaceExtends(id: Identifier | QualifiedTypeIdentifier, typeParameters?: TypeParameterInstantiation | null): InterfaceExtends; |
| | | declare function interfaceDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: Array<InterfaceExtends> | null | undefined, body: ObjectTypeAnnotation): InterfaceDeclaration; |
| | | declare function interfaceTypeAnnotation(_extends: Array<InterfaceExtends> | null | undefined, body: ObjectTypeAnnotation): InterfaceTypeAnnotation; |
| | | declare function intersectionTypeAnnotation(types: Array<FlowType>): IntersectionTypeAnnotation; |
| | | declare function interfaceDeclaration(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, _extends: InterfaceExtends[] | null | undefined, body: ObjectTypeAnnotation): InterfaceDeclaration; |
| | | declare function interfaceTypeAnnotation(_extends: InterfaceExtends[] | null | undefined, body: ObjectTypeAnnotation): InterfaceTypeAnnotation; |
| | | declare function intersectionTypeAnnotation(types: FlowType[]): IntersectionTypeAnnotation; |
| | | declare function mixedTypeAnnotation(): MixedTypeAnnotation; |
| | | declare function emptyTypeAnnotation(): EmptyTypeAnnotation; |
| | | declare function nullableTypeAnnotation(typeAnnotation: FlowType): NullableTypeAnnotation; |
| | | declare function numberLiteralTypeAnnotation(value: number): NumberLiteralTypeAnnotation; |
| | | declare function numberTypeAnnotation(): NumberTypeAnnotation; |
| | | declare function objectTypeAnnotation(properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty>, indexers?: Array<ObjectTypeIndexer>, callProperties?: Array<ObjectTypeCallProperty>, internalSlots?: Array<ObjectTypeInternalSlot>, exact?: boolean): ObjectTypeAnnotation; |
| | | declare function objectTypeAnnotation(properties: (ObjectTypeProperty | ObjectTypeSpreadProperty)[], indexers?: ObjectTypeIndexer[], callProperties?: ObjectTypeCallProperty[], internalSlots?: ObjectTypeInternalSlot[], exact?: boolean): ObjectTypeAnnotation; |
| | | declare function objectTypeInternalSlot(id: Identifier, value: FlowType, optional: boolean, _static: boolean, method: boolean): ObjectTypeInternalSlot; |
| | | declare function objectTypeCallProperty(value: FlowType): ObjectTypeCallProperty; |
| | | declare function objectTypeIndexer(id: Identifier | null | undefined, key: FlowType, value: FlowType, variance?: Variance | null): ObjectTypeIndexer; |
| | |
| | | declare function stringTypeAnnotation(): StringTypeAnnotation; |
| | | declare function symbolTypeAnnotation(): SymbolTypeAnnotation; |
| | | declare function thisTypeAnnotation(): ThisTypeAnnotation; |
| | | declare function tupleTypeAnnotation(types: Array<FlowType>): TupleTypeAnnotation; |
| | | declare function tupleTypeAnnotation(types: FlowType[]): TupleTypeAnnotation; |
| | | declare function typeofTypeAnnotation(argument: FlowType): TypeofTypeAnnotation; |
| | | declare function typeAlias(id: Identifier, typeParameters: TypeParameterDeclaration | null | undefined, right: FlowType): TypeAlias; |
| | | declare function typeAnnotation(typeAnnotation: FlowType): TypeAnnotation; |
| | | declare function typeCastExpression(expression: Expression, typeAnnotation: TypeAnnotation): TypeCastExpression; |
| | | declare function typeParameter(bound?: TypeAnnotation | null, _default?: FlowType | null, variance?: Variance | null): TypeParameter; |
| | | declare function typeParameterDeclaration(params: Array<TypeParameter>): TypeParameterDeclaration; |
| | | declare function typeParameterInstantiation(params: Array<FlowType>): TypeParameterInstantiation; |
| | | declare function unionTypeAnnotation(types: Array<FlowType>): UnionTypeAnnotation; |
| | | declare function typeParameterDeclaration(params: TypeParameter[]): TypeParameterDeclaration; |
| | | declare function typeParameterInstantiation(params: FlowType[]): TypeParameterInstantiation; |
| | | declare function unionTypeAnnotation(types: FlowType[]): UnionTypeAnnotation; |
| | | declare function variance(kind: "minus" | "plus"): Variance; |
| | | declare function voidTypeAnnotation(): VoidTypeAnnotation; |
| | | declare function enumDeclaration(id: Identifier, body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody): EnumDeclaration; |
| | | declare function enumBooleanBody(members: Array<EnumBooleanMember>): EnumBooleanBody; |
| | | declare function enumNumberBody(members: Array<EnumNumberMember>): EnumNumberBody; |
| | | declare function enumStringBody(members: Array<EnumStringMember | EnumDefaultedMember>): EnumStringBody; |
| | | declare function enumSymbolBody(members: Array<EnumDefaultedMember>): EnumSymbolBody; |
| | | declare function enumBooleanBody(members: EnumBooleanMember[]): EnumBooleanBody; |
| | | declare function enumNumberBody(members: EnumNumberMember[]): EnumNumberBody; |
| | | declare function enumStringBody(members: (EnumStringMember | EnumDefaultedMember)[]): EnumStringBody; |
| | | declare function enumSymbolBody(members: EnumDefaultedMember[]): EnumSymbolBody; |
| | | declare function enumBooleanMember(id: Identifier): EnumBooleanMember; |
| | | declare function enumNumberMember(id: Identifier, init: NumericLiteral): EnumNumberMember; |
| | | declare function enumStringMember(id: Identifier, init: StringLiteral): EnumStringMember; |
| | |
| | | |
| | | declare function jsxClosingElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName): JSXClosingElement; |
| | | |
| | | declare function jsxElement(openingElement: JSXOpeningElement, closingElement: JSXClosingElement | null | undefined, children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>, selfClosing?: boolean | null): JSXElement; |
| | | declare function jsxElement(openingElement: JSXOpeningElement, closingElement: JSXClosingElement | null | undefined, children: (JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[], selfClosing?: boolean | null): JSXElement; |
| | | |
| | | declare function jsxEmptyExpression(): JSXEmptyExpression; |
| | | |
| | |
| | | |
| | | declare function jsxNamespacedName(namespace: JSXIdentifier, name: JSXIdentifier): JSXNamespacedName; |
| | | |
| | | declare function jsxOpeningElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName, attributes: Array<JSXAttribute | JSXSpreadAttribute>, selfClosing?: boolean): JSXOpeningElement; |
| | | declare function jsxOpeningElement(name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName, attributes: (JSXAttribute | JSXSpreadAttribute)[], selfClosing?: boolean): JSXOpeningElement; |
| | | |
| | | declare function jsxSpreadAttribute(argument: Expression): JSXSpreadAttribute; |
| | | |
| | | declare function jsxText(value: string): JSXText; |
| | | |
| | | declare function jsxFragment(openingFragment: JSXOpeningFragment, closingFragment: JSXClosingFragment, children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>): JSXFragment; |
| | | declare function jsxFragment(openingFragment: JSXOpeningFragment, closingFragment: JSXClosingFragment, children: (JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment)[]): JSXFragment; |
| | | |
| | | declare function jsxOpeningFragment(): JSXOpeningFragment; |
| | | |
| | |
| | | declare function decorator(expression: Expression): Decorator; |
| | | declare function doExpression(body: BlockStatement, async?: boolean): DoExpression; |
| | | declare function exportDefaultSpecifier(exported: Identifier): ExportDefaultSpecifier; |
| | | declare function recordExpression(properties: Array<ObjectProperty | SpreadElement>): RecordExpression; |
| | | declare function tupleExpression(elements?: Array<Expression | SpreadElement>): TupleExpression; |
| | | declare function recordExpression(properties: (ObjectProperty | SpreadElement)[]): RecordExpression; |
| | | declare function tupleExpression(elements?: (Expression | SpreadElement)[]): TupleExpression; |
| | | declare function decimalLiteral(value: string): DecimalLiteral; |
| | | declare function moduleExpression(body: Program): ModuleExpression; |
| | | declare function topicReference(): TopicReference; |
| | |
| | | declare function voidPattern(): VoidPattern; |
| | | declare function tsParameterProperty(parameter: Identifier | AssignmentPattern): TSParameterProperty; |
| | | |
| | | declare function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<FunctionParameter>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction; |
| | | declare function tsDeclareFunction(id: Identifier | null | undefined, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: FunctionParameter[], returnType?: TSTypeAnnotation | Noop | null): TSDeclareFunction; |
| | | |
| | | declare function tsDeclareMethod(decorators: Array<Decorator> | null | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: Array<FunctionParameter | TSParameterProperty>, returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod; |
| | | declare function tsDeclareMethod(decorators: Decorator[] | null | undefined, key: Identifier | StringLiteral | NumericLiteral | BigIntLiteral | Expression, typeParameters: TSTypeParameterDeclaration | Noop | null | undefined, params: (FunctionParameter | TSParameterProperty)[], returnType?: TSTypeAnnotation | Noop | null): TSDeclareMethod; |
| | | |
| | | declare function tsQualifiedName(left: TSEntityName, right: Identifier): TSQualifiedName; |
| | | |
| | | declare function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration; |
| | | declare function tsCallSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[], typeAnnotation?: TSTypeAnnotation | null): TSCallSignatureDeclaration; |
| | | |
| | | declare function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration; |
| | | declare function tsConstructSignatureDeclaration(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[], typeAnnotation?: TSTypeAnnotation | null): TSConstructSignatureDeclaration; |
| | | |
| | | declare function tsPropertySignature(key: Expression, typeAnnotation?: TSTypeAnnotation | null): TSPropertySignature; |
| | | |
| | | declare function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature; |
| | | declare function tsMethodSignature(key: Expression, typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[], typeAnnotation?: TSTypeAnnotation | null): TSMethodSignature; |
| | | |
| | | declare function tsIndexSignature(parameters: Array<Identifier>, typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature; |
| | | declare function tsIndexSignature(parameters: Identifier[], typeAnnotation?: TSTypeAnnotation | null): TSIndexSignature; |
| | | |
| | | declare function tsAnyKeyword(): TSAnyKeyword; |
| | | |
| | |
| | | |
| | | declare function tsThisType(): TSThisType; |
| | | |
| | | declare function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSFunctionType; |
| | | declare function tsFunctionType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[], typeAnnotation?: TSTypeAnnotation | null): TSFunctionType; |
| | | |
| | | declare function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: Array<ArrayPattern | Identifier | ObjectPattern | RestElement>, typeAnnotation?: TSTypeAnnotation | null): TSConstructorType; |
| | | declare function tsConstructorType(typeParameters: TSTypeParameterDeclaration | null | undefined, parameters: (ArrayPattern | Identifier | ObjectPattern | RestElement)[], typeAnnotation?: TSTypeAnnotation | null): TSConstructorType; |
| | | |
| | | declare function tsTypeReference(typeName: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSTypeReference; |
| | | |
| | |
| | | |
| | | declare function tsTypeQuery(exprName: TSEntityName | TSImportType, typeParameters?: TSTypeParameterInstantiation | null): TSTypeQuery; |
| | | |
| | | declare function tsTypeLiteral(members: Array<TSTypeElement>): TSTypeLiteral; |
| | | declare function tsTypeLiteral(members: TSTypeElement[]): TSTypeLiteral; |
| | | |
| | | declare function tsArrayType(elementType: TSType): TSArrayType; |
| | | |
| | | declare function tsTupleType(elementTypes: Array<TSType | TSNamedTupleMember>): TSTupleType; |
| | | declare function tsTupleType(elementTypes: (TSType | TSNamedTupleMember)[]): TSTupleType; |
| | | |
| | | declare function tsOptionalType(typeAnnotation: TSType): TSOptionalType; |
| | | |
| | |
| | | |
| | | declare function tsNamedTupleMember(label: Identifier, elementType: TSType, optional?: boolean): TSNamedTupleMember; |
| | | |
| | | declare function tsUnionType(types: Array<TSType>): TSUnionType; |
| | | declare function tsUnionType(types: TSType[]): TSUnionType; |
| | | |
| | | declare function tsIntersectionType(types: Array<TSType>): TSIntersectionType; |
| | | declare function tsIntersectionType(types: TSType[]): TSIntersectionType; |
| | | |
| | | declare function tsConditionalType(checkType: TSType, extendsType: TSType, trueType: TSType, falseType: TSType): TSConditionalType; |
| | | |
| | |
| | | |
| | | declare function tsMappedType(typeParameter: TSTypeParameter, typeAnnotation?: TSType | null, nameType?: TSType | null): TSMappedType; |
| | | |
| | | declare function tsTemplateLiteralType(quasis: Array<TemplateElement>, types: Array<TSType>): TSTemplateLiteralType; |
| | | declare function tsTemplateLiteralType(quasis: TemplateElement[], types: TSType[]): TSTemplateLiteralType; |
| | | |
| | | declare function tsLiteralType(literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | TemplateLiteral | UnaryExpression): TSLiteralType; |
| | | |
| | | declare function tsExpressionWithTypeArguments(expression: TSEntityName, typeParameters?: TSTypeParameterInstantiation | null): TSExpressionWithTypeArguments; |
| | | |
| | | declare function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: Array<TSExpressionWithTypeArguments> | null | undefined, body: TSInterfaceBody): TSInterfaceDeclaration; |
| | | declare function tsInterfaceDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, _extends: TSExpressionWithTypeArguments[] | null | undefined, body: TSInterfaceBody): TSInterfaceDeclaration; |
| | | |
| | | declare function tsInterfaceBody(body: Array<TSTypeElement>): TSInterfaceBody; |
| | | declare function tsInterfaceBody(body: TSTypeElement[]): TSInterfaceBody; |
| | | |
| | | declare function tsTypeAliasDeclaration(id: Identifier, typeParameters: TSTypeParameterDeclaration | null | undefined, typeAnnotation: TSType): TSTypeAliasDeclaration; |
| | | |
| | |
| | | |
| | | declare function tsTypeAssertion(typeAnnotation: TSType, expression: Expression): TSTypeAssertion; |
| | | |
| | | declare function tsEnumBody(members: Array<TSEnumMember>): TSEnumBody; |
| | | declare function tsEnumBody(members: TSEnumMember[]): TSEnumBody; |
| | | |
| | | declare function tsEnumDeclaration(id: Identifier, members: Array<TSEnumMember>): TSEnumDeclaration; |
| | | declare function tsEnumDeclaration(id: Identifier, members: TSEnumMember[]): TSEnumDeclaration; |
| | | |
| | | declare function tsEnumMember(id: Identifier | StringLiteral, initializer?: Expression | null): TSEnumMember; |
| | | |
| | | declare function tsModuleDeclaration(id: Identifier | StringLiteral, body: TSModuleBlock | TSModuleDeclaration): TSModuleDeclaration; |
| | | |
| | | declare function tsModuleBlock(body: Array<Statement>): TSModuleBlock; |
| | | declare function tsModuleBlock(body: Statement[]): TSModuleBlock; |
| | | |
| | | declare function tsImportType(argument: StringLiteral, qualifier?: TSEntityName | null, typeParameters?: TSTypeParameterInstantiation | null): TSImportType; |
| | | |
| | |
| | | |
| | | declare function tsTypeAnnotation(typeAnnotation: TSType): TSTypeAnnotation; |
| | | |
| | | declare function tsTypeParameterInstantiation(params: Array<TSType>): TSTypeParameterInstantiation; |
| | | declare function tsTypeParameterInstantiation(params: TSType[]): TSTypeParameterInstantiation; |
| | | |
| | | declare function tsTypeParameterDeclaration(params: Array<TSTypeParameter>): TSTypeParameterDeclaration; |
| | | declare function tsTypeParameterDeclaration(params: TSTypeParameter[]): TSTypeParameterDeclaration; |
| | | |
| | | declare function tsTypeParameter(constraint: TSType | null | undefined, _default: TSType | null | undefined, name: string): TSTypeParameter; |
| | | |
| | |
| | | /** |
| | | * Add comments of certain type to a node. |
| | | */ |
| | | declare function addComments<T extends Node>(node: T, type: CommentTypeShorthand, comments: Array<Comment>): T; |
| | | declare function addComments<T extends Node>(node: T, type: CommentTypeShorthand, comments: Comment[]): T; |
| | | |
| | | declare function inheritInnerComments(child: Node, parent: Node): void; |
| | | |
| | |
| | | (value: number): NumericLiteral | BinaryExpression | UnaryExpression; |
| | | (value: bigint): BigIntLiteral; |
| | | (value: RegExp): RegExpLiteral; |
| | | (value: ReadonlyArray<unknown>): ArrayExpression; |
| | | (value: readonly unknown[]): ArrayExpression; |
| | | (value: object): ObjectExpression; |
| | | (value: unknown): Expression; |
| | | }; |
| | |
| | | type NodeTypesWithoutComment = Node["type"] | keyof Aliases; |
| | | type NodeTypes = NodeTypesWithoutComment | Comment["type"]; |
| | | type PrimitiveTypes = ReturnType<typeof getType>; |
| | | type FieldDefinitions = { |
| | | [x: string]: FieldOptions; |
| | | }; |
| | | type FieldDefinitions = Record<string, FieldOptions>; |
| | | type ValidatorImpl = (node?: Node, key?: string | { |
| | | toString(): string; |
| | | }, val?: any) => void; |
| | |
| | | oneOfNodeOrValueTypes: readonly (NodeTypes | PrimitiveTypes)[]; |
| | | } & ValidatorImpl; |
| | | type ValidatorShapeOf = { |
| | | shapeOf: { |
| | | [x: string]: FieldOptions; |
| | | }; |
| | | shapeOf: Record<string, FieldOptions>; |
| | | } & ValidatorImpl; |
| | | type Validator = ValidatorType | ValidatorEach | ValidatorChainOf | ValidatorOneOf | ValidatorOneOfNodeTypes | ValidatorOneOfNodeOrValueTypes | ValidatorShapeOf | ValidatorImpl; |
| | | type FieldOptions = { |
| | |
| | | ModuleDeclaration: string; |
| | | }; |
| | | |
| | | declare const TYPES: Array<string>; |
| | | declare const TYPES: string[]; |
| | | //# sourceMappingURL=index.d.ts.map |
| | | |
| | | /** |
| | |
| | | /** |
| | | * Dedupe type annotations. |
| | | */ |
| | | declare function removeTypeDuplicates(nodesIn: ReadonlyArray<FlowType | false | null | undefined>): FlowType[]; |
| | | declare function removeTypeDuplicates(nodesIn: readonly (FlowType | false | null | undefined)[]): FlowType[]; |
| | | |
| | | /** |
| | | * For the given node, generate a map from assignment id names to the identifier node. |
| | |
| | | */ |
| | | declare function getAssignmentIdentifiers(node: Node | Node[]): Record<string, Identifier>; |
| | | |
| | | declare function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean, newBindingsOnly?: boolean): Record<string, Array<Identifier>>; |
| | | declare function getBindingIdentifiers(node: Node, duplicates: true, outerOnly?: boolean, newBindingsOnly?: boolean): Record<string, Identifier[]>; |
| | | declare function getBindingIdentifiers(node: Node, duplicates?: false, outerOnly?: boolean, newBindingsOnly?: boolean): Record<string, Identifier>; |
| | | declare function getBindingIdentifiers(node: Node, duplicates?: boolean, outerOnly?: boolean, newBindingsOnly?: boolean): Record<string, Identifier> | Record<string, Array<Identifier>>; |
| | | declare function getBindingIdentifiers(node: Node, duplicates?: boolean, outerOnly?: boolean, newBindingsOnly?: boolean): Record<string, Identifier> | Record<string, Identifier[]>; |
| | | declare namespace getBindingIdentifiers { |
| | | var keys: KeysMap; |
| | | } |
| | |
| | | //# sourceMappingURL=getBindingIdentifiers.d.ts.map |
| | | |
| | | declare const _default: { |
| | | (node: Node, duplicates: true): Record<string, Array<Identifier>>; |
| | | (node: Node, duplicates: true): Record<string, Identifier[]>; |
| | | (node: Node, duplicates?: false): Record<string, Identifier>; |
| | | (node: Node, duplicates?: boolean): Record<string, Identifier> | Record<string, Array<Identifier>>; |
| | | (node: Node, duplicates?: boolean): Record<string, Identifier> | Record<string, Identifier[]>; |
| | | }; |
| | | //# sourceMappingURL=getOuterBindingIdentifiers.d.ts.map |
| | | |
| | |
| | | declare function getFunctionName(node: ObjectMethod | ClassMethod): GetFunctionNameResult; |
| | | declare function getFunctionName(node: Function | Class, parent: Node): GetFunctionNameResult; |
| | | |
| | | type TraversalAncestors = Array<{ |
| | | type TraversalAncestors = { |
| | | node: Node; |
| | | key: string; |
| | | index?: number; |
| | | }>; |
| | | }[]; |
| | | type TraversalHandler<T> = (this: undefined, node: Node, parent: TraversalAncestors, state: T) => void; |
| | | type TraversalHandlers<T> = { |
| | | enter?: TraversalHandler<T>; |