@peter.naydenov/cuts 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.claude/settings.local.json +10 -0
  2. package/Changelog.md +17 -0
  3. package/dist/cuts.cjs +1 -1
  4. package/dist/cuts.esm.mjs +1 -1
  5. package/dist/cuts.umd.js +1 -1
  6. package/graphify-out/.graphify_labels.json +56 -0
  7. package/graphify-out/.graphify_root +1 -0
  8. package/graphify-out/GRAPH_REPORT.md +116 -247
  9. package/graphify-out/cache/ast/v0.8.39/043be2e32281a59e2bacb95418b95816b558a290aa581434b22666fb9a6a3a6c.json +1 -0
  10. package/graphify-out/cache/ast/v0.8.39/151934b5e716a5f1d14f4954ebca16c64f767c94ea65182896565a0a845a99d8.json +1 -0
  11. package/graphify-out/cache/ast/v0.8.39/2b64175ef58c779348b9f3b1bc212093f30455a8c3b30e90ec66bc0c83893a17.json +1 -0
  12. package/graphify-out/cache/ast/v0.8.39/93e3201ab0f7055efb1bd85240bdae46fcc21d36089825bafeb9ba97e082b25d.json +1 -0
  13. package/graphify-out/cache/ast/v0.8.39/a54f836214535c9d3ff5d4ba866f261748789984734e148a99dff099f0977cd4.json +1 -0
  14. package/graphify-out/cache/ast/v0.8.39/ac32180db1477eed72583ce9d06051d06eb0336e02b1894789b5a039392b7255.json +1 -0
  15. package/graphify-out/cache/ast/v0.8.39/b3a576733a49496a7d162b3a08710f6ca29fd2678532e9406755046f6250acb9.json +1 -0
  16. package/graphify-out/cache/ast/v0.8.39/c2b57052ba235afaf3195c026546eabbe2ab6274aa24bc3e4481f92904fe6a9d.json +1 -0
  17. package/graphify-out/cache/stat-index.json +1 -0
  18. package/graphify-out/graph.html +69 -28
  19. package/graphify-out/graph.json +4052 -1782
  20. package/graphify-out/manifest.json +300 -50
  21. package/package.json +10 -10
  22. package/src/main.js +8 -3
  23. package/src/methods/hide.js +16 -16
  24. package/src/methods/listShortcuts.js +1 -1
  25. package/src/methods/show.js +14 -5
  26. package/test/02-cuts.test.js +169 -0
  27. package/types/findInstructions.d.ts +1 -1
  28. package/types/findInstructions.d.ts.map +1 -1
  29. package/types/main.d.ts +76 -12
  30. package/types/main.d.ts.map +1 -1
  31. package/types/methods/hide.d.ts +1 -1
  32. package/types/methods/hide.d.ts.map +1 -1
  33. package/types/methods/jump.d.ts +1 -1
  34. package/types/methods/jump.d.ts.map +1 -1
  35. package/types/methods/jumpBack.d.ts +2 -2
  36. package/types/methods/jumpBack.d.ts.map +1 -1
  37. package/types/methods/jumpsReset.d.ts +1 -1
  38. package/types/methods/jumpsReset.d.ts.map +1 -1
  39. package/types/methods/listShortcuts.d.ts +1 -1
  40. package/types/methods/listShortcuts.d.ts.map +1 -1
  41. package/types/methods/setScenes.d.ts +11 -17
  42. package/types/methods/setScenes.d.ts.map +1 -1
  43. package/types/methods/show.d.ts +2 -2
  44. package/types/methods/show.d.ts.map +1 -1
  45. package/types/setInstruction.d.ts +1 -1
  46. package/types/setInstruction.d.ts.map +1 -1
