@@ -379,26 +379,44 @@ declare module 'svelte' {
379
379
} ) : Snippet < Params > ;
380
380
/** Anything except a function */
381
381
type NotFunction < T > = T extends Function ? never : T ;
382
- /**
383
- * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
384
- * Transitions will play during the initial render unless the `intro` option is set to `false`.
385
- *
386
- * */
387
- export function mount < Props extends Record < string , any > , Exports extends Record < string , any > > ( component : ComponentType < SvelteComponent < Props > > | Component < Props , Exports , any > , options : { } extends Props ? {
382
+ export type MountOptions < Props extends Record < string , any > = Record < string , any > > = {
383
+ /**
384
+ * Target element where the component will be mounted.
385
+ */
388
386
target : Document | Element | ShadowRoot ;
387
+ /**
388
+ * Optional node inside `target` and when specified, it is used to render the component immediately before it.
389
+ */
389
390
anchor ?: Node ;
390
- props ?: Props ;
391
+ /**
392
+ * Allows the specification of events.
393
+ */
391
394
events ?: Record < string , ( e : any ) => any > ;
395
+ /**
396
+ * Used to define context at the component level.
397
+ */
392
398
context ?: Map < any , any > ;
399
+ /**
400
+ * Used to control transition playback on initial render. The default value is `true` to run transitions.
401
+ */
393
402
intro ?: boolean ;
403
+ } & { } extends Props ? {
404
+ /**
405
+ * Component properties.
406
+ */
407
+ props ?: Props ;
394
408
} : {
395
- target : Document | Element | ShadowRoot ;
409
+ /**
410
+ * Component properties.
411
+ */
396
412
props : Props ;
397
- anchor ?: Node ;
398
- events ?: Record < string , ( e : any ) => any > ;
399
- context ?: Map < any , any > ;
400
- intro ?: boolean ;
401
- } ) : Exports ;
413
+ }
414
+ /**
415
+ * Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
416
+ * Transitions will play during the initial render unless the `intro` option is set to `false`.
417
+ *
418
+ * */
419
+ export function mount < Props extends Record < string , any > , Exports extends Record < string , any > > ( component : ComponentType < SvelteComponent < Props > > | Component < Props , Exports , any > , options : MountOptions < Props > ) : Exports ;
402
420
/**
403
421
* Hydrates a component on the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component
404
422
*
0 commit comments