@@ -4,10 +4,10 @@ import { MissingComponentInCustomPush, NotFoundVariantConfig } from './errors.js
44import { StackItem } from './stack-item.svelte.js' ;
55
66/**
7- * @template {Record<string, import('svelte').Component>} [VariantMap={}]
7+ * @template {Record<string, import('svelte').Component<any> >} [VariantMap={}]
88 */
99export class Stack {
10- /** @type {Record<string, import('./types.d.ts ').StackItemVariantConfig<string, import('svelte').Component>> } */
10+ /** @type {Record<string, import('./types.package ').StackItemVariantConfig<string, import('svelte').Component<any> >> } */
1111 #variantConfigMap = { } ;
1212 #counter = 0 ;
1313
@@ -19,7 +19,7 @@ export class Stack {
1919 items = $state ( [ ] ) ;
2020
2121 /**
22- * @type {Required<import('./types.d.ts ').StackItemCommonConfig<string, import('svelte').Component>> }
22+ * @type {Required<import('./types.package ').StackItemCommonConfig<string, import('svelte').Component<any> >> }
2323 */
2424 // eslint-disable-next-line no-undef
2525 config = $state ( {
@@ -32,7 +32,7 @@ export class Stack {
3232 * register the element to render a stack item into
3333 * @param {HTMLElement } node
3434 * @param {StackItem<any> } item
35- * @returns {import('./types.d.ts ').StackItemRenderActionReturn }
35+ * @returns {import('./types.package ').StackItemRenderActionReturn }
3636 */
3737 render : ( node , item ) => {
3838 mount ( item . config . component , {
@@ -48,46 +48,48 @@ export class Stack {
4848 } ;
4949
5050 /**
51- * @param {Record<keyof VariantMap, import('./types.d.ts ').StackItemVariantConfig<string, import('svelte').Component>> } variantConfigMap
52- * @param {import('./types.d.ts ').StackItemCommonConfig<string, import('svelte').Component> } [init]
51+ * @param {Record<keyof VariantMap, import('./types.package ').StackItemVariantConfig<string, import('svelte').Component>> } variantConfigMap
52+ * @param {import('./types.package ').StackItemCommonConfig<string, import('svelte').Component<any> > } [init]
5353 */
5454 constructor ( variantConfigMap , init ) {
5555 if ( init ?. id ) this . config . id = init . id ;
5656 if ( init ?. timeout ) this . config . timeout = init . timeout ;
5757 this . #variantConfigMap = variantConfigMap ;
5858 }
5959
60-
6160 /**
6261 * @template {Extract<keyof VariantMap, string>} Variant
6362 * @template {VariantMap[Variant]} [UserComponent=VariantMap[Variant]]
6463 * @overload
6564 * @param {Variant } variant
66- * @param {import('./types.d.ts ').StackItemByVariantPushConfig<Variant, UserComponent> } [config]
65+ * @param {import('./types.package ').StackItemByVariantPushConfig<Variant, UserComponent> } [config]
6766 * @returns {StackItem<UserComponent> }
6867 */
6968 /**
70- * @template {import('svelte').Component} UserComponent
69+ * @template {Extract<keyof VariantMap, string>} Variant
70+ * @template {VariantMap[Variant]} [UserComponent=VariantMap[Variant]]
7171 * @overload
7272 * @param {'custom' } variant
73- * @param {import('./types.d.ts ').StackItemCustomPushConfig<UserComponent> } config
73+ * @param {import('./types.package ').StackItemCustomPushConfig<UserComponent> } config
7474 * @returns {StackItem<UserComponent> }
7575 */
7676 /**
77- * @param {string } variant
78- * @param {import('./types.d.ts').StackItemByVariantPushConfig<string, import('svelte').Component> | import('./types.d.ts').StackItemCustomPushConfig<import('svelte').Component> } [config]
77+ * @template {Extract<keyof VariantMap, string>} Variant
78+ * @template {VariantMap[Variant]} [UserComponent=VariantMap[Variant]]
79+ * @param {Variant } variant
80+ * @param {import('./types.package').StackItemByVariantPushConfig<Variant, UserComponent> | import('./types.package').StackItemCustomPushConfig<UserComponent> } [config]
7981 * @returns {StackItem<any> }
8082 */
8183 push ( variant , config ) {
8284 // STEP 1: resolve instance config, merge with common config and variant config, if any
83- /** @type {import('./types.d.ts ').StackItemInstanceConfig<string, import('svelte').Component> } */
85+ /** @type {import('./types.package ').StackItemInstanceConfig<string, import('svelte').Component<any> > } */
8486 let instanceConfig ;
85- /** @type {NonNullable<import('./types.d.ts ').StackItemCommonConfig<string, import('svelte').Component>['id']> } */
87+ /** @type {NonNullable<import('./types.package ').StackItemCommonConfig<string, import('svelte').Component>['id']> } */
8688 let idResolver ;
8789
8890 if ( variant === 'custom' ) {
8991 const rConfig =
90- /** @type {import('./types.d.ts ').StackItemCustomPushConfig<import('svelte').Component> } */ (
92+ /** @type {import('./types.package ').StackItemCustomPushConfig<import('svelte').Component<any> > } */ (
9193 config
9294 ) ;
9395 if ( ! rConfig || ! rConfig . component ) {
@@ -149,21 +151,21 @@ export class Stack {
149151 }
150152
151153 /**
152- * @template {import('svelte').Component} [UserComponent=import('svelte').Component]
154+ * @template {import('svelte').Component<any> } [UserComponent=import('svelte').Component]
153155 * @overload
154156 * @param {string } [id]
155157 * @param {any } [detail]
156158 * @returns {StackItem<UserComponent> | null }
157159 */
158160 /**
159- * @template {import('svelte').Component} [UserComponent=import('svelte').Component]
161+ * @template {import('svelte').Component<any> } [UserComponent=import('svelte').Component]
160162 * @overload
161- * @param {import('./types.d.ts ').StackItemPopVerboseInput<UserComponent> } [config]
163+ * @param {import('./types.package ').StackItemPopVerboseInput<UserComponent> } [config]
162164 * @returns {StackItem<UserComponent> | null }
163165 */
164166 /**
165- * @template {import('svelte').Component} [UserComponent=import('svelte').Component]
166- * @param {string | import('./types.d.ts ').StackItemPopVerboseInput<UserComponent> } [config]
167+ * @template {import('svelte').Component<any> } [UserComponent=import('svelte').Component]
168+ * @param {string | import('./types.package ').StackItemPopVerboseInput<UserComponent> } [config]
167169 * @param {any } [resolved]
168170 * @returns {StackItem<UserComponent> | null }
169171 */
0 commit comments