narrat 2.0.9 → 2.0.12

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.
@@ -19,7 +19,26 @@ interface MainState {
19
19
  export interface MainSaveData {
20
20
  playTime: number;
21
21
  }
22
- export declare const useMain: import("pinia").StoreDefinition<"main", MainState, {}, {
22
+ export declare const useMain: import("pinia").StoreDefinition<"main", MainState, {
23
+ isInGame(state: {
24
+ ready: boolean;
25
+ playing: boolean;
26
+ errors: {
27
+ text: string;
28
+ }[];
29
+ playTime: {
30
+ start: number;
31
+ previousPlaytime: number;
32
+ };
33
+ options: {
34
+ logging: boolean;
35
+ debug: boolean;
36
+ };
37
+ flowState: 'menu' | 'playing';
38
+ modal: string | false;
39
+ paused: boolean;
40
+ } & import("pinia").PiniaCustomStateProperties<MainState>): boolean;
41
+ }, {
23
42
  setup(scriptPaths: string[], config: Config): Promise<void>;
24
43
  startMachine(): void;
25
44
  startGame(): Promise<void>;
@@ -59,16 +78,53 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
59
78
  flowState: 'menu' | 'playing';
60
79
  modal: string | false;
61
80
  paused: boolean;
62
- } & import("pinia")._StoreWithState<"main", MainState, {}, any> & import("pinia")._StoreWithGetters<{}> & import("pinia").PiniaCustomProperties<string, import("pinia").StateTree, import("pinia")._GettersTree<import("pinia").StateTree>, import("pinia")._ActionsTree>;
81
+ } & import("pinia")._StoreWithState<"main", MainState, {
82
+ isInGame(state: {
83
+ ready: boolean;
84
+ playing: boolean;
85
+ errors: {
86
+ text: string;
87
+ }[];
88
+ playTime: {
89
+ start: number;
90
+ previousPlaytime: number;
91
+ };
92
+ options: {
93
+ logging: boolean;
94
+ debug: boolean;
95
+ };
96
+ flowState: 'menu' | 'playing';
97
+ modal: string | false;
98
+ paused: boolean;
99
+ } & import("pinia").PiniaCustomStateProperties<MainState>): boolean;
100
+ }, any> & import("pinia")._StoreWithGetters<{
101
+ isInGame(state: {
102
+ ready: boolean;
103
+ playing: boolean;
104
+ errors: {
105
+ text: string;
106
+ }[];
107
+ playTime: {
108
+ start: number;
109
+ previousPlaytime: number;
110
+ };
111
+ options: {
112
+ logging: boolean;
113
+ debug: boolean;
114
+ };
115
+ flowState: 'menu' | 'playing';
116
+ modal: string | false;
117
+ paused: boolean;
118
+ } & import("pinia").PiniaCustomStateProperties<MainState>): boolean;
119
+ }> & import("pinia").PiniaCustomProperties<string, import("pinia").StateTree, import("pinia")._GettersTree<import("pinia").StateTree>, import("pinia")._ActionsTree>;
63
120
  screens: import("pinia").Store<"screens", {
64
- currentScreen: string;
121
+ layers: string[];
65
122
  buttons: import("./screens-store").ButtonsState;
66
123
  }, {}, {
67
- setScreen(screen: string): void;
68
- setButtons(buttons: {
69
- [key: string]: import("../config").ButtonConfig;
70
- }): void;
71
- changeButton(button: string, newValue: boolean): void;
124
+ setScreen(screen: string, layer?: number | undefined): void;
125
+ emptyLayer(layer: number): void;
126
+ setButtons(config: Config): void;
127
+ changeButton(button: string, newValue: import("./screens-store").ButtonStateValue): void;
72
128
  generateSaveData(): import("./screens-store").ScreenState;
73
129
  loadSaveData(data: import("./screens-store").ScreenState): void;
74
130
  }>;
@@ -1,23 +1,23 @@
1
- import { ButtonConfig } from '../config';
1
+ import { Config } from '../config';
2
+ export declare type ButtonStateValue = boolean | 'hidden';
2
3
  export interface ButtonsState {
3
4
  [key: string]: {
4
- enabled: boolean;
5
+ state: ButtonStateValue;
5
6
  };
6
7
  }
7
8
  export interface ScreenState {
8
- currentScreen: string;
9
+ layers: string[];
9
10
  buttons: ButtonsState;
10
11
  }
11
12
  export declare type ScreenSave = ScreenState;
12
13
  export declare const useScreens: import("pinia").StoreDefinition<"screens", {
13
- currentScreen: string;
14
+ layers: string[];
14
15
  buttons: ButtonsState;
15
16
  }, {}, {
16
- setScreen(screen: string): void;
17
- setButtons(buttons: {
18
- [key: string]: ButtonConfig;
19
- }): void;
20
- changeButton(button: string, newValue: boolean): void;
17
+ setScreen(screen: string, layer?: number): void;
18
+ emptyLayer(layer: number): void;
19
+ setButtons(config: Config): void;
20
+ changeButton(button: string, newValue: ButtonStateValue): void;
21
21
  generateSaveData(): ScreenSave;
22
22
  loadSaveData(data: ScreenSave): void;
23
23
  }>;
@@ -1,8 +1,12 @@
1
1
  import { CommandPlugin } from './command-plugin';
2
2
  export declare const setScreenCommand: CommandPlugin<{
3
3
  screen: string;
4
+ layer: number;
5
+ }, {}>;
6
+ export declare const emptyLayerCommand: CommandPlugin<{
7
+ layer: number;
4
8
  }, {}>;
5
9
  export declare const setButtonCommand: CommandPlugin<{
6
10
  buttonId: string;
7
- enabled: boolean;
11
+ state: any;
8
12
  }, {}>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "2.0.9",
3
+ "version": "2.0.12",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "dist/narrat.umd.js",
6
6
  "module": "dist/narrat.es.js",
@@ -1,3 +0,0 @@
1
- export declare function startGameLoop(): void;
2
- export declare function gameLoop(): void;
3
- export declare function mouseclick(e: MouseEvent): void;