@vue/language-core 3.3.5 → 3.3.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.
Files changed (66) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +1 -0
  3. package/lib/codegen/codeFeatures.d.ts +24 -84
  4. package/lib/codegen/codeFeatures.js +46 -4
  5. package/lib/codegen/names.d.ts +3 -4
  6. package/lib/codegen/names.js +3 -4
  7. package/lib/codegen/script/index.js +5 -5
  8. package/lib/codegen/script/scriptSetup.js +4 -4
  9. package/lib/codegen/style/common.js +7 -11
  10. package/lib/codegen/style/index.d.ts +55 -27
  11. package/lib/codegen/style/index.js +3 -3
  12. package/lib/codegen/template/context.d.ts +55 -124
  13. package/lib/codegen/template/context.js +187 -269
  14. package/lib/codegen/template/element.js +16 -15
  15. package/lib/codegen/template/elementDirectives.js +11 -11
  16. package/lib/codegen/template/elementEvents.js +45 -44
  17. package/lib/codegen/template/elementProps.js +12 -12
  18. package/lib/codegen/template/index.d.ts +55 -27
  19. package/lib/codegen/template/index.js +7 -7
  20. package/lib/codegen/template/interpolation.js +28 -28
  21. package/lib/codegen/template/objectProperty.js +5 -5
  22. package/lib/codegen/template/propertyAccess.js +1 -1
  23. package/lib/codegen/template/slotOutlet.js +8 -10
  24. package/lib/codegen/template/styleScopedClasses.js +4 -4
  25. package/lib/codegen/template/vFor.js +3 -3
  26. package/lib/codegen/template/vIf.js +4 -4
  27. package/lib/codegen/template/vSlot.js +9 -9
  28. package/lib/codegen/utils/boundary.d.ts +7 -2
  29. package/lib/codegen/utils/boundary.js +15 -9
  30. package/lib/codegen/utils/camelized.js +5 -13
  31. package/lib/codegen/utils/escaped.js +4 -9
  32. package/lib/codegen/utils/index.d.ts +1 -1
  33. package/lib/codegen/utils/index.js +3 -3
  34. package/lib/codegen/utils/stringLiteralKey.js +3 -3
  35. package/lib/codegen/utils/unicode.d.ts +1 -1
  36. package/lib/codegen/utils/unicode.js +4 -4
  37. package/lib/languagePlugin.js +2 -1
  38. package/lib/parsers/scriptRanges.d.ts +2 -2
  39. package/lib/parsers/scriptRanges.js +3 -10
  40. package/lib/parsers/scriptSetupRanges.d.ts +2 -2
  41. package/lib/parsers/scriptSetupRanges.js +3 -10
  42. package/lib/parsers/utils.d.ts +1 -0
  43. package/lib/parsers/utils.js +10 -0
  44. package/lib/parsers/vueCompilerOptions.js +2 -2
  45. package/lib/plugins/file-html.js +4 -4
  46. package/lib/plugins/file-md.js +15 -15
  47. package/lib/plugins/file-vue.js +2 -2
  48. package/lib/plugins/vue-root-tags.js +3 -3
  49. package/lib/plugins/vue-sfc-customblocks.js +2 -2
  50. package/lib/plugins/vue-sfc-scripts.js +2 -4
  51. package/lib/plugins/vue-sfc-styles.js +3 -3
  52. package/lib/plugins/vue-sfc-template.js +2 -2
  53. package/lib/plugins/vue-style-css.js +86 -33
  54. package/lib/plugins/vue-template-html.js +3 -3
  55. package/lib/plugins/vue-template-inline-css.js +2 -7
  56. package/lib/plugins/vue-template-inline-ts.js +4 -5
  57. package/lib/plugins/vue-tsx.d.ts +61 -31
  58. package/lib/plugins/vue-tsx.js +26 -23
  59. package/lib/plugins.d.ts +0 -1
  60. package/lib/plugins.js +0 -15
  61. package/lib/utils/forEachTemplateNode.js +36 -43
  62. package/lib/virtualCode/index.js +2 -2
  63. package/package.json +2 -2
  64. package/types/template-helpers.d.ts +14 -24
  65. package/lib/plugins/shared.d.ts +0 -2
  66. package/lib/plugins/shared.js +0 -12
