@memoized-dom/compiler 0.0.4 → 0.0.6
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/README.md +106 -28
- package/dist/analysis/access-table.d.ts +1 -1
- package/dist/analysis/access-table.d.ts.map +1 -1
- package/dist/analysis/component-graph.d.ts +16 -1
- package/dist/analysis/component-graph.d.ts.map +1 -1
- package/dist/analysis/component-reads.d.ts +1 -1
- package/dist/analysis/component-reads.d.ts.map +1 -1
- package/dist/analysis/computed.d.ts +9 -5
- package/dist/analysis/computed.d.ts.map +1 -1
- package/dist/analysis/instance-control-flow.d.ts +1 -1
- package/dist/analysis/instance-control-flow.d.ts.map +1 -1
- package/dist/analysis/instance.d.ts +3 -4
- package/dist/analysis/instance.d.ts.map +1 -1
- package/dist/analysis/module-discovery.d.ts +27 -0
- package/dist/analysis/module-discovery.d.ts.map +1 -0
- package/dist/analysis/opaque-volatility.d.ts +7 -0
- package/dist/analysis/opaque-volatility.d.ts.map +1 -0
- package/dist/analysis/runtime-pattern.d.ts +3 -4
- package/dist/analysis/runtime-pattern.d.ts.map +1 -1
- package/dist/analysis/type-candidates.d.ts +15 -3
- package/dist/analysis/type-candidates.d.ts.map +1 -1
- package/dist/analysis.d.ts +7 -4
- package/dist/analysis.d.ts.map +1 -1
- package/dist/ast/builders.d.ts +108 -0
- package/dist/ast/builders.d.ts.map +1 -0
- package/dist/ast/compiler-types.d.ts +196 -0
- package/dist/ast/compiler-types.d.ts.map +1 -0
- package/dist/ast/factory.d.ts +139 -0
- package/dist/ast/factory.d.ts.map +1 -0
- package/dist/ast/index.d.ts +15 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/mutate.d.ts +17 -0
- package/dist/ast/mutate.d.ts.map +1 -0
- package/dist/ast/normalize.d.ts +9 -0
- package/dist/ast/normalize.d.ts.map +1 -0
- package/dist/ast/parser.d.ts +72 -0
- package/dist/ast/parser.d.ts.map +1 -0
- package/dist/ast/printer.d.ts +23 -0
- package/dist/ast/printer.d.ts.map +1 -0
- package/dist/ast/scope.d.ts +44 -0
- package/dist/ast/scope.d.ts.map +1 -0
- package/dist/ast/strip-typescript.d.ts +9 -0
- package/dist/ast/strip-typescript.d.ts.map +1 -0
- package/dist/ast/transform.d.ts +21 -0
- package/dist/ast/transform.d.ts.map +1 -0
- package/dist/ast/tsrx/frontend.d.ts +8 -0
- package/dist/ast/tsrx/frontend.d.ts.map +1 -0
- package/dist/ast/tsrx/index.d.ts +5 -0
- package/dist/ast/tsrx/index.d.ts.map +1 -0
- package/dist/ast/tsrx/lower.d.ts +8 -0
- package/dist/ast/tsrx/lower.d.ts.map +1 -0
- package/dist/ast/tsrx/style.d.ts +8 -0
- package/dist/ast/tsrx/style.d.ts.map +1 -0
- package/dist/ast/tsrx/types.d.ts +50 -0
- package/dist/ast/tsrx/types.d.ts.map +1 -0
- package/dist/ast/types.d.ts +478 -0
- package/dist/ast/types.d.ts.map +1 -0
- package/dist/ast/walk.d.ts +22 -0
- package/dist/ast/walk.d.ts.map +1 -0
- package/dist/cells.d.ts +10 -0
- package/dist/cells.d.ts.map +1 -0
- package/dist/compile.d.ts +30 -14
- package/dist/compile.d.ts.map +1 -1
- package/dist/component-linker.d.ts +5 -1
- package/dist/component-linker.d.ts.map +1 -1
- package/dist/components/callback-props.d.ts +1 -1
- package/dist/components/callback-props.d.ts.map +1 -1
- package/dist/components/calls.d.ts +1 -1
- package/dist/components/calls.d.ts.map +1 -1
- package/dist/components/children.d.ts +5 -3
- package/dist/components/children.d.ts.map +1 -1
- package/dist/components/declarations.d.ts +10 -3
- package/dist/components/declarations.d.ts.map +1 -1
- package/dist/components/jsx-values.d.ts +2 -4
- package/dist/components/jsx-values.d.ts.map +1 -1
- package/dist/components/local-derived.d.ts +1 -1
- package/dist/components/local-derived.d.ts.map +1 -1
- package/dist/components/manifest.d.ts +2 -3
- package/dist/components/manifest.d.ts.map +1 -1
- package/dist/components/prop-effects.d.ts.map +1 -1
- package/dist/components/prop-linker.d.ts.map +1 -1
- package/dist/components/prop-origins.d.ts +2 -0
- package/dist/components/prop-origins.d.ts.map +1 -1
- package/dist/components/prop-projections.d.ts.map +1 -1
- package/dist/components/prop-shape.d.ts +11 -0
- package/dist/components/prop-shape.d.ts.map +1 -0
- package/dist/components/props.d.ts +9 -1
- package/dist/components/props.d.ts.map +1 -1
- package/dist/components/ref-props.d.ts.map +1 -1
- package/dist/components/render-callbacks.d.ts +9 -5
- package/dist/components/render-callbacks.d.ts.map +1 -1
- package/dist/components/render-functions.d.ts +1 -0
- package/dist/components/render-functions.d.ts.map +1 -1
- package/dist/components/render-prelude.d.ts +1 -1
- package/dist/components/render-prelude.d.ts.map +1 -1
- package/dist/components/return-plan.d.ts +13 -7
- package/dist/components/return-plan.d.ts.map +1 -1
- package/dist/conds.d.ts +6 -3
- package/dist/conds.d.ts.map +1 -1
- package/dist/context/ast.d.ts +18 -5
- package/dist/context/ast.d.ts.map +1 -1
- package/dist/context/model.d.ts +146 -13
- package/dist/context/model.d.ts.map +1 -1
- package/dist/data-sources.d.ts +78 -0
- package/dist/data-sources.d.ts.map +1 -0
- package/dist/diagnostics.d.ts +20 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/effects.d.ts +13 -5
- package/dist/effects.d.ts.map +1 -1
- package/dist/emission/component.d.ts +3 -3
- package/dist/emission/component.d.ts.map +1 -1
- package/dist/emission/conditional-region.d.ts +6 -5
- package/dist/emission/conditional-region.d.ts.map +1 -1
- package/dist/emission/dom-template.d.ts.map +1 -1
- package/dist/emission/list-region.d.ts +6 -4
- package/dist/emission/list-region.d.ts.map +1 -1
- package/dist/emission/node-emitter.d.ts +4 -3
- package/dist/emission/node-emitter.d.ts.map +1 -1
- package/dist/emission/render-callback.d.ts +4 -3
- package/dist/emission/render-callback.d.ts.map +1 -1
- package/dist/emission/route-region.d.ts +10 -0
- package/dist/emission/route-region.d.ts.map +1 -0
- package/dist/emission/scope.d.ts +14 -2
- package/dist/emission/scope.d.ts.map +1 -1
- package/dist/emit.d.ts +5 -4
- package/dist/emit.d.ts.map +1 -1
- package/dist/errors.d.ts +15 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/handler-commits.d.ts +6 -1
- package/dist/handler-commits.d.ts.map +1 -1
- package/dist/handler-origin.d.ts +1 -1
- package/dist/handler-origin.d.ts.map +1 -1
- package/dist/handlers/analyze.d.ts +1 -1
- package/dist/handlers/analyze.d.ts.map +1 -1
- package/dist/handlers/local-calls.d.ts +2 -2
- package/dist/handlers/local-calls.d.ts.map +1 -1
- package/dist/handlers.d.ts +6 -5
- package/dist/handlers.d.ts.map +1 -1
- package/dist/helper-summaries.d.ts +2 -3
- package/dist/helper-summaries.d.ts.map +1 -1
- package/dist/identifiers.d.ts +15 -8
- package/dist/identifiers.d.ts.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/jsx/attributes.d.ts +1 -1
- package/dist/jsx/attributes.d.ts.map +1 -1
- package/dist/jsx/children.d.ts +3 -2
- package/dist/jsx/children.d.ts.map +1 -1
- package/dist/jsx/conditional-directives.d.ts +21 -0
- package/dist/jsx/conditional-directives.d.ts.map +1 -0
- package/dist/jsx/dom-attributes.d.ts +1 -1
- package/dist/jsx/dom-attributes.d.ts.map +1 -1
- package/dist/jsx/dynamic-tags.d.ts +9 -15
- package/dist/jsx/dynamic-tags.d.ts.map +1 -1
- package/dist/jsx/events.d.ts +2 -3
- package/dist/jsx/events.d.ts.map +1 -1
- package/dist/jsx/refs.d.ts +5 -4
- package/dist/jsx/refs.d.ts.map +1 -1
- package/dist/jsx/svg.d.ts +2 -2
- package/dist/jsx/svg.d.ts.map +1 -1
- package/dist/jsx-types.d.ts +42 -0
- package/dist/jsx-types.d.ts.map +1 -0
- package/dist/lifecycle.d.ts +10 -5
- package/dist/lifecycle.d.ts.map +1 -1
- package/dist/linker.d.ts +56 -5
- package/dist/linker.d.ts.map +1 -1
- package/dist/lists/calculated-sources.d.ts +1 -1
- package/dist/lists/calculated-sources.d.ts.map +1 -1
- package/dist/lists/map-site.d.ts +16 -8
- package/dist/lists/map-site.d.ts.map +1 -1
- package/dist/lists/source-shapes.d.ts +12 -3
- package/dist/lists/source-shapes.d.ts.map +1 -1
- package/dist/lists/static-derived.d.ts +37 -0
- package/dist/lists/static-derived.d.ts.map +1 -0
- package/dist/lists/targeted-refresh.d.ts +9 -2
- package/dist/lists/targeted-refresh.d.ts.map +1 -1
- package/dist/lists.d.ts +1 -0
- package/dist/lists.d.ts.map +1 -1
- package/dist/module-control-flow.d.ts +7 -6
- package/dist/module-control-flow.d.ts.map +1 -1
- package/dist/mutation-analysis.d.ts +22 -8
- package/dist/mutation-analysis.d.ts.map +1 -1
- package/dist/plugin.d.ts +15 -14
- package/dist/plugin.d.ts.map +1 -1
- package/dist/router.d.ts +32 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/server-functions.d.ts +49 -0
- package/dist/server-functions.d.ts.map +1 -0
- package/package.json +34 -30
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** Parser-neutral node contracts used by compiler analysis and emission. */
|
|
2
|
+
import type * as e from './types';
|
|
3
|
+
export type Node = e.BaseNode;
|
|
4
|
+
export type Program = e.Program;
|
|
5
|
+
export interface File extends e.BaseNode {
|
|
6
|
+
type: 'File';
|
|
7
|
+
program: Program;
|
|
8
|
+
}
|
|
9
|
+
export type Statement = e.Statement;
|
|
10
|
+
export type Expression = e.Expression;
|
|
11
|
+
export type Identifier = e.Identifier;
|
|
12
|
+
export type ArrayExpression = e.ArrayExpression;
|
|
13
|
+
export type ArrayPattern = e.ArrayPattern;
|
|
14
|
+
export type ArrowFunctionExpression = e.ArrowFunctionExpression;
|
|
15
|
+
export type AwaitExpression = e.AwaitExpression;
|
|
16
|
+
export type AssignmentExpression = e.AssignmentExpression;
|
|
17
|
+
export type AssignmentPattern = e.AssignmentPattern;
|
|
18
|
+
export type BinaryExpression = e.BinaryExpression;
|
|
19
|
+
export type BlockStatement = e.BlockStatement;
|
|
20
|
+
export type BreakStatement = e.BreakStatement;
|
|
21
|
+
export type CallExpression = e.CallExpression;
|
|
22
|
+
export type ChainExpression = e.ChainExpression;
|
|
23
|
+
export type ConditionalExpression = e.ConditionalExpression;
|
|
24
|
+
export type ClassDeclaration = e.ClassDeclaration;
|
|
25
|
+
export type EmptyStatement = e.EmptyStatement;
|
|
26
|
+
export type ExportDefaultDeclaration = e.ExportDefaultDeclaration;
|
|
27
|
+
export type ExportNamedDeclaration = e.ExportNamedDeclaration;
|
|
28
|
+
export type ExportSpecifier = e.ExportSpecifier;
|
|
29
|
+
export type ExpressionStatement = e.ExpressionStatement;
|
|
30
|
+
export type ForOfStatement = e.ForOfStatement;
|
|
31
|
+
export type FunctionDeclaration = e.FunctionDeclaration;
|
|
32
|
+
export type FunctionExpression = e.FunctionExpression;
|
|
33
|
+
export type IfStatement = e.IfStatement;
|
|
34
|
+
export type ImportDeclaration = e.ImportDeclaration;
|
|
35
|
+
export type ImportDefaultSpecifier = e.ImportDefaultSpecifier;
|
|
36
|
+
export type ImportSpecifier = e.ImportSpecifier;
|
|
37
|
+
export type JSXAttribute = e.JSXAttribute;
|
|
38
|
+
export type JSXElement = e.JSXElement;
|
|
39
|
+
export type JSXExpressionContainer = e.JSXExpressionContainer;
|
|
40
|
+
export type JSXEmptyExpression = e.JSXEmptyExpression;
|
|
41
|
+
export type JSXFragment = e.JSXFragment;
|
|
42
|
+
export type JSXIdentifier = e.JSXIdentifier;
|
|
43
|
+
export type JSXMemberExpression = e.JSXMemberExpression;
|
|
44
|
+
export type JSXNamespacedName = e.JSXNamespacedName;
|
|
45
|
+
export type JSXOpeningElement = e.JSXOpeningElement;
|
|
46
|
+
export type JSXSpreadAttribute = e.JSXSpreadAttribute;
|
|
47
|
+
export type JSXSpreadChild = e.JSXSpreadChild;
|
|
48
|
+
export type JSXText = e.JSXText;
|
|
49
|
+
export type LogicalExpression = e.LogicalExpression;
|
|
50
|
+
export type MemberExpression = e.MemberExpression;
|
|
51
|
+
export type MetaProperty = e.MetaProperty;
|
|
52
|
+
export type NewExpression = e.NewExpression;
|
|
53
|
+
export type ObjectExpression = e.ObjectExpression;
|
|
54
|
+
export type ObjectPattern = e.ObjectPattern;
|
|
55
|
+
export type ObjectProperty = e.Property;
|
|
56
|
+
export type OptionalCallExpression = e.CallExpression;
|
|
57
|
+
export type OptionalMemberExpression = e.MemberExpression;
|
|
58
|
+
export type RestElement = e.RestElement;
|
|
59
|
+
export type ReturnStatement = e.ReturnStatement;
|
|
60
|
+
export type SpreadElement = e.SpreadElement;
|
|
61
|
+
export type SwitchCase = e.SwitchCase;
|
|
62
|
+
export type SwitchStatement = e.SwitchStatement;
|
|
63
|
+
export type TemplateLiteral = e.TemplateLiteral;
|
|
64
|
+
export type UnaryExpression = e.UnaryExpression;
|
|
65
|
+
export type UpdateExpression = e.UpdateExpression;
|
|
66
|
+
export type VariableDeclaration = e.VariableDeclaration;
|
|
67
|
+
export type VariableDeclarator = e.VariableDeclarator;
|
|
68
|
+
export type YieldExpression = e.YieldExpression;
|
|
69
|
+
export type StringLiteral = e.StringLiteral;
|
|
70
|
+
export type NumericLiteral = e.NumericLiteral;
|
|
71
|
+
export type BooleanLiteral = e.BooleanLiteral;
|
|
72
|
+
export type NullLiteral = e.NullLiteral;
|
|
73
|
+
export type BigIntLiteral = e.Literal & {
|
|
74
|
+
value: bigint;
|
|
75
|
+
};
|
|
76
|
+
export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
|
77
|
+
export type LVal = e.Pattern | TSParameterProperty;
|
|
78
|
+
export interface Super extends e.BaseNode {
|
|
79
|
+
type: 'Super';
|
|
80
|
+
}
|
|
81
|
+
export interface PrivateName extends e.BaseNode {
|
|
82
|
+
type: 'PrivateName';
|
|
83
|
+
id: Identifier;
|
|
84
|
+
}
|
|
85
|
+
export interface ArgumentPlaceholder extends e.BaseNode {
|
|
86
|
+
type: 'ArgumentPlaceholder';
|
|
87
|
+
}
|
|
88
|
+
export interface V8IntrinsicIdentifier extends e.BaseNode {
|
|
89
|
+
type: 'V8IntrinsicIdentifier';
|
|
90
|
+
name: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TypeScriptNode extends e.BaseNode {
|
|
93
|
+
type: `TS${string}`;
|
|
94
|
+
}
|
|
95
|
+
export type TSType = TypeScriptNode;
|
|
96
|
+
export type TSTypeElement = TypeScriptNode;
|
|
97
|
+
export type TypeAnnotation = TypeScriptNode;
|
|
98
|
+
export interface TSTypeAnnotation extends TypeScriptNode {
|
|
99
|
+
type: 'TSTypeAnnotation';
|
|
100
|
+
typeAnnotation: TSType;
|
|
101
|
+
}
|
|
102
|
+
export interface TSTypeReference extends TypeScriptNode {
|
|
103
|
+
type: 'TSTypeReference';
|
|
104
|
+
typeName: Identifier | TypeScriptNode;
|
|
105
|
+
}
|
|
106
|
+
export interface TSUnionType extends TypeScriptNode {
|
|
107
|
+
type: 'TSUnionType';
|
|
108
|
+
types: TSType[];
|
|
109
|
+
}
|
|
110
|
+
export interface TSParenthesizedType extends TypeScriptNode {
|
|
111
|
+
type: 'TSParenthesizedType';
|
|
112
|
+
typeAnnotation: TSType;
|
|
113
|
+
}
|
|
114
|
+
export interface TSLiteralType extends TypeScriptNode {
|
|
115
|
+
type: 'TSLiteralType';
|
|
116
|
+
literal: Expression;
|
|
117
|
+
}
|
|
118
|
+
export interface TSTypeAliasDeclaration extends TypeScriptNode {
|
|
119
|
+
type: 'TSTypeAliasDeclaration';
|
|
120
|
+
id: Identifier;
|
|
121
|
+
typeAnnotation: TSType;
|
|
122
|
+
}
|
|
123
|
+
export interface TSInterfaceBody extends TypeScriptNode {
|
|
124
|
+
type: 'TSInterfaceBody';
|
|
125
|
+
body: TSTypeElement[];
|
|
126
|
+
}
|
|
127
|
+
export interface TSInterfaceDeclaration extends TypeScriptNode {
|
|
128
|
+
type: 'TSInterfaceDeclaration';
|
|
129
|
+
id: Identifier;
|
|
130
|
+
body: TSInterfaceBody;
|
|
131
|
+
}
|
|
132
|
+
export interface TSPropertySignature extends TypeScriptNode {
|
|
133
|
+
type: 'TSPropertySignature';
|
|
134
|
+
computed: boolean;
|
|
135
|
+
key: Expression | PrivateName;
|
|
136
|
+
typeAnnotation?: TSTypeAnnotation | null;
|
|
137
|
+
}
|
|
138
|
+
export interface TSUndefinedKeyword extends TypeScriptNode {
|
|
139
|
+
type: 'TSUndefinedKeyword';
|
|
140
|
+
}
|
|
141
|
+
export interface TSNullKeyword extends TypeScriptNode {
|
|
142
|
+
type: 'TSNullKeyword';
|
|
143
|
+
}
|
|
144
|
+
export interface TSSymbolKeyword extends TypeScriptNode {
|
|
145
|
+
type: 'TSSymbolKeyword';
|
|
146
|
+
}
|
|
147
|
+
export interface TSStringKeyword extends TypeScriptNode {
|
|
148
|
+
type: 'TSStringKeyword';
|
|
149
|
+
}
|
|
150
|
+
export interface TSBigIntKeyword extends TypeScriptNode {
|
|
151
|
+
type: 'TSBigIntKeyword';
|
|
152
|
+
}
|
|
153
|
+
export interface TSBooleanKeyword extends TypeScriptNode {
|
|
154
|
+
type: 'TSBooleanKeyword';
|
|
155
|
+
}
|
|
156
|
+
export interface TSNumberKeyword extends TypeScriptNode {
|
|
157
|
+
type: 'TSNumberKeyword';
|
|
158
|
+
}
|
|
159
|
+
export interface TSParameterProperty extends TypeScriptNode {
|
|
160
|
+
type: 'TSParameterProperty';
|
|
161
|
+
parameter: e.Pattern;
|
|
162
|
+
}
|
|
163
|
+
export interface TSAsExpression extends TypeScriptNode {
|
|
164
|
+
type: 'TSAsExpression';
|
|
165
|
+
expression: e.Expression;
|
|
166
|
+
typeAnnotation: TSType;
|
|
167
|
+
}
|
|
168
|
+
export interface TSTypeAssertion extends TypeScriptNode {
|
|
169
|
+
type: 'TSTypeAssertion';
|
|
170
|
+
expression: e.Expression;
|
|
171
|
+
typeAnnotation: TSType;
|
|
172
|
+
}
|
|
173
|
+
export interface TSNonNullExpression extends TypeScriptNode {
|
|
174
|
+
type: 'TSNonNullExpression';
|
|
175
|
+
expression: e.Expression;
|
|
176
|
+
}
|
|
177
|
+
export interface TSSatisfiesExpression extends TypeScriptNode {
|
|
178
|
+
type: 'TSSatisfiesExpression';
|
|
179
|
+
expression: e.Expression;
|
|
180
|
+
typeAnnotation: TSType;
|
|
181
|
+
}
|
|
182
|
+
export interface TSInstantiationExpression extends TypeScriptNode {
|
|
183
|
+
type: 'TSInstantiationExpression';
|
|
184
|
+
expression: e.Expression;
|
|
185
|
+
}
|
|
186
|
+
export interface TypeCastExpression extends e.BaseNode {
|
|
187
|
+
type: 'TypeCastExpression';
|
|
188
|
+
expression: e.Expression;
|
|
189
|
+
typeAnnotation: e.BaseNode;
|
|
190
|
+
}
|
|
191
|
+
export type TransparentExpression = TSAsExpression | TSTypeAssertion | TSNonNullExpression | TSSatisfiesExpression | TSInstantiationExpression | TypeCastExpression;
|
|
192
|
+
export interface TSTypeLiteral extends TypeScriptNode {
|
|
193
|
+
type: 'TSTypeLiteral';
|
|
194
|
+
members: TSTypeElement[];
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=compiler-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-types.d.ts","sourceRoot":"","sources":["../../src/ast/compiler-types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,KAAK,CAAC,MAAM,SAAS,CAAC;AAElC,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC;AAC9B,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;AAChC,MAAM,WAAW,IAAK,SAAQ,CAAC,CAAC,QAAQ;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;AAEtC,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC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,cAAe,SAAQ,cAAc;IACpD,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,IAAI,EAAE,iBAAiB,CAAC;IACxB,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,IAAI,EAAE,qBAAqB,CAAC;IAC5B,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,IAAI,EAAE,uBAAuB,CAAC;IAC9B,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,IAAI,EAAE,2BAA2B,CAAC;IAClC,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAmB,SAAQ,CAAC,CAAC,QAAQ;IACpD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,UAAU,EAAE,CAAC,CAAC,UAAU,CAAC;IACzB,cAAc,EAAE,CAAC,CAAC,QAAQ,CAAC;CAC5B;AAED,MAAM,MAAM,qBAAqB,GAC7B,cAAc,GACd,eAAe,GACf,mBAAmB,GACnB,qBAAqB,GACrB,yBAAyB,GACzB,kBAAkB,CAAC;AAEvB,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,IAAI,EAAE,eAAe,CAAC;IACtB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC1B"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESTree node construction and predicates exposed through compiler-owned node
|
|
3
|
+
* contracts. Every function in this module constructs plain ESTree nodes.
|
|
4
|
+
*/
|
|
5
|
+
import type * as t from './compiler-types';
|
|
6
|
+
import * as estree from './builders';
|
|
7
|
+
export declare const identifier: typeof estree.identifier;
|
|
8
|
+
export declare const stringLiteral: typeof estree.stringLiteral;
|
|
9
|
+
export declare const numericLiteral: typeof estree.numericLiteral;
|
|
10
|
+
export declare const booleanLiteral: typeof estree.booleanLiteral;
|
|
11
|
+
export declare const nullLiteral: typeof estree.nullLiteral;
|
|
12
|
+
export declare const callExpression: typeof estree.callExpression;
|
|
13
|
+
export declare const memberExpression: typeof estree.memberExpression;
|
|
14
|
+
export declare const optionalMemberExpression: typeof estree.optionalMemberExpression;
|
|
15
|
+
export declare const arrayExpression: typeof estree.arrayExpression;
|
|
16
|
+
export declare const objectExpression: typeof estree.objectExpression;
|
|
17
|
+
export declare const objectProperty: typeof estree.objectProperty;
|
|
18
|
+
export declare const spreadElement: typeof estree.spreadElement;
|
|
19
|
+
export declare const newExpression: typeof estree.newExpression;
|
|
20
|
+
export declare const binaryExpression: typeof estree.binaryExpression;
|
|
21
|
+
export declare const unaryExpression: typeof estree.unaryExpression;
|
|
22
|
+
export declare const logicalExpression: typeof estree.logicalExpression;
|
|
23
|
+
export declare const assignmentExpression: typeof estree.assignmentExpression;
|
|
24
|
+
export declare const conditionalExpression: typeof estree.conditionalExpression;
|
|
25
|
+
export declare const sequenceExpression: typeof estree.sequenceExpression;
|
|
26
|
+
export declare const assignmentPattern: typeof estree.assignmentPattern;
|
|
27
|
+
export declare const functionDeclaration: typeof estree.functionDeclaration;
|
|
28
|
+
export declare const arrowFunctionExpression: typeof estree.arrowFunctionExpression;
|
|
29
|
+
export declare const blockStatement: typeof estree.blockStatement;
|
|
30
|
+
export declare const expressionStatement: typeof estree.expressionStatement;
|
|
31
|
+
export declare const returnStatement: typeof estree.returnStatement;
|
|
32
|
+
export declare const ifStatement: typeof estree.ifStatement;
|
|
33
|
+
export declare const forOfStatement: typeof estree.forOfStatement;
|
|
34
|
+
export declare const variableDeclaration: typeof estree.variableDeclaration;
|
|
35
|
+
export declare const variableDeclarator: typeof estree.variableDeclarator;
|
|
36
|
+
export declare const importDeclaration: typeof estree.importDeclaration;
|
|
37
|
+
export declare const importSpecifier: typeof estree.importSpecifier;
|
|
38
|
+
export declare const importDefaultSpecifier: typeof estree.importDefaultSpecifier;
|
|
39
|
+
export declare const importNamespaceSpecifier: typeof estree.importNamespaceSpecifier;
|
|
40
|
+
export declare const exportNamedDeclaration: typeof estree.exportNamedDeclaration;
|
|
41
|
+
export declare const jsxIdentifier: typeof estree.jsxIdentifier;
|
|
42
|
+
export declare const jsxAttribute: typeof estree.jsxAttribute;
|
|
43
|
+
export declare const jsxExpressionContainer: typeof estree.jsxExpressionContainer;
|
|
44
|
+
export declare const jsxOpeningElement: typeof estree.jsxOpeningElement;
|
|
45
|
+
export declare const jsxElement: typeof estree.jsxElement;
|
|
46
|
+
export declare const jsxOpeningFragment: typeof estree.jsxOpeningFragment;
|
|
47
|
+
export declare const jsxClosingFragment: typeof estree.jsxClosingFragment;
|
|
48
|
+
export declare const jsxFragment: typeof estree.jsxFragment;
|
|
49
|
+
export declare const updateExpression: (operator: t.UpdateExpression['operator'], argument: t.UpdateExpression['argument'], prefix?: boolean) => t.UpdateExpression;
|
|
50
|
+
export declare const switchCase: (test: t.SwitchCase['test'], consequent: t.SwitchCase['consequent']) => t.SwitchCase;
|
|
51
|
+
export declare const switchStatement: (discriminant: t.SwitchStatement['discriminant'], cases: t.SwitchCase[]) => t.SwitchStatement;
|
|
52
|
+
export declare const metaProperty: (meta: t.Identifier, property: t.Identifier) => t.MetaProperty;
|
|
53
|
+
export declare const tsTypeLiteral: (members?: t.TSTypeElement[]) => t.TSTypeLiteral;
|
|
54
|
+
export declare const isNode: (node: unknown, options?: object | null) => node is import("./types").BaseNode;
|
|
55
|
+
export declare const isIdentifier: (node: unknown, options?: object | null) => node is import("./types").Identifier;
|
|
56
|
+
export declare const isStringLiteral: (node: unknown, options?: object | null) => node is import("./types").StringLiteral;
|
|
57
|
+
export declare const isNumericLiteral: (node: unknown, options?: object | null) => node is import("./types").NumericLiteral;
|
|
58
|
+
export declare const isBooleanLiteral: (node: unknown, options?: object | null) => node is import("./types").BooleanLiteral;
|
|
59
|
+
export declare const isNullLiteral: (node: unknown, options?: object | null) => node is import("./types").NullLiteral;
|
|
60
|
+
export declare const isBigIntLiteral: (node: unknown, options?: object | null) => node is t.BigIntLiteral;
|
|
61
|
+
export declare const isCallExpression: (node: unknown, options?: object | null) => node is import("./types").CallExpression;
|
|
62
|
+
export declare const isOptionalCallExpression: (node: unknown, options?: object | null) => node is import("./types").CallExpression;
|
|
63
|
+
export declare const isMemberExpression: (node: unknown, options?: object | null) => node is import("./types").MemberExpression;
|
|
64
|
+
export declare const isOptionalMemberExpression: (node: unknown, options?: object | null) => node is import("./types").MemberExpression;
|
|
65
|
+
export declare const isArrayExpression: (node: unknown, options?: object | null) => node is import("./types").ArrayExpression;
|
|
66
|
+
export declare const isObjectExpression: (node: unknown, options?: object | null) => node is import("./types").ObjectExpression;
|
|
67
|
+
export declare const isObjectProperty: (node: unknown, options?: object | null) => node is import("./types").Property;
|
|
68
|
+
export declare const isFunctionDeclaration: (node: unknown, options?: object | null) => node is import("./types").FunctionDeclaration;
|
|
69
|
+
export declare const isFunctionExpression: (node: unknown, options?: object | null) => node is import("./types").FunctionExpression;
|
|
70
|
+
export declare const isArrowFunctionExpression: (node: unknown, options?: object | null) => node is import("./types").ArrowFunctionExpression;
|
|
71
|
+
export declare const isFunction: (node: unknown, options?: object | null) => node is t.Function;
|
|
72
|
+
export declare const isVariableDeclaration: (node: unknown, options?: object | null) => node is import("./types").VariableDeclaration;
|
|
73
|
+
export declare const isVariableDeclarator: (node: unknown, options?: object | null) => node is import("./types").VariableDeclarator;
|
|
74
|
+
export declare const isBlockStatement: (node: unknown, options?: object | null) => node is import("./types").BlockStatement;
|
|
75
|
+
export declare const isReturnStatement: (node: unknown, options?: object | null) => node is import("./types").ReturnStatement;
|
|
76
|
+
export declare const isIfStatement: (node: unknown, options?: object | null) => node is import("./types").IfStatement;
|
|
77
|
+
export declare const isExpressionStatement: (node: unknown, options?: object | null) => node is import("./types").ExpressionStatement;
|
|
78
|
+
export declare const isAssignmentExpression: (node: unknown, options?: object | null) => node is import("./types").AssignmentExpression;
|
|
79
|
+
export declare const isUpdateExpression: (node: unknown, options?: object | null) => node is import("./types").UpdateExpression;
|
|
80
|
+
export declare const isUnaryExpression: (node: unknown, options?: object | null) => node is import("./types").UnaryExpression;
|
|
81
|
+
export declare const isLogicalExpression: (node: unknown, options?: object | null) => node is import("./types").LogicalExpression;
|
|
82
|
+
export declare const isConditionalExpression: (node: unknown, options?: object | null) => node is import("./types").ConditionalExpression;
|
|
83
|
+
export declare const isExpression: (node: unknown, options?: object | null) => node is import("./types").Expression;
|
|
84
|
+
export declare const isJSXElement: (node: unknown, options?: object | null) => node is import("./types").JSXElement;
|
|
85
|
+
export declare const isJSXFragment: (node: unknown, options?: object | null) => node is import("./types").JSXFragment;
|
|
86
|
+
export declare const isJSXAttribute: (node: unknown, options?: object | null) => node is import("./types").JSXAttribute;
|
|
87
|
+
export declare const isJSXSpreadAttribute: (node: unknown, options?: object | null) => node is import("./types").JSXSpreadAttribute;
|
|
88
|
+
export declare const isJSXExpressionContainer: (node: unknown, options?: object | null) => node is import("./types").JSXExpressionContainer;
|
|
89
|
+
export declare const isJSXIdentifier: (node: unknown, options?: object | null) => node is import("./types").JSXIdentifier;
|
|
90
|
+
export declare const isJSXText: (node: unknown, options?: object | null) => node is import("./types").JSXText;
|
|
91
|
+
export declare const isJSXEmptyExpression: (node: unknown, options?: object | null) => node is import("./types").JSXEmptyExpression;
|
|
92
|
+
export declare const isJSXNamespacedName: (node: unknown, options?: object | null) => node is import("./types").JSXNamespacedName;
|
|
93
|
+
export declare const isObjectPattern: (node: unknown, options?: object | null) => node is import("./types").ObjectPattern;
|
|
94
|
+
export declare const isArrayPattern: (node: unknown, options?: object | null) => node is import("./types").ArrayPattern;
|
|
95
|
+
export declare const isAssignmentPattern: (node: unknown, options?: object | null) => node is import("./types").AssignmentPattern;
|
|
96
|
+
export declare const isRestElement: (node: unknown, options?: object | null) => node is import("./types").RestElement;
|
|
97
|
+
export declare const isSpreadElement: (node: unknown, options?: object | null) => node is import("./types").SpreadElement;
|
|
98
|
+
export declare const isExportNamedDeclaration: (node: unknown, options?: object | null) => node is import("./types").ExportNamedDeclaration;
|
|
99
|
+
export declare const isExportDefaultDeclaration: (node: unknown, options?: object | null) => node is import("./types").ExportDefaultDeclaration;
|
|
100
|
+
export declare const isExportSpecifier: (node: unknown, options?: object | null) => node is import("./types").ExportSpecifier;
|
|
101
|
+
export declare const isImportDeclaration: (node: unknown, options?: object | null) => node is import("./types").ImportDeclaration;
|
|
102
|
+
export declare const isImportSpecifier: (node: unknown, options?: object | null) => node is import("./types").ImportSpecifier;
|
|
103
|
+
export declare const isImportDefaultSpecifier: (node: unknown, options?: object | null) => node is import("./types").ImportDefaultSpecifier;
|
|
104
|
+
export declare const isSwitchStatement: (node: unknown, options?: object | null) => node is import("./types").SwitchStatement;
|
|
105
|
+
export declare const isBreakStatement: (node: unknown, options?: object | null) => node is import("./types").BreakStatement;
|
|
106
|
+
export declare const isEmptyStatement: (node: unknown, options?: object | null) => node is import("./types").EmptyStatement;
|
|
107
|
+
export declare const isAwaitExpression: (node: unknown, options?: object | null) => node is import("./types").AwaitExpression;
|
|
108
|
+
export declare const isYieldExpression: (node: unknown, options?: object | null) => node is import("./types").YieldExpression;
|
|
109
|
+
export declare const isNewExpression: (node: unknown, options?: object | null) => node is import("./types").NewExpression;
|
|
110
|
+
export declare const isTemplateLiteral: (node: unknown, options?: object | null) => node is import("./types").TemplateLiteral;
|
|
111
|
+
export declare const isSuper: (node: unknown, options?: object | null) => node is t.Super;
|
|
112
|
+
export declare const isPrivateName: (node: unknown, options?: object | null) => node is t.PrivateName;
|
|
113
|
+
export declare const isClassDeclaration: (node: unknown, options?: object | null) => node is import("./types").ClassDeclaration;
|
|
114
|
+
export declare const isTypeCastExpression: (node: unknown, options?: object | null) => node is t.TypeCastExpression;
|
|
115
|
+
export declare const isTransparentExpression: (node: unknown, options?: object | null) => node is t.TransparentExpression;
|
|
116
|
+
export declare const isTypeScript: (node: unknown, options?: object | null) => node is t.TypeScriptNode;
|
|
117
|
+
export declare const isTSAsExpression: (node: unknown, options?: object | null) => node is t.TSAsExpression;
|
|
118
|
+
export declare const isTSTypeAssertion: (node: unknown, options?: object | null) => node is t.TSTypeAssertion;
|
|
119
|
+
export declare const isTSNonNullExpression: (node: unknown, options?: object | null) => node is t.TSNonNullExpression;
|
|
120
|
+
export declare const isTSSatisfiesExpression: (node: unknown, options?: object | null) => node is t.TSSatisfiesExpression;
|
|
121
|
+
export declare const isTSInstantiationExpression: (node: unknown, options?: object | null) => node is t.TSInstantiationExpression;
|
|
122
|
+
export declare const isTSTypeAliasDeclaration: (node: unknown, options?: object | null) => node is t.TSTypeAliasDeclaration;
|
|
123
|
+
export declare const isTSInterfaceDeclaration: (node: unknown, options?: object | null) => node is t.TSInterfaceDeclaration;
|
|
124
|
+
export declare const isTSParameterProperty: (node: unknown, options?: object | null) => node is t.TSParameterProperty;
|
|
125
|
+
export declare const isTSTypeAnnotation: (node: unknown, options?: object | null) => node is t.TSTypeAnnotation;
|
|
126
|
+
export declare const isTSTypeReference: (node: unknown, options?: object | null) => node is t.TSTypeReference;
|
|
127
|
+
export declare const isTSTypeLiteral: (node: unknown, options?: object | null) => node is t.TSTypeLiteral;
|
|
128
|
+
export declare const isTSPropertySignature: (node: unknown, options?: object | null) => node is t.TSPropertySignature;
|
|
129
|
+
export declare const isTSUndefinedKeyword: (node: unknown, options?: object | null) => node is t.TSUndefinedKeyword;
|
|
130
|
+
export declare const isTSNullKeyword: (node: unknown, options?: object | null) => node is t.TSNullKeyword;
|
|
131
|
+
export declare const isTSSymbolKeyword: (node: unknown, options?: object | null) => node is t.TSSymbolKeyword;
|
|
132
|
+
export declare const isTSUnionType: (node: unknown, options?: object | null) => node is t.TSUnionType;
|
|
133
|
+
export declare const isTSParenthesizedType: (node: unknown, options?: object | null) => node is t.TSParenthesizedType;
|
|
134
|
+
export declare const isTSLiteralType: (node: unknown, options?: object | null) => node is t.TSLiteralType;
|
|
135
|
+
export declare const isTSStringKeyword: (node: unknown, options?: object | null) => node is t.TSStringKeyword;
|
|
136
|
+
export declare const isTSBigIntKeyword: (node: unknown, options?: object | null) => node is t.TSBigIntKeyword;
|
|
137
|
+
export declare const isTSBooleanKeyword: (node: unknown, options?: object | null) => node is t.TSBooleanKeyword;
|
|
138
|
+
export declare const isTSNumberKeyword: (node: unknown, options?: object | null) => node is t.TSNumberKeyword;
|
|
139
|
+
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../src/ast/factory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,KAAK,CAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AAErC,eAAO,MAAM,UAAU,0BAAoB,CAAC;AAC5C,eAAO,MAAM,aAAa,6BAAuB,CAAC;AAClD,eAAO,MAAM,cAAc,8BAAwB,CAAC;AACpD,eAAO,MAAM,cAAc,8BAAwB,CAAC;AACpD,eAAO,MAAM,WAAW,2BAAqB,CAAC;AAC9C,eAAO,MAAM,cAAc,8BAAwB,CAAC;AACpD,eAAO,MAAM,gBAAgB,gCAA0B,CAAC;AACxD,eAAO,MAAM,wBAAwB,wCACJ,CAAC;AAClC,eAAO,MAAM,eAAe,+BAAyB,CAAC;AACtD,eAAO,MAAM,gBAAgB,gCAA0B,CAAC;AACxD,eAAO,MAAM,cAAc,8BAAwB,CAAC;AACpD,eAAO,MAAM,aAAa,6BAAuB,CAAC;AAClD,eAAO,MAAM,aAAa,6BAAuB,CAAC;AAClD,eAAO,MAAM,gBAAgB,gCAA0B,CAAC;AACxD,eAAO,MAAM,eAAe,+BAAyB,CAAC;AACtD,eAAO,M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AO,MAAM,iBAAiB,SA9NpB,OAAO,YAAY,MAAM,GAAG,IAAI,8BAgOzC,CAAC;AACF,eAAO,MAAM,eAAe,SAjOlB,OAAO,YAAY,MAAM,GAAG,IAAI,4BAiOyC,CAAC;AACpF,eAAO,MAAM,qBAAqB,SAlOxB,OAAO,YAAY,MAAM,GAAG,IAAI,kCAoOzC,CAAC;AACF,eAAO,MAAM,oBAAoB,SArOvB,OAAO,YAAY,MAAM,GAAG,IAAI,iCAuOzC,CAAC;AACF,eAAO,MAAM,eAAe,SAxOlB,OAAO,YAAY,MAAM,GAAG,IAAI,4BAwOyC,CAAC;AACpF,eAAO,MAAM,iBAAiB,SAzOpB,OAAO,YAAY,MAAM,GAAG,IAAI,8BAyO+C,CAAC;AAC1F,eAAO,MAAM,aAAa,SA1OhB,OAAO,YAAY,MAAM,GAAG,IAAI,0BA0OmC,CAAC;AAC9E,eAAO,MAAM,qBAAqB,SA3OxB,OAAO,YAAY,MAAM,GAAG,IAAI,kCA6OzC,CAAC;AACF,eAAO,MAAM,eAAe,SA9OlB,OAAO,YAAY,MAAM,GAAG,IAAI,4BA8OyC,CAAC;AACpF,eAAO,MAAM,iBAAiB,SA/OpB,OAAO,YAAY,MAAM,GAAG,IAAI,8BAiPzC,CAAC;AACF,eAAO,MAAM,iBAAiB,SAlPpB,OAAO,YAAY,MAAM,GAAG,IAAI,8BAkP+C,CAAC;AAC1F,eAAO,MAAM,kBAAkB,SAnPrB,OAAO,YAAY,MAAM,GAAG,IAAI,+BAqPzC,CAAC;AACF,eAAO,MAAM,iBAAiB,SAtPpB,OAAO,YAAY,MAAM,GAAG,IAAI,8BAwPzC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ESTree standard AST toolkit for @memoized-dom/compiler.
|
|
3
|
+
*/
|
|
4
|
+
export * from './types';
|
|
5
|
+
export * from './builders';
|
|
6
|
+
export * from './walk';
|
|
7
|
+
export * from './scope';
|
|
8
|
+
export * from './transform';
|
|
9
|
+
export * from './mutate';
|
|
10
|
+
export * from './normalize';
|
|
11
|
+
export * from './parser';
|
|
12
|
+
export * from './printer';
|
|
13
|
+
export * from './strip-typescript';
|
|
14
|
+
export * from './tsrx';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ast/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BaseNode } from './types';
|
|
2
|
+
import type { ScopeAnalysis } from './scope';
|
|
3
|
+
/** Replace a non-root node through parser-neutral parent metadata. */
|
|
4
|
+
export declare function replaceNode(analysis: ScopeAnalysis, target: BaseNode, replacement: BaseNode): void;
|
|
5
|
+
/**
|
|
6
|
+
* Overwrite a node in place while preserving its object identity.
|
|
7
|
+
*
|
|
8
|
+
* This is useful at temporary frontend-adapter boundaries where a live path
|
|
9
|
+
* may still retain the node object while parser-neutral mutation owns its
|
|
10
|
+
* fields. Rebuild scope/parent analysis after the surrounding batch.
|
|
11
|
+
*/
|
|
12
|
+
export declare function overwriteNode(target: BaseNode, replacement: BaseNode): void;
|
|
13
|
+
/** Remove a node held in an array-valued parent field. */
|
|
14
|
+
export declare function removeNode(analysis: ScopeAnalysis, target: BaseNode): void;
|
|
15
|
+
/** Whether a node is equal to or nested within an ancestor. */
|
|
16
|
+
export declare function nodeIsWithin(analysis: ScopeAnalysis, target: BaseNode, ancestor: BaseNode): boolean;
|
|
17
|
+
//# sourceMappingURL=mutate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutate.d.ts","sourceRoot":"","sources":["../../src/ast/mutate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAkB7C,sEAAsE;AACtE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,QAAQ,EAChB,WAAW,EAAE,QAAQ,GACpB,IAAI,CAWN;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,GAAG,IAAI,CAI3E;AAED,0DAA0D;AAC1D,wBAAgB,UAAU,CACxB,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,QAAQ,GACf,IAAI,CASN;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAOT"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Normalize accepted legacy node spellings to strict ESTree nodes. */
|
|
2
|
+
import type { BaseNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Convert accepted legacy literal/property spellings into the ESTree dialect
|
|
5
|
+
* consumed by parser-neutral printers and alternate frontends.
|
|
6
|
+
* Authored ESTree nodes pass through unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeEstreeDialect(root: BaseNode): void;
|
|
9
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/ast/normalize.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAGvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAiBxC;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAgE3D"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { BaseNode, SourceLocation } from './types';
|
|
2
|
+
export type AstLanguage = 'js' | 'jsx' | 'ts' | 'tsx' | 'dts';
|
|
3
|
+
export type AstSourceType = 'script' | 'module' | 'commonjs' | 'unambiguous';
|
|
4
|
+
export interface ParsedProgram extends BaseNode {
|
|
5
|
+
type: 'Program';
|
|
6
|
+
body: BaseNode[];
|
|
7
|
+
sourceType: 'script' | 'module' | 'commonjs';
|
|
8
|
+
hashbang?: BaseNode | null;
|
|
9
|
+
}
|
|
10
|
+
export interface AstComment {
|
|
11
|
+
type: 'Line' | 'Block';
|
|
12
|
+
value: string;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
loc: SourceLocation;
|
|
16
|
+
}
|
|
17
|
+
export interface AstDiagnosticLabel {
|
|
18
|
+
message: string | null;
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
}
|
|
22
|
+
export interface AstDiagnostic {
|
|
23
|
+
severity: 'Error' | 'Warning' | 'Advice';
|
|
24
|
+
message: string;
|
|
25
|
+
labels: AstDiagnosticLabel[];
|
|
26
|
+
helpMessage: string | null;
|
|
27
|
+
codeframe: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface ParseEstreeOptions {
|
|
30
|
+
filename?: string;
|
|
31
|
+
language?: AstLanguage;
|
|
32
|
+
sourceType?: AstSourceType;
|
|
33
|
+
includeRanges?: boolean;
|
|
34
|
+
checkSemantics?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface ParsedEstree {
|
|
37
|
+
program: ParsedProgram;
|
|
38
|
+
comments: AstComment[];
|
|
39
|
+
diagnostics: AstDiagnostic[];
|
|
40
|
+
/** Optional static CSS extracted by a source-language frontend. */
|
|
41
|
+
css?: string;
|
|
42
|
+
}
|
|
43
|
+
/** Parser adapter consumed by the backend-neutral ESTree compiler boundary. */
|
|
44
|
+
export interface EstreeFrontend {
|
|
45
|
+
readonly name: string;
|
|
46
|
+
parse(source: string, options?: ParseEstreeOptions): ParsedEstree;
|
|
47
|
+
}
|
|
48
|
+
/** Route known source extensions without silently assigning unknown files a parser. */
|
|
49
|
+
export declare function createExtensionEstreeFrontend(extensions: Readonly<Record<string, EstreeFrontend>>): EstreeFrontend;
|
|
50
|
+
export declare class EstreeParseError extends SyntaxError {
|
|
51
|
+
readonly diagnostics: AstDiagnostic[];
|
|
52
|
+
readonly moduleId: string;
|
|
53
|
+
readonly loc?: {
|
|
54
|
+
line: number;
|
|
55
|
+
column: number;
|
|
56
|
+
endLine?: number;
|
|
57
|
+
endColumn?: number;
|
|
58
|
+
};
|
|
59
|
+
constructor(filename: string, diagnostics: AstDiagnostic[], source?: string);
|
|
60
|
+
}
|
|
61
|
+
/** Parse through Yuku while returning the same compiler-owned ESTree result. */
|
|
62
|
+
export declare function parseYukuEstree(source: string, options?: ParseEstreeOptions): ParsedEstree;
|
|
63
|
+
export declare const yukuEstreeFrontend: EstreeFrontend;
|
|
64
|
+
/** Default standard-language parser retained under the original public name. */
|
|
65
|
+
export declare const parseEstree: typeof parseYukuEstree;
|
|
66
|
+
/** Parse with an injected frontend adapter (Yuku, TSRX, or another parser). */
|
|
67
|
+
export declare function parseWithEstreeFrontend(frontend: EstreeFrontend, source: string, options?: ParseEstreeOptions): ParsedEstree;
|
|
68
|
+
/** Parse through an injected frontend and reject its fatal diagnostics. */
|
|
69
|
+
export declare function parseWithEstreeFrontendOrThrow(frontend: EstreeFrontend, source: string, options?: ParseEstreeOptions): ParsedEstree;
|
|
70
|
+
/** Parse standard JavaScript/TypeScript source with Yuku and reject fatal diagnostics. */
|
|
71
|
+
export declare function parseEstreeOrThrow(source: string, options?: ParseEstreeOptions): ParsedEstree;
|
|
72
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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AAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,YAAY,CAEd;AAED,2EAA2E;AAC3E,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,YAAY,CAad;AAGD,0FAA0F;AAC1F,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GAC/B,YAAY,CAad"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { AstComment } from './parser';
|
|
2
|
+
import type { BaseNode } from './types';
|
|
3
|
+
export interface PrintEstreeOptions {
|
|
4
|
+
quotes?: 'double' | 'single';
|
|
5
|
+
indent?: string;
|
|
6
|
+
sourceMapSource?: string;
|
|
7
|
+
sourceMapContent?: string;
|
|
8
|
+
comments?: readonly AstComment[];
|
|
9
|
+
}
|
|
10
|
+
export interface EstreeSourceMap {
|
|
11
|
+
version: 3;
|
|
12
|
+
names: string[];
|
|
13
|
+
sources: Array<string | null>;
|
|
14
|
+
sourcesContent: Array<string | null>;
|
|
15
|
+
mappings: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PrintedEstree {
|
|
18
|
+
code: string;
|
|
19
|
+
map: EstreeSourceMap | null;
|
|
20
|
+
}
|
|
21
|
+
/** Print an ESTree/TS-ESTree tree without converting it to another AST dialect. */
|
|
22
|
+
export declare function printEstree(program: BaseNode, options?: PrintEstreeOptions): PrintedEstree;
|
|
23
|
+
//# sourceMappingURL=printer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../../src/ast/printer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9B,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,eAAe,GAAG,IAAI,CAAC;CAC7B;AA6BD,mFAAmF;AACnF,wBAAgB,WAAW,CACzB,OAAO,EAAE,QAAQ,EACjB,OAAO,GAAE,kBAAuB,GAC/B,aAAa,CAqBf"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure lexical scope analysis for standard ESTree ASTs.
|
|
3
|
+
*
|
|
4
|
+
* Replaces Babel's stateful `path.scope` with a fast, deterministic,
|
|
5
|
+
* tree-structured lexical scope model.
|
|
6
|
+
*/
|
|
7
|
+
import type { BaseNode, Identifier, Program } from './types';
|
|
8
|
+
export type BindingKind = 'var' | 'let' | 'const' | 'param' | 'function' | 'class' | 'import';
|
|
9
|
+
export interface Binding {
|
|
10
|
+
name: string;
|
|
11
|
+
kind: BindingKind;
|
|
12
|
+
identifier: Identifier;
|
|
13
|
+
declarationNode: BaseNode;
|
|
14
|
+
scope: Scope;
|
|
15
|
+
references: Identifier[];
|
|
16
|
+
constantViolations: BaseNode[];
|
|
17
|
+
}
|
|
18
|
+
export declare class Scope {
|
|
19
|
+
parent: Scope | null;
|
|
20
|
+
children: Scope[];
|
|
21
|
+
bindings: Map<string, Binding>;
|
|
22
|
+
block: BaseNode;
|
|
23
|
+
isFunctionScope: boolean;
|
|
24
|
+
isProgramScope: boolean;
|
|
25
|
+
constructor(block: BaseNode, parent?: Scope | null, isFunctionScope?: boolean);
|
|
26
|
+
registerBinding(name: string, kind: BindingKind, identifier: Identifier, declarationNode: BaseNode): Binding;
|
|
27
|
+
getBinding(name: string): Binding | undefined;
|
|
28
|
+
hasBinding(name: string): boolean;
|
|
29
|
+
hasOwnBinding(name: string): boolean;
|
|
30
|
+
getProgramScope(): Scope;
|
|
31
|
+
getFunctionScope(): Scope | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function extractPatternIdentifiers(pattern: BaseNode): Identifier[];
|
|
34
|
+
export declare function isReferenceIdentifier(parent: BaseNode | null, key: string | undefined): boolean;
|
|
35
|
+
/** Analyze lexical scopes of an AST tree. */
|
|
36
|
+
export interface ScopeAnalysis {
|
|
37
|
+
rootScope: Scope;
|
|
38
|
+
nodeToScope: Map<BaseNode, Scope>;
|
|
39
|
+
parentByNode: Map<BaseNode, BaseNode | null>;
|
|
40
|
+
keyByNode: Map<BaseNode, string | undefined>;
|
|
41
|
+
indexByNode: Map<BaseNode, number | undefined>;
|
|
42
|
+
}
|
|
43
|
+
export declare function analyzeScope(root: Program | BaseNode): ScopeAnalysis;
|
|
44
|
+
//# sourceMappingURL=scope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/ast/scope.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,UAAU,EACV,OAAO,EACR,MAAM,SAAS,CAAC;AAIjB,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,KAAK,GACL,OAAO,GACP,OAAO,GACP,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,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AC,CAAC;IAClC,YAAY,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC,CAAC;IAC7C,SAAS,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC7C,WAAW,EAAE,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAChD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,aAAa,CA4LpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Erase TypeScript-only syntax from a transformed TS-ESTree program. */
|
|
2
|
+
import type { BaseNode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Return a cloned JavaScript ESTree program with erasable TypeScript syntax
|
|
5
|
+
* removed. Runtime-bearing TypeScript constructs such as enums intentionally
|
|
6
|
+
* fail instead of being silently miscompiled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function stripTypeScript<T extends BaseNode>(root: T): T;
|
|
9
|
+
//# sourceMappingURL=strip-typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strip-typescript.d.ts","sourceRoot":"","sources":["../../src/ast/strip-typescript.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAGzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAwCxC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAuF9D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure AST transformer for @memoized-dom/compiler.
|
|
3
|
+
*
|
|
4
|
+
* Provides functional tree rewrites (replace / remove / splice)
|
|
5
|
+
* without mutable NodePath traversal lifecycles.
|
|
6
|
+
*/
|
|
7
|
+
import type { BaseNode } from './types';
|
|
8
|
+
export type TransformResult = BaseNode | BaseNode[] | null | undefined | void;
|
|
9
|
+
export interface ASTTransformer {
|
|
10
|
+
enter?: (node: BaseNode, parent: BaseNode | null, key?: string, index?: number) => TransformResult;
|
|
11
|
+
leave?: (node: BaseNode, parent: BaseNode | null, key?: string, index?: number) => TransformResult;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Transform an AST tree purely.
|
|
15
|
+
* - Return `null` to remove a node.
|
|
16
|
+
* - Return a new `BaseNode` to replace it.
|
|
17
|
+
* - Return `BaseNode[]` to splice multiple nodes in place (when in an array).
|
|
18
|
+
* - Return `undefined` to keep the node untouched.
|
|
19
|
+
*/
|
|
20
|
+
export declare function transformAst<T extends BaseNode = BaseNode>(root: T, transformer: ASTTransformer): T | null;
|
|
21
|
+
//# sourceMappingURL=transform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/ast/transform.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIxC,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAE9E,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,CACN,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,QAAQ,GAAG,IAAI,EACvB,GAAG,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,KACX,eAAe,CAAC;IACrB,KAAK,CAAC,EAAE,CACN,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,QAAQ,GAAG,IAAI,EACvB,GAAG,CAAC,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,KACX,eAAe,CAAC;CACtB;AAMD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,EACxD,IAAI,EAAE,CAAC,EACP,WAAW,EAAE,cAAc,GAC1B,CAAC,GAAG,IAAI,CAwEV"}
|