@@ -252,6 +252,30 @@ describe ( 'Cuts integration', () => {
252
252
 
253
253
 
254
254
 
255
+ it ( 'List shortcuts excludes beforeHide and afterShow', async () => {
256
+ // Regression test: listShortcuts used to destructure the old
257
+ // 'beforeUnload'/'afterLoad' names, so the real 'beforeHide'/'afterShow'
258
+ // scene methods leaked into the returned shortcuts list.
259
+ const script = cuts ()
260
+ const scenes = [
261
+ {
262
+ name: 'top'
263
+ , scene: {
264
+ show : ({task}) => task.done(),
265
+ hide : ({task}) => task.done(),
266
+ beforeHide : ({ done }) => done ( true ),
267
+ afterShow : () => {},
268
+ 'click: left-1' : () => {}
269
+ }
270
+ }
271
+ ];
272
+
273
+ script.setScenes ( scenes )
274
+ expect ( script.listShortcuts( 'top' ) ).toEqual ( ['click: left-1'] )
275
+ }) // it List shortcuts excludes beforeHide and afterShow
276
+
277
+
278
+
255
279
  it ( 'Jump functionality', async () => {
256
280
  const script = cuts({ logLevel : 0 });
257
281
  const calls = [];
@@ -409,4 +433,149 @@ describe ( 'Cuts integration', () => {
409
433
 
410
434
 
411
435
 
436
+ it ( 'Show scene with wildcard parent as the very first scene', async () => {
437
+ // Regression test: state.currentParents starts as null, and the
438
+ // wildcard branch used to push into it before it was initialized,
439
+ // crashing on the first-ever show() call.
440
+ const script = cuts();
441
+ const calls = [];
442
+ const scenes = [
443
+ {
444
+ name: 'overlay'
445
+ , scene: {
446
+ show: ({task}) => { calls.push('show overlay'); task.done() },
447
+ hide: ({task}) => { calls.push('hide overlay'); task.done() },
448
+ parents: ['*']
449
+ }
450
+ }
451
+ ];
452
+
453
+ script.setScenes ( scenes );
454
+
455
+ await script.show ({ scene: 'overlay' });
456
+ expect ( calls ).toEqual (['show overlay']);
457
+ expect ( script.getState().scene ).toEqual ( 'overlay' );
458
+ expect ( script.getState().parents ).toEqual ( [null] ); // No previous scene, saved as null
459
+ }) // it Show scene with wildcard parent as the very first scene
460
+
461
+
462
+
463
+ it ( 'Hide with wildcard steps resets state to the root', async () => {
464
+ // Regression test: hide('*') used to hide every scene correctly but left
465
+ // 'currentScene'/'currentParents' stale instead of resetting them to the root.
466
+ const calls = [];
467
+ const script = cuts();
468
+ const scenes = [
469
+ { name: 'top' , scene: { show: ({task}) => { calls.push('show top'); task.done() }, hide: ({task}) => { calls.push('hide top'); task.done() } } },
470
+ { name: 'mid' , scene: { show: ({task}) => { calls.push('show mid'); task.done() }, hide: ({task}) => { calls.push('hide mid'); task.done() }, parents: ['top'] } },
471
+ { name: 'deep', scene: { show: ({task}) => { calls.push('show deep'); task.done() }, hide: ({task}) => { calls.push('hide deep'); task.done() }, parents: ['top', 'mid'] } }
472
+ ];
473
+
474
+ script.setScenes ( scenes );
475
+ await script.show ({ scene: 'deep' });
476
+ calls.length = 0;
477
+
478
+ await script.hide ( '*' );
479
+ expect ( calls ).toEqual ([ 'hide deep', 'hide mid', 'hide top' ]);
480
+ expect ( script.getState() ).toEqual ({ scene: null, parents: [], opened: true });
481
+ }) // it Hide with wildcard steps resets state to the root
482
+
483
+
484
+
485
+ it ( 'emit() passes args through without an injected context object', async () => {
486
+ // Regression test: shortcuts@4.1.1's own emit() now prepends a
487
+ // { dependencies, type: 'custom' } object to support event chaining.
488
+ // cuts.emit() must keep forwarding exactly what the caller passed.
489
+ const received = [];
490
+ const script = cuts();
491
+ const scenes = [
492
+ {
493
+ name: 'top'
494
+ , scene: {
495
+ show : ({task}) => task.done(),
496
+ hide : ({task}) => task.done(),
497
+ '@custom-event' : ( payload ) => received.push ( payload )
498
+ }
499
+ }
500
+ ];
501
+
502
+ script.setScenes ( scenes );
503
+ await script.show ({ scene: 'top' });
504
+
505
+ script.emit ( '@custom-event', { foo: 'bar' } );
506
+ expect ( received ).toEqual ([{ foo: 'bar' }]);
507
+ }) // it emit() passes args through without an injected context object
508
+
509
+
510
+
511
+ it ( 'Wildcard overlay scene activates its own shortcuts context', async () => {
512
+ // Regression test: showing a '*'-parented scene never switched the
513
+ // shortcuts context to it, so its own shortcut/event handlers never fired.
514
+ const seen = [];
515
+ const script = cuts();
516
+ const scenes = [
517
+ {
518
+ name: 'base'
519
+ , scene: {
520
+ show : ({task}) => task.done(),
521
+ hide : ({task}) => task.done(),
522
+ '@ping' : () => seen.push ( 'base' )
523
+ }
524
+ },
525
+ {
526
+ name: 'overlay'
527
+ , scene: {
528
+ show : ({task}) => task.done(),
529
+ hide : ({task}) => task.done(),
530
+ parents: ['*'],
531
+ '@ping' : () => seen.push ( 'overlay' )
532
+ }
533
+ }
534
+ ];
535
+
536
+ script.setScenes ( scenes );
537
+ await script.show ({ scene: 'base' });
538
+ await script.show ({ scene: 'overlay' });
539
+
540
+ script.emit ( '@ping' );
541
+ expect ( seen ).toEqual ([ 'overlay' ]);
542
+ }) // it Wildcard overlay scene activates its own shortcuts context
543
+
544
+
545
+
546
+ it ( 'Showing a wildcard overlay does not corrupt the underlying scene, and returning to it works', async () => {
547
+ // Regression test: state.currentParents used to be aliased directly to a
548
+ // scene's own 'parents' array, so pushing onto it (done when showing a
549
+ // wildcard overlay) permanently mutated that scene's 'parents' definition -
550
+ // which then crashed when navigating back to it.
551
+ const calls = [];
552
+ const script = cuts();
553
+ const baseScene = {
554
+ show : ({task}) => { calls.push('show base'); task.done() }
555
+ , hide : ({task}) => { calls.push('hide base'); task.done() }
556
+ };
557
+ const scenes = [
558
+ { name: 'base', scene: baseScene },
559
+ {
560
+ name: 'overlay'
561
+ , scene: {
562
+ show : ({task}) => { calls.push('show overlay'); task.done() },
563
+ hide : ({task}) => { calls.push('hide overlay'); task.done() },
564
+ parents: ['*']
565
+ }
566
+ }
567
+ ];
568
+
569
+ script.setScenes ( scenes );
570
+ await script.show ({ scene: 'base' });
571
+ await script.show ({ scene: 'overlay' });
572
+
573
+ expect ( baseScene.parents ).toEqual ([]); // Not corrupted into ['base']
574
+
575
+ await script.show ({ scene: 'base' }); // Used to throw
576
+ expect ( script.getState() ).toEqual ({ scene: 'base', parents: [], opened: true });
577
+ }) // it Showing a wildcard overlay does not corrupt the underlying scene, and returning to it works
578
+
579
+
580
+
412
581
  }) // describe
@@ -1,4 +1,3 @@
1
- export default findInstructions;
2
1
  /**
3
2
  * @function findInstructions
4
3
  * @description Generator that yields instructions for transitioning between scenes
@@ -9,4 +8,5 @@ export default findInstructions;
9
8
  * @yields {Array.<string, 'show'|'hide'>} - instruction array with scene name and action
10
9
  */
11
10
  declare function findInstructions(currentName: string | null, currentParents: Array<string>, targetName: string, targetParents: Array<string>): Generator<string[], void, unknown>;
11
+ export default findInstructions;
12
12
  //# sourceMappingURL=findInstructions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"findInstructions.d.ts","sourceRoot":"","sources":["../src/findInstructions.js"],"names":[],"mappings":";AAGA;;;;;;;;GAQG;AACH,+CANW,MAAM,GAAC,IAAI,kBACX,KAAK,CAAE,MAAM,CAAC,cACd,MAAM,iBACN,KAAK,CAAE,MAAM,CAAC,sCAyExB"}
1
+ {"version":3,"file":"findInstructions.d.ts","sourceRoot":"","sources":["../src/findInstructions.js"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AACH,iBAAU,gBAAgB,CAAG,WAAW,EAN7B,MAAM,GAAC,IAMsB,EAAE,cAAc,EAL7C,KAAK,CAAE,MAAM,CAKgC,EAAE,UAAU,EAJzD,MAIyD,EAAE,aAAa,EAHxE,KAAK,CAAE,MAAM,CAG2D,sCAsElF;eAIc,gBAAgB"}
package/types/main.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export default main;
2
1
  declare function main(cfg?: {
3
2
  logLevel: number;
4
3
  }): {
@@ -9,23 +8,88 @@ declare function main(cfg?: {
9
8
  scene: string;
10
9
  options?: {
11
10
  ssr: boolean;
12
- } | undefined;
11
+ };
13
12
  }, ...args?: any[]) => Promise<any>;
14
13
  jump: ({ scene }: {
15
14
  scene: string;
16
15
  }, ...args?: any[]) => Promise<any>;
17
16
  jumpBack: ({ hops }?: {
18
- hops?: number | undefined;
17
+ hops?: number;
19
18
  }, ...args?: any[]) => Promise<any> | undefined;
20
19
  jumpsReset: () => void;
21
- loadPlugins(plugins: Array<"Key" | "Click" | "Form" | "Hover" | "Scroll">): Promise<Function[]>;
22
- setDependencies(deps: any): void;
23
- getDependencies(): any;
24
- setNote(note: string): void;
25
- listScenes(): Array<string>;
26
- enablePlugin(plugin: Function, options?: any): void;
27
- disablePlugin(pluginName: string): void;
28
- getState(): Object;
29
- emit(event: string, ...args: any[]): void;
20
+ /**
21
+ * @typedef {'Key'|'Click'|'Form'|'Hover'|'Scroll' } pluginNames
22
+ * @description List of possible plugin names: 'Key', 'Click', 'Form', 'Hover', 'Scroll'
23
+ *
24
+ * Load a needed shortcut plugins - 'Key', 'Click', 'Form', 'Hover', 'Scroll' and so on.
25
+ * It's a async function. Don't forget to 'await' it.
26
+ * @function loadPlugins
27
+ * @param {Array.<pluginNames>} plugins - list of plugins to load
28
+ * @returns {Promise.<function[]>} - loaded plugins in a sequence
29
+ *
30
+ * @example
31
+ * // script is instance of cuts
32
+ * await script.loadPlugins ( ['Key', 'Click'] )
33
+ * .then ( plugins => plugins.forEach ( plugin => script.enablePlugin ( plugin ) ) )
34
+ */
35
+ loadPlugins: (plugins: Array<"Click" | "Form" | "Hover" | "Key" | "Scroll">) => Promise<Function[]>;
36
+ /**
37
+ * @function setDependencies
38
+ * @description Set dependencies for the Scenes
39
+ * @param {*} deps - dependencies objects
40
+ * @returns void
41
+ */
42
+ setDependencies: (deps: any) => void;
43
+ /**
44
+ * @function getDependencies
45
+ * @description Get dependencies for the Scenes
46
+ * @returns {*} - dependencies objects
47
+ */
48
+ getDependencies: () => any;
49
+ /**
50
+ * @function setNote
51
+ * @param {string} note - note, provided to action functions
52
+ * @returns void
53
+ */
54
+ setNote: (note: string) => void;
55
+ /**
56
+ * @function listScenes
57
+ * @description List all loaded Scene names
58
+ * @returns {Array.<string>} - list of scene names
59
+ */
60
+ listScenes: () => Array<string>;
61
+ /**
62
+ * @function enablePlugin
63
+ * @description Enable a shortcut plugin
64
+ * @param {function} plugin - plugin library
65
+ * @param {*} [options] - plugin options
66
+ * @returns void
67
+ */
68
+ enablePlugin: (plugin: Function, options?: any) => void;
69
+ /**
70
+ * Disable a shortcut plugin
71
+ * @function disablePlugin
72
+ * @param {string} pluginName - plugin name
73
+ * @returns void
74
+ */
75
+ disablePlugin: (pluginName: string) => void;
76
+ /**
77
+ * Get the current state of the application
78
+ * @function getState
79
+ * @returns {Object} with properties:
80
+ * - scene: current scene name
81
+ * - parents: current parent scene names
82
+ * - opened: boolean indicating if the application is opened
83
+ */
84
+ getState: () => Object;
85
+ /**
86
+ * @function emit
87
+ * @description Emit an event
88
+ * @param {string} event - event name
89
+ * @param {...*} args - Extra data to pass to the listeners
90
+ * @returns void
91
+ */
92
+ emit: (event: string, ...args: any[]) => any;
30
93
  };
94
+ export default main;
31
95
  //# sourceMappingURL=main.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":";AAsCA;;;;;;;;;;;;;;;;;;;yBA8CmB,KAAK,+CAAc,GACjB,OAAO,CAAE,UAAU,CAAC;0BAgBtB,GAAC;uBAQC,GAAC;kBAMH,MAAM;kBAQJ,KAAK,CAAE,MAAM,CAAC;6CAQhB,GAAC;8BAQD,MAAM;gBAQJ,MAAM;gBAeP,MAAM,WACH,GAAC,EAAA;EAKvB"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.js"],"names":[],"mappings":"AAsCA,iBAAS,IAAI,CAAG,GAAG;IAAG,QAAQ;CAAG;;;;;;;;;;;;;;;;;IA0CzB;;;;;;;;;;;;;;OAcG;2BAPQ,KAAK,+CAAc,KACjB,OAAO,CAAE,UAAU,CAAC;IAajC;;;;;OAKG;4BAFQ,GAAC;IAKZ;;;;OAIG;2BADU,GAAC;IAId;;;;OAIG;oBAFQ,MAAM;IAKjB;;;;OAIG;sBADU,KAAK,CAAE,MAAM,CAAC;IAI3B;;;;;;OAMG;+CAFQ,GAAC;IAKZ;;;;;OAKG;gCAFQ,MAAM;IAKjB;;;;;;;OAOG;oBAJU,MAAM;IAYlB;;;;;;OAMG;kBAHQ,MAAM,WACH,GAAC,EAAA;EAOvB;eAIc,IAAI"}
@@ -1,3 +1,3 @@
1
- export default hide;
2
1
  declare function hide(dependencies: any, state: any): (endSteps?: number | string) => Promise<any>;
2
+ export default hide;
3
3
  //# sourceMappingURL=hide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hide.d.ts","sourceRoot":"","sources":["../../src/methods/hide.js"],"names":[],"mappings":";AAIA,uDAOuB,WAHZ,MAAM,GAAC,MAGe,kBAmC/B"}
1
+ {"version":3,"file":"hide.d.ts","sourceRoot":"","sources":["../../src/methods/hide.js"],"names":[],"mappings":"AAIA,iBAAS,IAAI,CAAG,YAAY,KAAA,EAAE,KAAK,KAAA,eAIxB,MAAM,GAAC,MAAM,kBAsCtB;eAIa,IAAI"}
@@ -1,5 +1,5 @@
1
- export default jump;
2
1
  declare function jump(state: any, show: any): ({ scene }: {
3
2
  scene: string;
4
3
  }, ...args?: any[]) => Promise<any>;
4
+ export default jump;
5
5
  //# sourceMappingURL=jump.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jump.d.ts","sourceRoot":"","sources":["../../src/methods/jump.js"],"names":[],"mappings":";AAAA,0DAKO;IAAwB,KAAK,EAArB,MAAM;CACd,mCAQN"}
1
+ {"version":3,"file":"jump.d.ts","sourceRoot":"","sources":["../../src/methods/jump.js"],"names":[],"mappings":"AAAA,iBAAS,IAAI,CAAG,KAAK,KAAA,EAAE,IAAI,KAAA,eAKpB;IAAwB,KAAK,EAArB,MAAM,CACd;CAAA,mCAQN;eAIc,IAAI"}
@@ -1,5 +1,5 @@
1
- export default jumpBack;
2
1
  declare function jumpBack(state: any, show: any): ({ hops }?: {
3
- hops?: number | undefined;
2
+ hops?: number;
4
3
  }, ...args?: any[]) => Promise<any> | undefined;
4
+ export default jumpBack;
5
5
  //# sourceMappingURL=jumpBack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jumpBack.d.ts","sourceRoot":"","sources":["../../src/methods/jumpBack.js"],"names":[],"mappings":";AAAA,8DAKO;IAAyB,IAAI;CAC7B,sBACU,eAAQ,SAAS,CAWjC"}
1
+ {"version":3,"file":"jumpBack.d.ts","sourceRoot":"","sources":["../../src/methods/jumpBack.js"],"names":[],"mappings":"AAAA,iBAAS,QAAQ,CAAG,KAAK,KAAA,EAAE,IAAI,KAAA,eAKxB;IAAyB,IAAI,AAA7B,CACA,EADQ,MAAM,CACd;CAAA,sBACU,eAAQ,SAAS,CAWjC;eAGc,QAAQ"}
@@ -1,3 +1,3 @@
1
- export default jumpsReset;
2
1
  declare function jumpsReset(state: any): () => void;
2
+ export default jumpsReset;
3
3
  //# sourceMappingURL=jumpsReset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"jumpsReset.d.ts","sourceRoot":"","sources":["../../src/methods/jumpsReset.js"],"names":[],"mappings":";AAAA,+CAIiB,IAAI,CAKpB"}
1
+ {"version":3,"file":"jumpsReset.d.ts","sourceRoot":"","sources":["../../src/methods/jumpsReset.js"],"names":[],"mappings":"AAAA,iBAAS,UAAU,CAAG,KAAK,KAAA,SAIV,IAAI,CAKpB;eAIc,UAAU"}
@@ -1,3 +1,3 @@
1
- export default listShortcuts;
2
1
  declare function listShortcuts(dependencies: any, state: any): (sceneName: string) => (Array<string> | null);
2
+ export default listShortcuts;
3
3
  //# sourceMappingURL=listShortcuts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"listShortcuts.d.ts","sourceRoot":"","sources":["../../src/methods/listShortcuts.js"],"names":[],"mappings":";AAEA,gEAOgC,WAHrB,MAG8B,KAF5B,CAAC,KAAK,CAAE,MAAM,CAAC,GAAC,IAAI,CAAC,CAOhC"}
1
+ {"version":3,"file":"listShortcuts.d.ts","sourceRoot":"","sources":["../../src/methods/listShortcuts.js"],"names":[],"mappings":"AAEA,iBAAS,aAAa,CAAG,YAAY,KAAA,EAAE,KAAK,KAAA,eAIjC,MAAM,KACJ,CAAC,KAAK,CAAE,MAAM,CAAC,GAAC,IAAI,CAAC,CAOhC;eAIa,aAAa"}
@@ -1,4 +1,3 @@
1
- export default setScenes;
2
1
  export type AskObject = {
3
2
  /**
4
3
  * - Mark the task as done
@@ -7,35 +6,29 @@ export type AskObject = {
7
6
  };
8
7
  export type SceneObject = {
9
8
  /**
10
- * - load interface and prerequisites for the scene;
9
+ * ({task: AskObject, dependencies: *}): void} show - load interface and prerequisites for the scene;
11
10
  */
12
- show: (arg0: {
13
- task: AskObject;
14
- dependencies: any;
15
- }) => void;
11
+ : Function;
16
12
  /**
17
- * - run after scene is loaded. Optional. Returns true to continue loading, false to cancel;
13
+ * ():boolean} [afterShow] - run after scene is loaded. Optional. Returns true to continue loading, false to cancel;
18
14
  */
19
- afterShow?: (() => boolean) | undefined;
15
+ : Function;
20
16
  /**
21
- * - Reverse the settings from 'show';
17
+ * ({task: AskObject, dependencies: *}): void} hide - Reverse the settings from 'show';
22
18
  */
23
- hide: (arg0: {
24
- task: AskObject;
25
- dependencies: any;
26
- }) => void;
19
+ : Function;
27
20
  /**
28
- * - Run before scene is hidden. Optional;
21
+ * ():void} [beforeHide] - Run before scene is hidden. Optional;
29
22
  */
30
- beforeHide?: (() => void) | undefined;
23
+ : Function;
31
24
  /**
32
25
  * - list of parent scene names.
33
26
  */
34
- parents?: string[] | undefined;
27
+ parents?: Array<string>;
35
28
  /**
36
29
  * - shortcut descriptions
37
30
  */
38
- "": any;
31
+ : any;
39
32
  };
40
33
  export type sceneDescription = {
41
34
  /**
@@ -66,4 +59,5 @@ export type sceneDescription = {
66
59
  * @property {SceneObject} scene - object should contain 'show' and 'hide' + shortcuts and action functions
67
60
  */
68
61
  declare function setScenes(dependencies: any, state: any): (list: sceneDescription[]) => void;
62
+ export default setScenes;
69
63
  //# sourceMappingURL=setScenes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setScenes.d.ts","sourceRoot":"","sources":["../../src/methods/setScenes.js"],"names":[],"mappings":";;;;;;;;;;;UASc,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;uBACvC,OAAO;;;;UAClB,CAAS,IAAkC,EAAlC;QAAC,IAAI,EAAE,SAAS,CAAC;QAAC,YAAY,EAAE,GAAC,CAAA;KAAC,KAAG,IAAI;;;;wBACvC,IAAI;;;;;;;;QAEf,GAAC;;;;;;UAOD,MAAM;;;;WACN,WAAW;;AAnBzB;;;GAGG;AACH;;;;;;;;GAQG;AAIH;;;;GAIG;AAKH,4DAOgC,MAJhB,gBAAgB,EAII,UAkClC"}
1
+ {"version":3,"file":"setScenes.d.ts","sourceRoot":"","sources":["../../src/methods/setScenes.js"],"names":[],"mappings":"AAIG,YAAkB,SAAS,GAC3B;;;;IAAqB,IAAI,WAC3B;CAAA,CAAA;AAEE,YAAkB,WAAW,GAC7B;;;;IAAmB,WACnB;;;;IAAmB,WACnB;;;;IAAmB,WACnB;;;;IAAmB,WACnB;;;;IAA4B,OAAO,AAAnC,CACA,EADW,KAAK,CAAE,MAAM,CAAC,CACzB;;;;IAAkB,AAAD,EAAN,GAAC,CACd;CAAA,CAAA;AAKE,YAAkB,gBAAgB,GAClC;;;;IAAmB,IAAI,EAAZ,MAAM,CACjB;;;;IAAwB,KAAK,EAAlB,WAAW,CACxB;CAAA,CAAA;AApBD;;;GAGG;AACH;;;;;;;;GAQG;AAIH;;;;GAIG;AAKH,iBAAS,SAAS,CAAG,YAAY,KAAA,EAAE,KAAK,KAAA,UAGxB,gBAAgB,EAAE,UAsChC;eAIa,SAAS"}
@@ -1,8 +1,8 @@
1
- export default show;
2
1
  declare function show(dependencies: any, state: any): ({ scene: requestedScene, options }: {
3
2
  scene: string;
4
3
  options?: {
5
4
  ssr: boolean;
6
- } | undefined;
5
+ };
7
6
  }, ...args?: any[]) => Promise<any>;
7
+ export default show;
8
8
  //# sourceMappingURL=show.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/methods/show.js"],"names":[],"mappings":";AAIA,2FAKG;IAAwB,KAAK,EAArB,MAAM;IACW,OAAO;aACxB,OAAO;;CACf,mCA4GF"}
1
+ {"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../src/methods/show.js"],"names":[],"mappings":"AAIA,iBAAS,IAAI,CAAG,YAAY,KAAA,EAAE,KAAK,KAAA,wCAKhC;IAAwB,KAAK,EAArB,MAAM,CACd;IAAyB,OAAO,AAAhC,CAEA,EADA;QAAiC,GAAG,EAA5B,OAAO,CACf;KAAA,CAAA;CAAA,mCAqHF;eAIc,IAAI"}
@@ -1,3 +1,3 @@
1
- export default setInstruction;
2
1
  declare function setInstruction(dependencies: any): (fn: Function, ...args: any[]) => Function;
2
+ export default setInstruction;
3
3
  //# sourceMappingURL=setInstruction.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setInstruction.d.ts","sourceRoot":"","sources":["../src/setInstruction.js"],"names":[],"mappings":";AAEA,qDAQiC,YAAE,EAAE,GAAG,MAHtB,GAAC,EAGyB,cAO1C"}
1
+ {"version":3,"file":"setInstruction.d.ts","sourceRoot":"","sources":["../src/setInstruction.js"],"names":[],"mappings":"AAEA,iBAAS,cAAc,CAAG,YAAY,KAAA,2BAKpB,GAAC,EAAA,cAUjB;eAIa,cAAc"}