@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.
- package/index.d.ts +0 -1
- package/index.js +1 -2
- package/lib/codeFeatures.d.ts +1 -0
- package/lib/codeFeatures.js +3 -0
- package/lib/codegen/codeFeatures.d.ts +83 -0
- package/lib/codegen/codeFeatures.js +71 -0
- package/lib/codegen/globalTypes.d.ts +3 -1
- package/lib/codegen/globalTypes.js +39 -14
- package/lib/codegen/localTypes.d.ts +1 -1
- package/lib/codegen/localTypes.js +7 -7
- package/lib/codegen/script/binding.d.ts +4 -0
- package/lib/codegen/script/binding.js +41 -0
- package/lib/codegen/script/component.d.ts +1 -1
- package/lib/codegen/script/component.js +44 -44
- package/lib/codegen/script/componentSelf.d.ts +1 -1
- package/lib/codegen/script/componentSelf.js +14 -14
- package/lib/codegen/script/context.d.ts +1 -1
- package/lib/codegen/script/context.js +2 -2
- package/lib/codegen/script/index.d.ts +6 -11
- package/lib/codegen/script/index.js +21 -63
- package/lib/codegen/script/scriptSetup.d.ts +1 -1
- package/lib/codegen/script/scriptSetup.js +236 -205
- package/lib/codegen/script/src.js +8 -8
- package/lib/codegen/script/styleModulesType.d.ts +1 -1
- package/lib/codegen/script/styleModulesType.js +7 -7
- package/lib/codegen/script/template.d.ts +2 -2
- package/lib/codegen/script/template.js +81 -114
- package/lib/codegen/template/context.d.ts +29 -15
- package/lib/codegen/template/context.js +51 -96
- package/lib/codegen/template/element.d.ts +2 -4
- package/lib/codegen/template/element.js +124 -317
- package/lib/codegen/template/elementChildren.d.ts +1 -1
- package/lib/codegen/template/elementChildren.js +10 -11
- package/lib/codegen/template/elementDirectives.d.ts +1 -0
- package/lib/codegen/template/elementDirectives.js +43 -30
- package/lib/codegen/template/elementEvents.d.ts +2 -2
- package/lib/codegen/template/elementEvents.js +32 -65
- package/lib/codegen/template/elementProps.d.ts +5 -3
- package/lib/codegen/template/elementProps.js +116 -123
- package/lib/codegen/template/index.d.ts +1 -0
- package/lib/codegen/template/index.js +67 -69
- package/lib/codegen/template/interpolation.d.ts +5 -3
- package/lib/codegen/template/interpolation.js +30 -27
- 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 +47 -25
- package/lib/codegen/template/styleScopedClasses.d.ts +4 -1
- package/lib/codegen/template/styleScopedClasses.js +152 -8
- package/lib/codegen/template/templateChild.d.ts +1 -1
- package/lib/codegen/template/templateChild.js +39 -20
- 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/vSlot.d.ts +5 -0
- package/lib/codegen/template/vSlot.js +80 -0
- package/lib/codegen/utils/camelized.d.ts +2 -0
- package/lib/codegen/utils/camelized.js +31 -0
- package/lib/codegen/utils/index.d.ts +21 -0
- package/lib/codegen/utils/index.js +79 -0
- package/lib/codegen/utils/src.d.ts +2 -0
- package/lib/codegen/utils/src.js +19 -0
- 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 +69 -83
- package/lib/parsers/scriptSetupRanges.js +194 -171
- 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-style-class-names.d.ts +5 -0
- package/lib/plugins/vue-style-class-names.js +32 -0
- package/lib/plugins/vue-style-reference-link.d.ts +1 -0
- package/lib/plugins/vue-style-reference-link.js +3 -0
- package/lib/plugins/vue-style-reference-links.d.ts +3 -0
- package/lib/plugins/vue-style-reference-links.js +26 -0
- 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 +66 -17
- package/lib/plugins/vue-tsx.d.ts +126 -92
- package/lib/plugins/vue-tsx.js +114 -97
- package/lib/plugins/vue-vine.d.ts +3 -0
- package/lib/plugins/vue-vine.js +35 -0
- package/lib/types.d.ts +25 -12
- package/lib/utils/buildMappings.d.ts +1 -1
- package/lib/utils/parseCssImports.d.ts +4 -0
- package/lib/utils/parseCssImports.js +19 -0
- package/lib/utils/parseSfc.d.ts +5 -0
- package/lib/utils/parseSfc.js +11 -5
- package/lib/utils/signals.d.ts +2 -0
- package/lib/utils/signals.js +54 -0
- package/lib/utils/ts.d.ts +14 -2
- package/lib/utils/ts.js +134 -91
- package/lib/virtualFile/computedEmbeddedCodes.d.ts +1 -2
- package/lib/virtualFile/computedEmbeddedCodes.js +11 -11
- package/lib/virtualFile/computedSfc.d.ts +1 -2
- package/lib/virtualFile/computedSfc.js +87 -79
- package/lib/virtualFile/computedVueSfc.d.ts +1 -2
- package/lib/virtualFile/computedVueSfc.js +7 -7
- package/lib/virtualFile/vueFile.d.ts +5 -5
- package/lib/virtualFile/vueFile.js +6 -6
- package/package.json +6 -6
- /package/lib/codegen/{template → utils}/stringLiteralKey.d.ts +0 -0
|
@@ -1,91 +1,77 @@
|
|
|
1
1
|
import type * as ts from 'typescript';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TextRange, VueCompilerOptions } from '../types';
|
|
3
|
+
type CallExpressionRange = {
|
|
4
|
+
callExp: TextRange;
|
|
5
|
+
exp: TextRange;
|
|
6
|
+
arg?: TextRange;
|
|
7
|
+
typeArg?: TextRange;
|
|
8
|
+
};
|
|
9
|
+
type DefineProp = {
|
|
10
|
+
localName?: TextRange;
|
|
11
|
+
name?: TextRange;
|
|
12
|
+
type?: TextRange;
|
|
13
|
+
modifierType?: TextRange;
|
|
14
|
+
runtimeType?: TextRange;
|
|
15
|
+
defaultValue?: TextRange;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
isModel?: boolean;
|
|
18
|
+
};
|
|
19
|
+
type DefineProps = CallExpressionRange & {
|
|
20
|
+
name?: string;
|
|
21
|
+
destructured?: Map<string, ts.Expression | undefined>;
|
|
22
|
+
destructuredRest?: string;
|
|
23
|
+
statement: TextRange;
|
|
24
|
+
argNode?: ts.Expression;
|
|
25
|
+
};
|
|
26
|
+
type WithDefaults = Omit<CallExpressionRange, 'typeArg'> & {
|
|
27
|
+
argNode?: ts.Expression;
|
|
28
|
+
};
|
|
29
|
+
type DefineEmits = CallExpressionRange & {
|
|
30
|
+
name?: string;
|
|
31
|
+
hasUnionTypeArg?: boolean;
|
|
32
|
+
statement: TextRange;
|
|
33
|
+
};
|
|
34
|
+
type DefineSlots = CallExpressionRange & {
|
|
35
|
+
name?: string;
|
|
36
|
+
statement: TextRange;
|
|
37
|
+
};
|
|
38
|
+
type DefineOptions = {
|
|
39
|
+
name?: string;
|
|
40
|
+
inheritAttrs?: string;
|
|
41
|
+
};
|
|
42
|
+
type UseTemplateRef = CallExpressionRange & {
|
|
43
|
+
name?: string;
|
|
44
|
+
};
|
|
3
45
|
export interface ScriptSetupRanges extends ReturnType<typeof parseScriptSetupRanges> {
|
|
4
46
|
}
|
|
5
47
|
export declare function parseScriptSetupRanges(ts: typeof import('typescript'), ast: ts.SourceFile, vueCompilerOptions: VueCompilerOptions): {
|
|
6
48
|
leadingCommentEndOffset: number;
|
|
7
49
|
importSectionEndOffset: number;
|
|
8
|
-
bindings:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
destructuredRest?: string;
|
|
14
|
-
define?: ReturnType<(node: ts.CallExpression) => TextRange & {
|
|
15
|
-
exp: TextRange;
|
|
16
|
-
arg?: TextRange;
|
|
17
|
-
typeArg?: TextRange;
|
|
18
|
-
}> & {
|
|
19
|
-
statement: TextRange;
|
|
20
|
-
};
|
|
21
|
-
withDefaults?: TextRange & {
|
|
22
|
-
arg?: TextRange;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
slots: {
|
|
26
|
-
name?: string;
|
|
27
|
-
isObjectBindingPattern?: boolean;
|
|
28
|
-
define?: ReturnType<(node: ts.CallExpression) => TextRange & {
|
|
29
|
-
exp: TextRange;
|
|
30
|
-
arg?: TextRange;
|
|
31
|
-
typeArg?: TextRange;
|
|
32
|
-
}> & {
|
|
33
|
-
statement: TextRange;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
emits: {
|
|
37
|
-
name?: string;
|
|
38
|
-
define?: ReturnType<(node: ts.CallExpression) => TextRange & {
|
|
39
|
-
exp: TextRange;
|
|
40
|
-
arg?: TextRange;
|
|
41
|
-
typeArg?: TextRange;
|
|
42
|
-
}> & {
|
|
43
|
-
statement: TextRange;
|
|
44
|
-
hasUnionTypeArg?: boolean;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
expose: {
|
|
48
|
-
name?: string;
|
|
49
|
-
define?: ReturnType<(node: ts.CallExpression) => TextRange & {
|
|
50
|
-
exp: TextRange;
|
|
51
|
-
arg?: TextRange;
|
|
52
|
-
typeArg?: TextRange;
|
|
53
|
-
}>;
|
|
54
|
-
};
|
|
55
|
-
options: {
|
|
56
|
-
name?: string;
|
|
57
|
-
inheritAttrs?: string;
|
|
58
|
-
};
|
|
59
|
-
cssModules: {
|
|
60
|
-
define: ReturnType<(node: ts.CallExpression) => TextRange & {
|
|
61
|
-
exp: TextRange;
|
|
62
|
-
arg?: TextRange;
|
|
63
|
-
typeArg?: TextRange;
|
|
64
|
-
}>;
|
|
65
|
-
}[];
|
|
66
|
-
defineProp: {
|
|
67
|
-
localName: TextRange | undefined;
|
|
68
|
-
name: TextRange | undefined;
|
|
69
|
-
type: TextRange | undefined;
|
|
70
|
-
modifierType?: TextRange | undefined;
|
|
71
|
-
runtimeType: TextRange | undefined;
|
|
72
|
-
defaultValue: TextRange | undefined;
|
|
73
|
-
required: boolean;
|
|
74
|
-
isModel?: boolean;
|
|
50
|
+
bindings: {
|
|
51
|
+
range: TextRange;
|
|
52
|
+
moduleName?: string;
|
|
53
|
+
isDefaultImport?: boolean;
|
|
54
|
+
isNamespace?: boolean;
|
|
75
55
|
}[];
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
export declare function getStartEnd(ts: typeof import('typescript'), node: ts.Node, sourceFile: ts.SourceFile): {
|
|
88
|
-
start: number;
|
|
89
|
-
end: number;
|
|
56
|
+
defineProp: DefineProp[];
|
|
57
|
+
defineProps: DefineProps | undefined;
|
|
58
|
+
withDefaults: WithDefaults | undefined;
|
|
59
|
+
defineEmits: DefineEmits | undefined;
|
|
60
|
+
defineSlots: DefineSlots | undefined;
|
|
61
|
+
defineExpose: CallExpressionRange | undefined;
|
|
62
|
+
defineOptions: DefineOptions | undefined;
|
|
63
|
+
useAttrs: CallExpressionRange[];
|
|
64
|
+
useCssModule: CallExpressionRange[];
|
|
65
|
+
useSlots: CallExpressionRange[];
|
|
66
|
+
useTemplateRef: UseTemplateRef[];
|
|
90
67
|
};
|
|
91
|
-
export declare function
|
|
68
|
+
export declare function parseBindingRanges(ts: typeof import('typescript'), ast: ts.SourceFile): {
|
|
69
|
+
range: TextRange;
|
|
70
|
+
moduleName?: string;
|
|
71
|
+
isDefaultImport?: boolean;
|
|
72
|
+
isNamespace?: boolean;
|
|
73
|
+
}[];
|
|
74
|
+
export declare function findBindingVars(ts: typeof import('typescript'), left: ts.BindingName, ast: ts.SourceFile): TextRange[];
|
|
75
|
+
export declare function getStartEnd(ts: typeof import('typescript'), node: ts.Node, ast: ts.SourceFile): TextRange;
|
|
76
|
+
export declare function getNodeText(ts: typeof import('typescript'), node: ts.Node, ast: ts.SourceFile): string;
|
|
77
|
+
export {};
|