@@ -24,23 +24,7 @@ declare class Svelte2TsxComponent<
24
24
*/
25
25
$$slot_def : Slots ;
26
26
// https://svelte.dev/docs#Client-side_component_API
27
- constructor ( options : {
28
- /**
29
- * An HTMLElement to render to. This option is required.
30
- */
31
- target : Element ;
32
- /**
33
- * A child of `target` to render the component immediately before.
34
- */
35
- anchor ?: Element ;
36
- /**
37
- * An object of properties to supply to the component.
38
- */
39
- props ?: Props ;
40
- hydrate ?: boolean ;
41
- intro ?: boolean ;
42
- $$inline ?: boolean ;
43
- } ) ;
27
+ constructor ( options : Svelte2TsxComponentConstructorParameters < Props > ) ;
44
28
/**
45
29
* Causes the callback function to be called whenever the component dispatches an event.
46
30
* A function is returned that will remove the event listener when called.
@@ -62,7 +46,26 @@ declare class Svelte2TsxComponent<
62
46
$inject_state ( ) : void ;
63
47
}
64
48
65
- type AConstructorTypeOf < T > = new ( ...args : any [ ] ) => T ;
49
+ interface Svelte2TsxComponentConstructorParameters < Props extends { } > {
50
+ /**
51
+ * An HTMLElement to render to. This option is required.
52
+ */
53
+ target : Element ;
54
+ /**
55
+ * A child of `target` to render the component immediately before.
56
+ */
57
+ anchor ?: Element ;
58
+ /**
59
+ * An object of properties to supply to the component.
60
+ */
61
+ props ?: Props ;
62
+ hydrate ?: boolean ;
63
+ intro ?: boolean ;
64
+ $$inline ?: boolean ;
65
+ }
66
+
67
+ type AConstructorTypeOf < T , U extends any [ ] = any [ ] > = new ( ...args : U ) => T ;
68
+ type SvelteComponentConstructor < T , U extends Svelte2TsxComponentConstructorParameters < any > > = new ( options : U ) => T ;
66
69
67
70
type SvelteAction < U extends any [ ] , El extends any > = ( node : El , ...args :U ) => {
68
71
update ?: ( ...args :U ) => void ,
@@ -174,7 +177,7 @@ declare function __sveltets_each<T>(
174
177
175
178
declare function createSvelte2TsxComponent < Props , Events , Slots > (
176
179
render : ( ) => { props ?: Props , events ?: Events , slots ?: Slots }
177
- ) : AConstructorTypeOf < Svelte2TsxComponent < Props , Events , Slots > > ;
180
+ ) : SvelteComponentConstructor < Svelte2TsxComponent < Props , Events , Slots > , Svelte2TsxComponentConstructorParameters < Props > > ;
178
181
179
182
declare function __sveltets_unwrapArr < T > ( arr : ArrayLike < T > ) : T
180
183
declare function __sveltets_unwrapPromiseLike < T > ( promise : PromiseLike < T > | T ) : T
0 commit comments