@@ -11,11 +11,8 @@ export class StackItem {
1111 /** @type {Required<import('./types.package').StackItemInstanceConfig<string, UserComponent>> } */
1212 config ;
1313
14- /** @type {number } */
15- // eslint-disable-next-line no-undef
16- msToTimeout = $state ( 0 ) ;
17-
1814 #internals = {
15+ msToTimeout : 0 ,
1916 /** @type {ReturnType<typeof setTimeout> | undefined } */
2017 timeoutId : undefined ,
2118 lastStartedTime : new Date ( ) . getTime ( ) ,
@@ -33,29 +30,29 @@ export class StackItem {
3330 */
3431 constructor ( config ) {
3532 this . config = config ;
36- this . msToTimeout = config . timeout ;
33+ this . #internals . msToTimeout = config . timeout ;
3734
3835 this . resolution = new Promise ( ( resolve ) => {
3936 this . #internals. resolve = resolve ;
4037 } ) ;
4138 }
4239
4340 resume = ( ) => {
44- if ( this . msToTimeout <= 0 || this . state === 'elapsing' ) return ;
41+ if ( this . #internals . msToTimeout <= 0 || this . state === 'elapsing' ) return ;
4542 clearTimeout ( this . #internals. timeoutId ) ;
4643 this . #internals. lastStartedTime = new Date ( ) . getTime ( ) ;
4744 this . #internals. timeoutId = setTimeout ( async ( ) => {
48- this . msToTimeout = 0 ;
45+ this . #internals . msToTimeout = 0 ;
4946 await this . resolve ( ) ;
5047 this . state = 'timeout' ;
51- } , this . msToTimeout ) ;
48+ } , this . #internals . msToTimeout ) ;
5249 this . state = 'elapsing' ;
5350 } ;
5451
5552 pause = ( ) => {
5653 if ( this . state === 'paused' || this . state === 'idle' ) return ;
5754 clearTimeout ( this . #internals. timeoutId ) ;
58- this . msToTimeout -= new Date ( ) . getTime ( ) - this . #internals. lastStartedTime ;
55+ this . #internals . msToTimeout -= new Date ( ) . getTime ( ) - this . #internals. lastStartedTime ;
5956 this . state = 'paused' ;
6057 } ;
6158
0 commit comments