@vue/language-core
Advanced tools
Comparing version 1.8.14 to 1.8.15
@@ -60,2 +60,3 @@ "use strict"; | ||
importSectionEndOffset: 0, | ||
withDefaults: undefined, | ||
defineProps: undefined, | ||
@@ -431,2 +432,10 @@ defineSlots: undefined, | ||
let setupCodeModifies = []; | ||
if (scriptSetupRanges.defineProps && !scriptSetupRanges.propsAssignName) { | ||
if (scriptSetupRanges.withDefaults) { | ||
setupCodeModifies.push([() => codes.push(`const __VLS_props = `), scriptSetupRanges.withDefaults.start, scriptSetupRanges.withDefaults.start]); | ||
} | ||
else { | ||
setupCodeModifies.push([() => codes.push(`const __VLS_props = `), scriptSetupRanges.defineProps.start, scriptSetupRanges.defineProps.start]); | ||
} | ||
} | ||
if (scriptSetupRanges.defineSlots && !scriptSetupRanges.slotsAssignName) { | ||
@@ -595,14 +604,7 @@ setupCodeModifies.push([() => codes.push(`const __VLS_slots = `), scriptSetupRanges.defineSlots.start, scriptSetupRanges.defineSlots.start]); | ||
// fill $props | ||
if (scriptSetupRanges.propsTypeArg) { | ||
if (scriptSetupRanges.defineProps) { | ||
// NOTE: defineProps is inaccurate for $props | ||
codes.push(`$props: __VLS_makeOptional(defineProps<`); | ||
addExtraReferenceVirtualCode('scriptSetup', scriptSetupRanges.propsTypeArg.start, scriptSetupRanges.propsTypeArg.end); | ||
codes.push(`>()),\n`); | ||
codes.push(`$props: __VLS_makeOptional(${scriptSetupRanges.propsAssignName ?? `__VLS_props`}),\n`); | ||
codes.push(`...${scriptSetupRanges.propsAssignName ?? `__VLS_props`},\n`); | ||
} | ||
else if (scriptSetupRanges.propsRuntimeArg) { | ||
// NOTE: defineProps is inaccurate for $props | ||
codes.push(`$props: __VLS_makeOptional(defineProps(`); | ||
addExtraReferenceVirtualCode('scriptSetup', scriptSetupRanges.propsRuntimeArg.start, scriptSetupRanges.propsRuntimeArg.end); | ||
codes.push(`)),\n`); | ||
} | ||
// fill $emit | ||
@@ -609,0 +611,0 @@ if (scriptSetupRanges.defineEmits) { |
@@ -10,2 +10,3 @@ import type * as ts from 'typescript/lib/tsserverlibrary'; | ||
withDefaultsArg: TextRange | undefined; | ||
withDefaults: TextRange | undefined; | ||
defineProps: TextRange | undefined; | ||
@@ -12,0 +13,0 @@ defineSlots: TextRange | undefined; |
@@ -9,2 +9,3 @@ "use strict"; | ||
let propsAssignName; | ||
let withDefaults; | ||
let defineProps; | ||
@@ -50,2 +51,3 @@ let propsRuntimeArg; | ||
withDefaultsArg, | ||
withDefaults, | ||
defineProps, | ||
@@ -176,2 +178,3 @@ defineSlots, | ||
else if (vueCompilerOptions.macros.withDefaults.includes(callText)) { | ||
withDefaults = _getStartEnd(node); | ||
if (node.arguments.length >= 2) { | ||
@@ -178,0 +181,0 @@ const arg = node.arguments[1]; |
@@ -20,2 +20,3 @@ import { Sfc, VueLanguagePlugin } from '../types'; | ||
withDefaultsArg: import("../types").TextRange | undefined; | ||
withDefaults: import("../types").TextRange | undefined; | ||
defineProps: import("../types").TextRange | undefined; | ||
@@ -22,0 +23,0 @@ defineSlots: import("../types").TextRange | undefined; |
@@ -115,3 +115,3 @@ "use strict"; | ||
? F extends (event: infer E, ...args: infer A) => infer R | ||
? { [K in E as K extends string ? K : never]: (...args: A) => R; } | ||
? { [K in E as K extends string ? K : never]: (...args: A) => void; } | ||
: never | ||
@@ -118,0 +118,0 @@ : never; |
{ | ||
"name": "@vue/language-core", | ||
"version": "1.8.14", | ||
"version": "1.8.15", | ||
"main": "out/index.js", | ||
@@ -37,3 +37,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "5febf2694e80621a7b852464edc76b74f73a5cb6" | ||
"gitHead": "24de4582131385e75f904bff7294df0e16ce1e01" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
255871
5526