@vue/language-core 2.1.8 → 2.2.0
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/lib/codegen/globalTypes.js +12 -5
- package/lib/codegen/localTypes.js +3 -3
- package/lib/codegen/script/component.js +42 -42
- package/lib/codegen/script/componentSelf.js +14 -13
- package/lib/codegen/script/context.js +2 -2
- package/lib/codegen/script/index.d.ts +5 -3
- package/lib/codegen/script/index.js +24 -37
- package/lib/codegen/script/scriptSetup.js +240 -193
- package/lib/codegen/script/src.js +6 -6
- package/lib/codegen/script/styleModulesType.js +5 -5
- package/lib/codegen/script/template.d.ts +1 -1
- package/lib/codegen/script/template.js +89 -99
- package/lib/codegen/template/context.d.ts +13 -3
- package/lib/codegen/template/context.js +21 -12
- package/lib/codegen/template/element.d.ts +2 -4
- package/lib/codegen/template/element.js +132 -105
- package/lib/codegen/template/elementChildren.d.ts +1 -1
- package/lib/codegen/template/elementChildren.js +8 -8
- package/lib/codegen/template/elementDirectives.d.ts +1 -0
- package/lib/codegen/template/elementDirectives.js +28 -22
- package/lib/codegen/template/elementEvents.d.ts +2 -2
- package/lib/codegen/template/elementEvents.js +32 -65
- package/lib/codegen/template/elementProps.d.ts +3 -2
- package/lib/codegen/template/elementProps.js +119 -122
- package/lib/codegen/template/index.js +52 -60
- package/lib/codegen/template/interpolation.d.ts +5 -3
- package/lib/codegen/template/interpolation.js +18 -19
- package/lib/codegen/template/objectProperty.js +8 -8
- package/lib/codegen/template/propertyAccess.js +4 -4
- package/lib/codegen/template/slotOutlet.d.ts +1 -1
- package/lib/codegen/template/slotOutlet.js +13 -13
- package/lib/codegen/template/styleScopedClasses.d.ts +1 -1
- package/lib/codegen/template/styleScopedClasses.js +11 -8
- package/lib/codegen/template/templateChild.d.ts +1 -1
- package/lib/codegen/template/templateChild.js +31 -19
- package/lib/codegen/template/vFor.d.ts +1 -1
- package/lib/codegen/template/vFor.js +11 -11
- package/lib/codegen/template/vIf.d.ts +1 -1
- package/lib/codegen/template/vIf.js +6 -6
- package/lib/codegen/{template → utils}/camelized.js +2 -2
- package/lib/codegen/{common.d.ts → utils/index.d.ts} +1 -2
- package/lib/codegen/{common.js → utils/index.js} +4 -15
- package/lib/codegen/{template → utils}/stringLiteralKey.js +3 -3
- package/lib/codegen/utils/unicode.d.ts +2 -0
- package/lib/codegen/utils/unicode.js +25 -0
- package/lib/languagePlugin.js +1 -1
- package/lib/parsers/scriptRanges.d.ts +7 -2
- package/lib/parsers/scriptSetupRanges.d.ts +67 -81
- package/lib/parsers/scriptSetupRanges.js +195 -166
- package/lib/parsers/vueCompilerOptions.d.ts +2 -0
- package/lib/parsers/vueCompilerOptions.js +23 -0
- package/lib/plugins/file-html.js +4 -3
- package/lib/plugins/file-md.js +1 -1
- package/lib/plugins/file-vue.js +4 -4
- package/lib/plugins/vue-root-tags.js +2 -2
- package/lib/plugins/vue-template-html.js +6 -2
- package/lib/plugins/vue-template-inline-css.js +1 -1
- package/lib/plugins/vue-template-inline-ts.js +13 -5
- package/lib/plugins/vue-tsx.d.ts +101 -72
- package/lib/plugins/vue-tsx.js +65 -69
- package/lib/types.d.ts +19 -10
- package/lib/utils/buildMappings.d.ts +1 -1
- package/lib/utils/parseSfc.d.ts +5 -0
- package/lib/utils/parseSfc.js +7 -2
- package/lib/utils/ts.d.ts +1 -1
- package/lib/utils/ts.js +38 -24
- package/lib/virtualFile/computedEmbeddedCodes.d.ts +1 -2
- package/lib/virtualFile/computedSfc.js +23 -12
- package/lib/virtualFile/computedVueSfc.d.ts +1 -1
- package/lib/virtualFile/vueFile.d.ts +3 -3
- package/package.json +5 -5
- package/lib/codegen/types.d.ts +0 -9
- package/lib/codegen/types.js +0 -3
- package/lib/utils/findDestructuredProps.d.ts +0 -1
- package/lib/utils/findDestructuredProps.js +0 -3
- /package/lib/codegen/{template → utils}/camelized.d.ts +0 -0
- /package/lib/codegen/{template → utils}/stringLiteralKey.d.ts +0 -0
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateComponent = generateComponent;
|
|
4
4
|
exports.generateElement = generateElement;
|
|
5
|
-
exports.getCanonicalComponentName = getCanonicalComponentName;
|
|
6
|
-
exports.getPossibleOriginalComponentNames = getPossibleOriginalComponentNames;
|
|
7
5
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
8
6
|
const shared_1 = require("@vue/shared");
|
|
7
|
+
const scriptSetupRanges_1 = require("../../parsers/scriptSetupRanges");
|
|
9
8
|
const shared_2 = require("../../utils/shared");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const inlayHints_1 = require("../inlayHints");
|
|
10
|
+
const utils_1 = require("../utils");
|
|
11
|
+
const camelized_1 = require("../utils/camelized");
|
|
12
12
|
const elementChildren_1 = require("./elementChildren");
|
|
13
13
|
const elementDirectives_1 = require("./elementDirectives");
|
|
14
14
|
const elementEvents_1 = require("./elementEvents");
|
|
15
15
|
const elementProps_1 = require("./elementProps");
|
|
16
16
|
const interpolation_1 = require("./interpolation");
|
|
17
|
+
const objectProperty_1 = require("./objectProperty");
|
|
17
18
|
const propertyAccess_1 = require("./propertyAccess");
|
|
18
19
|
const templateChild_1 = require("./templateChild");
|
|
19
|
-
const objectProperty_1 = require("./objectProperty");
|
|
20
|
-
const inlayHints_1 = require("../inlayHints");
|
|
21
|
-
const scriptSetupRanges_1 = require("../../parsers/scriptSetupRanges");
|
|
22
20
|
const colonReg = /:/g;
|
|
23
|
-
function* generateComponent(options, ctx, node
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
function* generateComponent(options, ctx, node) {
|
|
22
|
+
const tagOffsets = [node.loc.start.offset + options.template.content.slice(node.loc.start.offset).indexOf(node.tag)];
|
|
23
|
+
if (!node.isSelfClosing && options.template.lang === 'html') {
|
|
24
|
+
const endTagOffset = node.loc.start.offset + node.loc.source.lastIndexOf(node.tag);
|
|
25
|
+
if (endTagOffset > tagOffsets[0]) {
|
|
26
|
+
tagOffsets.push(endTagOffset);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const failedPropExps = [];
|
|
30
30
|
const possibleOriginalNames = getPossibleOriginalComponentNames(node.tag, true);
|
|
31
31
|
const matchImportName = possibleOriginalNames.find(name => options.scriptSetupImportComponentNames.has(name));
|
|
32
32
|
const var_originalComponent = matchImportName ?? ctx.getInternalVariable();
|
|
@@ -36,6 +36,11 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
36
36
|
const var_componentEvents = ctx.getInternalVariable();
|
|
37
37
|
const var_defineComponentCtx = ctx.getInternalVariable();
|
|
38
38
|
const isComponentTag = node.tag.toLowerCase() === 'component';
|
|
39
|
+
ctx.currentComponent = {
|
|
40
|
+
node,
|
|
41
|
+
ctxVar: var_defineComponentCtx,
|
|
42
|
+
used: false
|
|
43
|
+
};
|
|
39
44
|
let props = node.props;
|
|
40
45
|
let dynamicTagInfo;
|
|
41
46
|
if (isComponentTag) {
|
|
@@ -49,7 +54,7 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
49
54
|
}
|
|
50
55
|
dynamicTagInfo = {
|
|
51
56
|
tag: prop.exp.content,
|
|
52
|
-
offsets: [prop.exp.loc.start.offset
|
|
57
|
+
offsets: [prop.exp.loc.start.offset],
|
|
53
58
|
astHolder: prop.exp.loc,
|
|
54
59
|
};
|
|
55
60
|
props = props.filter(p => p !== prop);
|
|
@@ -61,15 +66,16 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
61
66
|
// namespace tag
|
|
62
67
|
dynamicTagInfo = {
|
|
63
68
|
tag: node.tag,
|
|
64
|
-
offsets:
|
|
69
|
+
offsets: tagOffsets,
|
|
65
70
|
astHolder: node.loc,
|
|
66
71
|
};
|
|
67
72
|
}
|
|
68
73
|
if (matchImportName) {
|
|
69
74
|
// hover, renaming / find references support
|
|
70
|
-
yield `// @ts-ignore${
|
|
71
|
-
yield
|
|
75
|
+
yield `// @ts-ignore${utils_1.newLine}`; // #2304
|
|
76
|
+
yield `/** @type { [`;
|
|
72
77
|
for (const tagOffset of tagOffsets) {
|
|
78
|
+
yield `typeof `;
|
|
73
79
|
if (var_originalComponent === node.tag) {
|
|
74
80
|
yield [
|
|
75
81
|
var_originalComponent,
|
|
@@ -79,7 +85,8 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
79
85
|
];
|
|
80
86
|
}
|
|
81
87
|
else {
|
|
82
|
-
|
|
88
|
+
const shouldCapitalize = matchImportName[0].toUpperCase() === matchImportName[0];
|
|
89
|
+
yield* (0, camelized_1.generateCamelized)(shouldCapitalize ? (0, shared_1.capitalize)(node.tag) : node.tag, tagOffset, {
|
|
83
90
|
...ctx.codeFeatures.withoutHighlightAndCompletion,
|
|
84
91
|
navigation: {
|
|
85
92
|
resolveRenameNewName: camelizeComponentName,
|
|
@@ -87,32 +94,32 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
87
94
|
},
|
|
88
95
|
});
|
|
89
96
|
}
|
|
90
|
-
yield
|
|
97
|
+
yield `, `;
|
|
91
98
|
}
|
|
92
|
-
yield `]
|
|
99
|
+
yield `] } */${utils_1.endOfLine}`;
|
|
93
100
|
}
|
|
94
101
|
else if (dynamicTagInfo) {
|
|
95
102
|
yield `const ${var_originalComponent} = (`;
|
|
96
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx,
|
|
103
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, dynamicTagInfo.tag, dynamicTagInfo.offsets[0], dynamicTagInfo.astHolder, '(', ')');
|
|
97
104
|
if (dynamicTagInfo.offsets[1] !== undefined) {
|
|
98
105
|
yield `,`;
|
|
99
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx,
|
|
106
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', {
|
|
100
107
|
...ctx.codeFeatures.all,
|
|
101
108
|
completion: false,
|
|
102
|
-
}, '(', ')');
|
|
109
|
+
}, dynamicTagInfo.tag, dynamicTagInfo.offsets[1], dynamicTagInfo.astHolder, '(', ')');
|
|
103
110
|
}
|
|
104
|
-
yield `)${
|
|
111
|
+
yield `)${utils_1.endOfLine}`;
|
|
105
112
|
}
|
|
106
113
|
else if (!isComponentTag) {
|
|
107
|
-
yield `const ${var_originalComponent} =
|
|
108
|
-
yield
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
yield `${
|
|
114
|
+
yield `const ${var_originalComponent} = ({} as __VLS_WithComponent<'${getCanonicalComponentName(node.tag)}', __VLS_LocalComponents, `;
|
|
115
|
+
yield getPossibleOriginalComponentNames(node.tag, false)
|
|
116
|
+
.map(name => `'${name}'`)
|
|
117
|
+
.join(`, `);
|
|
118
|
+
yield `>).`;
|
|
119
|
+
yield* generateCanonicalComponentName(node.tag, tagOffsets[0], ctx.codeFeatures.withoutHighlightAndCompletionAndNavigation);
|
|
120
|
+
yield `${utils_1.endOfLine}`;
|
|
114
121
|
const camelizedTag = (0, shared_1.camelize)(node.tag);
|
|
115
|
-
if (
|
|
122
|
+
if (utils_1.variableNameRegex.test(camelizedTag)) {
|
|
116
123
|
// renaming / find references support
|
|
117
124
|
yield `/** @type { [`;
|
|
118
125
|
for (const tagOffset of tagOffsets) {
|
|
@@ -128,47 +135,53 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
128
135
|
yield `, `;
|
|
129
136
|
}
|
|
130
137
|
}
|
|
131
|
-
yield `] } */${
|
|
138
|
+
yield `] } */${utils_1.endOfLine}`;
|
|
132
139
|
// auto import support
|
|
133
140
|
if (options.edited) {
|
|
134
|
-
yield `// @ts-ignore${
|
|
135
|
-
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(node.tag),
|
|
141
|
+
yield `// @ts-ignore${utils_1.newLine}`; // #2304
|
|
142
|
+
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(node.tag), tagOffsets[0], {
|
|
136
143
|
completion: {
|
|
137
144
|
isAdditional: true,
|
|
138
145
|
onlyImport: true,
|
|
139
146
|
},
|
|
140
147
|
});
|
|
141
|
-
yield `${
|
|
148
|
+
yield `${utils_1.endOfLine}`;
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
else {
|
|
146
|
-
yield `const ${var_originalComponent} = {} as any${
|
|
147
|
-
}
|
|
148
|
-
yield `// @ts-ignore${
|
|
149
|
-
yield `const ${var_functionalComponent} = __VLS_asFunctionalComponent(${var_originalComponent}, new ${var_originalComponent}({`;
|
|
150
|
-
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, props, false);
|
|
151
|
-
yield `}))${
|
|
152
|
-
yield `const
|
|
153
|
-
yield* (0,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
153
|
+
yield `const ${var_originalComponent} = {} as any${utils_1.endOfLine}`;
|
|
154
|
+
}
|
|
155
|
+
yield `// @ts-ignore${utils_1.newLine}`;
|
|
156
|
+
yield `const ${var_functionalComponent} = __VLS_asFunctionalComponent(${var_originalComponent}, new ${var_originalComponent}({${utils_1.newLine}`;
|
|
157
|
+
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.strictTemplates, false);
|
|
158
|
+
yield `}))${utils_1.endOfLine}`;
|
|
159
|
+
yield `const `;
|
|
160
|
+
yield* (0, utils_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, {
|
|
161
|
+
verification: {
|
|
162
|
+
shouldReport(_source, code) {
|
|
163
|
+
return String(code) !== '6133';
|
|
164
|
+
},
|
|
165
|
+
}
|
|
166
|
+
}, var_componentInstance);
|
|
167
|
+
yield ` = ${var_functionalComponent}`;
|
|
168
|
+
yield* generateComponentGeneric(ctx);
|
|
169
|
+
yield `(`;
|
|
170
|
+
yield* (0, utils_1.wrapWith)(tagOffsets[0], tagOffsets[0] + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.strictTemplates, true, failedPropExps), `}`);
|
|
171
|
+
yield `, ...__VLS_functionalComponentArgsRest(${var_functionalComponent}))${utils_1.endOfLine}`;
|
|
172
|
+
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
160
173
|
const [refName, offset] = yield* generateVScope(options, ctx, node, props);
|
|
161
174
|
const isRootNode = node === ctx.singleRootNode;
|
|
162
175
|
if (refName || isRootNode) {
|
|
163
176
|
const varName = ctx.getInternalVariable();
|
|
164
|
-
ctx.
|
|
177
|
+
ctx.currentComponent.used = true;
|
|
165
178
|
yield `var ${varName} = {} as (Parameters<NonNullable<typeof ${var_defineComponentCtx}['expose']>>[0] | null)`;
|
|
166
179
|
if (node.codegenNode?.type === CompilerDOM.NodeTypes.VNODE_CALL
|
|
167
180
|
&& node.codegenNode.props?.type === CompilerDOM.NodeTypes.JS_OBJECT_EXPRESSION
|
|
168
181
|
&& node.codegenNode.props.properties.some(({ key }) => key.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && key.content === 'ref_for')) {
|
|
169
182
|
yield `[]`;
|
|
170
183
|
}
|
|
171
|
-
yield `${
|
|
184
|
+
yield `${utils_1.endOfLine}`;
|
|
172
185
|
if (refName) {
|
|
173
186
|
ctx.templateRefs.set(refName, [varName, offset]);
|
|
174
187
|
}
|
|
@@ -176,11 +189,11 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
176
189
|
ctx.singleRootElType = `NonNullable<typeof ${varName}>['$el']`;
|
|
177
190
|
}
|
|
178
191
|
}
|
|
179
|
-
const usedComponentEventsVar = yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, var_functionalComponent, var_componentInstance,
|
|
192
|
+
const usedComponentEventsVar = yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, var_functionalComponent, var_componentInstance, var_componentEvents);
|
|
180
193
|
if (usedComponentEventsVar) {
|
|
181
|
-
ctx.
|
|
182
|
-
yield `let ${var_componentEmit}!: typeof ${var_defineComponentCtx}.emit${
|
|
183
|
-
yield `let ${var_componentEvents}!: __VLS_NormalizeEmits<typeof ${var_componentEmit}>${
|
|
194
|
+
ctx.currentComponent.used = true;
|
|
195
|
+
yield `let ${var_componentEmit}!: typeof ${var_defineComponentCtx}.emit${utils_1.endOfLine}`;
|
|
196
|
+
yield `let ${var_componentEvents}!: __VLS_NormalizeEmits<typeof ${var_componentEmit}>${utils_1.endOfLine}`;
|
|
184
197
|
}
|
|
185
198
|
if (options.vueCompilerOptions.fallthroughAttributes
|
|
186
199
|
&& (node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs')
|
|
@@ -191,21 +204,21 @@ function* generateComponent(options, ctx, node, currentComponent) {
|
|
|
191
204
|
}
|
|
192
205
|
const slotDir = node.props.find(p => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === 'slot');
|
|
193
206
|
if (slotDir) {
|
|
194
|
-
yield* generateComponentSlot(options, ctx, node, slotDir
|
|
207
|
+
yield* generateComponentSlot(options, ctx, node, slotDir);
|
|
195
208
|
}
|
|
196
209
|
else {
|
|
197
|
-
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node
|
|
210
|
+
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
198
211
|
}
|
|
199
|
-
if (ctx.
|
|
200
|
-
yield `var ${var_defineComponentCtx}!: __VLS_PickFunctionalComponentCtx<typeof ${var_originalComponent}, typeof ${var_componentInstance}>${
|
|
212
|
+
if (ctx.currentComponent.used) {
|
|
213
|
+
yield `var ${var_defineComponentCtx}!: __VLS_PickFunctionalComponentCtx<typeof ${var_originalComponent}, typeof ${var_componentInstance}>${utils_1.endOfLine}`;
|
|
201
214
|
}
|
|
202
215
|
}
|
|
203
|
-
function* generateElement(options, ctx, node,
|
|
204
|
-
const startTagOffset = node.loc.start.offset + options.template.content.
|
|
216
|
+
function* generateElement(options, ctx, node, isVForChild) {
|
|
217
|
+
const startTagOffset = node.loc.start.offset + options.template.content.slice(node.loc.start.offset).indexOf(node.tag);
|
|
205
218
|
const endTagOffset = !node.isSelfClosing && options.template.lang === 'html'
|
|
206
219
|
? node.loc.start.offset + node.loc.source.lastIndexOf(node.tag)
|
|
207
220
|
: undefined;
|
|
208
|
-
const
|
|
221
|
+
const failedPropExps = [];
|
|
209
222
|
yield `__VLS_elementAsFunction(__VLS_intrinsicElements`;
|
|
210
223
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, startTagOffset, ctx.codeFeatures.withoutHighlightAndCompletion);
|
|
211
224
|
if (endTagOffset !== undefined) {
|
|
@@ -213,12 +226,9 @@ function* generateElement(options, ctx, node, currentComponent, componentCtxVar,
|
|
|
213
226
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, endTagOffset, ctx.codeFeatures.withoutHighlightAndCompletion);
|
|
214
227
|
}
|
|
215
228
|
yield `)(`;
|
|
216
|
-
yield* (0,
|
|
217
|
-
yield `)${
|
|
218
|
-
|
|
219
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx, failedExp.node.loc.source, failedExp.node.loc, failedExp.node.loc.start.offset, ctx.codeFeatures.all, failedExp.prefix, failedExp.suffix);
|
|
220
|
-
yield common_1.endOfLine;
|
|
221
|
-
}
|
|
229
|
+
yield* (0, utils_1.wrapWith)(startTagOffset, startTagOffset + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.strictTemplates, true, failedPropExps), `}`);
|
|
230
|
+
yield `)${utils_1.endOfLine}`;
|
|
231
|
+
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
222
232
|
const [refName, offset] = yield* generateVScope(options, ctx, node, node.props);
|
|
223
233
|
if (refName) {
|
|
224
234
|
let refValue = `__VLS_nativeElements['${node.tag}']`;
|
|
@@ -231,11 +241,11 @@ function* generateElement(options, ctx, node, currentComponent, componentCtxVar,
|
|
|
231
241
|
ctx.singleRootElType = `typeof __VLS_nativeElements['${node.tag}']`;
|
|
232
242
|
}
|
|
233
243
|
const slotDir = node.props.find(p => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === 'slot');
|
|
234
|
-
if (slotDir &&
|
|
235
|
-
yield* generateComponentSlot(options, ctx, node, slotDir
|
|
244
|
+
if (slotDir && ctx.currentComponent) {
|
|
245
|
+
yield* generateComponentSlot(options, ctx, node, slotDir);
|
|
236
246
|
}
|
|
237
247
|
else {
|
|
238
|
-
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node
|
|
248
|
+
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
239
249
|
}
|
|
240
250
|
if (options.vueCompilerOptions.fallthroughAttributes
|
|
241
251
|
&& (node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs')
|
|
@@ -243,6 +253,12 @@ function* generateElement(options, ctx, node, currentComponent, componentCtxVar,
|
|
|
243
253
|
ctx.inheritedAttrVars.add(`__VLS_intrinsicElements.${node.tag}`);
|
|
244
254
|
}
|
|
245
255
|
}
|
|
256
|
+
function* generateFailedPropExps(options, ctx, failedPropExps) {
|
|
257
|
+
for (const failedExp of failedPropExps) {
|
|
258
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, failedExp.node.loc.source, failedExp.node.loc.start.offset, failedExp.node.loc, failedExp.prefix, failedExp.suffix);
|
|
259
|
+
yield utils_1.endOfLine;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
246
262
|
function* generateVScope(options, ctx, node, props) {
|
|
247
263
|
const vScope = props.find(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && (prop.name === 'scope' || prop.name === 'data'));
|
|
248
264
|
let inScope = false;
|
|
@@ -257,8 +273,8 @@ function* generateVScope(options, ctx, node, props) {
|
|
|
257
273
|
vScope.exp.loc.start.offset,
|
|
258
274
|
ctx.codeFeatures.all,
|
|
259
275
|
];
|
|
260
|
-
yield
|
|
261
|
-
yield `if (${condition}) {${
|
|
276
|
+
yield utils_1.endOfLine;
|
|
277
|
+
yield `if (${condition}) {${utils_1.newLine}`;
|
|
262
278
|
ctx.blockConditions.push(condition);
|
|
263
279
|
inScope = true;
|
|
264
280
|
}
|
|
@@ -266,13 +282,13 @@ function* generateVScope(options, ctx, node, props) {
|
|
|
266
282
|
const [refName, offset] = yield* generateReferencesForElements(options, ctx, node); // <el ref="foo" />
|
|
267
283
|
yield* generateReferencesForScopedCssClasses(options, ctx, node);
|
|
268
284
|
if (inScope) {
|
|
269
|
-
yield `}${
|
|
285
|
+
yield `}${utils_1.newLine}`;
|
|
270
286
|
ctx.blockConditions.length = originalConditionsNum;
|
|
271
287
|
}
|
|
272
288
|
return [refName, offset];
|
|
273
289
|
}
|
|
274
290
|
function getCanonicalComponentName(tagText) {
|
|
275
|
-
return
|
|
291
|
+
return utils_1.variableNameRegex.test(tagText)
|
|
276
292
|
? tagText
|
|
277
293
|
: (0, shared_1.capitalize)((0, shared_1.camelize)(tagText.replace(colonReg, '-')));
|
|
278
294
|
}
|
|
@@ -290,37 +306,43 @@ function getPossibleOriginalComponentNames(tagText, deduplicate) {
|
|
|
290
306
|
return names;
|
|
291
307
|
}
|
|
292
308
|
function* generateCanonicalComponentName(tagText, offset, features) {
|
|
293
|
-
if (
|
|
309
|
+
if (utils_1.variableNameRegex.test(tagText)) {
|
|
294
310
|
yield [tagText, 'template', offset, features];
|
|
295
311
|
}
|
|
296
312
|
else {
|
|
297
313
|
yield* (0, camelized_1.generateCamelized)((0, shared_1.capitalize)(tagText.replace(colonReg, '-')), offset, features);
|
|
298
314
|
}
|
|
299
315
|
}
|
|
300
|
-
function*
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
316
|
+
function* generateComponentGeneric(ctx) {
|
|
317
|
+
if (ctx.lastGenericComment) {
|
|
318
|
+
const { content, offset } = ctx.lastGenericComment;
|
|
319
|
+
yield* (0, utils_1.wrapWith)(offset, offset + content.length, ctx.codeFeatures.verification, `<`, [
|
|
320
|
+
content,
|
|
321
|
+
'template',
|
|
322
|
+
offset,
|
|
323
|
+
ctx.codeFeatures.all
|
|
324
|
+
], `>`);
|
|
325
|
+
}
|
|
326
|
+
ctx.lastGenericComment = undefined;
|
|
327
|
+
}
|
|
328
|
+
function* generateComponentSlot(options, ctx, node, slotDir) {
|
|
329
|
+
yield `{${utils_1.newLine}`;
|
|
330
|
+
if (ctx.currentComponent) {
|
|
331
|
+
ctx.currentComponent.used = true;
|
|
332
|
+
ctx.hasSlotElements.add(ctx.currentComponent.node);
|
|
305
333
|
}
|
|
306
334
|
const slotBlockVars = [];
|
|
307
335
|
yield `const {`;
|
|
308
336
|
if (slotDir?.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && slotDir.arg.content) {
|
|
309
337
|
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, slotDir.arg.loc.source, slotDir.arg.loc.start.offset, slotDir.arg.isStatic ? ctx.codeFeatures.withoutHighlight : ctx.codeFeatures.all, slotDir.arg.loc, false, true);
|
|
310
|
-
yield ': __VLS_thisSlot';
|
|
311
338
|
}
|
|
312
339
|
else {
|
|
313
|
-
yield `default
|
|
314
|
-
yield* (0, common_1.wrapWith)(slotDir.loc.start.offset, slotDir.loc.start.offset + (slotDir.loc.source.startsWith('#')
|
|
315
|
-
? '#'.length
|
|
316
|
-
: slotDir.loc.source.startsWith('v-slot:')
|
|
317
|
-
? 'v-slot:'.length
|
|
318
|
-
: 0), ctx.codeFeatures.withoutHighlightAndCompletion, `__VLS_thisSlot`);
|
|
340
|
+
yield* (0, utils_1.wrapWith)(slotDir.loc.start.offset, slotDir.loc.start.offset + (slotDir.rawName?.length ?? 0), ctx.codeFeatures.withoutHighlightAndCompletion, `default`);
|
|
319
341
|
}
|
|
320
|
-
yield
|
|
342
|
+
yield `: __VLS_thisSlot } = ${ctx.currentComponent.ctxVar}.slots!${utils_1.endOfLine}`;
|
|
321
343
|
if (slotDir?.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
322
|
-
const slotAst = (0,
|
|
323
|
-
(0,
|
|
344
|
+
const slotAst = (0, utils_1.createTsAst)(options.ts, slotDir, `(${slotDir.exp.content}) => {}`);
|
|
345
|
+
(0, utils_1.collectVars)(options.ts, slotAst, slotAst, slotBlockVars);
|
|
324
346
|
if (!slotDir.exp.content.includes(':')) {
|
|
325
347
|
yield `const [`;
|
|
326
348
|
yield [
|
|
@@ -329,7 +351,7 @@ function* generateComponentSlot(options, ctx, node, slotDir, currentComponent, c
|
|
|
329
351
|
slotDir.exp.loc.start.offset,
|
|
330
352
|
ctx.codeFeatures.all,
|
|
331
353
|
];
|
|
332
|
-
yield `] = __VLS_getSlotParams(__VLS_thisSlot)${
|
|
354
|
+
yield `] = __VLS_getSlotParams(__VLS_thisSlot)${utils_1.endOfLine}`;
|
|
333
355
|
}
|
|
334
356
|
else {
|
|
335
357
|
yield `const `;
|
|
@@ -339,7 +361,7 @@ function* generateComponentSlot(options, ctx, node, slotDir, currentComponent, c
|
|
|
339
361
|
slotDir.exp.loc.start.offset,
|
|
340
362
|
ctx.codeFeatures.all,
|
|
341
363
|
];
|
|
342
|
-
yield ` = __VLS_getSlotParam(__VLS_thisSlot)${
|
|
364
|
+
yield ` = __VLS_getSlotParam(__VLS_thisSlot)${utils_1.endOfLine}`;
|
|
343
365
|
}
|
|
344
366
|
}
|
|
345
367
|
for (const varName of slotBlockVars) {
|
|
@@ -348,7 +370,7 @@ function* generateComponentSlot(options, ctx, node, slotDir, currentComponent, c
|
|
|
348
370
|
yield* ctx.resetDirectiveComments('end of slot children start');
|
|
349
371
|
let prev;
|
|
350
372
|
for (const childNode of node.children) {
|
|
351
|
-
yield* (0, templateChild_1.generateTemplateChild)(options, ctx, childNode,
|
|
373
|
+
yield* (0, templateChild_1.generateTemplateChild)(options, ctx, childNode, prev);
|
|
352
374
|
prev = childNode;
|
|
353
375
|
}
|
|
354
376
|
for (const varName of slotBlockVars) {
|
|
@@ -359,7 +381,7 @@ function* generateComponentSlot(options, ctx, node, slotDir, currentComponent, c
|
|
|
359
381
|
isStatic = slotDir.arg.isStatic;
|
|
360
382
|
}
|
|
361
383
|
if (isStatic && slotDir && !slotDir.arg) {
|
|
362
|
-
yield
|
|
384
|
+
yield `${ctx.currentComponent.ctxVar}.slots!['`;
|
|
363
385
|
yield [
|
|
364
386
|
'',
|
|
365
387
|
'template',
|
|
@@ -369,10 +391,10 @@ function* generateComponentSlot(options, ctx, node, slotDir, currentComponent, c
|
|
|
369
391
|
: 0),
|
|
370
392
|
ctx.codeFeatures.completion,
|
|
371
393
|
];
|
|
372
|
-
yield `'/* empty slot name completion */]${
|
|
394
|
+
yield `'/* empty slot name completion */]${utils_1.newLine}`;
|
|
373
395
|
}
|
|
374
396
|
yield* ctx.generateAutoImportCompletion();
|
|
375
|
-
yield `}${
|
|
397
|
+
yield `}${utils_1.newLine}`;
|
|
376
398
|
}
|
|
377
399
|
function* generateReferencesForElements(options, ctx, node) {
|
|
378
400
|
for (const prop of node.props) {
|
|
@@ -380,11 +402,11 @@ function* generateReferencesForElements(options, ctx, node) {
|
|
|
380
402
|
&& prop.name === 'ref'
|
|
381
403
|
&& prop.value) {
|
|
382
404
|
const [content, startOffset] = normalizeAttributeValue(prop.value);
|
|
383
|
-
yield `// @ts-ignore navigation for \`const ${content} = ref()\`${
|
|
384
|
-
yield
|
|
405
|
+
yield `// @ts-ignore navigation for \`const ${content} = ref()\`${utils_1.newLine}`;
|
|
406
|
+
yield `/** @type { typeof __VLS_ctx`;
|
|
385
407
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, content, startOffset, ctx.codeFeatures.navigation, prop.value.loc);
|
|
386
|
-
yield
|
|
387
|
-
if (
|
|
408
|
+
yield ` } */${utils_1.endOfLine}`;
|
|
409
|
+
if (utils_1.variableNameRegex.test(content) && !options.templateRefNames.has(content)) {
|
|
388
410
|
ctx.accessExternalVariable(content, startOffset);
|
|
389
411
|
}
|
|
390
412
|
return [content, startOffset];
|
|
@@ -450,8 +472,13 @@ function* generateReferencesForScopedCssClasses(options, ctx, node) {
|
|
|
450
472
|
}
|
|
451
473
|
});
|
|
452
474
|
for (const literal of literals) {
|
|
453
|
-
|
|
454
|
-
|
|
475
|
+
if (literal.text) {
|
|
476
|
+
const classes = collectClasses(literal.text, literal.end - literal.text.length - 1 + startOffset);
|
|
477
|
+
ctx.scopedClasses.push(...classes);
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
ctx.emptyClassOffsets.push(literal.end - 1 + startOffset);
|
|
481
|
+
}
|
|
455
482
|
}
|
|
456
483
|
function walkArrayLiteral(node) {
|
|
457
484
|
const { elements } = node;
|
|
@@ -2,4 +2,4 @@ import * as CompilerDOM from '@vue/compiler-dom';
|
|
|
2
2
|
import type { Code } from '../../types';
|
|
3
3
|
import type { TemplateCodegenContext } from './context';
|
|
4
4
|
import type { TemplateCodegenOptions } from './index';
|
|
5
|
-
export declare function generateElementChildren(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode
|
|
5
|
+
export declare function generateElementChildren(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode): Generator<Code>;
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateElementChildren = generateElementChildren;
|
|
4
4
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
5
|
-
const
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
6
|
const templateChild_1 = require("./templateChild");
|
|
7
|
-
function* generateElementChildren(options, ctx, node
|
|
7
|
+
function* generateElementChildren(options, ctx, node) {
|
|
8
8
|
yield* ctx.resetDirectiveComments('end of element children start');
|
|
9
9
|
let prev;
|
|
10
10
|
for (const childNode of node.children) {
|
|
11
|
-
yield* (0, templateChild_1.generateTemplateChild)(options, ctx, childNode,
|
|
11
|
+
yield* (0, templateChild_1.generateTemplateChild)(options, ctx, childNode, prev);
|
|
12
12
|
prev = childNode;
|
|
13
13
|
}
|
|
14
14
|
yield* ctx.generateAutoImportCompletion();
|
|
15
15
|
// fix https://github.com/vuejs/language-tools/issues/932
|
|
16
|
-
if (
|
|
16
|
+
if (ctx.currentComponent
|
|
17
17
|
&& !ctx.hasSlotElements.has(node)
|
|
18
18
|
&& node.children.length
|
|
19
19
|
&& node.tagType !== CompilerDOM.ElementTypes.ELEMENT
|
|
20
20
|
&& node.tagType !== CompilerDOM.ElementTypes.TEMPLATE) {
|
|
21
|
-
ctx.
|
|
22
|
-
yield
|
|
23
|
-
yield* (0,
|
|
24
|
-
yield
|
|
21
|
+
ctx.currentComponent.used = true;
|
|
22
|
+
yield `${ctx.currentComponent.ctxVar}.slots!.`;
|
|
23
|
+
yield* (0, utils_1.wrapWith)(node.children[0].loc.start.offset, node.children[node.children.length - 1].loc.end.offset, ctx.codeFeatures.navigation, `default`);
|
|
24
|
+
yield utils_1.endOfLine;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
//# sourceMappingURL=elementChildren.js.map
|
|
@@ -3,3 +3,4 @@ import type { Code } from '../../types';
|
|
|
3
3
|
import type { TemplateCodegenContext } from './context';
|
|
4
4
|
import type { TemplateCodegenOptions } from './index';
|
|
5
5
|
export declare function generateElementDirectives(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode): Generator<Code>;
|
|
6
|
+
export declare function generateModifiers(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode, propertyName?: string): Generator<Code>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateElementDirectives = generateElementDirectives;
|
|
4
|
+
exports.generateModifiers = generateModifiers;
|
|
4
5
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
5
6
|
const shared_1 = require("@vue/shared");
|
|
6
7
|
const shared_2 = require("../../utils/shared");
|
|
7
|
-
const
|
|
8
|
-
const camelized_1 = require("
|
|
8
|
+
const utils_1 = require("../utils");
|
|
9
|
+
const camelized_1 = require("../utils/camelized");
|
|
10
|
+
const stringLiteralKey_1 = require("../utils/stringLiteralKey");
|
|
9
11
|
const interpolation_1 = require("./interpolation");
|
|
10
12
|
const objectProperty_1 = require("./objectProperty");
|
|
11
|
-
const stringLiteralKey_1 = require("./stringLiteralKey");
|
|
12
13
|
function* generateElementDirectives(options, ctx, node) {
|
|
13
14
|
for (const prop of node.props) {
|
|
14
15
|
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE
|
|
@@ -21,13 +22,13 @@ function* generateElementDirectives(options, ctx, node) {
|
|
|
21
22
|
continue;
|
|
22
23
|
}
|
|
23
24
|
ctx.accessExternalVariable((0, shared_1.camelize)('v-' + prop.name), prop.loc.start.offset);
|
|
24
|
-
yield* (0,
|
|
25
|
-
yield
|
|
25
|
+
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.end.offset, ctx.codeFeatures.verification, `__VLS_asFunctionalDirective(`, ...generateIdentifier(ctx, prop), `)(null!, { ...__VLS_directiveBindingRestFields, `, ...generateArg(options, ctx, prop), ...generateModifiers(options, ctx, prop), ...generateValue(options, ctx, prop), ` }, null!, null!)`);
|
|
26
|
+
yield utils_1.endOfLine;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
function* generateIdentifier(ctx, prop) {
|
|
29
30
|
const rawName = 'v-' + prop.name;
|
|
30
|
-
yield* (0,
|
|
31
|
+
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.start.offset + rawName.length, ctx.codeFeatures.verification, `__VLS_directives.`, ...(0, camelized_1.generateCamelized)(rawName, prop.loc.start.offset, {
|
|
31
32
|
...ctx.codeFeatures.all,
|
|
32
33
|
verification: false,
|
|
33
34
|
completion: {
|
|
@@ -46,34 +47,39 @@ function* generateArg(options, ctx, prop) {
|
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
48
49
|
const startOffset = arg.loc.start.offset + arg.loc.source.indexOf(arg.content);
|
|
49
|
-
yield* (0,
|
|
50
|
-
yield
|
|
50
|
+
yield* (0, utils_1.wrapWith)(startOffset, startOffset + arg.content.length, ctx.codeFeatures.verification, `arg`);
|
|
51
|
+
yield `: `;
|
|
51
52
|
if (arg.isStatic) {
|
|
52
|
-
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(arg.content, startOffset, ctx.codeFeatures.
|
|
53
|
+
yield* (0, stringLiteralKey_1.generateStringLiteralKey)(arg.content, startOffset, ctx.codeFeatures.all);
|
|
53
54
|
}
|
|
54
55
|
else {
|
|
55
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx,
|
|
56
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, arg.content, startOffset, arg.loc, `(`, `)`);
|
|
56
57
|
}
|
|
57
|
-
yield
|
|
58
|
+
yield `, `;
|
|
58
59
|
}
|
|
59
|
-
function* generateModifiers(options, ctx, prop) {
|
|
60
|
-
|
|
60
|
+
function* generateModifiers(options, ctx, prop, propertyName = 'modifiers') {
|
|
61
|
+
const { modifiers } = prop;
|
|
62
|
+
if (!modifiers.length) {
|
|
61
63
|
return;
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
const startOffset = modifiers[0].loc.start.offset - 1;
|
|
66
|
+
const endOffset = modifiers.at(-1).loc.end.offset;
|
|
67
|
+
yield* (0, utils_1.wrapWith)(startOffset, endOffset, ctx.codeFeatures.verification, propertyName);
|
|
68
|
+
yield `: { `;
|
|
69
|
+
for (const mod of modifiers) {
|
|
70
|
+
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, mod.content, mod.loc.start.offset, ctx.codeFeatures.withoutNavigation);
|
|
71
|
+
yield `: true, `;
|
|
67
72
|
}
|
|
68
|
-
yield
|
|
73
|
+
yield `}, `;
|
|
69
74
|
}
|
|
70
75
|
function* generateValue(options, ctx, prop) {
|
|
71
|
-
|
|
76
|
+
const { exp } = prop;
|
|
77
|
+
if (exp?.type !== CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
72
78
|
return;
|
|
73
79
|
}
|
|
74
|
-
yield* (0,
|
|
75
|
-
yield
|
|
76
|
-
yield* (0,
|
|
80
|
+
yield* (0, utils_1.wrapWith)(exp.loc.start.offset, exp.loc.end.offset, ctx.codeFeatures.verification, `value`);
|
|
81
|
+
yield `: `;
|
|
82
|
+
yield* (0, utils_1.wrapWith)(exp.loc.start.offset, exp.loc.end.offset, ctx.codeFeatures.verification, ...(0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, exp.content, exp.loc.start.offset, exp.loc, `(`, `)`));
|
|
77
83
|
}
|
|
78
84
|
function getPropRenameApply(oldName) {
|
|
79
85
|
return oldName === (0, shared_2.hyphenateAttr)(oldName) ? shared_2.hyphenateAttr : undefined;
|
|
@@ -3,7 +3,7 @@ import type * as ts from 'typescript';
|
|
|
3
3
|
import type { Code } from '../../types';
|
|
4
4
|
import type { TemplateCodegenContext } from './context';
|
|
5
5
|
import type { TemplateCodegenOptions } from './index';
|
|
6
|
-
export declare function generateElementEvents(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode, componentVar: string, componentInstanceVar: string,
|
|
7
|
-
export declare function generateEventArg(ctx: TemplateCodegenContext,
|
|
6
|
+
export declare function generateElementEvents(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, node: CompilerDOM.ElementNode, componentVar: string, componentInstanceVar: string, eventsVar: string): Generator<Code, boolean>;
|
|
7
|
+
export declare function generateEventArg(ctx: TemplateCodegenContext, name: string, start: number, directive?: string): Generator<Code>;
|
|
8
8
|
export declare function generateEventExpression(options: TemplateCodegenOptions, ctx: TemplateCodegenContext, prop: CompilerDOM.DirectiveNode): Generator<Code>;
|
|
9
9
|
export declare function isCompoundExpression(ts: typeof import('typescript'), ast: ts.SourceFile): boolean;
|