@marko/compiler 5.33.0 → 5.33.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel-plugin/index.js +21 -21
- package/dist/babel-plugin/parser.js +125 -125
- package/dist/babel-types/traverse/patch.js +32 -32
- package/dist/babel-types/types/definitions.js +15 -13
- package/dist/babel-types/types/patch.js +8 -8
- package/dist/register.js +12 -12
- package/dist/taglib/finder/index.js +3 -3
- package/dist/taglib/index.js +9 -9
- package/dist/taglib/loader/Taglib.js +2 -2
- package/dist/taglib/loader/index.js +4 -4
- package/dist/taglib/loader/json-file-reader.js +2 -2
- package/dist/taglib/loader/loadAttributeFromProps.js +8 -8
- package/dist/taglib/loader/loadAttributes.js +4 -4
- package/dist/taglib/loader/loadTagFromProps.js +60 -45
- package/dist/taglib/loader/loadTaglibFromDir.js +6 -6
- package/dist/taglib/loader/loadTaglibFromProps.js +45 -45
- package/dist/taglib/loader/property-handlers.js +5 -5
- package/dist/taglib/loader/scanTagsDir.js +5 -5
- package/dist/traverse.d.ts +940 -658
- package/dist/util/build-code-frame.js +18 -18
- package/dist/util/merge-errors.js +2 -2
- package/package.json +2 -2
package/dist/traverse.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for @babel/traverse 7.
|
|
1
|
+
// Type definitions for @babel/traverse 7.20
|
|
2
2
|
// Project: https://github.com/babel/babel/tree/main/packages/babel-traverse, https://babeljs.io
|
|
3
3
|
// Definitions by: Troy Gerwien <https://github.com/yortus>
|
|
4
4
|
// Marvin Hagemeister <https://github.com/marvinhagemeister>
|
|
@@ -12,26 +12,30 @@
|
|
|
12
12
|
|
|
13
13
|
import * as t from './types';
|
|
14
14
|
type Node = t.Node
|
|
15
|
+
export import RemovePropertiesOptions = t.RemovePropertiesOptions;
|
|
15
16
|
|
|
16
17
|
declare const traverse: {
|
|
17
|
-
<S>(
|
|
18
|
-
|
|
19
|
-
opts: TraverseOptions<S>,
|
|
20
|
-
scope: Scope | undefined,
|
|
21
|
-
state: S,
|
|
22
|
-
parentPath?: NodePath,
|
|
23
|
-
): void;
|
|
24
|
-
(
|
|
25
|
-
parent: Node | Node[] | null | undefined,
|
|
26
|
-
opts?: TraverseOptions,
|
|
27
|
-
scope?: Scope,
|
|
28
|
-
state?: any,
|
|
29
|
-
parentPath?: NodePath,
|
|
30
|
-
): void;
|
|
18
|
+
<S>(parent: Node, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath): void;
|
|
19
|
+
(parent: Node, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
|
|
31
20
|
|
|
32
21
|
visitors: typeof visitors;
|
|
33
22
|
verify: typeof visitors.verify;
|
|
34
23
|
explode: typeof visitors.explode;
|
|
24
|
+
|
|
25
|
+
cheap: (node: Node, enter: (node: Node) => void) => void;
|
|
26
|
+
node: (
|
|
27
|
+
node: Node,
|
|
28
|
+
opts: TraverseOptions,
|
|
29
|
+
scope?: Scope,
|
|
30
|
+
state?: any,
|
|
31
|
+
path?: NodePath,
|
|
32
|
+
skipKeys?: Record<string, boolean>,
|
|
33
|
+
) => void;
|
|
34
|
+
clearNode: (node: Node, opts?: RemovePropertiesOptions) => void;
|
|
35
|
+
removeProperties: (tree: Node, opts?: RemovePropertiesOptions) => Node;
|
|
36
|
+
hasType: (tree: Node, type: Node['type'], denylistTypes?: string[]) => boolean;
|
|
37
|
+
|
|
38
|
+
cache: typeof cache;
|
|
35
39
|
};
|
|
36
40
|
|
|
37
41
|
export namespace visitors {
|
|
@@ -49,32 +53,66 @@ export namespace visitors {
|
|
|
49
53
|
* - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
|
|
50
54
|
* - `enter` and `exit` functions are wrapped in arrays, to ease merging of visitors
|
|
51
55
|
*/
|
|
52
|
-
function explode<S =
|
|
56
|
+
function explode<S = unknown>(
|
|
53
57
|
visitor: Visitor<S>,
|
|
54
58
|
): {
|
|
55
|
-
[Type in Node['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
|
|
59
|
+
[Type in Exclude<Node, t.DeprecatedAliases>['type']]?: VisitNodeObject<S, Extract<Node, { type: Type }>>;
|
|
56
60
|
};
|
|
57
61
|
function verify(visitor: Visitor): void;
|
|
58
|
-
function merge<
|
|
62
|
+
function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
|
|
63
|
+
function merge(
|
|
64
|
+
visitors: Visitor[],
|
|
65
|
+
states?: any[],
|
|
66
|
+
wrapper?: (
|
|
67
|
+
stateKey: any,
|
|
68
|
+
visitorKey: keyof Visitor,
|
|
69
|
+
func: VisitNodeFunction<unknown, Node>,
|
|
70
|
+
) => VisitNodeFunction<unknown, Node> | null,
|
|
71
|
+
): Visitor;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
|
-
export
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
74
|
+
export namespace cache {
|
|
75
|
+
let path: WeakMap<t.Node, Map<t.Node, NodePath>>;
|
|
76
|
+
let scope: WeakMap<t.Node, Scope>;
|
|
77
|
+
function clear(): void;
|
|
78
|
+
function clearPath(): void;
|
|
79
|
+
function clearScope(): void;
|
|
66
80
|
}
|
|
67
81
|
|
|
68
|
-
export
|
|
82
|
+
export default traverse;
|
|
83
|
+
|
|
84
|
+
export type TraverseOptions<S = Node> = {
|
|
85
|
+
scope?: Scope;
|
|
86
|
+
noScope?: boolean;
|
|
87
|
+
denylist?: NodeType[];
|
|
88
|
+
/** @deprecated will be removed in Babel 8 */
|
|
89
|
+
blacklist?: NodeType[];
|
|
90
|
+
shouldSkip?: (node: NodePath) => boolean;
|
|
91
|
+
} & Visitor<S>;
|
|
69
92
|
|
|
70
93
|
export class Scope {
|
|
94
|
+
/**
|
|
95
|
+
* This searches the current "scope" and collects all references/bindings
|
|
96
|
+
* within.
|
|
97
|
+
*/
|
|
71
98
|
constructor(path: NodePath, parentScope?: Scope);
|
|
99
|
+
uid: number;
|
|
72
100
|
path: NodePath;
|
|
73
101
|
block: Node;
|
|
102
|
+
labels: Map<string, NodePath<t.LabeledStatement>>;
|
|
74
103
|
parentBlock: Node;
|
|
75
104
|
parent: Scope;
|
|
76
105
|
hub: HubInterface;
|
|
77
106
|
bindings: { [name: string]: Binding };
|
|
107
|
+
references: { [name: string]: true };
|
|
108
|
+
globals: { [name: string]: t.Identifier | t.JSXIdentifier };
|
|
109
|
+
uids: { [name: string]: boolean };
|
|
110
|
+
data: Record<string | symbol, unknown>;
|
|
111
|
+
crawling: boolean;
|
|
112
|
+
|
|
113
|
+
static globals: string[];
|
|
114
|
+
/** Variables available in current context. */
|
|
115
|
+
static contextVariables: string[];
|
|
78
116
|
|
|
79
117
|
/** Traverse node with current scope and path. */
|
|
80
118
|
traverse<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
|
|
@@ -112,17 +150,27 @@ export class Scope {
|
|
|
112
150
|
|
|
113
151
|
dump(): void;
|
|
114
152
|
|
|
115
|
-
toArray(
|
|
153
|
+
toArray(
|
|
154
|
+
node: t.Node,
|
|
155
|
+
i?: number | boolean,
|
|
156
|
+
arrayLikeIsIterable?: boolean,
|
|
157
|
+
): t.ArrayExpression | t.CallExpression | t.Identifier;
|
|
158
|
+
|
|
159
|
+
hasLabel(name: string): boolean;
|
|
160
|
+
|
|
161
|
+
getLabel(name: string): NodePath<t.LabeledStatement> | undefined;
|
|
162
|
+
|
|
163
|
+
registerLabel(path: NodePath<t.LabeledStatement>): void;
|
|
116
164
|
|
|
117
165
|
registerDeclaration(path: NodePath): void;
|
|
118
166
|
|
|
119
|
-
buildUndefinedNode():
|
|
167
|
+
buildUndefinedNode(): t.UnaryExpression;
|
|
120
168
|
|
|
121
169
|
registerConstantViolation(path: NodePath): void;
|
|
122
170
|
|
|
123
|
-
registerBinding(kind:
|
|
171
|
+
registerBinding(kind: BindingKind, path: NodePath, bindingPath?: NodePath): void;
|
|
124
172
|
|
|
125
|
-
addGlobal(node:
|
|
173
|
+
addGlobal(node: t.Identifier | t.JSXIdentifier): void;
|
|
126
174
|
|
|
127
175
|
hasUid(name: string): boolean;
|
|
128
176
|
|
|
@@ -132,29 +180,56 @@ export class Scope {
|
|
|
132
180
|
|
|
133
181
|
isPure(node: Node, constantsOnly?: boolean): boolean;
|
|
134
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Set some arbitrary data on the current scope.
|
|
185
|
+
*/
|
|
135
186
|
setData(key: string, val: any): any;
|
|
136
187
|
|
|
188
|
+
/**
|
|
189
|
+
* Recursively walk up scope tree looking for the data `key`.
|
|
190
|
+
*/
|
|
137
191
|
getData(key: string): any;
|
|
138
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Recursively walk up scope tree looking for the data `key` and if it exists,
|
|
195
|
+
* remove it.
|
|
196
|
+
*/
|
|
139
197
|
removeData(key: string): void;
|
|
140
198
|
|
|
141
199
|
crawl(): void;
|
|
142
200
|
|
|
143
201
|
push(opts: {
|
|
144
202
|
id: t.LVal;
|
|
145
|
-
init?: t.Expression
|
|
146
|
-
unique?: boolean
|
|
147
|
-
|
|
203
|
+
init?: t.Expression;
|
|
204
|
+
unique?: boolean;
|
|
205
|
+
_blockHoist?: number | undefined;
|
|
206
|
+
kind?: 'var' | 'let' | 'const';
|
|
148
207
|
}): void;
|
|
149
208
|
|
|
209
|
+
/** Walk up to the top of the scope tree and get the `Program`. */
|
|
150
210
|
getProgramParent(): Scope;
|
|
151
211
|
|
|
212
|
+
/** Walk up the scope tree until we hit either a Function or return null. */
|
|
152
213
|
getFunctionParent(): Scope | null;
|
|
153
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the
|
|
217
|
+
* very top and hit Program.
|
|
218
|
+
*/
|
|
154
219
|
getBlockParent(): Scope;
|
|
155
220
|
|
|
221
|
+
/**
|
|
222
|
+
* Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope,
|
|
223
|
+
* then returns its block parent
|
|
224
|
+
* @returns An ancestry scope whose path is a block parent
|
|
225
|
+
*/
|
|
226
|
+
getPatternParent(): Scope;
|
|
227
|
+
|
|
156
228
|
/** Walks the scope tree and gathers **all** bindings. */
|
|
157
|
-
getAllBindings(
|
|
229
|
+
getAllBindings(): Record<string, Binding>;
|
|
230
|
+
|
|
231
|
+
/** Walks the scope tree and gathers all declarations of `kind`. */
|
|
232
|
+
getAllBindingsOfKind(...kinds: string[]): Record<string, Binding>;
|
|
158
233
|
|
|
159
234
|
bindingIdentifierEquals(name: string, node: Node): boolean;
|
|
160
235
|
|
|
@@ -168,9 +243,23 @@ export class Scope {
|
|
|
168
243
|
|
|
169
244
|
hasOwnBinding(name: string): boolean;
|
|
170
245
|
|
|
171
|
-
hasBinding(
|
|
172
|
-
|
|
173
|
-
|
|
246
|
+
hasBinding(
|
|
247
|
+
name: string,
|
|
248
|
+
optsOrNoGlobals?:
|
|
249
|
+
| boolean
|
|
250
|
+
| {
|
|
251
|
+
noGlobals?: boolean;
|
|
252
|
+
noUids?: boolean;
|
|
253
|
+
},
|
|
254
|
+
): boolean;
|
|
255
|
+
|
|
256
|
+
parentHasBinding(
|
|
257
|
+
name: string,
|
|
258
|
+
opts?: {
|
|
259
|
+
noGlobals?: boolean;
|
|
260
|
+
noUids?: boolean;
|
|
261
|
+
},
|
|
262
|
+
): boolean;
|
|
174
263
|
|
|
175
264
|
/** Move a binding of `name` to another `scope`. */
|
|
176
265
|
moveBindingTo(name: string, scope: Scope): void;
|
|
@@ -182,6 +271,16 @@ export class Scope {
|
|
|
182
271
|
|
|
183
272
|
export type BindingKind = 'var' | 'let' | 'const' | 'module' | 'hoisted' | 'param' | 'local' | 'unknown';
|
|
184
273
|
|
|
274
|
+
/**
|
|
275
|
+
* This class is responsible for a binding inside of a scope.
|
|
276
|
+
*
|
|
277
|
+
* It tracks the following:
|
|
278
|
+
*
|
|
279
|
+
* * Node path.
|
|
280
|
+
* * Amount of times referenced by other nodes.
|
|
281
|
+
* * Paths to nodes that reassign or modify this binding.
|
|
282
|
+
* * The kind of binding. (Is it a parameter, declaration etc)
|
|
283
|
+
*/
|
|
185
284
|
export class Binding {
|
|
186
285
|
constructor(opts: { identifier: t.Identifier; scope: Scope; path: NodePath; kind: BindingKind });
|
|
187
286
|
identifier: t.Identifier;
|
|
@@ -193,23 +292,33 @@ export class Binding {
|
|
|
193
292
|
referencePaths: NodePath[];
|
|
194
293
|
constant: boolean;
|
|
195
294
|
constantViolations: NodePath[];
|
|
196
|
-
hasDeoptedValue
|
|
197
|
-
hasValue
|
|
198
|
-
value
|
|
295
|
+
hasDeoptedValue: boolean;
|
|
296
|
+
hasValue: boolean;
|
|
297
|
+
value: any;
|
|
199
298
|
|
|
200
299
|
deopValue(): void;
|
|
201
300
|
setValue(value: any): void;
|
|
202
301
|
clearValue(): void;
|
|
203
302
|
|
|
303
|
+
/** Register a constant violation with the provided `path`. */
|
|
204
304
|
reassign(path: NodePath): void;
|
|
305
|
+
/** Increment the amount of references to this binding. */
|
|
205
306
|
reference(path: NodePath): void;
|
|
307
|
+
/** Decrement the amount of references to this binding. */
|
|
206
308
|
dereference(): void;
|
|
207
309
|
}
|
|
208
310
|
|
|
209
|
-
export type Visitor<S =
|
|
311
|
+
export type Visitor<S = unknown> = VisitNodeObject<S, Node> & {
|
|
210
312
|
[Type in Node['type']]?: VisitNode<S, Extract<Node, { type: Type }>>;
|
|
211
313
|
} & {
|
|
212
314
|
[K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>;
|
|
315
|
+
} & {
|
|
316
|
+
[K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]>;
|
|
317
|
+
} & {
|
|
318
|
+
// Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
|
|
319
|
+
// too complex for TS. So we type it as a general visitor only if the key contains `|`
|
|
320
|
+
// this is good enough for non-visitor traverse options e.g. `noScope`
|
|
321
|
+
[k: `${string}|${string}`]: VisitNode<S, Node>;
|
|
213
322
|
};
|
|
214
323
|
|
|
215
324
|
export type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
|
@@ -219,74 +328,88 @@ export type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>,
|
|
|
219
328
|
type NodeType = Node['type'] | keyof t.Aliases;
|
|
220
329
|
|
|
221
330
|
export interface VisitNodeObject<S, P extends Node> {
|
|
222
|
-
enter?: VisitNodeFunction<S, P
|
|
223
|
-
exit?: VisitNodeFunction<S, P
|
|
224
|
-
denylist?: NodeType[] | undefined;
|
|
225
|
-
/**
|
|
226
|
-
* @deprecated will be removed in Babel 8
|
|
227
|
-
*/
|
|
228
|
-
blacklist?: NodeType[] | undefined;
|
|
331
|
+
enter?: VisitNodeFunction<S, P>;
|
|
332
|
+
exit?: VisitNodeFunction<S, P>;
|
|
229
333
|
}
|
|
230
334
|
|
|
335
|
+
export type NodeKeyOfArrays<T extends Node> = {
|
|
336
|
+
[P in keyof T]-?: T[P] extends Array<Node | null | undefined> ? P : never;
|
|
337
|
+
}[keyof T];
|
|
338
|
+
|
|
339
|
+
export type NodeKeyOfNodes<T extends Node> = {
|
|
340
|
+
[P in keyof T]-?: T[P] extends Node | null | undefined ? P : never;
|
|
341
|
+
}[keyof T];
|
|
342
|
+
|
|
231
343
|
export type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[]
|
|
232
344
|
? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> }
|
|
233
345
|
: T extends Node
|
|
234
346
|
? [NodePath<T>]
|
|
235
347
|
: never;
|
|
236
348
|
|
|
349
|
+
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
|
|
350
|
+
|
|
351
|
+
type NodesInsertionParam<T extends Node> = T | readonly T[] | [T, ...T[]];
|
|
352
|
+
|
|
237
353
|
export class NodePath<T = Node> {
|
|
238
|
-
constructor(hub:
|
|
354
|
+
constructor(hub: HubInterface, parent: Node);
|
|
239
355
|
parent: Node;
|
|
240
356
|
hub: Hub;
|
|
357
|
+
data: Record<string | symbol, unknown>;
|
|
358
|
+
context: TraversalContext;
|
|
359
|
+
scope: Scope;
|
|
241
360
|
contexts: TraversalContext[];
|
|
242
|
-
|
|
361
|
+
state: any;
|
|
362
|
+
opts: any; // exploded TraverseOptions
|
|
363
|
+
skipKeys: Record<string, boolean> | null;
|
|
364
|
+
parentPath: T extends t.Program ? null : NodePath;
|
|
365
|
+
container: Node | Node[] | null;
|
|
366
|
+
listKey: string | null;
|
|
367
|
+
key: string | number | null;
|
|
368
|
+
node: T;
|
|
369
|
+
type: T extends Node ? T['type'] : T extends null | undefined ? undefined : Node['type'] | undefined;
|
|
243
370
|
shouldSkip: boolean;
|
|
244
371
|
shouldStop: boolean;
|
|
245
372
|
removed: boolean;
|
|
246
|
-
state: any;
|
|
247
|
-
opts: object;
|
|
248
|
-
skipKeys: object;
|
|
249
|
-
parentPath: T extends t.Program ? null : NodePath;
|
|
250
|
-
context: TraversalContext;
|
|
251
|
-
container: object | object[];
|
|
252
|
-
listKey: string;
|
|
253
373
|
inList: boolean;
|
|
254
374
|
parentKey: string;
|
|
255
|
-
key: string | number;
|
|
256
|
-
node: T;
|
|
257
|
-
scope: Scope;
|
|
258
|
-
type: T extends null | undefined ? undefined : T extends Node ? T['type'] : string | undefined;
|
|
259
375
|
typeAnnotation: object;
|
|
260
376
|
|
|
377
|
+
static get<C extends Node, K extends keyof C>(opts: {
|
|
378
|
+
hub?: HubInterface;
|
|
379
|
+
parentPath: NodePath | null;
|
|
380
|
+
parent: Node;
|
|
381
|
+
container: C;
|
|
382
|
+
key: K;
|
|
383
|
+
}): NodePath<C[K]>;
|
|
384
|
+
static get<C extends Node, L extends NodeKeyOfArrays<C>>(opts: {
|
|
385
|
+
hub?: HubInterface;
|
|
386
|
+
parentPath: NodePath | null;
|
|
387
|
+
parent: Node;
|
|
388
|
+
container: C;
|
|
389
|
+
listKey: L;
|
|
390
|
+
key: number;
|
|
391
|
+
}): C[L] extends Array<Node | null | undefined> ? NodePath<C[L][number]> : never;
|
|
392
|
+
|
|
261
393
|
getScope(scope: Scope): Scope;
|
|
262
394
|
|
|
263
|
-
setData(key: string, val: any): any;
|
|
395
|
+
setData(key: string | symbol, val: any): any;
|
|
264
396
|
|
|
265
|
-
getData(key: string, def?: any): any;
|
|
397
|
+
getData(key: string | symbol, def?: any): any;
|
|
266
398
|
|
|
267
|
-
hasNode(): this is NodePath<
|
|
399
|
+
hasNode(): this is NodePath<Exclude<T, null | undefined>>;
|
|
268
400
|
|
|
269
|
-
buildCodeFrameError
|
|
401
|
+
buildCodeFrameError(msg: string, Error?: ErrorConstructor): Error;
|
|
270
402
|
|
|
271
403
|
traverse<T>(visitor: Visitor<T>, state: T): void;
|
|
272
404
|
traverse(visitor: Visitor): void;
|
|
273
405
|
|
|
274
|
-
set(key: string, node:
|
|
406
|
+
set(key: string, node: any): void;
|
|
275
407
|
|
|
276
408
|
getPathLocation(): string;
|
|
277
409
|
|
|
278
410
|
// Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
|
|
279
411
|
debug(buildMessage: () => string): void;
|
|
280
412
|
|
|
281
|
-
static get<C extends Node, K extends keyof C>(opts: {
|
|
282
|
-
hub: HubInterface;
|
|
283
|
-
parentPath: NodePath | null;
|
|
284
|
-
parent: Node;
|
|
285
|
-
container: C;
|
|
286
|
-
listKey?: string | undefined;
|
|
287
|
-
key: K;
|
|
288
|
-
}): NodePath<C[K]>;
|
|
289
|
-
|
|
290
413
|
//#region ------------------------- ancestry -------------------------
|
|
291
414
|
/**
|
|
292
415
|
* Starting at the parent path of the current `NodePath` and going up the
|
|
@@ -321,7 +444,7 @@ export class NodePath<T = Node> {
|
|
|
321
444
|
/** Get the earliest path in the tree where the provided `paths` intersect. */
|
|
322
445
|
getDeepestCommonAncestorFrom(
|
|
323
446
|
paths: NodePath[],
|
|
324
|
-
filter?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath,
|
|
447
|
+
filter?: (deepest: Node, i: number, ancestries: NodePath[][]) => NodePath,
|
|
325
448
|
): NodePath;
|
|
326
449
|
|
|
327
450
|
/**
|
|
@@ -346,13 +469,13 @@ export class NodePath<T = Node> {
|
|
|
346
469
|
|
|
347
470
|
//#region ------------------------- inference -------------------------
|
|
348
471
|
/** Infer the type of the current `NodePath`. */
|
|
349
|
-
getTypeAnnotation(): t.FlowType;
|
|
472
|
+
getTypeAnnotation(): t.FlowType | t.TSType;
|
|
350
473
|
|
|
351
474
|
isBaseType(baseName: string, soft?: boolean): boolean;
|
|
352
475
|
|
|
353
476
|
couldBeBaseType(name: string): boolean;
|
|
354
477
|
|
|
355
|
-
baseTypeStrictlyMatches(
|
|
478
|
+
baseTypeStrictlyMatches(rightArg: NodePath): boolean;
|
|
356
479
|
|
|
357
480
|
isGenericType(genericName: string): boolean;
|
|
358
481
|
//#endregion
|
|
@@ -365,7 +488,7 @@ export class NodePath<T = Node> {
|
|
|
365
488
|
* - Insert the provided nodes after the current node.
|
|
366
489
|
* - Remove the current node.
|
|
367
490
|
*/
|
|
368
|
-
replaceWithMultiple<Nodes extends readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
|
491
|
+
replaceWithMultiple<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
369
492
|
|
|
370
493
|
/**
|
|
371
494
|
* Parse a string as an expression and replace the current node with the result.
|
|
@@ -374,19 +497,20 @@ export class NodePath<T = Node> {
|
|
|
374
497
|
* transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's
|
|
375
498
|
* easier to use, your transforms will be extremely brittle.
|
|
376
499
|
*/
|
|
377
|
-
replaceWithSourceString(replacement:
|
|
500
|
+
replaceWithSourceString(replacement: string): [NodePath];
|
|
378
501
|
|
|
379
502
|
/** Replace the current node with another. */
|
|
380
|
-
replaceWith<
|
|
503
|
+
replaceWith<R extends Node>(replacementPath: R | NodePath<R>): [NodePath<R>];
|
|
504
|
+
replaceWith<R extends NodePath>(replacementPath: R): [R];
|
|
381
505
|
|
|
382
506
|
/**
|
|
383
507
|
* This method takes an array of statements nodes and then explodes it
|
|
384
508
|
* into expressions. This method retains completion records which is
|
|
385
509
|
* extremely important to retain original semantics.
|
|
386
510
|
*/
|
|
387
|
-
replaceExpressionWithStatements
|
|
511
|
+
replaceExpressionWithStatements(nodes: t.Statement[]): NodePaths<t.Expression | t.Statement>;
|
|
388
512
|
|
|
389
|
-
replaceInline<Nodes extends Node | readonly Node[]>(nodes: Nodes): NodePaths<Nodes>;
|
|
513
|
+
replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
390
514
|
//#endregion
|
|
391
515
|
|
|
392
516
|
//#region ------------------------- evaluation -------------------------
|
|
@@ -398,22 +522,28 @@ export class NodePath<T = Node> {
|
|
|
398
522
|
* value and `undefined` if we aren't sure. Because of this please do not
|
|
399
523
|
* rely on coercion when using this method and check with === if it's false.
|
|
400
524
|
*/
|
|
401
|
-
evaluateTruthy(): boolean;
|
|
525
|
+
evaluateTruthy(): boolean | undefined;
|
|
402
526
|
|
|
403
527
|
/**
|
|
404
528
|
* Walk the input `node` and statically evaluate it.
|
|
405
529
|
*
|
|
406
|
-
* Returns an object in the form `{ confident, value }`. `confident`
|
|
407
|
-
* whether or not we had to drop out of evaluating the expression
|
|
408
|
-
* hitting an unknown node that we couldn't confidently find the
|
|
530
|
+
* Returns an object in the form `{ confident, value, deopt }`. `confident`
|
|
531
|
+
* indicates whether or not we had to drop out of evaluating the expression
|
|
532
|
+
* because of hitting an unknown node that we couldn't confidently find the
|
|
533
|
+
* value of, in which case `deopt` is the path of said node.
|
|
409
534
|
*
|
|
410
535
|
* Example:
|
|
411
536
|
*
|
|
412
537
|
* t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
|
|
413
538
|
* t.evaluate(parse("!true")) // { confident: true, value: false }
|
|
414
|
-
* t.evaluate(parse("foo + foo")) // { confident: false, value: undefined }
|
|
539
|
+
* t.evaluate(parse("foo + foo")) // { confident: false, value: undefined, deopt: NodePath }
|
|
540
|
+
*
|
|
415
541
|
*/
|
|
416
|
-
evaluate(): {
|
|
542
|
+
evaluate(): {
|
|
543
|
+
confident: boolean;
|
|
544
|
+
value: any;
|
|
545
|
+
deopt?: NodePath;
|
|
546
|
+
};
|
|
417
547
|
//#endregion
|
|
418
548
|
|
|
419
549
|
//#region ------------------------- introspection -------------------------
|
|
@@ -430,17 +560,21 @@ export class NodePath<T = Node> {
|
|
|
430
560
|
* if the array has any items, otherwise we just check if it's falsy.
|
|
431
561
|
*/
|
|
432
562
|
has(key: string): boolean;
|
|
563
|
+
// has(key: keyof T): boolean;
|
|
433
564
|
|
|
434
565
|
isStatic(): boolean;
|
|
435
566
|
|
|
436
567
|
/** Alias of `has`. */
|
|
437
568
|
is(key: string): boolean;
|
|
569
|
+
// is(key: keyof T): boolean;
|
|
438
570
|
|
|
439
571
|
/** Opposite of `has`. */
|
|
440
572
|
isnt(key: string): boolean;
|
|
573
|
+
// isnt(key: keyof T): boolean;
|
|
441
574
|
|
|
442
575
|
/** Check whether the path node `key` strict equals `value`. */
|
|
443
576
|
equals(key: string, value: any): boolean;
|
|
577
|
+
// equals(key: keyof T, value: any): boolean;
|
|
444
578
|
|
|
445
579
|
/**
|
|
446
580
|
* Check the type against our stored internal type of the node. This is handy when a node has
|
|
@@ -484,12 +618,21 @@ export class NodePath<T = Node> {
|
|
|
484
618
|
getSource(): string;
|
|
485
619
|
|
|
486
620
|
/** Check if the current path will maybe execute before another path */
|
|
487
|
-
willIMaybeExecuteBefore(
|
|
621
|
+
willIMaybeExecuteBefore(target: NodePath): boolean;
|
|
622
|
+
|
|
623
|
+
resolve(dangerous?: boolean, resolved?: NodePath[]): NodePath;
|
|
624
|
+
|
|
625
|
+
isConstantExpression(): boolean;
|
|
626
|
+
|
|
627
|
+
isInStrictMode(): boolean;
|
|
488
628
|
//#endregion
|
|
489
629
|
|
|
490
630
|
//#region ------------------------- context -------------------------
|
|
491
631
|
call(key: string): boolean;
|
|
492
632
|
|
|
633
|
+
isDenylisted(): boolean;
|
|
634
|
+
|
|
635
|
+
/** @deprecated will be removed in Babel 8 */
|
|
493
636
|
isBlacklisted(): boolean;
|
|
494
637
|
|
|
495
638
|
visit(): boolean;
|
|
@@ -504,24 +647,72 @@ export class NodePath<T = Node> {
|
|
|
504
647
|
|
|
505
648
|
setContext(context?: TraversalContext): this;
|
|
506
649
|
|
|
650
|
+
/**
|
|
651
|
+
* Here we resync the node paths `key` and `container`. If they've changed according
|
|
652
|
+
* to what we have stored internally then we attempt to resync by crawling and looking
|
|
653
|
+
* for the new values.
|
|
654
|
+
*/
|
|
655
|
+
resync(): void;
|
|
656
|
+
|
|
507
657
|
popContext(): void;
|
|
508
658
|
|
|
509
659
|
pushContext(context: TraversalContext): void;
|
|
660
|
+
|
|
661
|
+
requeue(pathToQueue?: NodePath): void;
|
|
510
662
|
//#endregion
|
|
511
663
|
|
|
512
664
|
//#region ------------------------- removal -------------------------
|
|
513
665
|
remove(): void;
|
|
514
666
|
//#endregion
|
|
515
667
|
|
|
668
|
+
//#region ------------------------- conversion -------------------------
|
|
669
|
+
toComputedKey(): t.PrivateName | t.Expression;
|
|
670
|
+
|
|
671
|
+
/** @deprecated Use `arrowFunctionToExpression` */
|
|
672
|
+
arrowFunctionToShadowed(): void;
|
|
673
|
+
|
|
674
|
+
/**
|
|
675
|
+
* Given an arbitrary function, process its content as if it were an arrow function, moving references
|
|
676
|
+
* to "this", "arguments", "super", and such into the function's parent scope. This method is useful if
|
|
677
|
+
* you have wrapped some set of items in an IIFE or other function, but want "this", "arguments", and super"
|
|
678
|
+
* to continue behaving as expected.
|
|
679
|
+
*/
|
|
680
|
+
unwrapFunctionEnvironment(): void;
|
|
681
|
+
|
|
682
|
+
/**
|
|
683
|
+
* Convert a given arrow function into a normal ES5 function expression.
|
|
684
|
+
*/
|
|
685
|
+
arrowFunctionToExpression({
|
|
686
|
+
allowInsertArrow,
|
|
687
|
+
allowInsertArrowWithRest,
|
|
688
|
+
/** @deprecated Use `noNewArrows` instead */
|
|
689
|
+
specCompliant,
|
|
690
|
+
noNewArrows,
|
|
691
|
+
}?: {
|
|
692
|
+
allowInsertArrow?: boolean;
|
|
693
|
+
allowInsertArrowWithRest?: boolean;
|
|
694
|
+
specCompliant?: boolean;
|
|
695
|
+
noNewArrows?: boolean;
|
|
696
|
+
}): NodePath<Exclude<t.Function, t.Method | t.ArrowFunctionExpression> | t.CallExpression>;
|
|
697
|
+
|
|
698
|
+
ensureBlock(
|
|
699
|
+
this: NodePath<t.Loop | t.WithStatement | t.Function | t.LabeledStatement | t.CatchClause>,
|
|
700
|
+
): asserts this is NodePath<
|
|
701
|
+
T & {
|
|
702
|
+
body: t.BlockStatement;
|
|
703
|
+
}
|
|
704
|
+
>;
|
|
705
|
+
//#endregion
|
|
706
|
+
|
|
516
707
|
//#region ------------------------- modification -------------------------
|
|
517
708
|
/** Insert the provided nodes before the current one. */
|
|
518
|
-
insertBefore<Nodes extends Node
|
|
709
|
+
insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
519
710
|
|
|
520
711
|
/**
|
|
521
712
|
* Insert the provided nodes after the current one. When inserting nodes after an
|
|
522
713
|
* expression, ensure that the completion record is correct by pushing the current node.
|
|
523
714
|
*/
|
|
524
|
-
insertAfter<Nodes extends Node
|
|
715
|
+
insertAfter<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
525
716
|
|
|
526
717
|
/** Update all sibling node paths after `fromIndex` by `incrementBy`. */
|
|
527
718
|
updateSiblingKeys(fromIndex: number, incrementBy: number): void;
|
|
@@ -531,21 +722,29 @@ export class NodePath<T = Node> {
|
|
|
531
722
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
532
723
|
* @param nodes - the nodes to insert.
|
|
533
724
|
*/
|
|
534
|
-
unshiftContainer<
|
|
725
|
+
unshiftContainer<
|
|
726
|
+
T extends Node,
|
|
727
|
+
K extends NodeKeyOfArrays<T>,
|
|
728
|
+
Nodes extends NodesInsertionParam<NodeListType<T, K>>,
|
|
729
|
+
>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
535
730
|
|
|
536
731
|
/**
|
|
537
732
|
* Insert child nodes at the end of the current node.
|
|
538
733
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
539
734
|
* @param nodes - the nodes to insert.
|
|
540
735
|
*/
|
|
541
|
-
pushContainer<
|
|
736
|
+
pushContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(
|
|
737
|
+
this: NodePath<T>,
|
|
738
|
+
listKey: K,
|
|
739
|
+
nodes: Nodes,
|
|
740
|
+
): NodePaths<Nodes>;
|
|
542
741
|
|
|
543
742
|
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
|
544
743
|
hoist(scope: Scope): void;
|
|
545
744
|
//#endregion
|
|
546
745
|
|
|
547
746
|
//#region ------------------------- family -------------------------
|
|
548
|
-
getOpposite(): NodePath;
|
|
747
|
+
getOpposite(): NodePath | null;
|
|
549
748
|
|
|
550
749
|
getCompletionRecords(): NodePath[];
|
|
551
750
|
|
|
@@ -585,10 +784,10 @@ export class NodePath<T = Node> {
|
|
|
585
784
|
/** Share comments amongst siblings. */
|
|
586
785
|
shareCommentsWithSiblings(): void;
|
|
587
786
|
|
|
588
|
-
addComment(type:
|
|
787
|
+
addComment(type: t.CommentTypeShorthand, content: string, line?: boolean): void;
|
|
589
788
|
|
|
590
789
|
/** Give node `comments` of the specified `type`. */
|
|
591
|
-
addComments(type:
|
|
790
|
+
addComments(type: t.CommentTypeShorthand, comments: t.Comment[]): void;
|
|
592
791
|
//#endregion
|
|
593
792
|
|
|
594
793
|
//#region ------------------------- isXXX -------------------------
|
|
@@ -605,294 +804,334 @@ export class NodePath<T = Node> {
|
|
|
605
804
|
isMarkoSpreadAttribute(props?: object | null): this is NodePath<t.MarkoSpreadAttribute>;
|
|
606
805
|
isMarkoTagBody(props?: object | null): this is NodePath<t.MarkoTagBody>;
|
|
607
806
|
isMarkoTag(props?: object | null): this is NodePath<t.MarkoTag>;
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
807
|
+
isAccessor(opts?: object): this is NodePath<t.Accessor>;
|
|
808
|
+
isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
|
|
809
|
+
isArgumentPlaceholder(opts?: object): this is NodePath<t.ArgumentPlaceholder>;
|
|
810
|
+
isArrayExpression(opts?: object): this is NodePath<t.ArrayExpression>;
|
|
811
|
+
isArrayPattern(opts?: object): this is NodePath<t.ArrayPattern>;
|
|
812
|
+
isArrayTypeAnnotation(opts?: object): this is NodePath<t.ArrayTypeAnnotation>;
|
|
813
|
+
isArrowFunctionExpression(opts?: object): this is NodePath<t.ArrowFunctionExpression>;
|
|
814
|
+
isAssignmentExpression(opts?: object): this is NodePath<t.AssignmentExpression>;
|
|
815
|
+
isAssignmentPattern(opts?: object): this is NodePath<t.AssignmentPattern>;
|
|
816
|
+
isAwaitExpression(opts?: object): this is NodePath<t.AwaitExpression>;
|
|
817
|
+
isBigIntLiteral(opts?: object): this is NodePath<t.BigIntLiteral>;
|
|
818
|
+
isBinary(opts?: object): this is NodePath<t.Binary>;
|
|
819
|
+
isBinaryExpression(opts?: object): this is NodePath<t.BinaryExpression>;
|
|
820
|
+
isBindExpression(opts?: object): this is NodePath<t.BindExpression>;
|
|
821
|
+
isBlock(opts?: object): this is NodePath<t.Block>;
|
|
822
|
+
isBlockParent(opts?: object): this is NodePath<t.BlockParent>;
|
|
823
|
+
isBlockStatement(opts?: object): this is NodePath<t.BlockStatement>;
|
|
824
|
+
isBooleanLiteral(opts?: object): this is NodePath<t.BooleanLiteral>;
|
|
825
|
+
isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<t.BooleanLiteralTypeAnnotation>;
|
|
826
|
+
isBooleanTypeAnnotation(opts?: object): this is NodePath<t.BooleanTypeAnnotation>;
|
|
827
|
+
isBreakStatement(opts?: object): this is NodePath<t.BreakStatement>;
|
|
828
|
+
isCallExpression(opts?: object): this is NodePath<t.CallExpression>;
|
|
829
|
+
isCatchClause(opts?: object): this is NodePath<t.CatchClause>;
|
|
830
|
+
isClass(opts?: object): this is NodePath<t.Class>;
|
|
831
|
+
isClassAccessorProperty(opts?: object): this is NodePath<t.ClassAccessorProperty>;
|
|
832
|
+
isClassBody(opts?: object): this is NodePath<t.ClassBody>;
|
|
833
|
+
isClassDeclaration(opts?: object): this is NodePath<t.ClassDeclaration>;
|
|
834
|
+
isClassExpression(opts?: object): this is NodePath<t.ClassExpression>;
|
|
835
|
+
isClassImplements(opts?: object): this is NodePath<t.ClassImplements>;
|
|
836
|
+
isClassMethod(opts?: object): this is NodePath<t.ClassMethod>;
|
|
837
|
+
isClassPrivateMethod(opts?: object): this is NodePath<t.ClassPrivateMethod>;
|
|
838
|
+
isClassPrivateProperty(opts?: object): this is NodePath<t.ClassPrivateProperty>;
|
|
839
|
+
isClassProperty(opts?: object): this is NodePath<t.ClassProperty>;
|
|
840
|
+
isCompletionStatement(opts?: object): this is NodePath<t.CompletionStatement>;
|
|
841
|
+
isConditional(opts?: object): this is NodePath<t.Conditional>;
|
|
842
|
+
isConditionalExpression(opts?: object): this is NodePath<t.ConditionalExpression>;
|
|
843
|
+
isContinueStatement(opts?: object): this is NodePath<t.ContinueStatement>;
|
|
844
|
+
isDebuggerStatement(opts?: object): this is NodePath<t.DebuggerStatement>;
|
|
845
|
+
isDecimalLiteral(opts?: object): this is NodePath<t.DecimalLiteral>;
|
|
846
|
+
isDeclaration(opts?: object): this is NodePath<t.Declaration>;
|
|
847
|
+
isDeclareClass(opts?: object): this is NodePath<t.DeclareClass>;
|
|
848
|
+
isDeclareExportAllDeclaration(opts?: object): this is NodePath<t.DeclareExportAllDeclaration>;
|
|
849
|
+
isDeclareExportDeclaration(opts?: object): this is NodePath<t.DeclareExportDeclaration>;
|
|
850
|
+
isDeclareFunction(opts?: object): this is NodePath<t.DeclareFunction>;
|
|
851
|
+
isDeclareInterface(opts?: object): this is NodePath<t.DeclareInterface>;
|
|
852
|
+
isDeclareModule(opts?: object): this is NodePath<t.DeclareModule>;
|
|
853
|
+
isDeclareModuleExports(opts?: object): this is NodePath<t.DeclareModuleExports>;
|
|
854
|
+
isDeclareOpaqueType(opts?: object): this is NodePath<t.DeclareOpaqueType>;
|
|
855
|
+
isDeclareTypeAlias(opts?: object): this is NodePath<t.DeclareTypeAlias>;
|
|
856
|
+
isDeclareVariable(opts?: object): this is NodePath<t.DeclareVariable>;
|
|
857
|
+
isDeclaredPredicate(opts?: object): this is NodePath<t.DeclaredPredicate>;
|
|
858
|
+
isDecorator(opts?: object): this is NodePath<t.Decorator>;
|
|
859
|
+
isDirective(opts?: object): this is NodePath<t.Directive>;
|
|
860
|
+
isDirectiveLiteral(opts?: object): this is NodePath<t.DirectiveLiteral>;
|
|
861
|
+
isDoExpression(opts?: object): this is NodePath<t.DoExpression>;
|
|
862
|
+
isDoWhileStatement(opts?: object): this is NodePath<t.DoWhileStatement>;
|
|
863
|
+
isEmptyStatement(opts?: object): this is NodePath<t.EmptyStatement>;
|
|
864
|
+
isEmptyTypeAnnotation(opts?: object): this is NodePath<t.EmptyTypeAnnotation>;
|
|
865
|
+
isEnumBody(opts?: object): this is NodePath<t.EnumBody>;
|
|
866
|
+
isEnumBooleanBody(opts?: object): this is NodePath<t.EnumBooleanBody>;
|
|
867
|
+
isEnumBooleanMember(opts?: object): this is NodePath<t.EnumBooleanMember>;
|
|
868
|
+
isEnumDeclaration(opts?: object): this is NodePath<t.EnumDeclaration>;
|
|
869
|
+
isEnumDefaultedMember(opts?: object): this is NodePath<t.EnumDefaultedMember>;
|
|
870
|
+
isEnumMember(opts?: object): this is NodePath<t.EnumMember>;
|
|
871
|
+
isEnumNumberBody(opts?: object): this is NodePath<t.EnumNumberBody>;
|
|
872
|
+
isEnumNumberMember(opts?: object): this is NodePath<t.EnumNumberMember>;
|
|
873
|
+
isEnumStringBody(opts?: object): this is NodePath<t.EnumStringBody>;
|
|
874
|
+
isEnumStringMember(opts?: object): this is NodePath<t.EnumStringMember>;
|
|
875
|
+
isEnumSymbolBody(opts?: object): this is NodePath<t.EnumSymbolBody>;
|
|
876
|
+
isExistsTypeAnnotation(opts?: object): this is NodePath<t.ExistsTypeAnnotation>;
|
|
877
|
+
isExportAllDeclaration(opts?: object): this is NodePath<t.ExportAllDeclaration>;
|
|
878
|
+
isExportDeclaration(opts?: object): this is NodePath<t.ExportDeclaration>;
|
|
879
|
+
isExportDefaultDeclaration(opts?: object): this is NodePath<t.ExportDefaultDeclaration>;
|
|
880
|
+
isExportDefaultSpecifier(opts?: object): this is NodePath<t.ExportDefaultSpecifier>;
|
|
881
|
+
isExportNamedDeclaration(opts?: object): this is NodePath<t.ExportNamedDeclaration>;
|
|
882
|
+
isExportNamespaceSpecifier(opts?: object): this is NodePath<t.ExportNamespaceSpecifier>;
|
|
883
|
+
isExportSpecifier(opts?: object): this is NodePath<t.ExportSpecifier>;
|
|
884
|
+
isExpression(opts?: object): this is NodePath<t.Expression>;
|
|
885
|
+
isExpressionStatement(opts?: object): this is NodePath<t.ExpressionStatement>;
|
|
886
|
+
isExpressionWrapper(opts?: object): this is NodePath<t.ExpressionWrapper>;
|
|
887
|
+
isFile(opts?: object): this is NodePath<t.File>;
|
|
888
|
+
isFlow(opts?: object): this is NodePath<t.Flow>;
|
|
889
|
+
isFlowBaseAnnotation(opts?: object): this is NodePath<t.FlowBaseAnnotation>;
|
|
890
|
+
isFlowDeclaration(opts?: object): this is NodePath<t.FlowDeclaration>;
|
|
891
|
+
isFlowPredicate(opts?: object): this is NodePath<t.FlowPredicate>;
|
|
892
|
+
isFlowType(opts?: object): this is NodePath<t.FlowType>;
|
|
893
|
+
isFor(opts?: object): this is NodePath<t.For>;
|
|
894
|
+
isForInStatement(opts?: object): this is NodePath<t.ForInStatement>;
|
|
895
|
+
isForOfStatement(opts?: object): this is NodePath<t.ForOfStatement>;
|
|
896
|
+
isForStatement(opts?: object): this is NodePath<t.ForStatement>;
|
|
897
|
+
isForXStatement(opts?: object): this is NodePath<t.ForXStatement>;
|
|
898
|
+
isFunction(opts?: object): this is NodePath<t.Function>;
|
|
899
|
+
isFunctionDeclaration(opts?: object): this is NodePath<t.FunctionDeclaration>;
|
|
900
|
+
isFunctionExpression(opts?: object): this is NodePath<t.FunctionExpression>;
|
|
901
|
+
isFunctionParent(opts?: object): this is NodePath<t.FunctionParent>;
|
|
902
|
+
isFunctionTypeAnnotation(opts?: object): this is NodePath<t.FunctionTypeAnnotation>;
|
|
903
|
+
isFunctionTypeParam(opts?: object): this is NodePath<t.FunctionTypeParam>;
|
|
904
|
+
isGenericTypeAnnotation(opts?: object): this is NodePath<t.GenericTypeAnnotation>;
|
|
905
|
+
isIdentifier(opts?: object): this is NodePath<t.Identifier>;
|
|
906
|
+
isIfStatement(opts?: object): this is NodePath<t.IfStatement>;
|
|
907
|
+
isImmutable(opts?: object): this is NodePath<t.Immutable>;
|
|
908
|
+
isImport(opts?: object): this is NodePath<t.Import>;
|
|
909
|
+
isImportAttribute(opts?: object): this is NodePath<t.ImportAttribute>;
|
|
910
|
+
isImportDeclaration(opts?: object): this is NodePath<t.ImportDeclaration>;
|
|
911
|
+
isImportDefaultSpecifier(opts?: object): this is NodePath<t.ImportDefaultSpecifier>;
|
|
912
|
+
isImportNamespaceSpecifier(opts?: object): this is NodePath<t.ImportNamespaceSpecifier>;
|
|
913
|
+
isImportSpecifier(opts?: object): this is NodePath<t.ImportSpecifier>;
|
|
914
|
+
isIndexedAccessType(opts?: object): this is NodePath<t.IndexedAccessType>;
|
|
915
|
+
isInferredPredicate(opts?: object): this is NodePath<t.InferredPredicate>;
|
|
916
|
+
isInterfaceDeclaration(opts?: object): this is NodePath<t.InterfaceDeclaration>;
|
|
917
|
+
isInterfaceExtends(opts?: object): this is NodePath<t.InterfaceExtends>;
|
|
918
|
+
isInterfaceTypeAnnotation(opts?: object): this is NodePath<t.InterfaceTypeAnnotation>;
|
|
919
|
+
isInterpreterDirective(opts?: object): this is NodePath<t.InterpreterDirective>;
|
|
920
|
+
isIntersectionTypeAnnotation(opts?: object): this is NodePath<t.IntersectionTypeAnnotation>;
|
|
921
|
+
isJSX(opts?: object): this is NodePath<t.JSX>;
|
|
922
|
+
isJSXAttribute(opts?: object): this is NodePath<t.JSXAttribute>;
|
|
923
|
+
isJSXClosingElement(opts?: object): this is NodePath<t.JSXClosingElement>;
|
|
924
|
+
isJSXClosingFragment(opts?: object): this is NodePath<t.JSXClosingFragment>;
|
|
925
|
+
isJSXElement(opts?: object): this is NodePath<t.JSXElement>;
|
|
926
|
+
isJSXEmptyExpression(opts?: object): this is NodePath<t.JSXEmptyExpression>;
|
|
927
|
+
isJSXExpressionContainer(opts?: object): this is NodePath<t.JSXExpressionContainer>;
|
|
928
|
+
isJSXFragment(opts?: object): this is NodePath<t.JSXFragment>;
|
|
929
|
+
isJSXIdentifier(opts?: object): this is NodePath<t.JSXIdentifier>;
|
|
930
|
+
isJSXMemberExpression(opts?: object): this is NodePath<t.JSXMemberExpression>;
|
|
931
|
+
isJSXNamespacedName(opts?: object): this is NodePath<t.JSXNamespacedName>;
|
|
932
|
+
isJSXOpeningElement(opts?: object): this is NodePath<t.JSXOpeningElement>;
|
|
933
|
+
isJSXOpeningFragment(opts?: object): this is NodePath<t.JSXOpeningFragment>;
|
|
934
|
+
isJSXSpreadAttribute(opts?: object): this is NodePath<t.JSXSpreadAttribute>;
|
|
935
|
+
isJSXSpreadChild(opts?: object): this is NodePath<t.JSXSpreadChild>;
|
|
936
|
+
isJSXText(opts?: object): this is NodePath<t.JSXText>;
|
|
937
|
+
isLVal(opts?: object): this is NodePath<t.LVal>;
|
|
938
|
+
isLabeledStatement(opts?: object): this is NodePath<t.LabeledStatement>;
|
|
939
|
+
isLiteral(opts?: object): this is NodePath<t.Literal>;
|
|
940
|
+
isLogicalExpression(opts?: object): this is NodePath<t.LogicalExpression>;
|
|
941
|
+
isLoop(opts?: object): this is NodePath<t.Loop>;
|
|
942
|
+
isMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
|
|
943
|
+
isMetaProperty(opts?: object): this is NodePath<t.MetaProperty>;
|
|
944
|
+
isMethod(opts?: object): this is NodePath<t.Method>;
|
|
945
|
+
isMiscellaneous(opts?: object): this is NodePath<t.Miscellaneous>;
|
|
946
|
+
isMixedTypeAnnotation(opts?: object): this is NodePath<t.MixedTypeAnnotation>;
|
|
947
|
+
isModuleDeclaration(opts?: object): this is NodePath<t.ModuleDeclaration>;
|
|
948
|
+
isModuleExpression(opts?: object): this is NodePath<t.ModuleExpression>;
|
|
949
|
+
isModuleSpecifier(opts?: object): this is NodePath<t.ModuleSpecifier>;
|
|
950
|
+
isNewExpression(opts?: object): this is NodePath<t.NewExpression>;
|
|
951
|
+
isNoop(opts?: object): this is NodePath<t.Noop>;
|
|
952
|
+
isNullLiteral(opts?: object): this is NodePath<t.NullLiteral>;
|
|
953
|
+
isNullLiteralTypeAnnotation(opts?: object): this is NodePath<t.NullLiteralTypeAnnotation>;
|
|
954
|
+
isNullableTypeAnnotation(opts?: object): this is NodePath<t.NullableTypeAnnotation>;
|
|
737
955
|
|
|
738
956
|
/** @deprecated Use `isNumericLiteral` */
|
|
739
|
-
isNumberLiteral(
|
|
740
|
-
isNumberLiteralTypeAnnotation(
|
|
741
|
-
isNumberTypeAnnotation(
|
|
742
|
-
isNumericLiteral(
|
|
743
|
-
isObjectExpression(
|
|
744
|
-
isObjectMember(
|
|
745
|
-
isObjectMethod(
|
|
746
|
-
isObjectPattern(
|
|
747
|
-
isObjectProperty(
|
|
748
|
-
isObjectTypeAnnotation(
|
|
749
|
-
isObjectTypeCallProperty(
|
|
750
|
-
isObjectTypeIndexer(
|
|
751
|
-
isObjectTypeInternalSlot(
|
|
752
|
-
isObjectTypeProperty(
|
|
753
|
-
isObjectTypeSpreadProperty(
|
|
754
|
-
isOpaqueType(
|
|
755
|
-
isOptionalCallExpression(
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
957
|
+
isNumberLiteral(opts?: object): this is NodePath<t.NumberLiteral>;
|
|
958
|
+
isNumberLiteralTypeAnnotation(opts?: object): this is NodePath<t.NumberLiteralTypeAnnotation>;
|
|
959
|
+
isNumberTypeAnnotation(opts?: object): this is NodePath<t.NumberTypeAnnotation>;
|
|
960
|
+
isNumericLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
|
|
961
|
+
isObjectExpression(opts?: object): this is NodePath<t.ObjectExpression>;
|
|
962
|
+
isObjectMember(opts?: object): this is NodePath<t.ObjectMember>;
|
|
963
|
+
isObjectMethod(opts?: object): this is NodePath<t.ObjectMethod>;
|
|
964
|
+
isObjectPattern(opts?: object): this is NodePath<t.ObjectPattern>;
|
|
965
|
+
isObjectProperty(opts?: object): this is NodePath<t.ObjectProperty>;
|
|
966
|
+
isObjectTypeAnnotation(opts?: object): this is NodePath<t.ObjectTypeAnnotation>;
|
|
967
|
+
isObjectTypeCallProperty(opts?: object): this is NodePath<t.ObjectTypeCallProperty>;
|
|
968
|
+
isObjectTypeIndexer(opts?: object): this is NodePath<t.ObjectTypeIndexer>;
|
|
969
|
+
isObjectTypeInternalSlot(opts?: object): this is NodePath<t.ObjectTypeInternalSlot>;
|
|
970
|
+
isObjectTypeProperty(opts?: object): this is NodePath<t.ObjectTypeProperty>;
|
|
971
|
+
isObjectTypeSpreadProperty(opts?: object): this is NodePath<t.ObjectTypeSpreadProperty>;
|
|
972
|
+
isOpaqueType(opts?: object): this is NodePath<t.OpaqueType>;
|
|
973
|
+
isOptionalCallExpression(opts?: object): this is NodePath<t.OptionalCallExpression>;
|
|
974
|
+
isOptionalIndexedAccessType(opts?: object): this is NodePath<t.OptionalIndexedAccessType>;
|
|
975
|
+
isOptionalMemberExpression(opts?: object): this is NodePath<t.OptionalMemberExpression>;
|
|
976
|
+
isParenthesizedExpression(opts?: object): this is NodePath<t.ParenthesizedExpression>;
|
|
977
|
+
isPattern(opts?: object): this is NodePath<t.Pattern>;
|
|
978
|
+
isPatternLike(opts?: object): this is NodePath<t.PatternLike>;
|
|
979
|
+
isPipelineBareFunction(opts?: object): this is NodePath<t.PipelineBareFunction>;
|
|
980
|
+
isPipelinePrimaryTopicReference(opts?: object): this is NodePath<t.PipelinePrimaryTopicReference>;
|
|
981
|
+
isPipelineTopicExpression(opts?: object): this is NodePath<t.PipelineTopicExpression>;
|
|
982
|
+
isPlaceholder(opts?: object): this is NodePath<t.Placeholder>;
|
|
983
|
+
isPrivate(opts?: object): this is NodePath<t.Private>;
|
|
984
|
+
isPrivateName(opts?: object): this is NodePath<t.PrivateName>;
|
|
985
|
+
isProgram(opts?: object): this is NodePath<t.Program>;
|
|
986
|
+
isProperty(opts?: object): this is NodePath<t.Property>;
|
|
987
|
+
isPureish(opts?: object): this is NodePath<t.Pureish>;
|
|
988
|
+
isQualifiedTypeIdentifier(opts?: object): this is NodePath<t.QualifiedTypeIdentifier>;
|
|
989
|
+
isRecordExpression(opts?: object): this is NodePath<t.RecordExpression>;
|
|
990
|
+
isRegExpLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
|
|
770
991
|
|
|
771
992
|
/** @deprecated Use `isRegExpLiteral` */
|
|
772
|
-
isRegexLiteral(
|
|
773
|
-
isRestElement(
|
|
993
|
+
isRegexLiteral(opts?: object): this is NodePath<t.RegexLiteral>;
|
|
994
|
+
isRestElement(opts?: object): this is NodePath<t.RestElement>;
|
|
774
995
|
|
|
775
996
|
/** @deprecated Use `isRestElement` */
|
|
776
|
-
isRestProperty(
|
|
777
|
-
isReturnStatement(
|
|
778
|
-
isScopable(
|
|
779
|
-
isSequenceExpression(
|
|
780
|
-
isSpreadElement(
|
|
997
|
+
isRestProperty(opts?: object): this is NodePath<t.RestProperty>;
|
|
998
|
+
isReturnStatement(opts?: object): this is NodePath<t.ReturnStatement>;
|
|
999
|
+
isScopable(opts?: object): this is NodePath<t.Scopable>;
|
|
1000
|
+
isSequenceExpression(opts?: object): this is NodePath<t.SequenceExpression>;
|
|
1001
|
+
isSpreadElement(opts?: object): this is NodePath<t.SpreadElement>;
|
|
781
1002
|
|
|
782
1003
|
/** @deprecated Use `isSpreadElement` */
|
|
783
|
-
isSpreadProperty(
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
): this is NodePath<t.
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
1004
|
+
isSpreadProperty(opts?: object): this is NodePath<t.SpreadProperty>;
|
|
1005
|
+
isStandardized(opts?: object): this is NodePath<t.Standardized>;
|
|
1006
|
+
isStatement(opts?: object): this is NodePath<t.Statement>;
|
|
1007
|
+
isStaticBlock(opts?: object): this is NodePath<t.StaticBlock>;
|
|
1008
|
+
isStringLiteral(opts?: object): this is NodePath<t.StringLiteral>;
|
|
1009
|
+
isStringLiteralTypeAnnotation(opts?: object): this is NodePath<t.StringLiteralTypeAnnotation>;
|
|
1010
|
+
isStringTypeAnnotation(opts?: object): this is NodePath<t.StringTypeAnnotation>;
|
|
1011
|
+
isSuper(opts?: object): this is NodePath<t.Super>;
|
|
1012
|
+
isSwitchCase(opts?: object): this is NodePath<t.SwitchCase>;
|
|
1013
|
+
isSwitchStatement(opts?: object): this is NodePath<t.SwitchStatement>;
|
|
1014
|
+
isSymbolTypeAnnotation(opts?: object): this is NodePath<t.SymbolTypeAnnotation>;
|
|
1015
|
+
isTSAnyKeyword(opts?: object): this is NodePath<t.TSAnyKeyword>;
|
|
1016
|
+
isTSArrayType(opts?: object): this is NodePath<t.TSArrayType>;
|
|
1017
|
+
isTSAsExpression(opts?: object): this is NodePath<t.TSAsExpression>;
|
|
1018
|
+
isTSBaseType(opts?: object): this is NodePath<t.TSBaseType>;
|
|
1019
|
+
isTSBigIntKeyword(opts?: object): this is NodePath<t.TSBigIntKeyword>;
|
|
1020
|
+
isTSBooleanKeyword(opts?: object): this is NodePath<t.TSBooleanKeyword>;
|
|
1021
|
+
isTSCallSignatureDeclaration(opts?: object): this is NodePath<t.TSCallSignatureDeclaration>;
|
|
1022
|
+
isTSConditionalType(opts?: object): this is NodePath<t.TSConditionalType>;
|
|
1023
|
+
isTSConstructSignatureDeclaration(opts?: object): this is NodePath<t.TSConstructSignatureDeclaration>;
|
|
1024
|
+
isTSConstructorType(opts?: object): this is NodePath<t.TSConstructorType>;
|
|
1025
|
+
isTSDeclareFunction(opts?: object): this is NodePath<t.TSDeclareFunction>;
|
|
1026
|
+
isTSDeclareMethod(opts?: object): this is NodePath<t.TSDeclareMethod>;
|
|
1027
|
+
isTSEntityName(opts?: object): this is NodePath<t.TSEntityName>;
|
|
1028
|
+
isTSEnumDeclaration(opts?: object): this is NodePath<t.TSEnumDeclaration>;
|
|
1029
|
+
isTSEnumMember(opts?: object): this is NodePath<t.TSEnumMember>;
|
|
1030
|
+
isTSExportAssignment(opts?: object): this is NodePath<t.TSExportAssignment>;
|
|
1031
|
+
isTSExpressionWithTypeArguments(opts?: object): this is NodePath<t.TSExpressionWithTypeArguments>;
|
|
1032
|
+
isTSExternalModuleReference(opts?: object): this is NodePath<t.TSExternalModuleReference>;
|
|
1033
|
+
isTSFunctionType(opts?: object): this is NodePath<t.TSFunctionType>;
|
|
1034
|
+
isTSImportEqualsDeclaration(opts?: object): this is NodePath<t.TSImportEqualsDeclaration>;
|
|
1035
|
+
isTSImportType(opts?: object): this is NodePath<t.TSImportType>;
|
|
1036
|
+
isTSIndexSignature(opts?: object): this is NodePath<t.TSIndexSignature>;
|
|
1037
|
+
isTSIndexedAccessType(opts?: object): this is NodePath<t.TSIndexedAccessType>;
|
|
1038
|
+
isTSInferType(opts?: object): this is NodePath<t.TSInferType>;
|
|
1039
|
+
isTSInstantiationExpression(opts?: object): this is NodePath<t.TSInstantiationExpression>;
|
|
1040
|
+
isTSInterfaceBody(opts?: object): this is NodePath<t.TSInterfaceBody>;
|
|
1041
|
+
isTSInterfaceDeclaration(opts?: object): this is NodePath<t.TSInterfaceDeclaration>;
|
|
1042
|
+
isTSIntersectionType(opts?: object): this is NodePath<t.TSIntersectionType>;
|
|
1043
|
+
isTSIntrinsicKeyword(opts?: object): this is NodePath<t.TSIntrinsicKeyword>;
|
|
1044
|
+
isTSLiteralType(opts?: object): this is NodePath<t.TSLiteralType>;
|
|
1045
|
+
isTSMappedType(opts?: object): this is NodePath<t.TSMappedType>;
|
|
1046
|
+
isTSMethodSignature(opts?: object): this is NodePath<t.TSMethodSignature>;
|
|
1047
|
+
isTSModuleBlock(opts?: object): this is NodePath<t.TSModuleBlock>;
|
|
1048
|
+
isTSModuleDeclaration(opts?: object): this is NodePath<t.TSModuleDeclaration>;
|
|
1049
|
+
isTSNamedTupleMember(opts?: object): this is NodePath<t.TSNamedTupleMember>;
|
|
1050
|
+
isTSNamespaceExportDeclaration(opts?: object): this is NodePath<t.TSNamespaceExportDeclaration>;
|
|
1051
|
+
isTSNeverKeyword(opts?: object): this is NodePath<t.TSNeverKeyword>;
|
|
1052
|
+
isTSNonNullExpression(opts?: object): this is NodePath<t.TSNonNullExpression>;
|
|
1053
|
+
isTSNullKeyword(opts?: object): this is NodePath<t.TSNullKeyword>;
|
|
1054
|
+
isTSNumberKeyword(opts?: object): this is NodePath<t.TSNumberKeyword>;
|
|
1055
|
+
isTSObjectKeyword(opts?: object): this is NodePath<t.TSObjectKeyword>;
|
|
1056
|
+
isTSOptionalType(opts?: object): this is NodePath<t.TSOptionalType>;
|
|
1057
|
+
isTSParameterProperty(opts?: object): this is NodePath<t.TSParameterProperty>;
|
|
1058
|
+
isTSParenthesizedType(opts?: object): this is NodePath<t.TSParenthesizedType>;
|
|
1059
|
+
isTSPropertySignature(opts?: object): this is NodePath<t.TSPropertySignature>;
|
|
1060
|
+
isTSQualifiedName(opts?: object): this is NodePath<t.TSQualifiedName>;
|
|
1061
|
+
isTSRestType(opts?: object): this is NodePath<t.TSRestType>;
|
|
1062
|
+
isTSSatisfiesExpression(opts?: object): this is NodePath<t.TSSatisfiesExpression>;
|
|
1063
|
+
isTSStringKeyword(opts?: object): this is NodePath<t.TSStringKeyword>;
|
|
1064
|
+
isTSSymbolKeyword(opts?: object): this is NodePath<t.TSSymbolKeyword>;
|
|
1065
|
+
isTSThisType(opts?: object): this is NodePath<t.TSThisType>;
|
|
1066
|
+
isTSTupleType(opts?: object): this is NodePath<t.TSTupleType>;
|
|
1067
|
+
isTSType(opts?: object): this is NodePath<t.TSType>;
|
|
1068
|
+
isTSTypeAliasDeclaration(opts?: object): this is NodePath<t.TSTypeAliasDeclaration>;
|
|
1069
|
+
isTSTypeAnnotation(opts?: object): this is NodePath<t.TSTypeAnnotation>;
|
|
1070
|
+
isTSTypeAssertion(opts?: object): this is NodePath<t.TSTypeAssertion>;
|
|
1071
|
+
isTSTypeElement(opts?: object): this is NodePath<t.TSTypeElement>;
|
|
1072
|
+
isTSTypeLiteral(opts?: object): this is NodePath<t.TSTypeLiteral>;
|
|
1073
|
+
isTSTypeOperator(opts?: object): this is NodePath<t.TSTypeOperator>;
|
|
1074
|
+
isTSTypeParameter(opts?: object): this is NodePath<t.TSTypeParameter>;
|
|
1075
|
+
isTSTypeParameterDeclaration(opts?: object): this is NodePath<t.TSTypeParameterDeclaration>;
|
|
1076
|
+
isTSTypeParameterInstantiation(opts?: object): this is NodePath<t.TSTypeParameterInstantiation>;
|
|
1077
|
+
isTSTypePredicate(opts?: object): this is NodePath<t.TSTypePredicate>;
|
|
1078
|
+
isTSTypeQuery(opts?: object): this is NodePath<t.TSTypeQuery>;
|
|
1079
|
+
isTSTypeReference(opts?: object): this is NodePath<t.TSTypeReference>;
|
|
1080
|
+
isTSUndefinedKeyword(opts?: object): this is NodePath<t.TSUndefinedKeyword>;
|
|
1081
|
+
isTSUnionType(opts?: object): this is NodePath<t.TSUnionType>;
|
|
1082
|
+
isTSUnknownKeyword(opts?: object): this is NodePath<t.TSUnknownKeyword>;
|
|
1083
|
+
isTSVoidKeyword(opts?: object): this is NodePath<t.TSVoidKeyword>;
|
|
1084
|
+
isTaggedTemplateExpression(opts?: object): this is NodePath<t.TaggedTemplateExpression>;
|
|
1085
|
+
isTemplateElement(opts?: object): this is NodePath<t.TemplateElement>;
|
|
1086
|
+
isTemplateLiteral(opts?: object): this is NodePath<t.TemplateLiteral>;
|
|
1087
|
+
isTerminatorless(opts?: object): this is NodePath<t.Terminatorless>;
|
|
1088
|
+
isThisExpression(opts?: object): this is NodePath<t.ThisExpression>;
|
|
1089
|
+
isThisTypeAnnotation(opts?: object): this is NodePath<t.ThisTypeAnnotation>;
|
|
1090
|
+
isThrowStatement(opts?: object): this is NodePath<t.ThrowStatement>;
|
|
1091
|
+
isTopicReference(opts?: object): this is NodePath<t.TopicReference>;
|
|
1092
|
+
isTryStatement(opts?: object): this is NodePath<t.TryStatement>;
|
|
1093
|
+
isTupleExpression(opts?: object): this is NodePath<t.TupleExpression>;
|
|
1094
|
+
isTupleTypeAnnotation(opts?: object): this is NodePath<t.TupleTypeAnnotation>;
|
|
1095
|
+
isTypeAlias(opts?: object): this is NodePath<t.TypeAlias>;
|
|
1096
|
+
isTypeAnnotation(opts?: object): this is NodePath<t.TypeAnnotation>;
|
|
1097
|
+
isTypeCastExpression(opts?: object): this is NodePath<t.TypeCastExpression>;
|
|
1098
|
+
isTypeParameter(opts?: object): this is NodePath<t.TypeParameter>;
|
|
1099
|
+
isTypeParameterDeclaration(opts?: object): this is NodePath<t.TypeParameterDeclaration>;
|
|
1100
|
+
isTypeParameterInstantiation(opts?: object): this is NodePath<t.TypeParameterInstantiation>;
|
|
1101
|
+
isTypeScript(opts?: object): this is NodePath<t.TypeScript>;
|
|
1102
|
+
isTypeofTypeAnnotation(opts?: object): this is NodePath<t.TypeofTypeAnnotation>;
|
|
1103
|
+
isUnaryExpression(opts?: object): this is NodePath<t.UnaryExpression>;
|
|
1104
|
+
isUnaryLike(opts?: object): this is NodePath<t.UnaryLike>;
|
|
1105
|
+
isUnionTypeAnnotation(opts?: object): this is NodePath<t.UnionTypeAnnotation>;
|
|
1106
|
+
isUpdateExpression(opts?: object): this is NodePath<t.UpdateExpression>;
|
|
1107
|
+
isUserWhitespacable(opts?: object): this is NodePath<t.UserWhitespacable>;
|
|
1108
|
+
isV8IntrinsicIdentifier(opts?: object): this is NodePath<t.V8IntrinsicIdentifier>;
|
|
1109
|
+
isVariableDeclaration(opts?: object): this is NodePath<t.VariableDeclaration>;
|
|
1110
|
+
isVariableDeclarator(opts?: object): this is NodePath<t.VariableDeclarator>;
|
|
1111
|
+
isVariance(opts?: object): this is NodePath<t.Variance>;
|
|
1112
|
+
isVoidTypeAnnotation(opts?: object): this is NodePath<t.VoidTypeAnnotation>;
|
|
1113
|
+
isWhile(opts?: object): this is NodePath<t.While>;
|
|
1114
|
+
isWhileStatement(opts?: object): this is NodePath<t.WhileStatement>;
|
|
1115
|
+
isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
|
|
1116
|
+
isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
|
|
1117
|
+
|
|
1118
|
+
isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases['BindingIdentifier']>;
|
|
1119
|
+
isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
|
|
1120
|
+
|
|
1121
|
+
/** @deprecated */
|
|
1122
|
+
isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases['ExistentialTypeParam']>;
|
|
1123
|
+
isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases['ForAwaitStatement']>;
|
|
1124
|
+
isGenerated(opts?: object): boolean;
|
|
1125
|
+
|
|
1126
|
+
/** @deprecated */
|
|
1127
|
+
isNumericLiteralTypeAnnotation(opts?: object): void;
|
|
1128
|
+
isPure(opts?: object): boolean;
|
|
1129
|
+
isReferenced(opts?: object): boolean;
|
|
1130
|
+
isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases['ReferencedIdentifier']>;
|
|
1131
|
+
isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases['ReferencedMemberExpression']>;
|
|
1132
|
+
isScope(opts?: object): this is NodePath<VirtualTypeAliases['Scope']>;
|
|
1133
|
+
isUser(opts?: object): boolean;
|
|
1134
|
+
isVar(opts?: object): this is NodePath<VirtualTypeAliases['Var']>;
|
|
896
1135
|
//#endregion
|
|
897
1136
|
|
|
898
1137
|
//#region ------------------------- assertXXX -------------------------
|
|
@@ -909,292 +1148,316 @@ export class NodePath<T = Node> {
|
|
|
909
1148
|
assertMarkoSpreadAttribute(props?: object | null): void;
|
|
910
1149
|
assertMarkoTagBody(props?: object | null): void;
|
|
911
1150
|
assertMarkoTag(props?: object | null): void;
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1151
|
+
assertAccessor(opts?: object): asserts this is NodePath<t.Accessor>;
|
|
1152
|
+
assertAnyTypeAnnotation(opts?: object): asserts this is NodePath<t.AnyTypeAnnotation>;
|
|
1153
|
+
assertArgumentPlaceholder(opts?: object): asserts this is NodePath<t.ArgumentPlaceholder>;
|
|
1154
|
+
assertArrayExpression(opts?: object): asserts this is NodePath<t.ArrayExpression>;
|
|
1155
|
+
assertArrayPattern(opts?: object): asserts this is NodePath<t.ArrayPattern>;
|
|
1156
|
+
assertArrayTypeAnnotation(opts?: object): asserts this is NodePath<t.ArrayTypeAnnotation>;
|
|
1157
|
+
assertArrowFunctionExpression(opts?: object): asserts this is NodePath<t.ArrowFunctionExpression>;
|
|
1158
|
+
assertAssignmentExpression(opts?: object): asserts this is NodePath<t.AssignmentExpression>;
|
|
1159
|
+
assertAssignmentPattern(opts?: object): asserts this is NodePath<t.AssignmentPattern>;
|
|
1160
|
+
assertAwaitExpression(opts?: object): asserts this is NodePath<t.AwaitExpression>;
|
|
1161
|
+
assertBigIntLiteral(opts?: object): asserts this is NodePath<t.BigIntLiteral>;
|
|
1162
|
+
assertBinary(opts?: object): asserts this is NodePath<t.Binary>;
|
|
1163
|
+
assertBinaryExpression(opts?: object): asserts this is NodePath<t.BinaryExpression>;
|
|
1164
|
+
assertBindExpression(opts?: object): asserts this is NodePath<t.BindExpression>;
|
|
1165
|
+
assertBlock(opts?: object): asserts this is NodePath<t.Block>;
|
|
1166
|
+
assertBlockParent(opts?: object): asserts this is NodePath<t.BlockParent>;
|
|
1167
|
+
assertBlockStatement(opts?: object): asserts this is NodePath<t.BlockStatement>;
|
|
1168
|
+
assertBooleanLiteral(opts?: object): asserts this is NodePath<t.BooleanLiteral>;
|
|
1169
|
+
assertBooleanLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.BooleanLiteralTypeAnnotation>;
|
|
1170
|
+
assertBooleanTypeAnnotation(opts?: object): asserts this is NodePath<t.BooleanTypeAnnotation>;
|
|
1171
|
+
assertBreakStatement(opts?: object): asserts this is NodePath<t.BreakStatement>;
|
|
1172
|
+
assertCallExpression(opts?: object): asserts this is NodePath<t.CallExpression>;
|
|
1173
|
+
assertCatchClause(opts?: object): asserts this is NodePath<t.CatchClause>;
|
|
1174
|
+
assertClass(opts?: object): asserts this is NodePath<t.Class>;
|
|
1175
|
+
assertClassAccessorProperty(opts?: object): asserts this is NodePath<t.ClassAccessorProperty>;
|
|
1176
|
+
assertClassBody(opts?: object): asserts this is NodePath<t.ClassBody>;
|
|
1177
|
+
assertClassDeclaration(opts?: object): asserts this is NodePath<t.ClassDeclaration>;
|
|
1178
|
+
assertClassExpression(opts?: object): asserts this is NodePath<t.ClassExpression>;
|
|
1179
|
+
assertClassImplements(opts?: object): asserts this is NodePath<t.ClassImplements>;
|
|
1180
|
+
assertClassMethod(opts?: object): asserts this is NodePath<t.ClassMethod>;
|
|
1181
|
+
assertClassPrivateMethod(opts?: object): asserts this is NodePath<t.ClassPrivateMethod>;
|
|
1182
|
+
assertClassPrivateProperty(opts?: object): asserts this is NodePath<t.ClassPrivateProperty>;
|
|
1183
|
+
assertClassProperty(opts?: object): asserts this is NodePath<t.ClassProperty>;
|
|
1184
|
+
assertCompletionStatement(opts?: object): asserts this is NodePath<t.CompletionStatement>;
|
|
1185
|
+
assertConditional(opts?: object): asserts this is NodePath<t.Conditional>;
|
|
1186
|
+
assertConditionalExpression(opts?: object): asserts this is NodePath<t.ConditionalExpression>;
|
|
1187
|
+
assertContinueStatement(opts?: object): asserts this is NodePath<t.ContinueStatement>;
|
|
1188
|
+
assertDebuggerStatement(opts?: object): asserts this is NodePath<t.DebuggerStatement>;
|
|
1189
|
+
assertDecimalLiteral(opts?: object): asserts this is NodePath<t.DecimalLiteral>;
|
|
1190
|
+
assertDeclaration(opts?: object): asserts this is NodePath<t.Declaration>;
|
|
1191
|
+
assertDeclareClass(opts?: object): asserts this is NodePath<t.DeclareClass>;
|
|
1192
|
+
assertDeclareExportAllDeclaration(opts?: object): asserts this is NodePath<t.DeclareExportAllDeclaration>;
|
|
1193
|
+
assertDeclareExportDeclaration(opts?: object): asserts this is NodePath<t.DeclareExportDeclaration>;
|
|
1194
|
+
assertDeclareFunction(opts?: object): asserts this is NodePath<t.DeclareFunction>;
|
|
1195
|
+
assertDeclareInterface(opts?: object): asserts this is NodePath<t.DeclareInterface>;
|
|
1196
|
+
assertDeclareModule(opts?: object): asserts this is NodePath<t.DeclareModule>;
|
|
1197
|
+
assertDeclareModuleExports(opts?: object): asserts this is NodePath<t.DeclareModuleExports>;
|
|
1198
|
+
assertDeclareOpaqueType(opts?: object): asserts this is NodePath<t.DeclareOpaqueType>;
|
|
1199
|
+
assertDeclareTypeAlias(opts?: object): asserts this is NodePath<t.DeclareTypeAlias>;
|
|
1200
|
+
assertDeclareVariable(opts?: object): asserts this is NodePath<t.DeclareVariable>;
|
|
1201
|
+
assertDeclaredPredicate(opts?: object): asserts this is NodePath<t.DeclaredPredicate>;
|
|
1202
|
+
assertDecorator(opts?: object): asserts this is NodePath<t.Decorator>;
|
|
1203
|
+
assertDirective(opts?: object): asserts this is NodePath<t.Directive>;
|
|
1204
|
+
assertDirectiveLiteral(opts?: object): asserts this is NodePath<t.DirectiveLiteral>;
|
|
1205
|
+
assertDoExpression(opts?: object): asserts this is NodePath<t.DoExpression>;
|
|
1206
|
+
assertDoWhileStatement(opts?: object): asserts this is NodePath<t.DoWhileStatement>;
|
|
1207
|
+
assertEmptyStatement(opts?: object): asserts this is NodePath<t.EmptyStatement>;
|
|
1208
|
+
assertEmptyTypeAnnotation(opts?: object): asserts this is NodePath<t.EmptyTypeAnnotation>;
|
|
1209
|
+
assertEnumBody(opts?: object): asserts this is NodePath<t.EnumBody>;
|
|
1210
|
+
assertEnumBooleanBody(opts?: object): asserts this is NodePath<t.EnumBooleanBody>;
|
|
1211
|
+
assertEnumBooleanMember(opts?: object): asserts this is NodePath<t.EnumBooleanMember>;
|
|
1212
|
+
assertEnumDeclaration(opts?: object): asserts this is NodePath<t.EnumDeclaration>;
|
|
1213
|
+
assertEnumDefaultedMember(opts?: object): asserts this is NodePath<t.EnumDefaultedMember>;
|
|
1214
|
+
assertEnumMember(opts?: object): asserts this is NodePath<t.EnumMember>;
|
|
1215
|
+
assertEnumNumberBody(opts?: object): asserts this is NodePath<t.EnumNumberBody>;
|
|
1216
|
+
assertEnumNumberMember(opts?: object): asserts this is NodePath<t.EnumNumberMember>;
|
|
1217
|
+
assertEnumStringBody(opts?: object): asserts this is NodePath<t.EnumStringBody>;
|
|
1218
|
+
assertEnumStringMember(opts?: object): asserts this is NodePath<t.EnumStringMember>;
|
|
1219
|
+
assertEnumSymbolBody(opts?: object): asserts this is NodePath<t.EnumSymbolBody>;
|
|
1220
|
+
assertExistsTypeAnnotation(opts?: object): asserts this is NodePath<t.ExistsTypeAnnotation>;
|
|
1221
|
+
assertExportAllDeclaration(opts?: object): asserts this is NodePath<t.ExportAllDeclaration>;
|
|
1222
|
+
assertExportDeclaration(opts?: object): asserts this is NodePath<t.ExportDeclaration>;
|
|
1223
|
+
assertExportDefaultDeclaration(opts?: object): asserts this is NodePath<t.ExportDefaultDeclaration>;
|
|
1224
|
+
assertExportDefaultSpecifier(opts?: object): asserts this is NodePath<t.ExportDefaultSpecifier>;
|
|
1225
|
+
assertExportNamedDeclaration(opts?: object): asserts this is NodePath<t.ExportNamedDeclaration>;
|
|
1226
|
+
assertExportNamespaceSpecifier(opts?: object): asserts this is NodePath<t.ExportNamespaceSpecifier>;
|
|
1227
|
+
assertExportSpecifier(opts?: object): asserts this is NodePath<t.ExportSpecifier>;
|
|
1228
|
+
assertExpression(opts?: object): asserts this is NodePath<t.Expression>;
|
|
1229
|
+
assertExpressionStatement(opts?: object): asserts this is NodePath<t.ExpressionStatement>;
|
|
1230
|
+
assertExpressionWrapper(opts?: object): asserts this is NodePath<t.ExpressionWrapper>;
|
|
1231
|
+
assertFile(opts?: object): asserts this is NodePath<t.File>;
|
|
1232
|
+
assertFlow(opts?: object): asserts this is NodePath<t.Flow>;
|
|
1233
|
+
assertFlowBaseAnnotation(opts?: object): asserts this is NodePath<t.FlowBaseAnnotation>;
|
|
1234
|
+
assertFlowDeclaration(opts?: object): asserts this is NodePath<t.FlowDeclaration>;
|
|
1235
|
+
assertFlowPredicate(opts?: object): asserts this is NodePath<t.FlowPredicate>;
|
|
1236
|
+
assertFlowType(opts?: object): asserts this is NodePath<t.FlowType>;
|
|
1237
|
+
assertFor(opts?: object): asserts this is NodePath<t.For>;
|
|
1238
|
+
assertForInStatement(opts?: object): asserts this is NodePath<t.ForInStatement>;
|
|
1239
|
+
assertForOfStatement(opts?: object): asserts this is NodePath<t.ForOfStatement>;
|
|
1240
|
+
assertForStatement(opts?: object): asserts this is NodePath<t.ForStatement>;
|
|
1241
|
+
assertForXStatement(opts?: object): asserts this is NodePath<t.ForXStatement>;
|
|
1242
|
+
assertFunction(opts?: object): asserts this is NodePath<t.Function>;
|
|
1243
|
+
assertFunctionDeclaration(opts?: object): asserts this is NodePath<t.FunctionDeclaration>;
|
|
1244
|
+
assertFunctionExpression(opts?: object): asserts this is NodePath<t.FunctionExpression>;
|
|
1245
|
+
assertFunctionParent(opts?: object): asserts this is NodePath<t.FunctionParent>;
|
|
1246
|
+
assertFunctionTypeAnnotation(opts?: object): asserts this is NodePath<t.FunctionTypeAnnotation>;
|
|
1247
|
+
assertFunctionTypeParam(opts?: object): asserts this is NodePath<t.FunctionTypeParam>;
|
|
1248
|
+
assertGenericTypeAnnotation(opts?: object): asserts this is NodePath<t.GenericTypeAnnotation>;
|
|
1249
|
+
assertIdentifier(opts?: object): asserts this is NodePath<t.Identifier>;
|
|
1250
|
+
assertIfStatement(opts?: object): asserts this is NodePath<t.IfStatement>;
|
|
1251
|
+
assertImmutable(opts?: object): asserts this is NodePath<t.Immutable>;
|
|
1252
|
+
assertImport(opts?: object): asserts this is NodePath<t.Import>;
|
|
1253
|
+
assertImportAttribute(opts?: object): asserts this is NodePath<t.ImportAttribute>;
|
|
1254
|
+
assertImportDeclaration(opts?: object): asserts this is NodePath<t.ImportDeclaration>;
|
|
1255
|
+
assertImportDefaultSpecifier(opts?: object): asserts this is NodePath<t.ImportDefaultSpecifier>;
|
|
1256
|
+
assertImportNamespaceSpecifier(opts?: object): asserts this is NodePath<t.ImportNamespaceSpecifier>;
|
|
1257
|
+
assertImportSpecifier(opts?: object): asserts this is NodePath<t.ImportSpecifier>;
|
|
1258
|
+
assertIndexedAccessType(opts?: object): asserts this is NodePath<t.IndexedAccessType>;
|
|
1259
|
+
assertInferredPredicate(opts?: object): asserts this is NodePath<t.InferredPredicate>;
|
|
1260
|
+
assertInterfaceDeclaration(opts?: object): asserts this is NodePath<t.InterfaceDeclaration>;
|
|
1261
|
+
assertInterfaceExtends(opts?: object): asserts this is NodePath<t.InterfaceExtends>;
|
|
1262
|
+
assertInterfaceTypeAnnotation(opts?: object): asserts this is NodePath<t.InterfaceTypeAnnotation>;
|
|
1263
|
+
assertInterpreterDirective(opts?: object): asserts this is NodePath<t.InterpreterDirective>;
|
|
1264
|
+
assertIntersectionTypeAnnotation(opts?: object): asserts this is NodePath<t.IntersectionTypeAnnotation>;
|
|
1265
|
+
assertJSX(opts?: object): asserts this is NodePath<t.JSX>;
|
|
1266
|
+
assertJSXAttribute(opts?: object): asserts this is NodePath<t.JSXAttribute>;
|
|
1267
|
+
assertJSXClosingElement(opts?: object): asserts this is NodePath<t.JSXClosingElement>;
|
|
1268
|
+
assertJSXClosingFragment(opts?: object): asserts this is NodePath<t.JSXClosingFragment>;
|
|
1269
|
+
assertJSXElement(opts?: object): asserts this is NodePath<t.JSXElement>;
|
|
1270
|
+
assertJSXEmptyExpression(opts?: object): asserts this is NodePath<t.JSXEmptyExpression>;
|
|
1271
|
+
assertJSXExpressionContainer(opts?: object): asserts this is NodePath<t.JSXExpressionContainer>;
|
|
1272
|
+
assertJSXFragment(opts?: object): asserts this is NodePath<t.JSXFragment>;
|
|
1273
|
+
assertJSXIdentifier(opts?: object): asserts this is NodePath<t.JSXIdentifier>;
|
|
1274
|
+
assertJSXMemberExpression(opts?: object): asserts this is NodePath<t.JSXMemberExpression>;
|
|
1275
|
+
assertJSXNamespacedName(opts?: object): asserts this is NodePath<t.JSXNamespacedName>;
|
|
1276
|
+
assertJSXOpeningElement(opts?: object): asserts this is NodePath<t.JSXOpeningElement>;
|
|
1277
|
+
assertJSXOpeningFragment(opts?: object): asserts this is NodePath<t.JSXOpeningFragment>;
|
|
1278
|
+
assertJSXSpreadAttribute(opts?: object): asserts this is NodePath<t.JSXSpreadAttribute>;
|
|
1279
|
+
assertJSXSpreadChild(opts?: object): asserts this is NodePath<t.JSXSpreadChild>;
|
|
1280
|
+
assertJSXText(opts?: object): asserts this is NodePath<t.JSXText>;
|
|
1281
|
+
assertLVal(opts?: object): asserts this is NodePath<t.LVal>;
|
|
1282
|
+
assertLabeledStatement(opts?: object): asserts this is NodePath<t.LabeledStatement>;
|
|
1283
|
+
assertLiteral(opts?: object): asserts this is NodePath<t.Literal>;
|
|
1284
|
+
assertLogicalExpression(opts?: object): asserts this is NodePath<t.LogicalExpression>;
|
|
1285
|
+
assertLoop(opts?: object): asserts this is NodePath<t.Loop>;
|
|
1286
|
+
assertMemberExpression(opts?: object): asserts this is NodePath<t.MemberExpression>;
|
|
1287
|
+
assertMetaProperty(opts?: object): asserts this is NodePath<t.MetaProperty>;
|
|
1288
|
+
assertMethod(opts?: object): asserts this is NodePath<t.Method>;
|
|
1289
|
+
assertMiscellaneous(opts?: object): asserts this is NodePath<t.Miscellaneous>;
|
|
1290
|
+
assertMixedTypeAnnotation(opts?: object): asserts this is NodePath<t.MixedTypeAnnotation>;
|
|
1291
|
+
assertModuleDeclaration(opts?: object): asserts this is NodePath<t.ModuleDeclaration>;
|
|
1292
|
+
assertModuleExpression(opts?: object): asserts this is NodePath<t.ModuleExpression>;
|
|
1293
|
+
assertModuleSpecifier(opts?: object): asserts this is NodePath<t.ModuleSpecifier>;
|
|
1294
|
+
assertNewExpression(opts?: object): asserts this is NodePath<t.NewExpression>;
|
|
1295
|
+
assertNoop(opts?: object): asserts this is NodePath<t.Noop>;
|
|
1296
|
+
assertNullLiteral(opts?: object): asserts this is NodePath<t.NullLiteral>;
|
|
1297
|
+
assertNullLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.NullLiteralTypeAnnotation>;
|
|
1298
|
+
assertNullableTypeAnnotation(opts?: object): asserts this is NodePath<t.NullableTypeAnnotation>;
|
|
1041
1299
|
|
|
1042
1300
|
/** @deprecated Use `assertNumericLiteral` */
|
|
1043
|
-
assertNumberLiteral(
|
|
1044
|
-
assertNumberLiteralTypeAnnotation(
|
|
1045
|
-
assertNumberTypeAnnotation(
|
|
1046
|
-
assertNumericLiteral(
|
|
1047
|
-
assertObjectExpression(
|
|
1048
|
-
assertObjectMember(
|
|
1049
|
-
assertObjectMethod(
|
|
1050
|
-
assertObjectPattern(
|
|
1051
|
-
assertObjectProperty(
|
|
1052
|
-
assertObjectTypeAnnotation(
|
|
1053
|
-
assertObjectTypeCallProperty(
|
|
1054
|
-
assertObjectTypeIndexer(
|
|
1055
|
-
assertObjectTypeInternalSlot(
|
|
1056
|
-
assertObjectTypeProperty(
|
|
1057
|
-
assertObjectTypeSpreadProperty(
|
|
1058
|
-
assertOpaqueType(
|
|
1059
|
-
assertOptionalCallExpression(
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1301
|
+
assertNumberLiteral(opts?: object): asserts this is NodePath<t.NumberLiteral>;
|
|
1302
|
+
assertNumberLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.NumberLiteralTypeAnnotation>;
|
|
1303
|
+
assertNumberTypeAnnotation(opts?: object): asserts this is NodePath<t.NumberTypeAnnotation>;
|
|
1304
|
+
assertNumericLiteral(opts?: object): asserts this is NodePath<t.NumericLiteral>;
|
|
1305
|
+
assertObjectExpression(opts?: object): asserts this is NodePath<t.ObjectExpression>;
|
|
1306
|
+
assertObjectMember(opts?: object): asserts this is NodePath<t.ObjectMember>;
|
|
1307
|
+
assertObjectMethod(opts?: object): asserts this is NodePath<t.ObjectMethod>;
|
|
1308
|
+
assertObjectPattern(opts?: object): asserts this is NodePath<t.ObjectPattern>;
|
|
1309
|
+
assertObjectProperty(opts?: object): asserts this is NodePath<t.ObjectProperty>;
|
|
1310
|
+
assertObjectTypeAnnotation(opts?: object): asserts this is NodePath<t.ObjectTypeAnnotation>;
|
|
1311
|
+
assertObjectTypeCallProperty(opts?: object): asserts this is NodePath<t.ObjectTypeCallProperty>;
|
|
1312
|
+
assertObjectTypeIndexer(opts?: object): asserts this is NodePath<t.ObjectTypeIndexer>;
|
|
1313
|
+
assertObjectTypeInternalSlot(opts?: object): asserts this is NodePath<t.ObjectTypeInternalSlot>;
|
|
1314
|
+
assertObjectTypeProperty(opts?: object): asserts this is NodePath<t.ObjectTypeProperty>;
|
|
1315
|
+
assertObjectTypeSpreadProperty(opts?: object): asserts this is NodePath<t.ObjectTypeSpreadProperty>;
|
|
1316
|
+
assertOpaqueType(opts?: object): asserts this is NodePath<t.OpaqueType>;
|
|
1317
|
+
assertOptionalCallExpression(opts?: object): asserts this is NodePath<t.OptionalCallExpression>;
|
|
1318
|
+
assertOptionalIndexedAccessType(opts?: object): asserts this is NodePath<t.OptionalIndexedAccessType>;
|
|
1319
|
+
assertOptionalMemberExpression(opts?: object): asserts this is NodePath<t.OptionalMemberExpression>;
|
|
1320
|
+
assertParenthesizedExpression(opts?: object): asserts this is NodePath<t.ParenthesizedExpression>;
|
|
1321
|
+
assertPattern(opts?: object): asserts this is NodePath<t.Pattern>;
|
|
1322
|
+
assertPatternLike(opts?: object): asserts this is NodePath<t.PatternLike>;
|
|
1323
|
+
assertPipelineBareFunction(opts?: object): asserts this is NodePath<t.PipelineBareFunction>;
|
|
1324
|
+
assertPipelinePrimaryTopicReference(opts?: object): asserts this is NodePath<t.PipelinePrimaryTopicReference>;
|
|
1325
|
+
assertPipelineTopicExpression(opts?: object): asserts this is NodePath<t.PipelineTopicExpression>;
|
|
1326
|
+
assertPlaceholder(opts?: object): asserts this is NodePath<t.Placeholder>;
|
|
1327
|
+
assertPrivate(opts?: object): asserts this is NodePath<t.Private>;
|
|
1328
|
+
assertPrivateName(opts?: object): asserts this is NodePath<t.PrivateName>;
|
|
1329
|
+
assertProgram(opts?: object): asserts this is NodePath<t.Program>;
|
|
1330
|
+
assertProperty(opts?: object): asserts this is NodePath<t.Property>;
|
|
1331
|
+
assertPureish(opts?: object): asserts this is NodePath<t.Pureish>;
|
|
1332
|
+
assertQualifiedTypeIdentifier(opts?: object): asserts this is NodePath<t.QualifiedTypeIdentifier>;
|
|
1333
|
+
assertRecordExpression(opts?: object): asserts this is NodePath<t.RecordExpression>;
|
|
1334
|
+
assertRegExpLiteral(opts?: object): asserts this is NodePath<t.RegExpLiteral>;
|
|
1074
1335
|
|
|
1075
1336
|
/** @deprecated Use `assertRegExpLiteral` */
|
|
1076
|
-
assertRegexLiteral(
|
|
1077
|
-
assertRestElement(
|
|
1337
|
+
assertRegexLiteral(opts?: object): asserts this is NodePath<t.RegexLiteral>;
|
|
1338
|
+
assertRestElement(opts?: object): asserts this is NodePath<t.RestElement>;
|
|
1078
1339
|
|
|
1079
1340
|
/** @deprecated Use `assertRestElement` */
|
|
1080
|
-
assertRestProperty(
|
|
1081
|
-
assertReturnStatement(
|
|
1082
|
-
assertScopable(
|
|
1083
|
-
assertSequenceExpression(
|
|
1084
|
-
assertSpreadElement(
|
|
1341
|
+
assertRestProperty(opts?: object): asserts this is NodePath<t.RestProperty>;
|
|
1342
|
+
assertReturnStatement(opts?: object): asserts this is NodePath<t.ReturnStatement>;
|
|
1343
|
+
assertScopable(opts?: object): asserts this is NodePath<t.Scopable>;
|
|
1344
|
+
assertSequenceExpression(opts?: object): asserts this is NodePath<t.SequenceExpression>;
|
|
1345
|
+
assertSpreadElement(opts?: object): asserts this is NodePath<t.SpreadElement>;
|
|
1085
1346
|
|
|
1086
1347
|
/** @deprecated Use `assertSpreadElement` */
|
|
1087
|
-
assertSpreadProperty(
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1348
|
+
assertSpreadProperty(opts?: object): asserts this is NodePath<t.SpreadProperty>;
|
|
1349
|
+
assertStandardized(opts?: object): asserts this is NodePath<t.Standardized>;
|
|
1350
|
+
assertStatement(opts?: object): asserts this is NodePath<t.Statement>;
|
|
1351
|
+
assertStaticBlock(opts?: object): asserts this is NodePath<t.StaticBlock>;
|
|
1352
|
+
assertStringLiteral(opts?: object): asserts this is NodePath<t.StringLiteral>;
|
|
1353
|
+
assertStringLiteralTypeAnnotation(opts?: object): asserts this is NodePath<t.StringLiteralTypeAnnotation>;
|
|
1354
|
+
assertStringTypeAnnotation(opts?: object): asserts this is NodePath<t.StringTypeAnnotation>;
|
|
1355
|
+
assertSuper(opts?: object): asserts this is NodePath<t.Super>;
|
|
1356
|
+
assertSwitchCase(opts?: object): asserts this is NodePath<t.SwitchCase>;
|
|
1357
|
+
assertSwitchStatement(opts?: object): asserts this is NodePath<t.SwitchStatement>;
|
|
1358
|
+
assertSymbolTypeAnnotation(opts?: object): asserts this is NodePath<t.SymbolTypeAnnotation>;
|
|
1359
|
+
assertTSAnyKeyword(opts?: object): asserts this is NodePath<t.TSAnyKeyword>;
|
|
1360
|
+
assertTSArrayType(opts?: object): asserts this is NodePath<t.TSArrayType>;
|
|
1361
|
+
assertTSAsExpression(opts?: object): asserts this is NodePath<t.TSAsExpression>;
|
|
1362
|
+
assertTSBaseType(opts?: object): asserts this is NodePath<t.TSBaseType>;
|
|
1363
|
+
assertTSBigIntKeyword(opts?: object): asserts this is NodePath<t.TSBigIntKeyword>;
|
|
1364
|
+
assertTSBooleanKeyword(opts?: object): asserts this is NodePath<t.TSBooleanKeyword>;
|
|
1365
|
+
assertTSCallSignatureDeclaration(opts?: object): asserts this is NodePath<t.TSCallSignatureDeclaration>;
|
|
1366
|
+
assertTSConditionalType(opts?: object): asserts this is NodePath<t.TSConditionalType>;
|
|
1367
|
+
assertTSConstructSignatureDeclaration(opts?: object): asserts this is NodePath<t.TSConstructSignatureDeclaration>;
|
|
1368
|
+
assertTSConstructorType(opts?: object): asserts this is NodePath<t.TSConstructorType>;
|
|
1369
|
+
assertTSDeclareFunction(opts?: object): asserts this is NodePath<t.TSDeclareFunction>;
|
|
1370
|
+
assertTSDeclareMethod(opts?: object): asserts this is NodePath<t.TSDeclareMethod>;
|
|
1371
|
+
assertTSEntityName(opts?: object): asserts this is NodePath<t.TSEntityName>;
|
|
1372
|
+
assertTSEnumDeclaration(opts?: object): asserts this is NodePath<t.TSEnumDeclaration>;
|
|
1373
|
+
assertTSEnumMember(opts?: object): asserts this is NodePath<t.TSEnumMember>;
|
|
1374
|
+
assertTSExportAssignment(opts?: object): asserts this is NodePath<t.TSExportAssignment>;
|
|
1375
|
+
assertTSExpressionWithTypeArguments(opts?: object): asserts this is NodePath<t.TSExpressionWithTypeArguments>;
|
|
1376
|
+
assertTSExternalModuleReference(opts?: object): asserts this is NodePath<t.TSExternalModuleReference>;
|
|
1377
|
+
assertTSFunctionType(opts?: object): asserts this is NodePath<t.TSFunctionType>;
|
|
1378
|
+
assertTSImportEqualsDeclaration(opts?: object): asserts this is NodePath<t.TSImportEqualsDeclaration>;
|
|
1379
|
+
assertTSImportType(opts?: object): asserts this is NodePath<t.TSImportType>;
|
|
1380
|
+
assertTSIndexSignature(opts?: object): asserts this is NodePath<t.TSIndexSignature>;
|
|
1381
|
+
assertTSIndexedAccessType(opts?: object): asserts this is NodePath<t.TSIndexedAccessType>;
|
|
1382
|
+
assertTSInferType(opts?: object): asserts this is NodePath<t.TSInferType>;
|
|
1383
|
+
assertTSInstantiationExpression(opts?: object): asserts this is NodePath<t.TSInstantiationExpression>;
|
|
1384
|
+
assertTSInterfaceBody(opts?: object): asserts this is NodePath<t.TSInterfaceBody>;
|
|
1385
|
+
assertTSInterfaceDeclaration(opts?: object): asserts this is NodePath<t.TSInterfaceDeclaration>;
|
|
1386
|
+
assertTSIntersectionType(opts?: object): asserts this is NodePath<t.TSIntersectionType>;
|
|
1387
|
+
assertTSIntrinsicKeyword(opts?: object): asserts this is NodePath<t.TSIntrinsicKeyword>;
|
|
1388
|
+
assertTSLiteralType(opts?: object): asserts this is NodePath<t.TSLiteralType>;
|
|
1389
|
+
assertTSMappedType(opts?: object): asserts this is NodePath<t.TSMappedType>;
|
|
1390
|
+
assertTSMethodSignature(opts?: object): asserts this is NodePath<t.TSMethodSignature>;
|
|
1391
|
+
assertTSModuleBlock(opts?: object): asserts this is NodePath<t.TSModuleBlock>;
|
|
1392
|
+
assertTSModuleDeclaration(opts?: object): asserts this is NodePath<t.TSModuleDeclaration>;
|
|
1393
|
+
assertTSNamedTupleMember(opts?: object): asserts this is NodePath<t.TSNamedTupleMember>;
|
|
1394
|
+
assertTSNamespaceExportDeclaration(opts?: object): asserts this is NodePath<t.TSNamespaceExportDeclaration>;
|
|
1395
|
+
assertTSNeverKeyword(opts?: object): asserts this is NodePath<t.TSNeverKeyword>;
|
|
1396
|
+
assertTSNonNullExpression(opts?: object): asserts this is NodePath<t.TSNonNullExpression>;
|
|
1397
|
+
assertTSNullKeyword(opts?: object): asserts this is NodePath<t.TSNullKeyword>;
|
|
1398
|
+
assertTSNumberKeyword(opts?: object): asserts this is NodePath<t.TSNumberKeyword>;
|
|
1399
|
+
assertTSObjectKeyword(opts?: object): asserts this is NodePath<t.TSObjectKeyword>;
|
|
1400
|
+
assertTSOptionalType(opts?: object): asserts this is NodePath<t.TSOptionalType>;
|
|
1401
|
+
assertTSParameterProperty(opts?: object): asserts this is NodePath<t.TSParameterProperty>;
|
|
1402
|
+
assertTSParenthesizedType(opts?: object): asserts this is NodePath<t.TSParenthesizedType>;
|
|
1403
|
+
assertTSPropertySignature(opts?: object): asserts this is NodePath<t.TSPropertySignature>;
|
|
1404
|
+
assertTSQualifiedName(opts?: object): asserts this is NodePath<t.TSQualifiedName>;
|
|
1405
|
+
assertTSRestType(opts?: object): asserts this is NodePath<t.TSRestType>;
|
|
1406
|
+
assertTSSatisfiesExpression(opts?: object): asserts this is NodePath<t.TSSatisfiesExpression>;
|
|
1407
|
+
assertTSStringKeyword(opts?: object): asserts this is NodePath<t.TSStringKeyword>;
|
|
1408
|
+
assertTSSymbolKeyword(opts?: object): asserts this is NodePath<t.TSSymbolKeyword>;
|
|
1409
|
+
assertTSThisType(opts?: object): asserts this is NodePath<t.TSThisType>;
|
|
1410
|
+
assertTSTupleType(opts?: object): asserts this is NodePath<t.TSTupleType>;
|
|
1411
|
+
assertTSType(opts?: object): asserts this is NodePath<t.TSType>;
|
|
1412
|
+
assertTSTypeAliasDeclaration(opts?: object): asserts this is NodePath<t.TSTypeAliasDeclaration>;
|
|
1413
|
+
assertTSTypeAnnotation(opts?: object): asserts this is NodePath<t.TSTypeAnnotation>;
|
|
1414
|
+
assertTSTypeAssertion(opts?: object): asserts this is NodePath<t.TSTypeAssertion>;
|
|
1415
|
+
assertTSTypeElement(opts?: object): asserts this is NodePath<t.TSTypeElement>;
|
|
1416
|
+
assertTSTypeLiteral(opts?: object): asserts this is NodePath<t.TSTypeLiteral>;
|
|
1417
|
+
assertTSTypeOperator(opts?: object): asserts this is NodePath<t.TSTypeOperator>;
|
|
1418
|
+
assertTSTypeParameter(opts?: object): asserts this is NodePath<t.TSTypeParameter>;
|
|
1419
|
+
assertTSTypeParameterDeclaration(opts?: object): asserts this is NodePath<t.TSTypeParameterDeclaration>;
|
|
1420
|
+
assertTSTypeParameterInstantiation(opts?: object): asserts this is NodePath<t.TSTypeParameterInstantiation>;
|
|
1421
|
+
assertTSTypePredicate(opts?: object): asserts this is NodePath<t.TSTypePredicate>;
|
|
1422
|
+
assertTSTypeQuery(opts?: object): asserts this is NodePath<t.TSTypeQuery>;
|
|
1423
|
+
assertTSTypeReference(opts?: object): asserts this is NodePath<t.TSTypeReference>;
|
|
1424
|
+
assertTSUndefinedKeyword(opts?: object): asserts this is NodePath<t.TSUndefinedKeyword>;
|
|
1425
|
+
assertTSUnionType(opts?: object): asserts this is NodePath<t.TSUnionType>;
|
|
1426
|
+
assertTSUnknownKeyword(opts?: object): asserts this is NodePath<t.TSUnknownKeyword>;
|
|
1427
|
+
assertTSVoidKeyword(opts?: object): asserts this is NodePath<t.TSVoidKeyword>;
|
|
1428
|
+
assertTaggedTemplateExpression(opts?: object): asserts this is NodePath<t.TaggedTemplateExpression>;
|
|
1429
|
+
assertTemplateElement(opts?: object): asserts this is NodePath<t.TemplateElement>;
|
|
1430
|
+
assertTemplateLiteral(opts?: object): asserts this is NodePath<t.TemplateLiteral>;
|
|
1431
|
+
assertTerminatorless(opts?: object): asserts this is NodePath<t.Terminatorless>;
|
|
1432
|
+
assertThisExpression(opts?: object): asserts this is NodePath<t.ThisExpression>;
|
|
1433
|
+
assertThisTypeAnnotation(opts?: object): asserts this is NodePath<t.ThisTypeAnnotation>;
|
|
1434
|
+
assertThrowStatement(opts?: object): asserts this is NodePath<t.ThrowStatement>;
|
|
1435
|
+
assertTopicReference(opts?: object): asserts this is NodePath<t.TopicReference>;
|
|
1436
|
+
assertTryStatement(opts?: object): asserts this is NodePath<t.TryStatement>;
|
|
1437
|
+
assertTupleExpression(opts?: object): asserts this is NodePath<t.TupleExpression>;
|
|
1438
|
+
assertTupleTypeAnnotation(opts?: object): asserts this is NodePath<t.TupleTypeAnnotation>;
|
|
1439
|
+
assertTypeAlias(opts?: object): asserts this is NodePath<t.TypeAlias>;
|
|
1440
|
+
assertTypeAnnotation(opts?: object): asserts this is NodePath<t.TypeAnnotation>;
|
|
1441
|
+
assertTypeCastExpression(opts?: object): asserts this is NodePath<t.TypeCastExpression>;
|
|
1442
|
+
assertTypeParameter(opts?: object): asserts this is NodePath<t.TypeParameter>;
|
|
1443
|
+
assertTypeParameterDeclaration(opts?: object): asserts this is NodePath<t.TypeParameterDeclaration>;
|
|
1444
|
+
assertTypeParameterInstantiation(opts?: object): asserts this is NodePath<t.TypeParameterInstantiation>;
|
|
1445
|
+
assertTypeScript(opts?: object): asserts this is NodePath<t.TypeScript>;
|
|
1446
|
+
assertTypeofTypeAnnotation(opts?: object): asserts this is NodePath<t.TypeofTypeAnnotation>;
|
|
1447
|
+
assertUnaryExpression(opts?: object): asserts this is NodePath<t.UnaryExpression>;
|
|
1448
|
+
assertUnaryLike(opts?: object): asserts this is NodePath<t.UnaryLike>;
|
|
1449
|
+
assertUnionTypeAnnotation(opts?: object): asserts this is NodePath<t.UnionTypeAnnotation>;
|
|
1450
|
+
assertUpdateExpression(opts?: object): asserts this is NodePath<t.UpdateExpression>;
|
|
1451
|
+
assertUserWhitespacable(opts?: object): asserts this is NodePath<t.UserWhitespacable>;
|
|
1452
|
+
assertV8IntrinsicIdentifier(opts?: object): asserts this is NodePath<t.V8IntrinsicIdentifier>;
|
|
1453
|
+
assertVariableDeclaration(opts?: object): asserts this is NodePath<t.VariableDeclaration>;
|
|
1454
|
+
assertVariableDeclarator(opts?: object): asserts this is NodePath<t.VariableDeclarator>;
|
|
1455
|
+
assertVariance(opts?: object): asserts this is NodePath<t.Variance>;
|
|
1456
|
+
assertVoidTypeAnnotation(opts?: object): asserts this is NodePath<t.VoidTypeAnnotation>;
|
|
1457
|
+
assertWhile(opts?: object): asserts this is NodePath<t.While>;
|
|
1458
|
+
assertWhileStatement(opts?: object): asserts this is NodePath<t.WhileStatement>;
|
|
1459
|
+
assertWithStatement(opts?: object): asserts this is NodePath<t.WithStatement>;
|
|
1460
|
+
assertYieldExpression(opts?: object): asserts this is NodePath<t.YieldExpression>;
|
|
1198
1461
|
//#endregion
|
|
1199
1462
|
}
|
|
1200
1463
|
|
|
@@ -1215,7 +1478,7 @@ export interface HubInterface {
|
|
|
1215
1478
|
getCode(): string | undefined;
|
|
1216
1479
|
getScope(): Scope | undefined;
|
|
1217
1480
|
addHelper(name: string): any;
|
|
1218
|
-
buildError
|
|
1481
|
+
buildError(node: Node, msg: string, Error: ErrorConstructor): Error;
|
|
1219
1482
|
}
|
|
1220
1483
|
|
|
1221
1484
|
export class Hub implements HubInterface {
|
|
@@ -1224,16 +1487,35 @@ export class Hub implements HubInterface {
|
|
|
1224
1487
|
getCode(): string | undefined;
|
|
1225
1488
|
getScope(): Scope | undefined;
|
|
1226
1489
|
addHelper(name: string): any;
|
|
1227
|
-
buildError
|
|
1490
|
+
buildError(node: Node, msg: string, Error?: ErrorConstructor): Error;
|
|
1228
1491
|
}
|
|
1229
1492
|
|
|
1230
|
-
export interface TraversalContext {
|
|
1493
|
+
export interface TraversalContext<S = unknown> {
|
|
1231
1494
|
parentPath: NodePath;
|
|
1232
1495
|
scope: Scope;
|
|
1233
|
-
state:
|
|
1234
|
-
opts:
|
|
1496
|
+
state: S;
|
|
1497
|
+
opts: TraverseOptions;
|
|
1235
1498
|
}
|
|
1236
1499
|
|
|
1237
1500
|
export type NodePathResult<T> =
|
|
1238
1501
|
| (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>)
|
|
1239
1502
|
| (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
|
|
1503
|
+
|
|
1504
|
+
export interface VirtualTypeAliases {
|
|
1505
|
+
BindingIdentifier: t.Identifier;
|
|
1506
|
+
BlockScoped: Node;
|
|
1507
|
+
ExistentialTypeParam: t.ExistsTypeAnnotation;
|
|
1508
|
+
Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;
|
|
1509
|
+
ForAwaitStatement: t.ForOfStatement;
|
|
1510
|
+
Generated: Node;
|
|
1511
|
+
NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;
|
|
1512
|
+
Pure: Node;
|
|
1513
|
+
Referenced: Node;
|
|
1514
|
+
ReferencedIdentifier: t.Identifier | t.JSXIdentifier;
|
|
1515
|
+
ReferencedMemberExpression: t.MemberExpression;
|
|
1516
|
+
RestProperty: t.RestElement;
|
|
1517
|
+
Scope: t.Scopable | t.Pattern;
|
|
1518
|
+
SpreadProperty: t.RestElement;
|
|
1519
|
+
User: Node;
|
|
1520
|
+
Var: t.VariableDeclaration;
|
|
1521
|
+
}
|