@@ -35,10 +35,16 @@ export type VueElementConstructor<P = {}> = {
3535
3636// overload 1: direct setup function
3737export function defineCustomElement < Props , RawBindings = object > (
38- setup : (
39- props : Readonly < Props > ,
40- ctx : SetupContext ,
41- ) => RawBindings | RenderFunction ,
38+ setup : ( props : Props , ctx : SetupContext ) => RawBindings | RenderFunction ,
39+ options ?: Pick < ComponentOptions , 'name' | 'inheritAttrs' | 'emits' > & {
40+ props ?: ( keyof Props ) [ ]
41+ } ,
42+ ) : VueElementConstructor < Props >
43+ export function defineCustomElement < Props , RawBindings = object > (
44+ setup : ( props : Props , ctx : SetupContext ) => RawBindings | RenderFunction ,
45+ options ?: Pick < ComponentOptions , 'name' | 'inheritAttrs' | 'emits' > & {
46+ props ?: ComponentObjectPropsOptions < Props >
47+ } ,
4248) : VueElementConstructor < Props >
4349
4450// overload 2: object format with no props
@@ -143,9 +149,13 @@ export function defineCustomElement<P>(
143149/*! #__NO_SIDE_EFFECTS__ */
144150export function defineCustomElement (
145151 options : any ,
152+ extraOptions ?: ComponentOptions ,
153+ /**
154+ * @internal
155+ */
146156 hydrate ?: RootHydrateFunction ,
147157) : VueElementConstructor {
148- const Comp = defineComponent ( options ) as any
158+ const Comp = defineComponent ( options , extraOptions ) as any
149159 class VueCustomElement extends VueElement {
150160 static def = Comp
151161 constructor ( initialProps ?: Record < string , any > ) {
@@ -157,9 +167,12 @@ export function defineCustomElement(
157167}
158168
159169/*! #__NO_SIDE_EFFECTS__ */
160- export const defineSSRCustomElement = ( ( options : any ) => {
170+ export const defineSSRCustomElement = ( (
171+ options : any ,
172+ extraOptions ?: ComponentOptions ,
173+ ) => {
161174 // @ts -expect-error
162- return defineCustomElement ( options , hydrate )
175+ return defineCustomElement ( options , extraOptions , hydrate )
163176} ) as typeof defineCustomElement
164177
165178const BaseClass = (
0 commit comments