@vue/language-core 2.1.10 → 2.2.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.
Files changed (109) hide show
  1. package/index.d.ts +0 -1
  2. package/index.js +1 -2
  3. package/lib/codeFeatures.d.ts +1 -0
  4. package/lib/codeFeatures.js +3 -0
  5. package/lib/codegen/codeFeatures.d.ts +83 -0
  6. package/lib/codegen/codeFeatures.js +71 -0
  7. package/lib/codegen/globalTypes.d.ts +3 -1
  8. package/lib/codegen/globalTypes.js +39 -14
  9. package/lib/codegen/localTypes.d.ts +1 -1
  10. package/lib/codegen/localTypes.js +7 -7
  11. package/lib/codegen/script/binding.d.ts +4 -0
  12. package/lib/codegen/script/binding.js +41 -0
  13. package/lib/codegen/script/component.d.ts +1 -1
  14. package/lib/codegen/script/component.js +44 -44
  15. package/lib/codegen/script/componentSelf.d.ts +1 -1
  16. package/lib/codegen/script/componentSelf.js +14 -14
  17. package/lib/codegen/script/context.d.ts +1 -1
  18. package/lib/codegen/script/context.js +2 -2
  19. package/lib/codegen/script/index.d.ts +6 -11
  20. package/lib/codegen/script/index.js +21 -63
  21. package/lib/codegen/script/scriptSetup.d.ts +1 -1
  22. package/lib/codegen/script/scriptSetup.js +236 -205
  23. package/lib/codegen/script/src.js +8 -8
  24. package/lib/codegen/script/styleModulesType.d.ts +1 -1
  25. package/lib/codegen/script/styleModulesType.js +7 -7
  26. package/lib/codegen/script/template.d.ts +2 -2
  27. package/lib/codegen/script/template.js +81 -114
  28. package/lib/codegen/template/context.d.ts +29 -15
  29. package/lib/codegen/template/context.js +51 -96
  30. package/lib/codegen/template/element.d.ts +2 -4
  31. package/lib/codegen/template/element.js +124 -317
  32. package/lib/codegen/template/elementChildren.d.ts +1 -1
  33. package/lib/codegen/template/elementChildren.js +10 -11
  34. package/lib/codegen/template/elementDirectives.d.ts +1 -0
  35. package/lib/codegen/template/elementDirectives.js +43 -30
  36. package/lib/codegen/template/elementEvents.d.ts +2 -2
  37. package/lib/codegen/template/elementEvents.js +32 -65
  38. package/lib/codegen/template/elementProps.d.ts +5 -3
  39. package/lib/codegen/template/elementProps.js +116 -123
  40. package/lib/codegen/template/index.d.ts +1 -0
  41. package/lib/codegen/template/index.js +67 -69
  42. package/lib/codegen/template/interpolation.d.ts +5 -3
  43. package/lib/codegen/template/interpolation.js +30 -27
  44. package/lib/codegen/template/objectProperty.js +8 -8
  45. package/lib/codegen/template/propertyAccess.js +4 -4
  46. package/lib/codegen/template/slotOutlet.d.ts +1 -1
  47. package/lib/codegen/template/slotOutlet.js +47 -25
  48. package/lib/codegen/template/styleScopedClasses.d.ts +4 -1
  49. package/lib/codegen/template/styleScopedClasses.js +152 -8
  50. package/lib/codegen/template/templateChild.d.ts +1 -1
  51. package/lib/codegen/template/templateChild.js +39 -20
  52. package/lib/codegen/template/vFor.d.ts +1 -1
  53. package/lib/codegen/template/vFor.js +11 -11
  54. package/lib/codegen/template/vIf.d.ts +1 -1
  55. package/lib/codegen/template/vIf.js +6 -6
  56. package/lib/codegen/template/vSlot.d.ts +5 -0
  57. package/lib/codegen/template/vSlot.js +80 -0
  58. package/lib/codegen/utils/camelized.d.ts +2 -0
  59. package/lib/codegen/utils/camelized.js +31 -0
  60. package/lib/codegen/utils/index.d.ts +21 -0
  61. package/lib/codegen/utils/index.js +79 -0
  62. package/lib/codegen/utils/src.d.ts +2 -0
  63. package/lib/codegen/utils/src.js +19 -0
  64. package/lib/codegen/{template → utils}/stringLiteralKey.js +3 -3
  65. package/lib/codegen/utils/unicode.d.ts +2 -0
  66. package/lib/codegen/utils/unicode.js +25 -0
  67. package/lib/languagePlugin.js +1 -1
  68. package/lib/parsers/scriptRanges.d.ts +7 -2
  69. package/lib/parsers/scriptSetupRanges.d.ts +69 -83
  70. package/lib/parsers/scriptSetupRanges.js +194 -171
  71. package/lib/parsers/vueCompilerOptions.d.ts +2 -0
  72. package/lib/parsers/vueCompilerOptions.js +23 -0
  73. package/lib/plugins/file-html.js +4 -3
  74. package/lib/plugins/file-md.js +1 -1
  75. package/lib/plugins/file-vue.js +4 -4
  76. package/lib/plugins/vue-root-tags.js +2 -2
  77. package/lib/plugins/vue-style-class-names.d.ts +5 -0
  78. package/lib/plugins/vue-style-class-names.js +32 -0
  79. package/lib/plugins/vue-style-reference-link.d.ts +1 -0
  80. package/lib/plugins/vue-style-reference-link.js +3 -0
  81. package/lib/plugins/vue-style-reference-links.d.ts +3 -0
  82. package/lib/plugins/vue-style-reference-links.js +26 -0
  83. package/lib/plugins/vue-template-html.js +6 -2
  84. package/lib/plugins/vue-template-inline-css.js +1 -1
  85. package/lib/plugins/vue-template-inline-ts.js +66 -17
  86. package/lib/plugins/vue-tsx.d.ts +126 -92
  87. package/lib/plugins/vue-tsx.js +114 -97
  88. package/lib/plugins/vue-vine.d.ts +3 -0
  89. package/lib/plugins/vue-vine.js +35 -0
  90. package/lib/types.d.ts +25 -12
  91. package/lib/utils/buildMappings.d.ts +1 -1
  92. package/lib/utils/parseCssImports.d.ts +4 -0
  93. package/lib/utils/parseCssImports.js +19 -0
  94. package/lib/utils/parseSfc.d.ts +5 -0
  95. package/lib/utils/parseSfc.js +11 -5
  96. package/lib/utils/signals.d.ts +2 -0
  97. package/lib/utils/signals.js +54 -0
  98. package/lib/utils/ts.d.ts +14 -2
  99. package/lib/utils/ts.js +134 -91
  100. package/lib/virtualFile/computedEmbeddedCodes.d.ts +1 -2
  101. package/lib/virtualFile/computedEmbeddedCodes.js +11 -11
  102. package/lib/virtualFile/computedSfc.d.ts +1 -2
  103. package/lib/virtualFile/computedSfc.js +87 -79
  104. package/lib/virtualFile/computedVueSfc.d.ts +1 -2
  105. package/lib/virtualFile/computedVueSfc.js +7 -7
  106. package/lib/virtualFile/vueFile.d.ts +5 -5
  107. package/lib/virtualFile/vueFile.js +6 -6
  108. package/package.json +6 -6
  109. /package/lib/codegen/{template → utils}/stringLiteralKey.d.ts +0 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commentReg = void 0;
