UNPKG

46.2 kBTypeScriptView Raw
1export interface Plugin {
2 (module: Program): Program;
3}
4export declare type ParseOptions = ParserConfig & {
5 comments?: boolean;
6 script?: boolean;
7 /**
8 * Defaults to es3.
9 */
10 target?: JscTarget;
11};
12/**
13 * Programmatic options.
14 */
15export interface Options extends Config {
16 /**
17 * If true, a file is parsed as a script instead of module.
18 */
19 script?: boolean;
20 /**
21 * The working directory that all paths in the programmatic
22 * options will be resolved relative to.
23 *
24 * Defaults to `process.cwd()`.
25 */
26 cwd?: string;
27 caller?: CallerOptions;
28 /** The filename associated with the code currently being compiled,
29 * if there is one. The filename is optional, but not all of Swc's
30 * functionality is available when the filename is unknown, because a
31 * subset of options rely on the filename for their functionality.
32 *
33 * The three primary cases users could run into are:
34 *
35 * - The filename is exposed to plugins. Some plugins may require the
36 * presence of the filename.
37 * - Options like "test", "exclude", and "ignore" require the filename
38 * for string/RegExp matching.
39 * - .swcrc files are loaded relative to the file being compiled.
40 * If this option is omitted, Swc will behave as if swcrc: false has been set.
41 */
42 filename?: string;
43 /**
44 * The initial path that will be processed based on the "rootMode" to
45 * determine the conceptual root folder for the current Swc project.
46 * This is used in two primary cases:
47 *
48 * - The base directory when checking for the default "configFile" value
49 * - The default value for "swcrcRoots".
50 *
51 * Defaults to `opts.cwd`
52 */
53 root?: string;
54 /**
55 * This option, combined with the "root" value, defines how Swc chooses
56 * its project root. The different modes define different ways that Swc
57 * can process the "root" value to get the final project root.
58 *
59 * "root" - Passes the "root" value through as unchanged.
60 * "upward" - Walks upward from the "root" directory, looking for a directory
61 * containinga swc.config.js file, and throws an error if a swc.config.js
62 * is not found.
63 * "upward-optional" - Walk upward from the "root" directory, looking for
64 * a directory containing a swc.config.js file, and falls back to "root"
65 * if a swc.config.js is not found.
66 *
67 *
68 * "root" is the default mode because it avoids the risk that Swc
69 * will accidentally load a swc.config.js that is entirely outside
70 * of the current project folder. If you use "upward-optional",
71 * be aware that it will walk up the directory structure all the
72 * way to the filesystem root, and it is always possible that someone
73 * will have a forgotten swc.config.js in their home directory,
74 * which could cause unexpected errors in your builds.
75 *
76 *
77 * Users with monorepo project structures that run builds/tests on a
78 * per-package basis may well want to use "upward" since monorepos
79 * often have a swc.config.js in the project root. Running Swc
80 * in a monorepo subdirectory without "upward", will cause Swc
81 * to skip loading any swc.config.js files in the project root,
82 * which can lead to unexpected errors and compilation failure.
83 */
84 rootMode?: "root" | "upward" | "upward-optional";
85 /**
86 * The current active environment used during configuration loading.
87 * This value is used as the key when resolving "env" configs,
88 * and is also available inside configuration functions, plugins,
89 * and presets, via the api.env() function.
90 *
91 * Defaults to `process.env.SWC_ENV || process.env.NODE_ENV || "development"`
92 */
93 envName?: string;
94 /**
95 * Defaults to searching for a default `.swcrc` file, but can
96 * be passed the path of any JS or JSON5 config file.
97 *
98 *
99 * NOTE: This option does not affect loading of .swcrc files,
100 * so while it may be tempting to do configFile: "./foo/.swcrc",
101 * it is not recommended. If the given .swcrc is loaded via the
102 * standard file-relative logic, you'll end up loading the same
103 * config file twice, merging it with itself. If you are linking
104 * a specific config file, it is recommended to stick with a
105 * naming scheme that is independent of the "swcrc" name.
106 *
107 * Defaults to `path.resolve(opts.root, ".swcrc")`
108 */
109 configFile?: string | boolean;
110 /**
111 * true will enable searching for configuration files relative to the "filename" provided to Swc.
112 *
113 * A swcrc value passed in the programmatic options will override one set within a configuration file.
114 *
115 * Note: .swcrc files are only loaded if the current "filename" is inside of
116 * a package that matches one of the "swcrcRoots" packages.
117 *
118 *
119 * Defaults to true as long as the filename option has been specificed
120 */
121 swcrc?: boolean;
122 /**
123 * By default, Babel will only search for .babelrc files within the "root" package
124 * because otherwise Babel cannot know if a given .babelrc is meant to be loaded,
125 * or if it's "plugins" and "presets" have even been installed, since the file
126 * being compiled could be inside node_modules, or have been symlinked into the project.
127 *
128 *
129 * This option allows users to provide a list of other packages that should be
130 * considered "root" packages when considering whether to load .babelrc files.
131 *
132 *
133 * For example, a monorepo setup that wishes to allow individual packages
134 * to have their own configs might want to do
135 *
136 *
137 *
138 * Defaults to `opts.root`
139 */
140 swcrcRoots?: boolean | MatchPattern | MatchPattern[];
141 /**
142 * `true` will attempt to load an input sourcemap from the file itself, if it
143 * contains a //# sourceMappingURL=... comment. If no map is found, or the
144 * map fails to load and parse, it will be silently discarded.
145 *
146 * If an object is provided, it will be treated as the source map object itself.
147 *
148 * Defaults to `true`.
149 */
150 inputSourceMap?: boolean | string;
151 /**
152 * The name to use for the file inside the source map object.
153 *
154 * Defaults to `path.basename(opts.filenameRelative)` when available, or `"unknown"`.
155 */
156 sourceFileName?: string;
157 /**
158 * The sourceRoot fields to set in the generated source map, if one is desired.
159 */
160 sourceRoot?: string;
161 plugin?: Plugin;
162 isModule?: boolean;
163}
164export interface CallerOptions {
165 name: string;
166 [key: string]: any;
167}
168export declare type Swcrc = Config | Config[];
169/**
170 * .swcrc
171 */
172export interface Config {
173 /**
174 * Note: The type is string beacuse it follow rust's regex syntax.
175 */
176 test?: string | string[];
177 /**
178 * Note: The type is string beacuse it follow rust's regex syntax.
179 */
180 exclude?: string | string[];
181 env?: EnvConfig;
182 jsc?: JscConfig;
183 module?: ModuleConfig;
184 minify?: boolean;
185 /**
186 * - true to generate a sourcemap for the code and include it in the result object.
187 * - "inline" to generate a sourcemap and append it as a data URL to the end of the code, but not include it in the result object.
188 * - "both" is the same as inline, but will include the map in the result object.
189 *
190 * `swc-cli` overloads some of these to also affect how maps are written to disk:
191 *
192 * - true will write the map to a .map file on disk
193 * - "inline" will write the file directly, so it will have a data: containing the map
194 * - "both" will write the file with a data: URL and also a .map.
195 * - Note: These options are bit weird, so it may make the most sense to just use true
196 * and handle the rest in your own code, depending on your use case.
197 */
198 sourceMaps?: boolean | "inline" | "both";
199}
200/**
201 * Configuration ported from babel-preset-env
202 */
203export interface EnvConfig {
204 mode?: "usage" | "entry";
205 debug?: boolean;
206 dynamicImport?: boolean;
207 loose?: boolean;
208 skip?: string[];
209 include?: string[];
210 exclude?: string[];
211 /**
212 * The version of the used core js.
213 *
214 */
215 coreJs?: string;
216 targets?: any;
217 path?: string;
218 shippedProposals?: boolean;
219 /**
220 * Enable all trnasforms
221 */
222 forceAllTransforms?: boolean;
223}
224export interface JscConfig {
225 loose?: boolean;
226 /**
227 * Defaults to EsParserConfig
228 */
229 parser?: ParserConfig;
230 transform?: TransformConfig;
231 /**
232 * Use `@swc/helpers` instead of inline helpers.
233 */
234 externalHelpers?: boolean;
235 /**
236 * Defaults to `es3` (which enableds **all** pass).
237 */
238 target?: JscTarget;
239}
240export declare type JscTarget = "es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020";
241export declare type ParserConfig = TsParserConfig | EsParserConfig;
242export interface TsParserConfig {
243 syntax: "typescript";
244 /**
245 * Defaults to `false`.
246 */
247 tsx?: boolean;
248 /**
249 * Defaults to `false`.
250 */
251 decorators?: boolean;
252 /**
253 * Defaults to `false`
254 */
255 dynamicImport?: boolean;
256}
257export interface EsParserConfig {
258 syntax: "ecmascript";
259 /**
260 * Defaults to false.
261 */
262 jsx?: boolean;
263 /**
264 * Defaults to `false`.
265 *
266 * @deprecated Always true because it's in ecmascript spec.
267 */
268 numericSeparator?: boolean;
269 /**
270 * Defaults to `false`
271 */
272 classPrivateProperty?: boolean;
273 /**
274 * Defaults to `false`
275 *
276 * @deprecated Always true because it's in ecmascript spec.
277 */
278 privateMethod?: boolean;
279 /**
280 * Defaults to `false`
281 */
282 classProperty?: boolean;
283 /**
284 * Defaults to `false`
285 */
286 functionBind?: boolean;
287 /**
288 * Defaults to `false`
289 */
290 decorators?: boolean;
291 /**
292 * Defaults to `false`
293 */
294 decoratorsBeforeExport?: boolean;
295 /**
296 * Defaults to `false`
297 */
298 dynamicImport?: boolean;
299 /**
300 * Defaults to `false`
301 *
302 * @deprecated Always true because it's in ecmascript spec.
303 */
304 nullishCoalescing?: boolean;
305 /**
306 * Defaults to `false`
307 */
308 exportDefaultFrom?: boolean;
309 /**
310 * Defaults to `false`
311 */
312 exportNamespaceFrom?: boolean;
313 /**
314 * Defaults to `false`
315 */
316 importMeta?: boolean;
317}
318/**
319 * Options for trasnform.
320 */
321export interface TransformConfig {
322 /**
323 * Effective only if `syntax` supports ƒ.
324 */
325 react?: ReactConfig;
326 constModules?: ConstModulesConfig;
327 /**
328 * Defaults to null, which skips optimizer pass.
329 */
330 optimizer?: OptimizerConfig;
331 /**
332 * https://swc.rs/docs/configuring-swc.html#jsctransformlegacydecorator
333 */
334 legacyDecorator?: boolean;
335 /**
336 * https://swc.rs/docs/configuring-swc.html#jsctransformdecoratormetadata
337 */
338 decoratorMetadata?: boolean;
339}
340export interface ReactConfig {
341 /**
342 * Replace the function used when compiling JSX expressions.
343 *
344 * Defaults to `React.createElement`.
345 */
346 pragma: String;
347 /**
348 * Replace the component used when compiling JSX fragments.
349 *
350 * Defaults to `React.Fragment`
351 */
352 pragmaFrag: String;
353 /**
354 * Toggles whether or not to throw an error if a XML namespaced tag name is used. For example:
355 * `<f:image />`
356 *
357 * Though the JSX spec allows this, it is disabled by default since React's
358 * JSX does not currently have support for it.
359 *
360 */
361 throwIfNamespace: boolean;
362 /**
363 * Toggles plugins that aid in development, such as @swc/plugin-transform-react-jsx-self
364 * and @swc/plugin-transform-react-jsx-source.
365 *
366 * Defaults to `false`,
367 *
368 */
369 development: boolean;
370 /**
371 * Use `Object.assign()` instead of `_extends`. Defaults to false.
372 */
373 useBuiltins: boolean;
374}
375/**
376 * - `import { DEBUG } from '@ember/env-flags';`
377 * - `import { FEATURE_A, FEATURE_B } from '@ember/features';`
378 *
379 * See: https://github.com/swc-project/swc/issues/18#issuecomment-466272558
380 */
381export interface ConstModulesConfig {
382 globals?: {
383 [module: string]: {
384 [name: string]: string;
385 };
386 };
387}
388export interface OptimizerConfig {
389 globals?: GlobalPassOption;
390 jsonify?: {
391 minCost: number;
392 };
393}
394/**
395 * Options for inline-global pass.
396 */
397export interface GlobalPassOption {
398 /**
399 * Global variables.
400 *
401 * e.g. `{ __DEBUG__: true }`
402 */
403 vars?: {
404 [key: string]: string;
405 };
406 /**
407 * Name of environment variables to inline.
408 *
409 * Defaults to `["NODE_ENV", "SWC_ENV"]`
410 */
411 envs?: string[];
412}
413export declare type ModuleConfig = CommonJsConfig | UmdConfig | AmdConfig;
414export interface BaseModuleConfig {
415 /**
416 * By default, when using exports with babel a non-enumerable `__esModule`
417 * property is exported. In some cases this property is used to determine
418 * if the import is the default export or if it contains the default export.
419 *
420 * In order to prevent the __esModule property from being exported, you
421 * can set the strict option to true.
422 *
423 * Defaults to `false`.
424 */
425 strict?: boolean;
426 /**
427 * Emits 'use strict' directive.
428 *
429 * Defaults to `true`.
430 */
431 strict_mode?: boolean;
432 /**
433 * Changes Babel's compiled import statements to be lazily evaluated when their imported bindings are used for the first time.
434 *
435 * This can improve initial load time of your module because evaluating dependencies up
436 * front is sometimes entirely un-necessary. This is especially the case when implementing
437 * a library module.
438 *
439 *
440 * The value of `lazy` has a few possible effects:
441 *
442 * - `false` - No lazy initialization of any imported module.
443 * - `true` - Do not lazy-initialize local `./foo` imports, but lazy-init `foo` dependencies.
444 *
445 * Local paths are much more likely to have circular dependencies, which may break if loaded lazily,
446 * so they are not lazy by default, whereas dependencies between independent modules are rarely cyclical.
447 *
448 * - `Array<string>` - Lazy-initialize all imports with source matching one of the given strings.
449 *
450 * -----
451 *
452 * The two cases where imports can never be lazy are:
453 *
454 * - `import "foo";`
455 *
456 * Side-effect imports are automatically non-lazy since their very existence means
457 * that there is no binding to later kick off initialization.
458 *
459 * - `export * from "foo"`
460 *
461 * Re-exporting all names requires up-front execution because otherwise there is no
462 * way to know what names need to be exported.
463 *
464 * Defaults to `false`.
465 */
466 lazy?: boolean | string[];
467 /**
468 * By default, when using exports with swc a non-enumerable __esModule property is exported.
469 * This property is then used to determine if the import is the default export or if
470 * it contains the default export.
471 *
472 * In cases where the auto-unwrapping of default is not needed, you can set the noInterop option
473 * to true to avoid the usage of the interopRequireDefault helper (shown in inline form above).
474 *
475 * Defaults to `false`.
476 */
477 noInterop?: boolean;
478}
479export interface CommonJsConfig extends BaseModuleConfig {
480 type: "commonjs";
481}
482export interface UmdConfig extends BaseModuleConfig {
483 type: "umd";
484 globals?: {
485 [key: string]: string;
486 };
487}
488export interface AmdConfig extends BaseModuleConfig {
489 type: "amd";
490 moduleId: string;
491}
492export interface Output {
493 /**
494 * Transformed code
495 */
496 code: string;
497 /**
498 * Sourcemap (**not** base64 encoded)
499 */
500 map?: string;
501}
502export interface MatchPattern {
503}
504export interface Span {
505 start: number;
506 end: number;
507 ctxt: number;
508}
509export interface Node {
510 type: string;
511}
512export interface HasSpan {
513 span: Span;
514}
515export interface HasDecorator {
516 decorators?: Decorator[];
517}
518export interface Class extends HasSpan, HasDecorator {
519 body: ClassMember[];
520 superClass?: Expression;
521 is_abstract: boolean;
522 typeParams: TsTypeParameterDeclaration;
523 superTypeParams?: TsTypeParameterInstantiation;
524 implements: TsExpressionWithTypeArguments[];
525}
526export declare type ClassMember = Constructor | ClassMethod | PrivateMethod | ClassProperty | PrivateProperty | TsIndexSignature;
527export interface ClassPropertyBase extends Node, HasSpan, HasDecorator {
528 value?: Expression;
529 typeAnnotation?: TsTypeAnnotation;
530 is_static: boolean;
531 computed: boolean;
532 accessibility?: Accessibility;
533 is_abstract: boolean;
534 is_optional: boolean;
535 readonly: boolean;
536 definite: boolean;
537}
538export interface ClassProperty extends ClassPropertyBase {
539 type: "ClassProperty";
540 key: Expression;
541}
542export interface PrivateProperty extends ClassPropertyBase {
543 type: "PrivateProperty";
544 key: PrivateName;
545}
546export interface Param extends Node, HasSpan, HasDecorator {
547 type: "Parameter";
548 pat: Pattern;
549}
550export interface Constructor extends Node, HasSpan {
551 type: "Constructor";
552 key: PropertyName;
553 params: (Param | TsParameterProperty)[];
554 body: BlockStatement;
555 accessibility?: Accessibility;
556 is_optional: boolean;
557}
558export interface ClassMethodBase extends Node, HasSpan {
559 function: Fn;
560 kind: MethodKind;
561 is_static: boolean;
562 accessibility?: Accessibility;
563 is_abstract: boolean;
564 is_optional: boolean;
565}
566export interface ClassMethod extends ClassMethodBase {
567 type: "ClassMethod";
568 key: PropertyName;
569}
570export interface PrivateMethod extends ClassMethodBase {
571 type: "PrivateMethod";
572 key: PrivateName;
573}
574export interface Decorator extends Node, HasSpan {
575 type: "Decorator";
576 expression: Expression;
577}
578export declare type MethodKind = "method" | "setter" | "getter";
579export declare type Declaration = ClassDeclaration | FunctionDeclaration | VariableDeclaration | TsInterfaceDeclaration | TsTypeAliasDeclaration | TsEnumDeclaration | TsModuleDeclaration;
580export interface FunctionDeclaration extends Fn {
581 type: "FunctionDeclaration";
582 ident: Identifier;
583 declare: boolean;
584}
585export interface ClassDeclaration extends Class, Node {
586 type: "ClassDeclaration";
587 identifier: Identifier;
588 declare: boolean;
589}
590export interface VariableDeclaration extends Node, HasSpan {
591 type: "VariableDeclaration";
592 kind: VariableDeclarationKind;
593 declare: boolean;
594 declarations: VariableDeclarator[];
595}
596export declare type VariableDeclarationKind = "get" | "let" | "const";
597export interface VariableDeclarator extends Node, HasSpan {
598 type: "VariableDeclarator";
599 id: Pattern;
600 init?: Expression;
601 definite: boolean;
602}
603export declare type Expression = ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression | UnaryExpression | UpdateExpression | BinaryExpression | AssignmentExpression | MemberExpression | ConditionalExpression | CallExpression | NewExpression | SequenceExpression | Identifier | Literal | TemplateLiteral | TaggedTemplateExpression | ArrowFunctionExpression | ClassExpression | YieldExpression | MetaProperty | AwaitExpression | ParenthesisExpression | JSXMemberExpression | JSXNamespacedName | JSXEmptyExpression | JSXElement | JSXFragment | TsTypeAssertion | TsNonNullExpression | TsAsExpression | PrivateName | OptionalChainingExpression | Invalid;
604interface ExpressionBase extends Node, HasSpan {
605}
606export interface OptionalChainingExpression extends ExpressionBase {
607 type: "OptionalChainingExpression";
608 /**
609 * Call expression or member expression.
610 */
611 expr: Expression;
612}
613export interface ThisExpression extends ExpressionBase {
614 type: "ThisExpression";
615}
616export interface ArrayExpression extends ExpressionBase {
617 type: "ArrayExpression";
618 elements: (Expression | SpreadElement | undefined)[];
619}
620export interface ObjectExpression extends ExpressionBase {
621 type: "ObjectExpression";
622 properties: (Property | SpreadElement)[];
623}
624export interface Argument {
625 spread: Span;
626 expression: Expression;
627}
628export declare type PropertOrSpread = Property | SpreadElement;
629export interface SpreadElement extends Node {
630 type: "SpreadElement";
631 spread: Span;
632 arguments: Expression;
633}
634export interface UnaryExpression extends ExpressionBase {
635 type: "UnaryExpression";
636 operator: UnaryOperator;
637 argument: Expression;
638}
639export interface UpdateExpression extends ExpressionBase {
640 type: "UpdateExpression";
641 operator: UpdateOperator;
642 prefix: boolean;
643 argument: Expression;
644}
645export interface BinaryExpression extends ExpressionBase {
646 type: "BinaryExpression";
647 operator: BinaryOperator;
648 left: Expression;
649 right: Expression;
650}
651export interface FunctionExpression extends Fn, ExpressionBase {
652 type: "FunctionExpression";
653 identifier: Identifier;
654}
655export interface ClassExpression extends Class, ExpressionBase {
656 type: "ClassExpression";
657 identifier: Identifier;
658}
659export interface AssignmentExpression extends ExpressionBase {
660 type: "AssignmentExpression";
661 operator: AssignmentOperator;
662 left: Pattern | Expression;
663 right: Expression;
664}
665export interface MemberExpression extends ExpressionBase {
666 type: "MemberExpression";
667 object: Expression | Super;
668 property: Expression;
669 computed: boolean;
670}
671export interface ConditionalExpression extends ExpressionBase {
672 type: "ConditionalExpression";
673 test: Expression;
674 consequent: Expression;
675 alternate: Expression;
676}
677export interface Super extends Node, HasSpan {
678 type: "Super";
679}
680export interface CallExpression extends ExpressionBase {
681 type: "CallExpression";
682 callee: Expression | Super;
683 arguments: Argument[];
684 typeArguments?: TsTypeParameterInstantiation;
685}
686export interface NewExpression extends ExpressionBase {
687 type: "NewExpression";
688 callee: Expression;
689 arguments: Argument[];
690 typeArguments?: TsTypeParameterInstantiation;
691}
692export interface SequenceExpression extends ExpressionBase {
693 type: "SequenceExpression";
694 expressions: Expression[];
695}
696export interface ArrowFunctionExpression extends ExpressionBase {
697 type: "ArrowFunctionExpression";
698 params: Pattern[];
699 body: BlockStatement | Expression;
700 async: boolean;
701 generator: boolean;
702 typeParameters?: TsTypeParameterDeclaration;
703 returnType?: TsTypeAnnotation;
704}
705export interface YieldExpression extends ExpressionBase {
706 type: "YieldExpression";
707 argument?: Expression;
708 delegate: boolean;
709}
710export interface MetaProperty extends Node {
711 type: "MetaProperty";
712 meta: Identifier;
713 property: Identifier;
714}
715export interface AwaitExpression extends ExpressionBase {
716 type: "AwaitExpression";
717 argument: Expression;
718}
719export interface TplBase {
720 expressions: Expression[];
721 quasis: TemplateElement[];
722}
723export interface TemplateLiteral extends ExpressionBase, TplBase {
724 type: "TemplateLiteral";
725}
726export interface TaggedTemplateExpression extends ExpressionBase, TplBase {
727 type: "TaggedTemplateExpression";
728 tag: Expression;
729 typeParameters: TsTypeParameterInstantiation;
730}
731export interface TemplateElement extends ExpressionBase {
732 type: "TemplateElement";
733 tail: boolean;
734 cooked: StringLiteral;
735 raw: StringLiteral;
736}
737export interface ParenthesisExpression extends ExpressionBase {
738 type: "ParenthesisExpression";
739 expression: Expression;
740}
741export interface Fn extends HasSpan, HasDecorator {
742 params: Param[];
743 body: BlockStatement;
744 generator: boolean;
745 async: boolean;
746 typeParameters?: TsTypeParameterDeclaration;
747 returnType?: TsTypeAnnotation;
748}
749interface PatternBase {
750 typeAnnotation?: TsTypeAnnotation;
751}
752export interface Identifier extends HasSpan, PatternBase {
753 type: "Identifier";
754 value: string;
755 optional: boolean;
756}
757export interface PrivateName extends ExpressionBase {
758 type: "PrivateName";
759 id: Identifier;
760}
761export declare type JSXObject = JSXMemberExpression | Identifier;
762export interface JSXMemberExpression extends Node {
763 type: "JSXMemberExpression";
764 object: JSXObject;
765 property: Identifier;
766}
767/**
768 * XML-based namespace syntax:
769 */
770export interface JSXNamespacedName extends Node {
771 type: "JSXNamespacedName";
772 namespace: Identifier;
773 name: Identifier;
774}
775export interface JSXEmptyExpression extends Node, HasSpan {
776 type: "JSXEmptyExpression";
777}
778export interface JSXExpressionContainer extends Node {
779 type: "JSXExpressionContainer";
780 expression: JSXExpression;
781}
782export declare type JSXExpression = JSXEmptyExpression | Expression;
783export interface JSXSpreadChild extends Node {
784 type: "JSXSpreadChild";
785 expression: Expression;
786}
787export declare type JSXElementName = Identifier | JSXMemberExpression | JSXNamespacedName;
788export interface JSXOpeningElement extends Node, HasSpan {
789 type: "JSXOpeningElement";
790 name: JSXElementName;
791 attrs?: JSXAttributeOrSpread[];
792 selfClosing: boolean;
793 typeArguments?: TsTypeParameterInstantiation;
794}
795export declare type JSXAttributeOrSpread = JSXAttribute | SpreadElement;
796export interface JSXClosingElement extends Node, HasSpan {
797 type: "JSXClosingElement";
798 name: JSXElementName;
799}
800export interface JSXAttribute extends Node, HasSpan {
801 type: "JSXAttribute";
802 name: JSXAttributeName;
803 value?: JSXAttrValue;
804}
805export declare type JSXAttributeName = Identifier | JSXNamespacedName;
806export declare type JSXAttrValue = Literal | JSXExpressionContainer | JSXElement | JSXFragment;
807export interface JSXText extends Node, HasSpan {
808 type: "JSXText";
809 value: string;
810 raw: string;
811}
812export interface JSXElement extends Node, HasSpan {
813 type: "JSXElement";
814 opening: JSXOpeningElement;
815 children: JSXElementChild[];
816 closing?: JSXClosingElement;
817}
818export declare type JSXElementChild = JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment;
819export interface JSXFragment extends Node, HasSpan {
820 type: "JSXFragment";
821 opening: JSXOpeningFragment;
822 children: JSXElementChild[];
823 closing: JSXClosingFragment;
824}
825export interface JSXOpeningFragment extends Node, HasSpan {
826 type: "JSXOpeningFragment";
827}
828export interface JSXClosingFragment extends Node, HasSpan {
829 type: "JSXClosingFragment";
830}
831export declare type Literal = StringLiteral | BooleanLiteral | NullLiteral | NumericLiteral | RegExpLiteral | JSXText;
832export interface StringLiteral extends Node, HasSpan {
833 type: "StringLiteral";
834 value: string;
835 has_escape: boolean;
836}
837export interface BooleanLiteral extends Node, HasSpan {
838 type: "BooleanLiteral";
839 value: boolean;
840}
841export interface NullLiteral extends Node, HasSpan {
842 type: "NullLiteral";
843}
844export interface RegExpLiteral extends Node, HasSpan {
845 type: "RegExpLiteral";
846 pattern: string;
847 flags: string;
848}
849export interface NumericLiteral extends Node, HasSpan {
850 type: "NumericLiteral";
851 value: number;
852}
853export declare type ModuleDeclaration = ImportDeclaration | ExportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportDefaultExpression | ExportAllDeclaration | TsImportEqualsDeclaration | TsExportAssignment | TsNamespaceExportDeclaration;
854export interface ExportDefaultExpression extends Node, HasSpan {
855 type: "ExportDefaultExpression";
856 expression: Expression;
857}
858export interface ExportDeclaration extends Node, HasSpan {
859 type: "ExportDeclaration";
860 declaration: Declaration;
861}
862export interface ImportDeclaration extends Node, HasSpan {
863 type: "ImportDeclaration";
864 specifiers: ImportSpecifier[];
865 source: StringLiteral;
866}
867export interface ExportAllDeclaration extends Node, HasSpan {
868 type: "ExportAllDeclaration";
869 source: StringLiteral;
870}
871/**
872 * - `export { foo } from 'mod'`
873 * - `export { foo as bar } from 'mod'`
874 */
875export interface ExportNamedDeclaration extends Node, HasSpan {
876 type: "ExportNamedDeclaration";
877 specifiers: ExportSpecifier[];
878 source?: StringLiteral;
879}
880export interface ExportDefaultDeclaration extends Node, HasSpan {
881 type: "ExportDefaultDeclaration";
882 decl: DefaultDecl;
883}
884export declare type DefaultDecl = ClassExpression | FunctionExpression | TsInterfaceDeclaration;
885export declare type ImportSpecifier = NamedImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier;
886/**
887 * e.g. `import foo from 'mod.js'`
888 */
889export interface ImportDefaultSpecifier extends Node, HasSpan {
890 type: "ImportDefaultSpecifier";
891 local: Identifier;
892}
893/**
894 * e.g. `import * as foo from 'mod.js'`.
895 */
896export interface ImportNamespaceSpecifier extends Node, HasSpan {
897 type: "ImportNamespaceSpecifier";
898 local: Identifier;
899}
900/**
901 * e.g. - `import { foo } from 'mod.js'`
902 *
903 * local = foo, imported = None
904 *
905 * e.g. `import { foo as bar } from 'mod.js'`
906 *
907 * local = bar, imported = Some(foo) for
908 */
909export interface NamedImportSpecifier extends Node, HasSpan {
910 type: "ImportSpecifier";
911 local: Identifier;
912 imported: Identifier;
913}
914export declare type ExportSpecifier = ExportNamespaceSpecifer | ExportDefaultSpecifier | NamedExportSpecifier;
915/**
916 * `export * as foo from 'src';`
917 */
918export interface ExportNamespaceSpecifer extends Node, HasSpan {
919 type: "ExportNamespaceSpecifer";
920 name: Identifier;
921}
922export interface ExportDefaultSpecifier extends Node, HasSpan {
923 type: "ExportDefaultSpecifier";
924 exported: Identifier;
925}
926export interface NamedExportSpecifier extends Node, HasSpan {
927 type: "ExportSpecifier";
928 orig: Identifier;
929 /**
930 * `Some(bar)` in `export { foo as bar }`
931 */
932 exported: Identifier;
933}
934interface HasInterpreter {
935 /**
936 * e.g. `/usr/bin/node` for `#!/usr/bin/node`
937 */
938 interpreter: string;
939}
940export declare type Program = Module | Script;
941export interface Module extends Node, HasSpan, HasInterpreter {
942 type: "Module";
943 body: ModuleItem[];
944}
945export interface Script extends Node, HasSpan, HasInterpreter {
946 type: "Script";
947 body: Statement[];
948}
949export declare type ModuleItem = ModuleDeclaration | Statement;
950export declare type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "||" | "&&" | "in" | "instanceof" | "??";
951export declare type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=";
952export declare type UpdateOperator = "++" | "--";
953export declare type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
954export declare type Pattern = Identifier | ArrayPattern | RestElement | ObjectPattern | AssignmentPattern | Invalid | Expression;
955export interface ArrayPattern extends Node, HasSpan, PatternBase {
956 type: "ArrayPattern";
957 elements: (Pattern | undefined)[];
958}
959export interface ObjectPattern extends Node, HasSpan, PatternBase {
960 type: "ObjectPattern";
961 props: ObjectPatternProperty[];
962}
963export interface AssignmentPattern extends Node, HasSpan, PatternBase {
964 type: "AssignmentPattern";
965 left: Pattern;
966 right: Expression;
967}
968export interface RestElement extends Node, HasSpan, PatternBase {
969 type: "RestElement";
970 rest: Span;
971 argument: Pattern;
972}
973export declare type ObjectPatternProperty = KeyValuePatternProperty | AssignmentPatternProperty | RestElement;
974/**
975 * `{key: value}`
976 */
977export interface KeyValuePatternProperty extends Node {
978 type: "KeyValuePatternProperty";
979 key: PropertyName;
980 value: Pattern;
981}
982/**
983 * `{key}` or `{key = value}`
984 */
985export interface AssignmentPatternProperty extends Node, HasSpan {
986 type: "AssignmentPatternProperty";
987 key: Identifier;
988 value?: Expression;
989}
990/** Identifier is `a` in `{ a, }` */
991export declare type Property = Identifier | KeyValueProperty | AssignmentProperty | GetterProperty | SetterProperty | MethodProperty;
992interface PropBase extends Node {
993 key: PropertyName;
994}
995export interface KeyValueProperty extends PropBase {
996 type: "KeyValueProperty";
997 value: Expression;
998}
999export interface AssignmentProperty extends Node {
1000 type: "AssignmentProperty";
1001 key: Identifier;
1002 value: Expression;
1003}
1004export interface GetterProperty extends PropBase, HasSpan {
1005 type: "GetterProperty";
1006 typeAnnotation?: TsTypeAnnotation;
1007 body: BlockStatement;
1008}
1009export interface SetterProperty extends PropBase, HasSpan {
1010 type: "SetterProperty";
1011 param: Pattern;
1012 body: BlockStatement;
1013}
1014export interface MethodProperty extends PropBase, Fn {
1015 type: "MethodProperty";
1016}
1017export declare type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropName;
1018export interface ComputedPropName extends Node, HasSpan {
1019 type: "Computed";
1020 expression: Expression;
1021}
1022export interface BlockStatement extends Node, HasSpan {
1023 type: "BlockStatement";
1024 stmts: Statement[];
1025}
1026export interface ExpressionStatement extends Node, HasSpan {
1027 type: "ExpressionStatement";
1028 expression: Expression;
1029}
1030export declare type Statement = ExpressionStatement | BlockStatement | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
1031export interface EmptyStatement extends Node, HasSpan {
1032 type: "EmptyStatement";
1033}
1034export interface DebuggerStatement extends Node, HasSpan {
1035 type: "DebuggerStatement";
1036}
1037export interface WithStatement extends Node, HasSpan {
1038 type: "WithStatement";
1039 object: Expression;
1040 body: Statement;
1041}
1042export interface ReturnStatement extends Node, HasSpan {
1043 type: "ReturnStatement";
1044 argument: Expression;
1045}
1046export interface LabeledStatement extends Node, HasSpan {
1047 type: "LabeledStatement";
1048 label: Identifier;
1049 body: Statement;
1050}
1051export interface BreakStatement extends Node, HasSpan {
1052 type: "BreakStatement";
1053 label: Identifier;
1054}
1055export interface ContinueStatement extends Node, HasSpan {
1056 type: "ContinueStatement";
1057 label: Identifier;
1058}
1059export interface IfStatement extends Node, HasSpan {
1060 type: "IfStatement";
1061 test: Expression;
1062 consequent: Statement;
1063 alternate?: Statement;
1064}
1065export interface SwitchStatement extends Node, HasSpan {
1066 type: "SwitchStatement";
1067 discriminant: Expression;
1068 cases: SwitchCase[];
1069}
1070export interface ThrowStatement extends Node, HasSpan {
1071 type: "ThrowStatement";
1072 argument: Expression;
1073}
1074export interface TryStatement extends Node, HasSpan {
1075 type: "TryStatement";
1076 block: BlockStatement;
1077 handler?: CatchClause;
1078 finalizer: BlockStatement;
1079}
1080export interface WhileStatement extends Node, HasSpan {
1081 type: "WhileStatement";
1082 test: Expression;
1083 body: Statement;
1084}
1085export interface DoWhileStatement extends Node, HasSpan {
1086 type: "DoWhileStatement";
1087 test: Expression;
1088 body: Statement;
1089}
1090export interface ForStatement extends Node, HasSpan {
1091 type: "ForStatement";
1092 init?: VariableDeclaration | Expression;
1093 test?: Expression;
1094 update?: Expression;
1095 body: Statement;
1096}
1097export interface ForInStatement extends Node, HasSpan {
1098 type: "ForInStatement";
1099 left: VariableDeclaration | Pattern;
1100 right: Expression;
1101 body: Statement;
1102}
1103export interface ForOfStatement extends Node, HasSpan {
1104 type: "ForOfStatement";
1105 /**
1106 * Span of the await token.
1107 *
1108 * es2018 for-await-of statements, e.g., `for await (const x of xs) {`
1109 */
1110 await: Span;
1111 left: VariableDeclaration | Pattern;
1112 right: Expression;
1113 body: Statement;
1114}
1115export interface SwitchCase extends Node, HasSpan {
1116 type: "SwitchCase";
1117 /**
1118 * Undefined for default case
1119 */
1120 test?: Expression;
1121 consequent: Statement[];
1122}
1123export interface CatchClause extends Node, HasSpan {
1124 type: "CatchClause";
1125 /**
1126 * The param is `undefined` if the catch binding is omitted. E.g., `try { foo() } catch {}`
1127 */
1128 param: Pattern;
1129 body: BlockStatement;
1130}
1131export interface TsTypeAnnotation extends Node, HasSpan {
1132 type: "TsTypeAnnotation";
1133 typeAnnotation: TsType;
1134}
1135export interface TsTypeParameterDeclaration extends Node, HasSpan {
1136 type: "TsTypeParameterDeclaration";
1137 parameters: TsTypeParameter[];
1138}
1139export interface TsTypeParameter extends Node, HasSpan {
1140 type: "TsTypeParameter";
1141 name: Identifier;
1142 constraint: TsType;
1143 default: TsType;
1144}
1145export interface TsTypeParameterInstantiation extends Node, HasSpan {
1146 type: "TsTypeParameterInstantiation";
1147 params: TsType[];
1148}
1149export interface TsParameterProperty extends Node, HasSpan, HasDecorator {
1150 type: "TsParameterProperty";
1151 accessibility?: Accessibility;
1152 readonly: boolean;
1153 param: TsParameterPropertyParameter;
1154}
1155export declare type TsParameterPropertyParameter = Identifier | AssignmentPattern;
1156export interface TsQualifiedName extends Node {
1157 type: "TsQualifiedName";
1158 left: TsEntityName;
1159 right: Identifier;
1160}
1161export declare type TsEntityName = TsQualifiedName | Identifier;
1162export declare type TsSignatureDeclaration = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsMethodSignature | TsFunctionType | TsConstructorType;
1163export declare type TsTypeElement = TsCallSignatureDeclaration | TsConstructSignatureDeclaration | TsPropertySignature | TsMethodSignature | TsIndexSignature;
1164export interface TsCallSignatureDeclaration extends Node, HasSpan {
1165 type: "TsCallSignatureDeclaration";
1166 params: TsFnParameter[];
1167 typeAnnotation: TsTypeAnnotation;
1168 typeParams: TsTypeParameterDeclaration;
1169}
1170export interface TsConstructSignatureDeclaration extends Node, HasSpan {
1171 type: "TsConstructSignatureDeclaration";
1172 params: TsFnParameter[];
1173 typeAnnotation: TsTypeAnnotation;
1174 typeParams: TsTypeParameterDeclaration;
1175}
1176export interface TsPropertySignature extends Node, HasSpan {
1177 type: "TsPropertySignature";
1178 readonly: boolean;
1179 key: Expression;
1180 computed: boolean;
1181 optional: boolean;
1182 init: Expression;
1183 params: TsFnParameter[];
1184 typeAnnotation?: TsTypeAnnotation;
1185 typeParams: TsTypeParameterDeclaration;
1186}
1187export interface TsMethodSignature extends Node, HasSpan {
1188 type: "TsMethodSignature";
1189 readonly: boolean;
1190 key: Expression;
1191 computed: boolean;
1192 optional: boolean;
1193 params: TsFnParameter[];
1194 typeAnnotation: TsTypeAnnotation;
1195 typeParams: TsTypeParameterDeclaration;
1196}
1197export interface TsIndexSignature extends Node, HasSpan {
1198 type: "TsIndexSignature";
1199 readonly: boolean;
1200 params: TsFnParameter[];
1201 typeAnnotation?: TsTypeAnnotation;
1202}
1203export declare type TsType = TsKeywordType | TsThisType | TsFnOrConstructorType | TsTypeReference | TsTypeQuery | TsTypeLiteral | TsArrayType | TsTupleType | TsOptionalType | TsRestType | TsUnionOrIntersectionType | TsConditionalType | TsInferType | TsParenthesizedType | TsTypeOperator | TsIndexedAccessType | TsMappedType | TsLiteralType | TsImportType | TsTypePredicate;
1204export declare type TsFnOrConstructorType = TsFunctionType | TsConstructorType;
1205export interface TsKeywordType extends Node, HasSpan {
1206 type: "TsKeywordType";
1207 kind: TsKeywordTypeKind;
1208}
1209export declare type TsKeywordTypeKind = "any" | "unknown" | "number" | "object" | "boolean" | "bigint" | "string" | "symbol" | "void" | "undefined" | "null" | "never";
1210export interface TsThisType extends Node, HasSpan {
1211 type: "TsThisType";
1212}
1213export declare type TsFnParameter = Identifier | RestElement | ObjectPattern;
1214export interface TsFunctionType extends Node, HasSpan {
1215 type: "TsFunctionType";
1216 typeParams: TsTypeParameterDeclaration;
1217 typeAnnotation: TsTypeAnnotation;
1218}
1219export interface TsConstructorType extends Node, HasSpan {
1220 type: "TsConstructorType";
1221 params: TsFnParameter[];
1222 typeParams: TsTypeParameterDeclaration;
1223 typeAnnotation: TsTypeAnnotation;
1224}
1225export interface TsTypeReference extends Node, HasSpan {
1226 type: "TsTypeReference";
1227 typeName: TsEntityName;
1228 typeParams: TsTypeParameterInstantiation;
1229}
1230export interface TsTypePredicate extends Node, HasSpan {
1231 type: "TsTypePredicate";
1232 asserts: boolean;
1233 paramName: TsThisTypeOrIdent;
1234 typeAnnotation: TsTypeAnnotation;
1235}
1236export declare type TsThisTypeOrIdent = TsThisType | Identifier;
1237export interface TsImportType extends Node, HasSpan {
1238 argument: StringLiteral;
1239 qualifier?: TsEntityName;
1240 typeArguments?: TsTypeParameterInstantiation;
1241}
1242/**
1243 * `typeof` operator
1244 */
1245export interface TsTypeQuery extends Node, HasSpan {
1246 type: "TsTypeQuery";
1247 exprName: TsTypeQueryExpr;
1248}
1249export declare type TsTypeQueryExpr = TsEntityName | TsImportType;
1250export interface TsTypeLiteral extends Node, HasSpan {
1251 type: "TsTypeLiteral";
1252 members: TsTypeElement[];
1253}
1254export interface TsArrayType extends Node, HasSpan {
1255 type: "TsArrayType";
1256 elemType: TsType;
1257}
1258export interface TsTupleType extends Node, HasSpan {
1259 type: "TsTupleType";
1260 elemTypes: TsType[];
1261}
1262export interface TsOptionalType extends Node, HasSpan {
1263 type: "TsOptionalType";
1264 typeAnnotation: TsType;
1265}
1266export interface TsRestType extends Node, HasSpan {
1267 type: "TsRestType";
1268 typeAnnotation: TsType;
1269}
1270export declare type TsUnionOrIntersectionType = TsUnionType | TsIntersectionType;
1271export interface TsUnionType extends Node, HasSpan {
1272 type: "TsUnionType";
1273 types: TsType[];
1274}
1275export interface TsIntersectionType extends Node, HasSpan {
1276 type: "TsIntersectionType";
1277 types: TsType[];
1278}
1279export interface TsConditionalType extends Node, HasSpan {
1280 type: "TsConditionalType";
1281 checkType: TsType;
1282 extendsType: TsType;
1283 trueType: TsType;
1284 falseType: TsType;
1285}
1286export interface TsInferType extends Node, HasSpan {
1287 type: "TsInferType";
1288 typeParam: TsTypeParameter;
1289}
1290export interface TsParenthesizedType extends Node, HasSpan {
1291 type: "TsParenthesizedType";
1292 typeAnnotation: TsType;
1293}
1294export interface TsTypeOperator extends Node, HasSpan {
1295 type: "TsTypeOperator";
1296 op: TsTypeOperatorOp;
1297 typeAnnotation: TsType;
1298}
1299export declare type TsTypeOperatorOp = "keyof" | "unique";
1300export interface TsIndexedAccessType extends Node, HasSpan {
1301 type: "TsIndexedAccessType";
1302 objectType: TsType;
1303 indexType: TsType;
1304}
1305export declare type TruePlusMinus = true | "+" | "-";
1306export interface TsMappedType extends Node, HasSpan {
1307 type: "TsMappedType";
1308 readonly: TruePlusMinus;
1309 typeParam: TsTypeParameter;
1310 optional: TruePlusMinus;
1311 typeAnnotation: TsType;
1312}
1313export interface TsLiteralType extends Node, HasSpan {
1314 type: "TsLiteralType";
1315 literal: TsLiteral;
1316}
1317export declare type TsLiteral = NumericLiteral | StringLiteral | BooleanLiteral | TemplateLiteral;
1318export interface TsInterfaceDeclaration extends Node, HasSpan {
1319 type: "TsInterfaceDeclaration";
1320 id: Identifier;
1321 declare: boolean;
1322 typeParams?: TsTypeParameterDeclaration;
1323 extends: TsExpressionWithTypeArguments[];
1324 body: TsInterfaceBody;
1325}
1326export interface TsInterfaceBody extends Node, HasSpan {
1327 type: "TsInterfaceBody";
1328 body: TsTypeElement[];
1329}
1330export interface TsExpressionWithTypeArguments extends Node, HasSpan {
1331 type: "TsExpressionWithTypeArguments";
1332 expression: TsEntityName;
1333 typeArguments?: TsTypeParameterInstantiation;
1334}
1335export interface TsTypeAliasDeclaration extends Node, HasSpan {
1336 type: "TsTypeAliasDeclaration";
1337 declare: boolean;
1338 id: Identifier;
1339 typeParams?: TsTypeParameterDeclaration;
1340 typeAnnotation: TsType;
1341}
1342export interface TsEnumDeclaration extends Node, HasSpan {
1343 type: "TsEnumDeclaration";
1344 declare: boolean;
1345 is_const: boolean;
1346 id: Identifier;
1347 member: TsEnumMember[];
1348}
1349export interface TsEnumMember extends Node, HasSpan {
1350 type: "TsEnumMember";
1351 id: TsEnumMemberId;
1352 init?: Expression;
1353}
1354export declare type TsEnumMemberId = Identifier | StringLiteral;
1355export interface TsModuleDeclaration extends Node, HasSpan {
1356 type: "TsModuleDeclaration";
1357 declare: boolean;
1358 global: boolean;
1359 id: TsModuleName;
1360 body?: TsNamespaceBody;
1361}
1362/**
1363 * `namespace A.B { }` is a namespace named `A` with another TsNamespaceDecl as its body.
1364 */
1365export declare type TsNamespaceBody = TsModuleBlock | TsNamespaceDeclaration;
1366export interface TsModuleBlock extends Node, HasSpan {
1367 type: "TsModuleBlock";
1368 body: ModuleItem[];
1369}
1370export interface TsNamespaceDeclaration extends Node, HasSpan {
1371 type: "TsNamespaceDeclaration";
1372 declare: boolean;
1373 global: boolean;
1374 id: Identifier;
1375 body: TsNamespaceBody;
1376}
1377export declare type TsModuleName = Identifier | StringLiteral;
1378export interface TsImportEqualsDeclaration extends Node, HasSpan {
1379 type: "TsImportEqualsDeclaration";
1380 declare: boolean;
1381 is_export: boolean;
1382 id: Identifier;
1383 moduleRef: TsModuleReference;
1384}
1385export declare type TsModuleReference = TsEntityName | TsExternalModuleReference;
1386export interface TsExternalModuleReference extends Node, HasSpan {
1387 type: "TsExternalModuleReference";
1388 expression: Expression;
1389}
1390export interface TsExportAssignment extends Node, HasSpan {
1391 type: "TsExportAssignment";
1392 expression: Expression;
1393}
1394export interface TsNamespaceExportDeclaration extends Node, HasSpan {
1395 type: "TsNamespaceExportDeclaration";
1396 id: Identifier;
1397}
1398export interface TsAsExpression extends ExpressionBase {
1399 type: "TsAsExpression";
1400 expression: Expression;
1401 typeAnnotation: TsType;
1402}
1403export interface TsTypeAssertion extends ExpressionBase {
1404 type: "TsTypeAssertion";
1405 expression: Expression;
1406 typeAnnotation: TsType;
1407}
1408export interface TsNonNullExpression extends ExpressionBase {
1409 type: "TsNonNullExpression";
1410 expression: Expression;
1411}
1412export declare type Accessibility = "public" | "protected" | "private";
1413export interface Invalid extends Node, HasSpan {
1414 type: "Invalid";
1415}
1416export {};