File tree Expand file tree Collapse file tree 4 files changed +473
-507
lines changed Expand file tree Collapse file tree 4 files changed +473
-507
lines changed Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ export function transformJsxMacros(
2222 if ( asyncModifier && macros . defineComponent )
2323 codes . replaceRange ( asyncModifier . pos , asyncModifier . end )
2424 const result =
25- macros . defineComponent && root . typeParameters ?. length
26- ? '({}) as JSX.Element'
27- : '__ctx.render'
25+ '({}) as typeof __ctx.render & { __ctx?: { props: typeof __ctx.props } & typeof __ctx.context }'
2826
2927 const propsType = root . parameters [ 0 ] ?. type
3028 ? root . parameters [ 0 ] . type . getText ( ast )
@@ -97,10 +95,10 @@ export function transformJsxMacros(
9795return {} as {
9896 props: {${ props . join ( ', ' ) } },
9997 context: ${
100- root . parameters [ 1 ] ?. type ? root . parameters [ 1 ] . type . getText ( ast ) : '{} '
101- } & {
98+ root . parameters [ 1 ] ?. type ? ` ${ root . parameters [ 1 ] . type . getText ( ast ) } & ` : ''
99+ } {
102100 slots: ${ macros . defineSlots ?? '{}' } ,
103- expose: (exposed: ${ macros . defineExpose ?? '{} ' } ) => void,
101+ expose: (exposed: ${ macros . defineExpose ?? 'Record<string, any> ' } ) => void,
104102 attrs: Record<string, any>
105103 },
106104 render: typeof __render
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ export declare class VaporComponentInstance<
9191 expose : ( < T extends Record < string , any > = Exposed > ( exposed : T ) => void ) &
9292 string [ ]
9393 exposed : Exposed | null
94- exposeProxy : ShallowUnwrapRef < Exposed > | null
94+ exposeProxy : Prettify < ShallowUnwrapRef < Exposed > > | null
9595 refs : TypeRefs
9696 provides : Record < string , any >
9797 ids : [ string , number , number ]
You can’t perform that action at this time.
0 commit comments