4
+ exports.fillBlank = fillBlank;
5
+ exports.commentReg = /(?<=\/\*)[\s\S]*?(?=\*\/)|(?<=\/\/)[\s\S]*?(?=\n)/g;
6
+ const cssClassNameReg = /(?=(\.[a-z_][-\w]*)[\s.,+~>:#)[{])/gi;
7
+ const fragmentReg = /(?<={)[^{]*(?=(?<!\\);)/g;
8
+ const plugin = () => {
9
+ return {
10
+ version: 2.1,
11
+ resolveStyleReferenceLinks(block) {
12
+ const result = [];
13
+ const content = fillBlank(block.content, exports.commentReg, fragmentReg);
14
+ const matches = content.matchAll(cssClassNameReg);
15
+ for (const match of matches) {
16
+ const matchText = match[1];
17
+ if (matchText) {
18
+ result.push({ text: matchText, offset: match.index });
19
+ }
20
+ }
21
+ return result;
22
+ },
23
+ };
24
+ };
25
+ exports.default = plugin;
26
+ function fillBlank(css, ...regs) {
27
+ for (const reg of regs) {
28
+ css = css.replace(reg, match => ' '.repeat(match.length));
29
+ }
30
+ return css;
31
+ }
32
+ //# sourceMappingURL=vue-style-class-names.js.map
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=vue-style-reference-link.js.map
@@ -0,0 +1,3 @@
1
+ import type { VueLanguagePlugin } from '../types';
2
+ declare const plugin: VueLanguagePlugin;
3
+ export default plugin;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cssImportReg = /(?<=@import\s+url\()(["']?).*?\1(?=\))|(?<=@import\b\s*)(["']).*?\2/g;
4
+ const plugin = () => {
5
+ return {
6
+ version: 2.1,
7
+ resolveStyleReferenceLinks(block) {
8
+ const result = [];
9
+ const matches = block.content.matchAll(cssImportReg);
10
+ for (const match of matches) {
11
+ let text = match[0];
12
+ let offset = match.index;
13
+ if (text.startsWith('\'') || text.startsWith('"')) {
14
+ text = text.slice(1, -1);
15
+ offset += 1;
16
+ }
17
+ if (text) {
18
+ result.push({ text, offset });
19
+ }
20
+ }
21
+ return result;
22
+ },
23
+ };
24
+ };
25
+ exports.default = plugin;
26
+ //# sourceMappingURL=vue-style-reference-links.js.map
@@ -155,6 +155,10 @@ const plugin = ({ modules }) => {
155
155
  if (node.isStatic) {
156
156
  return false;
157
157
  }
158
+ else if (!node.loc.source) {
159
+ // :class="..." -> :class=""
160
+ return false;
161
+ }
158
162
  else {
159
163
  node.content = node.loc.source;
160
164
  }
@@ -168,9 +172,9 @@ const plugin = ({ modules }) => {
168
172
  delete loc.__endOffset;
169
173
  if (withinChangeRange(loc)) {
170
174
  loc.source =
171
- loc.source.substring(0, change.start - loc.start.offset)
175
+ loc.source.slice(0, change.start - loc.start.offset)
172
176
  + change.newText
173
- + loc.source.substring(change.end - loc.start.offset);
177
+ + loc.source.slice(change.end - loc.start.offset);
174
178
  loc.__endOffset = loc.end.offset;
175
179
  loc.end.offset += lengthDiff;
176
180
  return true;
@@ -39,7 +39,7 @@ function* generate(templateAst) {
39
39
  const endCrt = prop.arg.loc.source[prop.arg.loc.source.length - 1]; // " | '
40
40
  const start = prop.arg.loc.source.indexOf(endCrt) + 1;
41
41
  const end = prop.arg.loc.source.lastIndexOf(endCrt);
42
- const content = prop.arg.loc.source.substring(start, end);
42
+ const content = prop.arg.loc.source.slice(start, end);
43
43
  yield `x { `;
44
44
  yield [
45
45
  content,
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const common_1 = require("../codegen/common");
3
+ const CompilerDOM = require("@vue/compiler-dom");
4
4
  const elementEvents_1 = require("../codegen/template/elementEvents");
5
5
  const templateChild_1 = require("../codegen/template/templateChild");
6
6
  const vFor_1 = require("../codegen/template/vFor");
7
- const CompilerDOM = require("@vue/compiler-dom");
7
+ const utils_1 = require("../codegen/utils");
8
8
  const codeFeatures = {
9
9
  format: true,
10
10
  };
@@ -18,6 +18,7 @@ const formatBrackets = {
18
18
  // fix https://github.com/vuejs/language-tools/issues/2305
19
19
  curly: ['0 +', '+ 0;'],
20
20
  event: ['() => ', ';'],
21
+ generic: ['<', '>() => {};'],
21
22
  };
22
23
  const plugin = ctx => {
23
24
  const parseds = new WeakMap();
@@ -58,7 +59,14 @@ const plugin = ctx => {
58
59
  sfc.template.ast.children.forEach(visit);
59
60
  return data;
60
61
  function visit(node) {
61
- if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
62
+ if (node.type === CompilerDOM.NodeTypes.COMMENT) {
63
+ const match = node.loc.source.match(/^<!--\s*@vue-generic\b\s*\{(?<content>[^}]*)\}/);
64
+ if (match) {
65
+ const { content } = match.groups ?? {};
66
+ addFormatCodes(content, node.loc.start.offset + match[0].indexOf(content), formatBrackets.generic);
67
+ }
68
+ }
69
+ else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
62
70
  for (const prop of node.props) {
63
71
  if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE) {
64
72
  continue;
@@ -68,19 +76,37 @@ const plugin = ctx => {
68
76
  continue;
69
77
  }
70
78
  if (prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && !prop.arg.isStatic) {
71
- addFormatCodes(prop.arg.content, prop.arg.loc.start.offset, formatBrackets.normal);
79
+ addFormatCodes(prop.arg.loc.source, prop.arg.loc.start.offset, formatBrackets.normal);
72
80
  }
73
81
  if (prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION
74
82
  && prop.exp.constType !== CompilerDOM.ConstantTypes.CAN_STRINGIFY // style='z-index: 2' will compile to {'z-index':'2'}
75
83
  ) {
76
84
  if (prop.name === 'on' && prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
77
- const ast = (0, common_1.createTsAst)(ctx.modules.typescript, prop.exp, prop.exp.content);
78
- addFormatCodes(prop.exp.content, prop.exp.loc.start.offset, (0, elementEvents_1.isCompoundExpression)(ctx.modules.typescript, ast)
79
- ? formatBrackets.event
80
- : formatBrackets.normal);
85
+ const ast = (0, utils_1.createTsAst)(ctx.modules.typescript, prop.exp, prop.exp.content);
86
+ if ((0, elementEvents_1.isCompoundExpression)(ctx.modules.typescript, ast)) {
87
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.event);
88
+ }
89
+ else {
90
+ const lines = prop.exp.content.split('\n');
91
+ const firstLineEmpty = lines[0].trim() === '';
92
+ const lastLineEmpty = lines[lines.length - 1].trim() === '';
93
+ if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
94
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.normal);
95
+ }
96
+ else {
97
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, ['(', ');']);
98
+ }
99
+ }
100
+ }
101
+ else if (prop.name === 'slot') {
102
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.params);
103
+ }
104
+ else if (prop.rawName === 'v-for') {
105
+ // #2586
106
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.for);
81
107
  }
82
108
  else {
83
- addFormatCodes(prop.exp.content, prop.exp.loc.start.offset, formatBrackets.normal);
109
+ addFormatCodes(prop.exp.loc.source, prop.exp.loc.start.offset, formatBrackets.normal);
84
110
  }
85
111
  }
86
112
  }
@@ -92,7 +118,7 @@ const plugin = ctx => {
92
118
  for (let i = 0; i < node.branches.length; i++) {
93
119
  const branch = node.branches[i];
94
120
  if (branch.condition?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
95
- addFormatCodes(branch.condition.content, branch.condition.loc.start.offset, formatBrackets.if);
121
+ addFormatCodes(branch.condition.loc.source, branch.condition.loc.start.offset, formatBrackets.if);
96
122
  }
97
123
  for (const childNode of branch.children) {
98
124
  visit(childNode);
@@ -103,9 +129,15 @@ const plugin = ctx => {
103
129
  const { leftExpressionRange, leftExpressionText } = (0, vFor_1.parseVForNode)(node);
104
130
  const { source } = node.parseResult;
105
131
  if (leftExpressionRange && leftExpressionText && source.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
106
- const start = leftExpressionRange.start;
107
- const end = source.loc.start.offset + source.content.length;
108
- addFormatCodes(templateContent.substring(start, end), start, formatBrackets.for);
132
+ let start = leftExpressionRange.start;
133
+ let end = source.loc.start.offset + source.content.length;
134
+ while (templateContent[start - 1] === ' ' || templateContent[start - 1] === '(') {
135
+ start--;
136
+ }
137
+ while (templateContent[end] === ' ' || templateContent[end] === ')') {
138
+ end++;
139
+ }
140
+ addFormatCodes(templateContent.slice(start, end), start, formatBrackets.for);
109
141
  }
110
142
  for (const child of node.children) {
111
143
  visit(child);
@@ -127,10 +159,27 @@ const plugin = ctx => {
127
159
  // {{ ... }}
128
160
  const [content, start] = (0, templateChild_1.parseInterpolationNode)(node, templateContent);
129
161
  const lines = content.split('\n');
130
- addFormatCodes(content, start, lines.length <= 1 ? formatBrackets.curly : [
131
- lines[0].trim() === '' ? '(' : formatBrackets.curly[0],
132
- lines[lines.length - 1].trim() === '' ? ');' : formatBrackets.curly[1],
133
- ]);
162
+ const firstLineEmpty = lines[0].trim() === '';
163
+ const lastLineEmpty = lines[lines.length - 1].trim() === '';
164
+ if (content.includes('=>')) { // arrow function
165
+ if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
166
+ addFormatCodes(content, start, formatBrackets.normal);
167
+ }
168
+ else {
169
+ addFormatCodes(content, start, ['(', ');']);
170
+ }
171
+ }
172
+ else {
173
+ if (lines.length <= 1 || (!firstLineEmpty && !lastLineEmpty)) {
174
+ addFormatCodes(content, start, formatBrackets.curly);
175
+ }
176
+ else {
177
+ addFormatCodes(content, start, [
178
+ firstLineEmpty ? '(' : '(0 +',
179
+ lastLineEmpty ? ');' : '+ 0);'
180
+ ]);
181
+ }
182
+ }
134
183
  }
135
184
  }
136
185
  function addFormatCodes(code, offset, wrapper) {
@@ -1,7 +1,7 @@
1
1
  import type { Mapping } from '@volar/language-core';
2
2
  import type { Code, Sfc, VueLanguagePlugin } from '../types';
3
3
  export declare const tsCodegen: WeakMap<Sfc, {
4
- scriptRanges: import("alien-signals").ISignal<{
4
+ getScriptRanges: () => {
5
5
  exportDefault: (import("../types").TextRange & {
6
6
  expression: import("../types").TextRange;
7
7
  args: import("../types").TextRange;
@@ -13,90 +13,110 @@ export declare const tsCodegen: WeakMap<Sfc, {
13
13
  inheritAttrsOption: string | undefined;
14
14
  }) | undefined;
15
15
  classBlockEnd: number | undefined;
16
- bindings: import("../types").TextRange[];
17
- } | undefined>;
18
- scriptSetupRanges: import("alien-signals").ISignal<{
16
+ bindings: {
17
+ range: import("../types").TextRange;
18
+ moduleName?: string;
19
+ isDefaultImport?: boolean;
20
+ isNamespace?: boolean;
21
+ }[];
22
+ } | undefined;
23
+ getScriptSetupRanges: () => {
19
24
  leadingCommentEndOffset: number;
20
25
  importSectionEndOffset: number;
21
- bindings: import("../types").TextRange[];
22
- importComponentNames: Set<string>;
23
- props: {
26
+ bindings: {
27
+ range: import("../types").TextRange;
28
+ moduleName?: string;
29
+ isDefaultImport?: boolean;
30
+ isNamespace?: boolean;
31
+ }[];
32
+ defineProp: {
33
+ localName?: import("../types").TextRange;
34
+ name?: import("../types").TextRange;
35
+ type?: import("../types").TextRange;
36
+ modifierType?: import("../types").TextRange;
37
+ runtimeType?: import("../types").TextRange;
38
+ defaultValue?: import("../types").TextRange;
39
+ required?: boolean;
40
+ isModel?: boolean;
41
+ }[];
42
+ defineProps: ({
43
+ callExp: import("../types").TextRange;
44
+ exp: import("../types").TextRange;
45
+ arg?: import("../types").TextRange;
46
+ typeArg?: import("../types").TextRange;
47
+ } & {
24
48
  name?: string;
25
- destructured?: Set<string>;
49
+ destructured?: Map<string, import("typescript").Expression | undefined>;
26
50
  destructuredRest?: string;
27
- define?: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
28
- exp: import("../types").TextRange;
29
- arg?: import("../types").TextRange;
30
- typeArg?: import("../types").TextRange;
31
- }> & {
32
- statement: import("../types").TextRange;
33
- };
34
- withDefaults?: import("../types").TextRange & {
35
- arg?: import("../types").TextRange;
36
- };
37
- };
38
- slots: {
39
- name?: string;
40
- isObjectBindingPattern?: boolean;
41
- define?: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
42
- exp: import("../types").TextRange;
43
- arg?: import("../types").TextRange;
44
- typeArg?: import("../types").TextRange;
45
- }> & {
46
- statement: import("../types").TextRange;
47
- };
48
- };
49
- emits: {
51
+ statement: import("../types").TextRange;
52
+ argNode?: import("typescript").Expression;
53
+ }) | undefined;
54
+ withDefaults: (Omit<{
55
+ callExp: import("../types").TextRange;
56
+ exp: import("../types").TextRange;
57
+ arg?: import("../types").TextRange;
58
+ typeArg?: import("../types").TextRange;
59
+ }, "typeArg"> & {
60
+ argNode?: import("typescript").Expression;
61
+ }) | undefined;
62
+ defineEmits: ({
63
+ callExp: import("../types").TextRange;
64
+ exp: import("../types").TextRange;
65
+ arg?: import("../types").TextRange;
66
+ typeArg?: import("../types").TextRange;
67
+ } & {
50
68
  name?: string;
51
- define?: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
52
- exp: import("../types").TextRange;
53
- arg?: import("../types").TextRange;
54
- typeArg?: import("../types").TextRange;
55
- }> & {
56
- statement: import("../types").TextRange;
57
- hasUnionTypeArg?: boolean;
58
- };
59
- };
60
- expose: {
69
+ hasUnionTypeArg?: boolean;
70
+ statement: import("../types").TextRange;
71
+ }) | undefined;
72
+ defineSlots: ({
73
+ callExp: import("../types").TextRange;
74
+ exp: import("../types").TextRange;
75
+ arg?: import("../types").TextRange;
76
+ typeArg?: import("../types").TextRange;
77
+ } & {
61
78
  name?: string;
62
- define?: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
63
- exp: import("../types").TextRange;
64
- arg?: import("../types").TextRange;
65
- typeArg?: import("../types").TextRange;
66
- }>;
67
- };
68
- options: {
79
+ statement: import("../types").TextRange;
80
+ }) | undefined;
81
+ defineExpose: {
82
+ callExp: import("../types").TextRange;
83
+ exp: import("../types").TextRange;
84
+ arg?: import("../types").TextRange;
85
+ typeArg?: import("../types").TextRange;
86
+ } | undefined;
87
+ defineOptions: {
69
88
  name?: string;
70
89
  inheritAttrs?: string;
71
- };
72
- cssModules: {
73
- define: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
74
- exp: import("../types").TextRange;
75
- arg?: import("../types").TextRange;
76
- typeArg?: import("../types").TextRange;
77
- }>;
90
+ } | undefined;
91
+ useAttrs: {
92
+ callExp: import("../types").TextRange;
93
+ exp: import("../types").TextRange;
94
+ arg?: import("../types").TextRange;
95
+ typeArg?: import("../types").TextRange;
78
96
  }[];
79
- defineProp: {
80
- localName: import("../types").TextRange | undefined;
81
- name: import("../types").TextRange | undefined;
82
- type: import("../types").TextRange | undefined;
83
- modifierType?: import("../types").TextRange | undefined;
84
- runtimeType: import("../types").TextRange | undefined;
85
- defaultValue: import("../types").TextRange | undefined;
86
- required: boolean;
87
- isModel?: boolean;
97
+ useCssModule: {
98
+ callExp: import("../types").TextRange;
99
+ exp: import("../types").TextRange;
100
+ arg?: import("../types").TextRange;
101
+ typeArg?: import("../types").TextRange;
88
102
  }[];
89
- templateRefs: {
90
- name?: string;
91
- define: ReturnType<(node: import("typescript").CallExpression) => import("../types").TextRange & {
92
- exp: import("../types").TextRange;
93
- arg?: import("../types").TextRange;
94
- typeArg?: import("../types").TextRange;
95
- }>;
103
+ useSlots: {
104
+ callExp: import("../types").TextRange;
105
+ exp: import("../types").TextRange;
106
+ arg?: import("../types").TextRange;
107
+ typeArg?: import("../types").TextRange;
96
108
  }[];
97
- } | undefined>;
98
- lang: import("alien-signals").ISignal<string>;
99
- generatedScript: import("alien-signals").ISignal<{
109
+ useTemplateRef: ({
110
+ callExp: import("../types").TextRange;
111
+ exp: import("../types").TextRange;
112
+ arg?: import("../types").TextRange;
113
+ typeArg?: import("../types").TextRange;
114
+ } & {
115
+ name?: string;
116
+ })[];
117
+ } | undefined;
118
+ getLang: () => string;
119
+ getGeneratedScript: () => {
100
120
  codes: Code[];
101
121
  linkedCodeMappings: Mapping<unknown>[];
102
122
  generatedTemplate: boolean;
@@ -110,43 +130,52 @@ export declare const tsCodegen: WeakMap<Sfc, {
110
130
  readonly PrettifyLocal: string;
111
131
  readonly OmitKeepDiscriminatedUnion: string;
112
132
  readonly WithDefaults: string;
113
- readonly WithTemplateSlots: string;
133
+ readonly WithSlots: string;
114
134
  readonly PropsChildren: string;
115
135
  readonly TypePropsToOption: string;
116
136
  readonly OmitIndexSignature: string;
117
137
  };
118
138
  inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
119
- }>;
120
- generatedTemplate: import("alien-signals").ISignal<{
139
+ };
140
+ getGeneratedTemplate: () => {
121
141
  codes: Code[];
122
- slots: {
123
- name: string;
124
- loc?: number;
125
- tagRange: [number, number];
126
- varName: string;
127
- nodeLoc: any;
128
- }[];
129
- dynamicSlots: {
130
- expVar: string;
131
- varName: string;
132
- }[];
133
142
  codeFeatures: {
134
143
  all: import("../types").VueCodeInformation;
144
+ none: import("../types").VueCodeInformation;
135
145
  verification: import("../types").VueCodeInformation;
136
146
  completion: import("../types").VueCodeInformation;
137
147
  additionalCompletion: import("../types").VueCodeInformation;
148
+ withoutCompletion: import("../types").VueCodeInformation;
138
149
  navigation: import("../types").VueCodeInformation;
139
150
  navigationWithoutRename: import("../types").VueCodeInformation;
140
151
  navigationAndCompletion: import("../types").VueCodeInformation;
141
152
  navigationAndAdditionalCompletion: import("../types").VueCodeInformation;
153
+ navigationAndVerification: import("../types").VueCodeInformation;
154
+ withoutNavigation: import("../types").VueCodeInformation;
142
155
  withoutHighlight: import("../types").VueCodeInformation;
156
+ withoutHighlightAndNavigation: import("../types").VueCodeInformation;
143
157
  withoutHighlightAndCompletion: import("../types").VueCodeInformation;
144
158
  withoutHighlightAndCompletionAndNavigation: import("../types").VueCodeInformation;
145
159
  };
160
+ resolveCodeFeatures: (features: import("../types").VueCodeInformation) => import("../types").VueCodeInformation;
161
+ slots: {
162
+ name: string;
163
+ offset?: number;
164
+ tagRange: [number, number];
165
+ nodeLoc: any;
166
+ propsVar: string;
167
+ }[];
168
+ dynamicSlots: {
169
+ expVar: string;
170
+ propsVar: string;
171
+ }[];
172
+ specialVars: Set<string>;
146
173
  accessExternalVariables: Map<string, Set<number>>;
147
- hasSlotElements: Set<import("@vue/compiler-dom").ElementNode>;
174
+ lastGenericComment: {
175
+ content: string;
176
+ offset: number;
177
+ } | undefined;
148
178
  blockConditions: string[];
149
- usedComponentCtxVars: Set<string>;
150
179
  scopedClasses: {
151
180
  source: string;
152
181
  className: string;
@@ -155,8 +184,13 @@ export declare const tsCodegen: WeakMap<Sfc, {
155
184
  emptyClassOffsets: number[];
156
185
  inlayHints: import("../codegen/inlayHints").InlayHintInfo[];
157
186
  hasSlot: boolean;
158
- inheritedAttrVars: Set<unknown>;
187
+ bindingAttrLocs: import("@vue/compiler-dom").SourceLocation[];
188
+ inheritedAttrVars: Set<string>;
159
189
  templateRefs: Map<string, [varName: string, offset: number]>;
190
+ currentComponent: {
191
+ ctxVar: string;
192
+ used: boolean;
193
+ } | undefined;
160
194
  singleRootElType: string | undefined;
161
195
  singleRootNode: import("@vue/compiler-dom").ElementNode | undefined;
162
196
  accessExternalVariable(name: string, offset?: number): void;
@@ -168,7 +202,7 @@ export declare const tsCodegen: WeakMap<Sfc, {
168
202
  expectError: (prevNode: import("@vue/compiler-dom").CommentNode) => Generator<Code>;
169
203
  resetDirectiveComments: (endStr: string) => Generator<Code>;
170
204
  generateAutoImportCompletion: () => Generator<Code>;
171
- } | undefined>;
205
+ } | undefined;
172
206
  }>;
173
207
  declare const plugin: VueLanguagePlugin;
174
208
  export default plugin;