Mark optional AST fields in generated type definitions (#12511)
This commit is contained in:
parent
90fb8d275e
commit
0ea065014b
@ -77,11 +77,12 @@ export type Node = ${t.TYPES.sort().join(" | ")};\n\n`;
|
|||||||
}
|
}
|
||||||
|
|
||||||
const alphaNumeric = /^\w+$/;
|
const alphaNumeric = /^\w+$/;
|
||||||
|
const optional = field.optional ? "?" : "";
|
||||||
|
|
||||||
if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) {
|
if (t.isValidIdentifier(fieldName) || alphaNumeric.test(fieldName)) {
|
||||||
struct.push(`${fieldName}: ${typeAnnotation};`);
|
struct.push(`${fieldName}${optional}: ${typeAnnotation};`);
|
||||||
} else {
|
} else {
|
||||||
struct.push(`"${fieldName}": ${typeAnnotation};`);
|
struct.push(`"${fieldName}"${optional}: ${typeAnnotation};`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -401,7 +401,7 @@ export interface BlockStatement extends BaseNode {
|
|||||||
|
|
||||||
export interface BreakStatement extends BaseNode {
|
export interface BreakStatement extends BaseNode {
|
||||||
type: "BreakStatement";
|
type: "BreakStatement";
|
||||||
label: Identifier | null;
|
label?: Identifier | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CallExpression extends BaseNode {
|
export interface CallExpression extends BaseNode {
|
||||||
@ -410,14 +410,14 @@ export interface CallExpression extends BaseNode {
|
|||||||
arguments: Array<
|
arguments: Array<
|
||||||
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
||||||
>;
|
>;
|
||||||
optional: true | false | null;
|
optional?: true | false | null;
|
||||||
typeArguments: TypeParameterInstantiation | null;
|
typeArguments?: TypeParameterInstantiation | null;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CatchClause extends BaseNode {
|
export interface CatchClause extends BaseNode {
|
||||||
type: "CatchClause";
|
type: "CatchClause";
|
||||||
param: Identifier | ArrayPattern | ObjectPattern | null;
|
param?: Identifier | ArrayPattern | ObjectPattern | null;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,7 +430,7 @@ export interface ConditionalExpression extends BaseNode {
|
|||||||
|
|
||||||
export interface ContinueStatement extends BaseNode {
|
export interface ContinueStatement extends BaseNode {
|
||||||
type: "ContinueStatement";
|
type: "ContinueStatement";
|
||||||
label: Identifier | null;
|
label?: Identifier | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DebuggerStatement extends BaseNode {
|
export interface DebuggerStatement extends BaseNode {
|
||||||
@ -455,8 +455,8 @@ export interface ExpressionStatement extends BaseNode {
|
|||||||
export interface File extends BaseNode {
|
export interface File extends BaseNode {
|
||||||
type: "File";
|
type: "File";
|
||||||
program: Program;
|
program: Program;
|
||||||
comments: Array<CommentBlock | CommentLine> | null;
|
comments?: Array<CommentBlock | CommentLine> | null;
|
||||||
tokens: Array<any> | null;
|
tokens?: Array<any> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ForInStatement extends BaseNode {
|
export interface ForInStatement extends BaseNode {
|
||||||
@ -468,22 +468,22 @@ export interface ForInStatement extends BaseNode {
|
|||||||
|
|
||||||
export interface ForStatement extends BaseNode {
|
export interface ForStatement extends BaseNode {
|
||||||
type: "ForStatement";
|
type: "ForStatement";
|
||||||
init: VariableDeclaration | Expression | null;
|
init?: VariableDeclaration | Expression | null;
|
||||||
test: Expression | null;
|
test?: Expression | null;
|
||||||
update: Expression | null;
|
update?: Expression | null;
|
||||||
body: Statement;
|
body: Statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FunctionDeclaration extends BaseNode {
|
export interface FunctionDeclaration extends BaseNode {
|
||||||
type: "FunctionDeclaration";
|
type: "FunctionDeclaration";
|
||||||
id: Identifier | null;
|
id?: Identifier | null;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -492,13 +492,13 @@ export interface FunctionDeclaration extends BaseNode {
|
|||||||
|
|
||||||
export interface FunctionExpression extends BaseNode {
|
export interface FunctionExpression extends BaseNode {
|
||||||
type: "FunctionExpression";
|
type: "FunctionExpression";
|
||||||
id: Identifier | null;
|
id?: Identifier | null;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -508,16 +508,16 @@ export interface FunctionExpression extends BaseNode {
|
|||||||
export interface Identifier extends BaseNode {
|
export interface Identifier extends BaseNode {
|
||||||
type: "Identifier";
|
type: "Identifier";
|
||||||
name: string;
|
name: string;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IfStatement extends BaseNode {
|
export interface IfStatement extends BaseNode {
|
||||||
type: "IfStatement";
|
type: "IfStatement";
|
||||||
test: Expression;
|
test: Expression;
|
||||||
consequent: Statement;
|
consequent: Statement;
|
||||||
alternate: Statement | null;
|
alternate?: Statement | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface LabeledStatement extends BaseNode {
|
export interface LabeledStatement extends BaseNode {
|
||||||
@ -580,7 +580,7 @@ export interface MemberExpression extends BaseNode {
|
|||||||
object: Expression;
|
object: Expression;
|
||||||
property: Expression | Identifier | PrivateName;
|
property: Expression | Identifier | PrivateName;
|
||||||
computed: boolean;
|
computed: boolean;
|
||||||
optional: true | false | null;
|
optional?: true | false | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NewExpression extends BaseNode {
|
export interface NewExpression extends BaseNode {
|
||||||
@ -589,9 +589,9 @@ export interface NewExpression extends BaseNode {
|
|||||||
arguments: Array<
|
arguments: Array<
|
||||||
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
||||||
>;
|
>;
|
||||||
optional: true | false | null;
|
optional?: true | false | null;
|
||||||
typeArguments: TypeParameterInstantiation | null;
|
typeArguments?: TypeParameterInstantiation | null;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Program extends BaseNode {
|
export interface Program extends BaseNode {
|
||||||
@ -599,7 +599,7 @@ export interface Program extends BaseNode {
|
|||||||
body: Array<Statement>;
|
body: Array<Statement>;
|
||||||
directives: Array<Directive>;
|
directives: Array<Directive>;
|
||||||
sourceType: "script" | "module";
|
sourceType: "script" | "module";
|
||||||
interpreter: InterpreterDirective | null;
|
interpreter?: InterpreterDirective | null;
|
||||||
sourceFile: string;
|
sourceFile: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -615,11 +615,11 @@ export interface ObjectMethod extends BaseNode {
|
|||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
computed: boolean;
|
computed: boolean;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -632,14 +632,14 @@ export interface ObjectProperty extends BaseNode {
|
|||||||
value: Expression | PatternLike;
|
value: Expression | PatternLike;
|
||||||
computed: boolean;
|
computed: boolean;
|
||||||
shorthand: boolean;
|
shorthand: boolean;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RestElement extends BaseNode {
|
export interface RestElement extends BaseNode {
|
||||||
type: "RestElement";
|
type: "RestElement";
|
||||||
argument: LVal;
|
argument: LVal;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -648,13 +648,13 @@ export interface RestElement extends BaseNode {
|
|||||||
export interface RestProperty extends BaseNode {
|
export interface RestProperty extends BaseNode {
|
||||||
type: "RestProperty";
|
type: "RestProperty";
|
||||||
argument: LVal;
|
argument: LVal;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ReturnStatement extends BaseNode {
|
export interface ReturnStatement extends BaseNode {
|
||||||
type: "ReturnStatement";
|
type: "ReturnStatement";
|
||||||
argument: Expression | null;
|
argument?: Expression | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SequenceExpression extends BaseNode {
|
export interface SequenceExpression extends BaseNode {
|
||||||
@ -669,7 +669,7 @@ export interface ParenthesizedExpression extends BaseNode {
|
|||||||
|
|
||||||
export interface SwitchCase extends BaseNode {
|
export interface SwitchCase extends BaseNode {
|
||||||
type: "SwitchCase";
|
type: "SwitchCase";
|
||||||
test: Expression | null;
|
test?: Expression | null;
|
||||||
consequent: Array<Statement>;
|
consequent: Array<Statement>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -691,8 +691,8 @@ export interface ThrowStatement extends BaseNode {
|
|||||||
export interface TryStatement extends BaseNode {
|
export interface TryStatement extends BaseNode {
|
||||||
type: "TryStatement";
|
type: "TryStatement";
|
||||||
block: BlockStatement;
|
block: BlockStatement;
|
||||||
handler: CatchClause | null;
|
handler?: CatchClause | null;
|
||||||
finalizer: BlockStatement | null;
|
finalizer?: BlockStatement | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface UnaryExpression extends BaseNode {
|
export interface UnaryExpression extends BaseNode {
|
||||||
@ -713,14 +713,14 @@ export interface VariableDeclaration extends BaseNode {
|
|||||||
type: "VariableDeclaration";
|
type: "VariableDeclaration";
|
||||||
kind: "var" | "let" | "const";
|
kind: "var" | "let" | "const";
|
||||||
declarations: Array<VariableDeclarator>;
|
declarations: Array<VariableDeclarator>;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface VariableDeclarator extends BaseNode {
|
export interface VariableDeclarator extends BaseNode {
|
||||||
type: "VariableDeclarator";
|
type: "VariableDeclarator";
|
||||||
id: LVal;
|
id: LVal;
|
||||||
init: Expression | null;
|
init?: Expression | null;
|
||||||
definite: boolean | null;
|
definite?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface WhileStatement extends BaseNode {
|
export interface WhileStatement extends BaseNode {
|
||||||
@ -739,26 +739,26 @@ export interface AssignmentPattern extends BaseNode {
|
|||||||
type: "AssignmentPattern";
|
type: "AssignmentPattern";
|
||||||
left: Identifier | ObjectPattern | ArrayPattern | MemberExpression;
|
left: Identifier | ObjectPattern | ArrayPattern | MemberExpression;
|
||||||
right: Expression;
|
right: Expression;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ArrayPattern extends BaseNode {
|
export interface ArrayPattern extends BaseNode {
|
||||||
type: "ArrayPattern";
|
type: "ArrayPattern";
|
||||||
elements: Array<null | PatternLike>;
|
elements: Array<null | PatternLike>;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ArrowFunctionExpression extends BaseNode {
|
export interface ArrowFunctionExpression extends BaseNode {
|
||||||
type: "ArrowFunctionExpression";
|
type: "ArrowFunctionExpression";
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement | Expression;
|
body: BlockStatement | Expression;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
expression: boolean;
|
expression: boolean;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -779,17 +779,17 @@ export interface ClassBody extends BaseNode {
|
|||||||
|
|
||||||
export interface ClassExpression extends BaseNode {
|
export interface ClassExpression extends BaseNode {
|
||||||
type: "ClassExpression";
|
type: "ClassExpression";
|
||||||
id: Identifier | null;
|
id?: Identifier | null;
|
||||||
superClass: Expression | null;
|
superClass?: Expression | null;
|
||||||
body: ClassBody;
|
body: ClassBody;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
implements: Array<TSExpressionWithTypeArguments | ClassImplements> | null;
|
implements?: Array<TSExpressionWithTypeArguments | ClassImplements> | null;
|
||||||
mixins: InterfaceExtends | null;
|
mixins?: InterfaceExtends | null;
|
||||||
superTypeParameters:
|
superTypeParameters?:
|
||||||
| TypeParameterInstantiation
|
| TypeParameterInstantiation
|
||||||
| TSTypeParameterInstantiation
|
| TSTypeParameterInstantiation
|
||||||
| null;
|
| null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -799,18 +799,18 @@ export interface ClassExpression extends BaseNode {
|
|||||||
export interface ClassDeclaration extends BaseNode {
|
export interface ClassDeclaration extends BaseNode {
|
||||||
type: "ClassDeclaration";
|
type: "ClassDeclaration";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
superClass: Expression | null;
|
superClass?: Expression | null;
|
||||||
body: ClassBody;
|
body: ClassBody;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
abstract: boolean | null;
|
abstract?: boolean | null;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
implements: Array<TSExpressionWithTypeArguments | ClassImplements> | null;
|
implements?: Array<TSExpressionWithTypeArguments | ClassImplements> | null;
|
||||||
mixins: InterfaceExtends | null;
|
mixins?: InterfaceExtends | null;
|
||||||
superTypeParameters:
|
superTypeParameters?:
|
||||||
| TypeParameterInstantiation
|
| TypeParameterInstantiation
|
||||||
| TSTypeParameterInstantiation
|
| TSTypeParameterInstantiation
|
||||||
| null;
|
| null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -820,7 +820,7 @@ export interface ClassDeclaration extends BaseNode {
|
|||||||
export interface ExportAllDeclaration extends BaseNode {
|
export interface ExportAllDeclaration extends BaseNode {
|
||||||
type: "ExportAllDeclaration";
|
type: "ExportAllDeclaration";
|
||||||
source: StringLiteral;
|
source: StringLiteral;
|
||||||
assertions: ImportAttribute | null;
|
assertions?: ImportAttribute | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExportDefaultDeclaration extends BaseNode {
|
export interface ExportDefaultDeclaration extends BaseNode {
|
||||||
@ -834,13 +834,13 @@ export interface ExportDefaultDeclaration extends BaseNode {
|
|||||||
|
|
||||||
export interface ExportNamedDeclaration extends BaseNode {
|
export interface ExportNamedDeclaration extends BaseNode {
|
||||||
type: "ExportNamedDeclaration";
|
type: "ExportNamedDeclaration";
|
||||||
declaration: Declaration | null;
|
declaration?: Declaration | null;
|
||||||
specifiers: Array<
|
specifiers: Array<
|
||||||
ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier
|
ExportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier
|
||||||
>;
|
>;
|
||||||
source: StringLiteral | null;
|
source?: StringLiteral | null;
|
||||||
assertions: ImportAttribute | null;
|
assertions?: ImportAttribute | null;
|
||||||
exportKind: "type" | "value" | null;
|
exportKind?: "type" | "value" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ExportSpecifier extends BaseNode {
|
export interface ExportSpecifier extends BaseNode {
|
||||||
@ -863,8 +863,8 @@ export interface ImportDeclaration extends BaseNode {
|
|||||||
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier
|
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier
|
||||||
>;
|
>;
|
||||||
source: StringLiteral;
|
source: StringLiteral;
|
||||||
assertions: ImportAttribute | null;
|
assertions?: ImportAttribute | null;
|
||||||
importKind: "type" | "typeof" | "value" | null;
|
importKind?: "type" | "typeof" | "value" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ImportDefaultSpecifier extends BaseNode {
|
export interface ImportDefaultSpecifier extends BaseNode {
|
||||||
@ -881,7 +881,7 @@ export interface ImportSpecifier extends BaseNode {
|
|||||||
type: "ImportSpecifier";
|
type: "ImportSpecifier";
|
||||||
local: Identifier;
|
local: Identifier;
|
||||||
imported: Identifier | StringLiteral;
|
imported: Identifier | StringLiteral;
|
||||||
importKind: "type" | "typeof" | null;
|
importKind?: "type" | "typeof" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MetaProperty extends BaseNode {
|
export interface MetaProperty extends BaseNode {
|
||||||
@ -892,21 +892,21 @@ export interface MetaProperty extends BaseNode {
|
|||||||
|
|
||||||
export interface ClassMethod extends BaseNode {
|
export interface ClassMethod extends BaseNode {
|
||||||
type: "ClassMethod";
|
type: "ClassMethod";
|
||||||
kind: "get" | "set" | "method" | "constructor";
|
kind?: "get" | "set" | "method" | "constructor";
|
||||||
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
computed: boolean;
|
computed?: boolean;
|
||||||
static: boolean;
|
static?: boolean;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
abstract: boolean | null;
|
abstract?: boolean | null;
|
||||||
access: "public" | "private" | "protected" | null;
|
access?: "public" | "private" | "protected" | null;
|
||||||
accessibility: "public" | "private" | "protected" | null;
|
accessibility?: "public" | "private" | "protected" | null;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -916,8 +916,8 @@ export interface ClassMethod extends BaseNode {
|
|||||||
export interface ObjectPattern extends BaseNode {
|
export interface ObjectPattern extends BaseNode {
|
||||||
type: "ObjectPattern";
|
type: "ObjectPattern";
|
||||||
properties: Array<RestElement | ObjectProperty>;
|
properties: Array<RestElement | ObjectProperty>;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SpreadElement extends BaseNode {
|
export interface SpreadElement extends BaseNode {
|
||||||
@ -941,7 +941,7 @@ export interface TaggedTemplateExpression extends BaseNode {
|
|||||||
type: "TaggedTemplateExpression";
|
type: "TaggedTemplateExpression";
|
||||||
tag: Expression;
|
tag: Expression;
|
||||||
quasi: TemplateLiteral;
|
quasi: TemplateLiteral;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterInstantiation
|
| TypeParameterInstantiation
|
||||||
| TSTypeParameterInstantiation
|
| TSTypeParameterInstantiation
|
||||||
| null;
|
| null;
|
||||||
@ -961,7 +961,7 @@ export interface TemplateLiteral extends BaseNode {
|
|||||||
|
|
||||||
export interface YieldExpression extends BaseNode {
|
export interface YieldExpression extends BaseNode {
|
||||||
type: "YieldExpression";
|
type: "YieldExpression";
|
||||||
argument: Expression | null;
|
argument?: Expression | null;
|
||||||
delegate: boolean;
|
delegate: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -999,8 +999,8 @@ export interface OptionalCallExpression extends BaseNode {
|
|||||||
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
Expression | SpreadElement | JSXNamespacedName | ArgumentPlaceholder
|
||||||
>;
|
>;
|
||||||
optional: boolean;
|
optional: boolean;
|
||||||
typeArguments: TypeParameterInstantiation | null;
|
typeArguments?: TypeParameterInstantiation | null;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AnyTypeAnnotation extends BaseNode {
|
export interface AnyTypeAnnotation extends BaseNode {
|
||||||
@ -1028,40 +1028,40 @@ export interface NullLiteralTypeAnnotation extends BaseNode {
|
|||||||
export interface ClassImplements extends BaseNode {
|
export interface ClassImplements extends BaseNode {
|
||||||
type: "ClassImplements";
|
type: "ClassImplements";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterInstantiation | null;
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareClass extends BaseNode {
|
export interface DeclareClass extends BaseNode {
|
||||||
type: "DeclareClass";
|
type: "DeclareClass";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
extends: Array<InterfaceExtends> | null;
|
extends?: Array<InterfaceExtends> | null;
|
||||||
body: ObjectTypeAnnotation;
|
body: ObjectTypeAnnotation;
|
||||||
implements: Array<ClassImplements> | null;
|
implements?: Array<ClassImplements> | null;
|
||||||
mixins: Array<InterfaceExtends> | null;
|
mixins?: Array<InterfaceExtends> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareFunction extends BaseNode {
|
export interface DeclareFunction extends BaseNode {
|
||||||
type: "DeclareFunction";
|
type: "DeclareFunction";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
predicate: DeclaredPredicate | null;
|
predicate?: DeclaredPredicate | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareInterface extends BaseNode {
|
export interface DeclareInterface extends BaseNode {
|
||||||
type: "DeclareInterface";
|
type: "DeclareInterface";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
extends: Array<InterfaceExtends> | null;
|
extends?: Array<InterfaceExtends> | null;
|
||||||
body: ObjectTypeAnnotation;
|
body: ObjectTypeAnnotation;
|
||||||
implements: Array<ClassImplements> | null;
|
implements?: Array<ClassImplements> | null;
|
||||||
mixins: Array<InterfaceExtends> | null;
|
mixins?: Array<InterfaceExtends> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareModule extends BaseNode {
|
export interface DeclareModule extends BaseNode {
|
||||||
type: "DeclareModule";
|
type: "DeclareModule";
|
||||||
id: Identifier | StringLiteral;
|
id: Identifier | StringLiteral;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
kind: "CommonJS" | "ES" | null;
|
kind?: "CommonJS" | "ES" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareModuleExports extends BaseNode {
|
export interface DeclareModuleExports extends BaseNode {
|
||||||
@ -1072,15 +1072,15 @@ export interface DeclareModuleExports extends BaseNode {
|
|||||||
export interface DeclareTypeAlias extends BaseNode {
|
export interface DeclareTypeAlias extends BaseNode {
|
||||||
type: "DeclareTypeAlias";
|
type: "DeclareTypeAlias";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
right: FlowType;
|
right: FlowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareOpaqueType extends BaseNode {
|
export interface DeclareOpaqueType extends BaseNode {
|
||||||
type: "DeclareOpaqueType";
|
type: "DeclareOpaqueType";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
supertype: FlowType | null;
|
supertype?: FlowType | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareVariable extends BaseNode {
|
export interface DeclareVariable extends BaseNode {
|
||||||
@ -1090,16 +1090,16 @@ export interface DeclareVariable extends BaseNode {
|
|||||||
|
|
||||||
export interface DeclareExportDeclaration extends BaseNode {
|
export interface DeclareExportDeclaration extends BaseNode {
|
||||||
type: "DeclareExportDeclaration";
|
type: "DeclareExportDeclaration";
|
||||||
declaration: Flow | null;
|
declaration?: Flow | null;
|
||||||
specifiers: Array<ExportSpecifier | ExportNamespaceSpecifier> | null;
|
specifiers?: Array<ExportSpecifier | ExportNamespaceSpecifier> | null;
|
||||||
source: StringLiteral | null;
|
source?: StringLiteral | null;
|
||||||
default: boolean | null;
|
default?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclareExportAllDeclaration extends BaseNode {
|
export interface DeclareExportAllDeclaration extends BaseNode {
|
||||||
type: "DeclareExportAllDeclaration";
|
type: "DeclareExportAllDeclaration";
|
||||||
source: StringLiteral;
|
source: StringLiteral;
|
||||||
exportKind: "type" | "value" | null;
|
exportKind?: "type" | "value" | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeclaredPredicate extends BaseNode {
|
export interface DeclaredPredicate extends BaseNode {
|
||||||
@ -1113,23 +1113,23 @@ export interface ExistsTypeAnnotation extends BaseNode {
|
|||||||
|
|
||||||
export interface FunctionTypeAnnotation extends BaseNode {
|
export interface FunctionTypeAnnotation extends BaseNode {
|
||||||
type: "FunctionTypeAnnotation";
|
type: "FunctionTypeAnnotation";
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
params: Array<FunctionTypeParam>;
|
params: Array<FunctionTypeParam>;
|
||||||
rest: FunctionTypeParam | null;
|
rest?: FunctionTypeParam | null;
|
||||||
returnType: FlowType;
|
returnType: FlowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FunctionTypeParam extends BaseNode {
|
export interface FunctionTypeParam extends BaseNode {
|
||||||
type: "FunctionTypeParam";
|
type: "FunctionTypeParam";
|
||||||
name: Identifier | null;
|
name?: Identifier | null;
|
||||||
typeAnnotation: FlowType;
|
typeAnnotation: FlowType;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GenericTypeAnnotation extends BaseNode {
|
export interface GenericTypeAnnotation extends BaseNode {
|
||||||
type: "GenericTypeAnnotation";
|
type: "GenericTypeAnnotation";
|
||||||
id: Identifier | QualifiedTypeIdentifier;
|
id: Identifier | QualifiedTypeIdentifier;
|
||||||
typeParameters: TypeParameterInstantiation | null;
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InferredPredicate extends BaseNode {
|
export interface InferredPredicate extends BaseNode {
|
||||||
@ -1139,22 +1139,22 @@ export interface InferredPredicate extends BaseNode {
|
|||||||
export interface InterfaceExtends extends BaseNode {
|
export interface InterfaceExtends extends BaseNode {
|
||||||
type: "InterfaceExtends";
|
type: "InterfaceExtends";
|
||||||
id: Identifier | QualifiedTypeIdentifier;
|
id: Identifier | QualifiedTypeIdentifier;
|
||||||
typeParameters: TypeParameterInstantiation | null;
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InterfaceDeclaration extends BaseNode {
|
export interface InterfaceDeclaration extends BaseNode {
|
||||||
type: "InterfaceDeclaration";
|
type: "InterfaceDeclaration";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
extends: Array<InterfaceExtends> | null;
|
extends?: Array<InterfaceExtends> | null;
|
||||||
body: ObjectTypeAnnotation;
|
body: ObjectTypeAnnotation;
|
||||||
implements: Array<ClassImplements> | null;
|
implements?: Array<ClassImplements> | null;
|
||||||
mixins: Array<InterfaceExtends> | null;
|
mixins?: Array<InterfaceExtends> | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InterfaceTypeAnnotation extends BaseNode {
|
export interface InterfaceTypeAnnotation extends BaseNode {
|
||||||
type: "InterfaceTypeAnnotation";
|
type: "InterfaceTypeAnnotation";
|
||||||
extends: Array<InterfaceExtends> | null;
|
extends?: Array<InterfaceExtends> | null;
|
||||||
body: ObjectTypeAnnotation;
|
body: ObjectTypeAnnotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1188,11 +1188,11 @@ export interface NumberTypeAnnotation extends BaseNode {
|
|||||||
export interface ObjectTypeAnnotation extends BaseNode {
|
export interface ObjectTypeAnnotation extends BaseNode {
|
||||||
type: "ObjectTypeAnnotation";
|
type: "ObjectTypeAnnotation";
|
||||||
properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty>;
|
properties: Array<ObjectTypeProperty | ObjectTypeSpreadProperty>;
|
||||||
indexers: Array<ObjectTypeIndexer> | null;
|
indexers?: Array<ObjectTypeIndexer> | null;
|
||||||
callProperties: Array<ObjectTypeCallProperty> | null;
|
callProperties?: Array<ObjectTypeCallProperty> | null;
|
||||||
internalSlots: Array<ObjectTypeInternalSlot> | null;
|
internalSlots?: Array<ObjectTypeInternalSlot> | null;
|
||||||
exact: boolean;
|
exact: boolean;
|
||||||
inexact: boolean | null;
|
inexact?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ObjectTypeInternalSlot extends BaseNode {
|
export interface ObjectTypeInternalSlot extends BaseNode {
|
||||||
@ -1212,10 +1212,10 @@ export interface ObjectTypeCallProperty extends BaseNode {
|
|||||||
|
|
||||||
export interface ObjectTypeIndexer extends BaseNode {
|
export interface ObjectTypeIndexer extends BaseNode {
|
||||||
type: "ObjectTypeIndexer";
|
type: "ObjectTypeIndexer";
|
||||||
id: Identifier | null;
|
id?: Identifier | null;
|
||||||
key: FlowType;
|
key: FlowType;
|
||||||
value: FlowType;
|
value: FlowType;
|
||||||
variance: Variance | null;
|
variance?: Variance | null;
|
||||||
static: boolean;
|
static: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1223,7 +1223,7 @@ export interface ObjectTypeProperty extends BaseNode {
|
|||||||
type: "ObjectTypeProperty";
|
type: "ObjectTypeProperty";
|
||||||
key: Identifier | StringLiteral;
|
key: Identifier | StringLiteral;
|
||||||
value: FlowType;
|
value: FlowType;
|
||||||
variance: Variance | null;
|
variance?: Variance | null;
|
||||||
kind: "init" | "get" | "set";
|
kind: "init" | "get" | "set";
|
||||||
optional: boolean;
|
optional: boolean;
|
||||||
proto: boolean;
|
proto: boolean;
|
||||||
@ -1238,8 +1238,8 @@ export interface ObjectTypeSpreadProperty extends BaseNode {
|
|||||||
export interface OpaqueType extends BaseNode {
|
export interface OpaqueType extends BaseNode {
|
||||||
type: "OpaqueType";
|
type: "OpaqueType";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
supertype: FlowType | null;
|
supertype?: FlowType | null;
|
||||||
impltype: FlowType;
|
impltype: FlowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1279,7 +1279,7 @@ export interface TypeofTypeAnnotation extends BaseNode {
|
|||||||
export interface TypeAlias extends BaseNode {
|
export interface TypeAlias extends BaseNode {
|
||||||
type: "TypeAlias";
|
type: "TypeAlias";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TypeParameterDeclaration | null;
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
right: FlowType;
|
right: FlowType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1296,9 +1296,9 @@ export interface TypeCastExpression extends BaseNode {
|
|||||||
|
|
||||||
export interface TypeParameter extends BaseNode {
|
export interface TypeParameter extends BaseNode {
|
||||||
type: "TypeParameter";
|
type: "TypeParameter";
|
||||||
bound: TypeAnnotation | null;
|
bound?: TypeAnnotation | null;
|
||||||
default: FlowType | null;
|
default?: FlowType | null;
|
||||||
variance: Variance | null;
|
variance?: Variance | null;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1381,7 +1381,7 @@ export interface EnumDefaultedMember extends BaseNode {
|
|||||||
export interface JSXAttribute extends BaseNode {
|
export interface JSXAttribute extends BaseNode {
|
||||||
type: "JSXAttribute";
|
type: "JSXAttribute";
|
||||||
name: JSXIdentifier | JSXNamespacedName;
|
name: JSXIdentifier | JSXNamespacedName;
|
||||||
value:
|
value?:
|
||||||
| JSXElement
|
| JSXElement
|
||||||
| JSXFragment
|
| JSXFragment
|
||||||
| StringLiteral
|
| StringLiteral
|
||||||
@ -1397,11 +1397,11 @@ export interface JSXClosingElement extends BaseNode {
|
|||||||
export interface JSXElement extends BaseNode {
|
export interface JSXElement extends BaseNode {
|
||||||
type: "JSXElement";
|
type: "JSXElement";
|
||||||
openingElement: JSXOpeningElement;
|
openingElement: JSXOpeningElement;
|
||||||
closingElement: JSXClosingElement | null;
|
closingElement?: JSXClosingElement | null;
|
||||||
children: Array<
|
children: Array<
|
||||||
JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment
|
JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment
|
||||||
>;
|
>;
|
||||||
selfClosing: boolean | null;
|
selfClosing?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface JSXEmptyExpression extends BaseNode {
|
export interface JSXEmptyExpression extends BaseNode {
|
||||||
@ -1440,7 +1440,7 @@ export interface JSXOpeningElement extends BaseNode {
|
|||||||
name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
|
||||||
attributes: Array<JSXAttribute | JSXSpreadAttribute>;
|
attributes: Array<JSXAttribute | JSXSpreadAttribute>;
|
||||||
selfClosing: boolean;
|
selfClosing: boolean;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterInstantiation
|
| TypeParameterInstantiation
|
||||||
| TSTypeParameterInstantiation
|
| TSTypeParameterInstantiation
|
||||||
| null;
|
| null;
|
||||||
@ -1509,17 +1509,17 @@ export interface BindExpression extends BaseNode {
|
|||||||
export interface ClassProperty extends BaseNode {
|
export interface ClassProperty extends BaseNode {
|
||||||
type: "ClassProperty";
|
type: "ClassProperty";
|
||||||
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
||||||
value: Expression | null;
|
value?: Expression | null;
|
||||||
typeAnnotation: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
typeAnnotation?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
computed: boolean;
|
computed?: boolean;
|
||||||
static: boolean;
|
static?: boolean;
|
||||||
abstract: boolean | null;
|
abstract?: boolean | null;
|
||||||
accessibility: "public" | "private" | "protected" | null;
|
accessibility?: "public" | "private" | "protected" | null;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
definite: boolean | null;
|
definite?: boolean | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
readonly: boolean | null;
|
readonly?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface PipelineTopicExpression extends BaseNode {
|
export interface PipelineTopicExpression extends BaseNode {
|
||||||
@ -1539,28 +1539,28 @@ export interface PipelinePrimaryTopicReference extends BaseNode {
|
|||||||
export interface ClassPrivateProperty extends BaseNode {
|
export interface ClassPrivateProperty extends BaseNode {
|
||||||
type: "ClassPrivateProperty";
|
type: "ClassPrivateProperty";
|
||||||
key: PrivateName;
|
key: PrivateName;
|
||||||
value: Expression | null;
|
value?: Expression | null;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
static: any;
|
static: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ClassPrivateMethod extends BaseNode {
|
export interface ClassPrivateMethod extends BaseNode {
|
||||||
type: "ClassPrivateMethod";
|
type: "ClassPrivateMethod";
|
||||||
kind: "get" | "set" | "method" | "constructor";
|
kind?: "get" | "set" | "method" | "constructor";
|
||||||
key: PrivateName;
|
key: PrivateName;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
body: BlockStatement;
|
body: BlockStatement;
|
||||||
static: boolean;
|
static?: boolean;
|
||||||
abstract: boolean | null;
|
abstract?: boolean | null;
|
||||||
access: "public" | "private" | "protected" | null;
|
access?: "public" | "private" | "protected" | null;
|
||||||
accessibility: "public" | "private" | "protected" | null;
|
accessibility?: "public" | "private" | "protected" | null;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
computed: boolean;
|
computed?: boolean;
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
returnType: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
returnType?: TypeAnnotation | TSTypeAnnotation | Noop | null;
|
||||||
typeParameters:
|
typeParameters?:
|
||||||
| TypeParameterDeclaration
|
| TypeParameterDeclaration
|
||||||
| TSTypeParameterDeclaration
|
| TSTypeParameterDeclaration
|
||||||
| Noop
|
| Noop
|
||||||
@ -1616,37 +1616,37 @@ export interface StaticBlock extends BaseNode {
|
|||||||
export interface TSParameterProperty extends BaseNode {
|
export interface TSParameterProperty extends BaseNode {
|
||||||
type: "TSParameterProperty";
|
type: "TSParameterProperty";
|
||||||
parameter: Identifier | AssignmentPattern;
|
parameter: Identifier | AssignmentPattern;
|
||||||
accessibility: "public" | "private" | "protected" | null;
|
accessibility?: "public" | "private" | "protected" | null;
|
||||||
readonly: boolean | null;
|
readonly?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSDeclareFunction extends BaseNode {
|
export interface TSDeclareFunction extends BaseNode {
|
||||||
type: "TSDeclareFunction";
|
type: "TSDeclareFunction";
|
||||||
id: Identifier | null;
|
id?: Identifier | null;
|
||||||
typeParameters: TSTypeParameterDeclaration | Noop | null;
|
typeParameters?: TSTypeParameterDeclaration | Noop | null;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
returnType: TSTypeAnnotation | Noop | null;
|
returnType?: TSTypeAnnotation | Noop | null;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSDeclareMethod extends BaseNode {
|
export interface TSDeclareMethod extends BaseNode {
|
||||||
type: "TSDeclareMethod";
|
type: "TSDeclareMethod";
|
||||||
decorators: Array<Decorator> | null;
|
decorators?: Array<Decorator> | null;
|
||||||
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
key: Identifier | StringLiteral | NumericLiteral | Expression;
|
||||||
typeParameters: TSTypeParameterDeclaration | Noop | null;
|
typeParameters?: TSTypeParameterDeclaration | Noop | null;
|
||||||
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
|
||||||
returnType: TSTypeAnnotation | Noop | null;
|
returnType?: TSTypeAnnotation | Noop | null;
|
||||||
abstract: boolean | null;
|
abstract?: boolean | null;
|
||||||
access: "public" | "private" | "protected" | null;
|
access?: "public" | "private" | "protected" | null;
|
||||||
accessibility: "public" | "private" | "protected" | null;
|
accessibility?: "public" | "private" | "protected" | null;
|
||||||
async: boolean;
|
async?: boolean;
|
||||||
computed: boolean;
|
computed?: boolean;
|
||||||
generator: boolean;
|
generator?: boolean;
|
||||||
kind: "get" | "set" | "method" | "constructor";
|
kind?: "get" | "set" | "method" | "constructor";
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
static: boolean;
|
static?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSQualifiedName extends BaseNode {
|
export interface TSQualifiedName extends BaseNode {
|
||||||
@ -1657,43 +1657,43 @@ export interface TSQualifiedName extends BaseNode {
|
|||||||
|
|
||||||
export interface TSCallSignatureDeclaration extends BaseNode {
|
export interface TSCallSignatureDeclaration extends BaseNode {
|
||||||
type: "TSCallSignatureDeclaration";
|
type: "TSCallSignatureDeclaration";
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
parameters: Array<Identifier | RestElement>;
|
parameters: Array<Identifier | RestElement>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSConstructSignatureDeclaration extends BaseNode {
|
export interface TSConstructSignatureDeclaration extends BaseNode {
|
||||||
type: "TSConstructSignatureDeclaration";
|
type: "TSConstructSignatureDeclaration";
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
parameters: Array<Identifier | RestElement>;
|
parameters: Array<Identifier | RestElement>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSPropertySignature extends BaseNode {
|
export interface TSPropertySignature extends BaseNode {
|
||||||
type: "TSPropertySignature";
|
type: "TSPropertySignature";
|
||||||
key: Expression;
|
key: Expression;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
initializer: Expression | null;
|
initializer?: Expression | null;
|
||||||
computed: boolean | null;
|
computed?: boolean | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
readonly: boolean | null;
|
readonly?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSMethodSignature extends BaseNode {
|
export interface TSMethodSignature extends BaseNode {
|
||||||
type: "TSMethodSignature";
|
type: "TSMethodSignature";
|
||||||
key: Expression;
|
key: Expression;
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
parameters: Array<Identifier | RestElement>;
|
parameters: Array<Identifier | RestElement>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
computed: boolean | null;
|
computed?: boolean | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSIndexSignature extends BaseNode {
|
export interface TSIndexSignature extends BaseNode {
|
||||||
type: "TSIndexSignature";
|
type: "TSIndexSignature";
|
||||||
parameters: Array<Identifier>;
|
parameters: Array<Identifier>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
readonly: boolean | null;
|
readonly?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSAnyKeyword extends BaseNode {
|
export interface TSAnyKeyword extends BaseNode {
|
||||||
@ -1754,29 +1754,29 @@ export interface TSThisType extends BaseNode {
|
|||||||
|
|
||||||
export interface TSFunctionType extends BaseNode {
|
export interface TSFunctionType extends BaseNode {
|
||||||
type: "TSFunctionType";
|
type: "TSFunctionType";
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
parameters: Array<Identifier | RestElement>;
|
parameters: Array<Identifier | RestElement>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSConstructorType extends BaseNode {
|
export interface TSConstructorType extends BaseNode {
|
||||||
type: "TSConstructorType";
|
type: "TSConstructorType";
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
parameters: Array<Identifier | RestElement>;
|
parameters: Array<Identifier | RestElement>;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSTypeReference extends BaseNode {
|
export interface TSTypeReference extends BaseNode {
|
||||||
type: "TSTypeReference";
|
type: "TSTypeReference";
|
||||||
typeName: TSEntityName;
|
typeName: TSEntityName;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSTypePredicate extends BaseNode {
|
export interface TSTypePredicate extends BaseNode {
|
||||||
type: "TSTypePredicate";
|
type: "TSTypePredicate";
|
||||||
parameterName: Identifier | TSThisType;
|
parameterName: Identifier | TSThisType;
|
||||||
typeAnnotation: TSTypeAnnotation | null;
|
typeAnnotation?: TSTypeAnnotation | null;
|
||||||
asserts: boolean | null;
|
asserts?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSTypeQuery extends BaseNode {
|
export interface TSTypeQuery extends BaseNode {
|
||||||
@ -1859,10 +1859,10 @@ export interface TSIndexedAccessType extends BaseNode {
|
|||||||
export interface TSMappedType extends BaseNode {
|
export interface TSMappedType extends BaseNode {
|
||||||
type: "TSMappedType";
|
type: "TSMappedType";
|
||||||
typeParameter: TSTypeParameter;
|
typeParameter: TSTypeParameter;
|
||||||
typeAnnotation: TSType | null;
|
typeAnnotation?: TSType | null;
|
||||||
nameType: TSType | null;
|
nameType?: TSType | null;
|
||||||
optional: boolean | null;
|
optional?: boolean | null;
|
||||||
readonly: boolean | null;
|
readonly?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSLiteralType extends BaseNode {
|
export interface TSLiteralType extends BaseNode {
|
||||||
@ -1873,16 +1873,16 @@ export interface TSLiteralType extends BaseNode {
|
|||||||
export interface TSExpressionWithTypeArguments extends BaseNode {
|
export interface TSExpressionWithTypeArguments extends BaseNode {
|
||||||
type: "TSExpressionWithTypeArguments";
|
type: "TSExpressionWithTypeArguments";
|
||||||
expression: TSEntityName;
|
expression: TSEntityName;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSInterfaceDeclaration extends BaseNode {
|
export interface TSInterfaceDeclaration extends BaseNode {
|
||||||
type: "TSInterfaceDeclaration";
|
type: "TSInterfaceDeclaration";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
extends: Array<TSExpressionWithTypeArguments> | null;
|
extends?: Array<TSExpressionWithTypeArguments> | null;
|
||||||
body: TSInterfaceBody;
|
body: TSInterfaceBody;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSInterfaceBody extends BaseNode {
|
export interface TSInterfaceBody extends BaseNode {
|
||||||
@ -1893,9 +1893,9 @@ export interface TSInterfaceBody extends BaseNode {
|
|||||||
export interface TSTypeAliasDeclaration extends BaseNode {
|
export interface TSTypeAliasDeclaration extends BaseNode {
|
||||||
type: "TSTypeAliasDeclaration";
|
type: "TSTypeAliasDeclaration";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
typeParameters: TSTypeParameterDeclaration | null;
|
typeParameters?: TSTypeParameterDeclaration | null;
|
||||||
typeAnnotation: TSType;
|
typeAnnotation: TSType;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSAsExpression extends BaseNode {
|
export interface TSAsExpression extends BaseNode {
|
||||||
@ -1914,23 +1914,23 @@ export interface TSEnumDeclaration extends BaseNode {
|
|||||||
type: "TSEnumDeclaration";
|
type: "TSEnumDeclaration";
|
||||||
id: Identifier;
|
id: Identifier;
|
||||||
members: Array<TSEnumMember>;
|
members: Array<TSEnumMember>;
|
||||||
const: boolean | null;
|
const?: boolean | null;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
initializer: Expression | null;
|
initializer?: Expression | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSEnumMember extends BaseNode {
|
export interface TSEnumMember extends BaseNode {
|
||||||
type: "TSEnumMember";
|
type: "TSEnumMember";
|
||||||
id: Identifier | StringLiteral;
|
id: Identifier | StringLiteral;
|
||||||
initializer: Expression | null;
|
initializer?: Expression | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSModuleDeclaration extends BaseNode {
|
export interface TSModuleDeclaration extends BaseNode {
|
||||||
type: "TSModuleDeclaration";
|
type: "TSModuleDeclaration";
|
||||||
id: Identifier | StringLiteral;
|
id: Identifier | StringLiteral;
|
||||||
body: TSModuleBlock | TSModuleDeclaration;
|
body: TSModuleBlock | TSModuleDeclaration;
|
||||||
declare: boolean | null;
|
declare?: boolean | null;
|
||||||
global: boolean | null;
|
global?: boolean | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSModuleBlock extends BaseNode {
|
export interface TSModuleBlock extends BaseNode {
|
||||||
@ -1941,8 +1941,8 @@ export interface TSModuleBlock extends BaseNode {
|
|||||||
export interface TSImportType extends BaseNode {
|
export interface TSImportType extends BaseNode {
|
||||||
type: "TSImportType";
|
type: "TSImportType";
|
||||||
argument: StringLiteral;
|
argument: StringLiteral;
|
||||||
qualifier: TSEntityName | null;
|
qualifier?: TSEntityName | null;
|
||||||
typeParameters: TSTypeParameterInstantiation | null;
|
typeParameters?: TSTypeParameterInstantiation | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TSImportEqualsDeclaration extends BaseNode {
|
export interface TSImportEqualsDeclaration extends BaseNode {
|
||||||
@ -1989,8 +1989,8 @@ export interface TSTypeParameterDeclaration extends BaseNode {
|
|||||||
|
|
||||||
export interface TSTypeParameter extends BaseNode {
|
export interface TSTypeParameter extends BaseNode {
|
||||||
type: "TSTypeParameter";
|
type: "TSTypeParameter";
|
||||||
constraint: TSType | null;
|
constraint?: TSType | null;
|
||||||
default: TSType | null;
|
default?: TSType | null;
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user