Skip to content

Commit

Permalink
fix: props type extract(#2176) (#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sight-wcg committed Dec 8, 2022
1 parent 250cc4b commit ed529f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vue-language-tools/vue-language-core/src/utils/localTypes.ts
Expand Up @@ -110,8 +110,8 @@ export type GetComponents<Components, N1, N2 = unknown, N3 = unknown> =
export type ComponentProps<T> =
${vueCompilerOptions.strictTemplates ? '' : 'Record<string, unknown> &'}
(
T extends (...args: any) => any ? (T extends (...args: any) => { props: infer Props } ? Props : {})
: T extends new (...args: any) => any ? (T extends new (...args: any) => { $props: infer Props } ? Props : {})
T extends new (...args: any) => any ? (T extends new (...args: any) => { $props: infer Props } ? Props : {})
: T extends (...args: any) => any ? (T extends (...args: any) => { props: infer Props } ? Props : {})
: T // IntrinsicElement
);
export type InstanceProps<I, C> = I extends { $props: infer Props } ? Props & Record<string, unknown> : C & Record<string, unknown>;
Expand Down

0 comments on commit ed529f8

Please sign in to comment.