8000 fix: return type of createComponent · nathee/vue-function-api@8bfeb62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bfeb62

Browse files
committed
fix: return type of createComponent
1 parent 8334cd1 commit 8bfeb62

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/ts-api/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ export type PropType<T> = T;
66

77
// type FullPropType<T> = T extends { required: boolean } ? T : T | undefined;
88

9-
interface ComponentOptionsWithSetup<Props> extends Omit<ComponentOptions<Vue>, 'props' | 'setup'> {
9+
type ComponentOptionsWithSetup<Props> = Omit<ComponentOptions<Vue>, 'props' | 'setup'> & {
1010
props: Props;
1111
setup?: (
1212
this: undefined,
1313
props: { [K in keyof Props]: Props[K] },
1414
context: Context
1515
) => object | null | undefined | void;
16-
}
16+
};
1717

18-
export function createComponent<Props>(compOpions: ComponentOptionsWithSetup<Props>) {
19-
return compOpions;
18+
export function createComponent<Props>(
19+
compOpions: ComponentOptionsWithSetup<Props>
20+
): ComponentOptions<Vue> {
21+
return (compOpions as any) as ComponentOptions<Vue>;
2022
}

0 commit comments

Comments
 (0)
0