@@ -21,25 +21,16 @@ declare global {
21
21
  : N2 extends keyof GlobalComponents ? { [K in N0]: GlobalComponents[N2] }
22
22
  : N3 extends keyof GlobalComponents ? { [K in N0]: GlobalComponents[N3] }
23
23
  : {};
24
- type __VLS_FunctionalComponentCtx<T, K> = __VLS_PickNotAny<
24
+ type __VLS_ExtractComponentContext<T, K> = __VLS_PickNotAny<
25
25
  '__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? NonNullable<Ctx> : never : any,
26
26
  T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
27
27
  >;
28
- type __VLS_FunctionalComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
28
+ type __VLS_ExtractComponentProps<T, K> = '__ctx' extends keyof __VLS_PickNotAny<K, {}>
29
29
  ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
30
30
  : T extends (props: infer P, ...args: any) => any ? P
31
31
  : {};
32
- type __VLS_FunctionalComponent0<T> = (props: T extends { $props: infer Props } ? Props : {}, ctx?: any) => {
33
- __ctx?: {
34
- attrs?: any;
35
- slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
36
- emit?: T extends { $emit: infer Emit } ? Emit : {};
37
- props?: typeof props;
38
- expose?: (exposed: T) => void;
39
- };
40
- };
41
- type __VLS_FunctionalComponent1<T> = (
42
- props: (T extends { $props: infer Props } ? Props : {}) & Record<string, unknown>,
32
+ type __VLS_FunctionalComponent<T, P = {}> = (
33
+ props: (T extends { $props: infer Props } ? Props : {}) & P,
43
34
  ctx?: any,
44
35
  ) => {
45
36
  __ctx?: {
@@ -50,9 +41,8 @@ declare global {
50
41
  expose?: (exposed: T) => void;
51
42
  };
52
43
  };
53
- type __VLS_IsFunction<T, K> = K extends keyof T ? __VLS_IsAny<T[K]> extends false ? unknown extends T[K] ? false
54
- : true
55
- : false
44
+ type __VLS_IsFunction<T, K> = K extends keyof T ? unknown extends T[K] ? false
45
+ : true
56
46
  : false;
57
47
  type __VLS_ResolveEvent<
58
48
  Props,
@@ -123,20 +113,20 @@ declare global {
123
113
  >
124
114
  : T extends (...args: any) => any ? T
125
115
  : (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
126
- function __VLS_asFunctionalComponent0<T, K = T extends new(...args: any) => any ? InstanceType<T> : unknown>(
116
+ function __VLS_asFunctionalComponent0<T, K>(
127
117
  t: T,
128
- instance?: K,
129
- ): T extends new(...args: any) => any ? __VLS_FunctionalComponent0<K>
118
+ instance: K,
119
+ ): T extends new(...args: any) => any ? __VLS_FunctionalComponent<K>
130
120
  : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
131
121
  : T extends (...args: any) => any ? T
132
- : __VLS_FunctionalComponent0<{}>;
133
- function __VLS_asFunctionalComponent1<T, K = T extends new(...args: any) => any ? InstanceType<T> : unknown>(
122
+ : __VLS_FunctionalComponent<{}>;
123
+ function __VLS_asFunctionalComponent1<T, K>(
134
124
  t: T,
135
- instance?: K,
136
- ): T extends new(...args: any) => any ? __VLS_FunctionalComponent1<K>
125
+ instance: K,
126
+ ): T extends new(...args: any) => any ? __VLS_FunctionalComponent<K, Record<string, unknown>>
137
127
  : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
138
128
  : T extends (...args: any) => any ? T
139
- : __VLS_FunctionalComponent1<{}>;
129
+ : __VLS_FunctionalComponent<{}, Record<string, unknown>>;
140
130
  function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(
141
131
  t: T,
142
132
  ): 2 extends Parameters<T>['length'] ? [any] : [];
@@ -1,2 +0,0 @@
1
- import type { CodeInformation } from '@volar/language-core';
2
- export declare const allCodeFeatures: CodeInformation;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allCodeFeatures = void 0;
4
- exports.allCodeFeatures = {
5
- verification: true,
6
- completion: true,
7
- semantic: true,
8
- navigation: true,
9
- structure: true,
10
- format: true,
11
- };
12
- //# sourceMappingURL=shared.js.map