narrat 2.0.11 → 2.0.13-test-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 (132) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +120 -105
  3. package/dist/app.vue.d.ts +96 -96
  4. package/dist/components/MainMenu.vue.d.ts +12 -12
  5. package/dist/components/Skills.vue.d.ts +22 -22
  6. package/dist/components/debug/debug-menu.vue.d.ts +48 -48
  7. package/dist/components/dialog-picture.vue.d.ts +9 -9
  8. package/dist/components/game-dialog.vue.d.ts +65 -65
  9. package/dist/components/hud.vue.d.ts +14 -12
  10. package/dist/components/inventory-ui.vue.d.ts +30 -30
  11. package/dist/components/loading-bar.vue.d.ts +10 -10
  12. package/dist/components/menu-buttons.vue.d.ts +26 -26
  13. package/dist/components/notification-toast.vue.d.ts +6 -6
  14. package/dist/components/quests-ui.vue.d.ts +20 -20
  15. package/dist/components/screen-layer.vue.d.ts +54 -0
  16. package/dist/components/screens.vue.d.ts +46 -46
  17. package/dist/components/utils/modal.vue.d.ts +6 -6
  18. package/dist/components/volume-controls.vue.d.ts +7 -7
  19. package/dist/config.d.ts +165 -158
  20. package/dist/constants.d.ts +1 -1
  21. package/dist/defaultConfig.d.ts +2 -2
  22. package/dist/demo/demo.d.ts +1 -1
  23. package/dist/dialog-box.vue.d.ts +37 -37
  24. package/dist/exports/config.d.ts +1 -1
  25. package/dist/exports/display.d.ts +2 -2
  26. package/dist/exports/plugins.d.ts +20 -20
  27. package/dist/img/backgrounds/rpg.png +0 -0
  28. package/dist/img/backgrounds/test-layers.gif +0 -0
  29. package/dist/img/enemies/goblin.png +0 -0
  30. package/dist/img/enemies/skeleton.png +0 -0
  31. package/dist/img/enemies/slime.png +0 -0
  32. package/dist/img/levels/cave.png +0 -0
  33. package/dist/img/levels/dungeon.png +0 -0
  34. package/dist/img/levels/dungeon_F.png +0 -0
  35. package/dist/img/levels/dungeon_FL.png +0 -0
  36. package/dist/img/levels/dungeon_FR.png +0 -0
  37. package/dist/img/levels/dungeon_FRL.png +0 -0
  38. package/dist/img/levels/dungeon_LR.png +0 -0
  39. package/dist/img/levels/grass.png +0 -0
  40. package/dist/img/players/wizard.png +0 -0
  41. package/dist/img/ui/front.png +0 -0
  42. package/dist/img/ui/left.png +0 -0
  43. package/dist/img/ui/right.png +0 -0
  44. package/dist/img/ui/start.png +0 -0
  45. package/dist/lib/lib.d.ts +15 -15
  46. package/dist/main.d.ts +5 -5
  47. package/dist/narrat.es.js +30732 -33089
  48. package/dist/narrat.es.js.map +1 -1
  49. package/dist/narrat.umd.js +92 -103
  50. package/dist/narrat.umd.js.map +1 -1
  51. package/dist/plugins/NarratPlugin.d.ts +11 -11
  52. package/dist/stores/audio-store.d.ts +12 -12
  53. package/dist/stores/dialog-store.d.ts +31 -31
  54. package/dist/stores/hud-stats-store.d.ts +22 -22
  55. package/dist/stores/inventory-store.d.ts +37 -37
  56. package/dist/stores/main-store.d.ts +347 -338
  57. package/dist/stores/notification-store.d.ts +12 -12
  58. package/dist/stores/quest-log.d.ts +39 -39
  59. package/dist/stores/rendering-store.d.ts +13 -13
  60. package/dist/stores/screens-store.d.ts +23 -22
  61. package/dist/stores/skills.d.ts +40 -36
  62. package/dist/stores/vm-store.d.ts +155 -155
  63. package/dist/{lib.css → style.css} +1 -1
  64. package/dist/types/app-types.d.ts +5 -4
  65. package/dist/types/character-types.d.ts +27 -27
  66. package/dist/types/dialog-box-types.d.ts +10 -10
  67. package/dist/types/game-save.d.ts +21 -21
  68. package/dist/types/parser.d.ts +93 -93
  69. package/dist/types/state.d.ts +3 -3
  70. package/dist/utils/ajax.d.ts +1 -1
  71. package/dist/utils/audio-loader.d.ts +13 -13
  72. package/dist/utils/characters.d.ts +5 -5
  73. package/dist/utils/data-helpers.d.ts +19 -19
  74. package/dist/utils/debounce.d.ts +14 -14
  75. package/dist/utils/error-handling.d.ts +3 -3
  76. package/dist/utils/helpers.d.ts +6 -6
  77. package/dist/utils/images-loader.d.ts +6 -6
  78. package/dist/utils/logger.d.ts +11 -11
  79. package/dist/utils/object-iterators.d.ts +8 -8
  80. package/dist/utils/promises.d.ts +1 -1
  81. package/dist/utils/randomId.d.ts +1 -1
  82. package/dist/utils/save-helpers.d.ts +3 -3
  83. package/dist/utils/skillchecks.d.ts +17 -17
  84. package/dist/utils/string-helpers.d.ts +3 -3
  85. package/dist/utils/time-helpers.d.ts +2 -2
  86. package/dist/vm/commands/arithmetic-commands.d.ts +23 -17
  87. package/dist/vm/commands/audio-commands.d.ts +8 -8
  88. package/dist/vm/commands/choice.d.ts +37 -37
  89. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  90. package/dist/vm/commands/command-helpers.d.ts +3 -2
  91. package/dist/vm/commands/command-plugin.d.ts +43 -43
  92. package/dist/vm/commands/flow-commands.d.ts +17 -14
  93. package/dist/vm/commands/if.d.ts +10 -10
  94. package/dist/vm/commands/index.d.ts +2 -2
  95. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  96. package/dist/vm/commands/logic-command.d.ts +42 -42
  97. package/dist/vm/commands/math-commands.d.ts +14 -0
  98. package/dist/vm/commands/notify.d.ts +4 -4
  99. package/dist/vm/commands/quest-commands.d.ts +30 -30
  100. package/dist/vm/commands/random-commands.d.ts +10 -0
  101. package/dist/vm/commands/screen-commands.d.ts +12 -8
  102. package/dist/vm/commands/set.d.ts +6 -6
  103. package/dist/vm/commands/skill-commands.d.ts +45 -33
  104. package/dist/vm/commands/stats-commands.d.ts +12 -12
  105. package/dist/vm/commands/string-commands.d.ts +9 -9
  106. package/dist/vm/commands/text-field.d.ts +7 -7
  107. package/dist/vm/commands/text.d.ts +13 -13
  108. package/dist/vm/commands/wait.d.ts +4 -4
  109. package/dist/vm/vm-helpers.d.ts +18 -16
  110. package/dist/vm/vm-parser.d.ts +19 -19
  111. package/dist/vm/vm-parser.test.d.ts +1 -1
  112. package/dist/vm/vm.d.ts +18 -19
  113. package/package.json +82 -79
  114. package/CHANGELOG.md +0 -844
  115. package/dist/.DS_Store +0 -0
  116. package/dist/audio/click.ogg +0 -0
  117. package/dist/audio/failure.ogg +0 -0
  118. package/dist/audio/game_start.ogg +0 -0
  119. package/dist/audio/success.wav +0 -0
  120. package/dist/audio.7z +0 -0
  121. package/dist/data/characters.json +0 -62
  122. package/dist/data/config.json +0 -184
  123. package/dist/data/example.rpy +0 -367
  124. package/dist/data/refactor.rpy +0 -31
  125. package/dist/fonts/OpenDyslexic.ttf.eot +0 -0
  126. package/dist/fonts/OpenDyslexic.ttf.svg +0 -2326
  127. package/dist/fonts/OpenDyslexic.ttf.woff +0 -0
  128. package/dist/img/.DS_Store +0 -0
  129. package/dist/img/characters/music_cat.jpeg +0 -0
  130. package/dist/music/.DS_Store +0 -0
  131. package/dist/music/calm.mp3 +0 -0
  132. package/dist/sounds/.DS_Store +0 -0
@@ -1,12 +1,12 @@
1
- export interface NotificationState {
2
- text: string;
3
- }
4
- export interface NotificationsState {
5
- notifications: {
6
- [key: string]: NotificationState;
7
- };
8
- }
9
- export declare const useNotifications: import("pinia").StoreDefinition<"notifications", NotificationsState, {}, {
10
- addNotification(text: string): Promise<void>;
11
- deleteNotification(id: string): void;
12
- }>;
1
+ export interface NotificationState {
2
+ text: string;
3
+ }
4
+ export interface NotificationsState {
5
+ notifications: {
6
+ [key: string]: NotificationState;
7
+ };
8
+ }
9
+ export declare const useNotifications: import("pinia").StoreDefinition<"notifications", NotificationsState, {}, {
10
+ addNotification(text: string): Promise<void>;
11
+ deleteNotification(id: string): void;
12
+ }>;
@@ -1,39 +1,39 @@
1
- import { QuestData } from '../config';
2
- export interface QuestLogState {
3
- quests: {
4
- [key: string]: QuestState;
5
- };
6
- }
7
- export interface QuestState {
8
- id: string;
9
- state: 'hidden' | 'unlocked' | 'completed';
10
- ending?: string;
11
- /** Note: Objectives are an object so that it's easy to access specific objectives in game scripts.
12
- * One side effect of this is that the order objectives appear in isn't technicaclly guaranteed. */
13
- objectives: {
14
- [key: string]: ObjectiveState;
15
- };
16
- }
17
- export interface ObjectiveState {
18
- id: string;
19
- state: 'hidden' | 'unlocked' | 'completed';
20
- }
21
- export declare type QuestLogSave = QuestLogState;
22
- export declare const useQuests: import("pinia").StoreDefinition<"quests", QuestLogState, {}, {
23
- getQuest(questId: string): QuestState;
24
- getObjective(questId: string, objectiveId: string): ObjectiveState;
25
- setupQuests(quests: {
26
- [key: string]: QuestData;
27
- }): void;
28
- startQuest(questId: string): void;
29
- startObjective(questId: string, objectiveId: string): void;
30
- completeObjective(questId: string, objectiveId: string): void;
31
- completeQuest(questId: string, ending?: string): void;
32
- isQuestCompleted(questId: string): boolean;
33
- isObjectiveCompleted(questId: string, objectiveId: string): boolean;
34
- isQuestStarted(questId: string): boolean;
35
- isObjectiveStarted(questId: string, objectiveId: string): boolean;
36
- removeQuest(id: string): void;
37
- generateSaveData(): QuestLogSave;
38
- loadSaveData(data: QuestLogSave): void;
39
- }>;
1
+ import { QuestData } from '../config';
2
+ export interface QuestLogState {
3
+ quests: {
4
+ [key: string]: QuestState;
5
+ };
6
+ }
7
+ export interface QuestState {
8
+ id: string;
9
+ state: 'hidden' | 'unlocked' | 'completed';
10
+ ending?: string;
11
+ /** Note: Objectives are an object so that it's easy to access specific objectives in game scripts.
12
+ * One side effect of this is that the order objectives appear in isn't technicaclly guaranteed. */
13
+ objectives: {
14
+ [key: string]: ObjectiveState;
15
+ };
16
+ }
17
+ export interface ObjectiveState {
18
+ id: string;
19
+ state: 'hidden' | 'unlocked' | 'completed';
20
+ }
21
+ export declare type QuestLogSave = QuestLogState;
22
+ export declare const useQuests: import("pinia").StoreDefinition<"quests", QuestLogState, {}, {
23
+ getQuest(questId: string): QuestState;
24
+ getObjective(questId: string, objectiveId: string): ObjectiveState;
25
+ setupQuests(quests: {
26
+ [key: string]: QuestData;
27
+ }): void;
28
+ startQuest(questId: string): void;
29
+ startObjective(questId: string, objectiveId: string): void;
30
+ completeObjective(questId: string, objectiveId: string): void;
31
+ completeQuest(questId: string, ending?: string): void;
32
+ isQuestCompleted(questId: string): boolean;
33
+ isObjectiveCompleted(questId: string, objectiveId: string): boolean;
34
+ isQuestStarted(questId: string): boolean;
35
+ isObjectiveStarted(questId: string, objectiveId: string): boolean;
36
+ removeQuest(id: string): void;
37
+ generateSaveData(): QuestLogSave;
38
+ loadSaveData(data: QuestLogSave): void;
39
+ }>;
@@ -1,13 +1,13 @@
1
- export interface RenderingState {
2
- screenWidth: number;
3
- screenHeight: number;
4
- canvasWidth: number;
5
- canvasHeight: number;
6
- renderRatio: number;
7
- topOffset: number;
8
- leftOffset: number;
9
- layoutMode: 'horizontal' | 'vertical';
10
- }
11
- export declare const useRenderingStore: import("pinia").StoreDefinition<"rendering", RenderingState, {}, {
12
- updateScreenSize(width: number, height: number, textWidth: number): void;
13
- }>;
1
+ export interface RenderingState {
2
+ screenWidth: number;
3
+ screenHeight: number;
4
+ canvasWidth: number;
5
+ canvasHeight: number;
6
+ renderRatio: number;
7
+ topOffset: number;
8
+ leftOffset: number;
9
+ layoutMode: 'horizontal' | 'vertical';
10
+ }
11
+ export declare const useRenderingStore: import("pinia").StoreDefinition<"rendering", RenderingState, {}, {
12
+ updateScreenSize(width: number, height: number, textWidth: number): void;
13
+ }>;
@@ -1,22 +1,23 @@
1
- import { Config } from '../config';
2
- export declare type ButtonStateValue = boolean | 'hidden';
3
- export interface ButtonsState {
4
- [key: string]: {
5
- state: ButtonStateValue;
6
- };
7
- }
8
- export interface ScreenState {
9
- currentScreen: string;
10
- buttons: ButtonsState;
11
- }
12
- export declare type ScreenSave = ScreenState;
13
- export declare const useScreens: import("pinia").StoreDefinition<"screens", {
14
- currentScreen: string;
15
- buttons: ButtonsState;
16
- }, {}, {
17
- setScreen(screen: string): void;
18
- setButtons(config: Config): void;
19
- changeButton(button: string, newValue: ButtonStateValue): void;
20
- generateSaveData(): ScreenSave;
21
- loadSaveData(data: ScreenSave): void;
22
- }>;
1
+ import { Config } from '../config';
2
+ export declare type ButtonStateValue = boolean | 'hidden' | 'greyed';
3
+ export interface ButtonsState {
4
+ [key: string]: {
5
+ state: ButtonStateValue;
6
+ };
7
+ }
8
+ export interface ScreenState {
9
+ layers: string[];
10
+ buttons: ButtonsState;
11
+ }
12
+ export declare type ScreenSave = ScreenState;
13
+ export declare const useScreens: import("pinia").StoreDefinition<"screens", {
14
+ layers: string[];
15
+ buttons: ButtonsState;
16
+ }, {}, {
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
+ generateSaveData(): ScreenSave;
22
+ loadSaveData(data: ScreenSave): void;
23
+ }>;
@@ -1,36 +1,40 @@
1
- import { SkillData } from '../config';
2
- export interface SkillState {
3
- id: string;
4
- level: number;
5
- xp: number;
6
- }
7
- export interface SkillsState {
8
- [key: string]: SkillState;
9
- }
10
- export interface SkillCheckState {
11
- happened: boolean;
12
- succeeded: boolean;
13
- hidden: boolean;
14
- }
15
- export interface Skills {
16
- skillChecks: {
17
- [key: string]: SkillCheckState;
18
- };
19
- skills: SkillsState;
20
- }
21
- export declare type SkillsSave = Skills;
22
- export declare const useSkills: import("pinia").StoreDefinition<"skills", Skills, {}, {
23
- setupSkillCheck(skillCheck: SkillCheckState, id: string): void;
24
- passSkillCheck(skillCheckId: string, hide?: boolean): void;
25
- failSkillCheck(skillCheckId: string, hide?: boolean): void;
26
- generateSaveData(): SkillsSave;
27
- getSkillCheck(id: string): SkillCheckState;
28
- createSkillCheckState(): SkillCheckState;
29
- loadSaveData(data: SkillsSave): void;
30
- setupSkills(skills: {
31
- [key: string]: SkillData;
32
- }): void;
33
- addXp(skill: string, xp: number): void;
34
- incrementSkill(skill: string, amount: number): void;
35
- levelledUp(skill: string): void;
36
- }>;
1
+ import { SkillData } from '../config';
2
+ export interface SkillState {
3
+ id: string;
4
+ level: number;
5
+ xp: number;
6
+ }
7
+ export interface SkillsState {
8
+ [key: string]: SkillState;
9
+ }
10
+ export interface SkillCheckState {
11
+ happened: boolean;
12
+ succeeded: boolean;
13
+ hidden: boolean;
14
+ }
15
+ export interface Skills {
16
+ skillChecks: {
17
+ [key: string]: SkillCheckState;
18
+ };
19
+ skills: SkillsState;
20
+ }
21
+ export declare type SkillsSave = Skills;
22
+ export declare const useSkills: import("pinia").StoreDefinition<"skills", Skills, {}, {
23
+ setupSkillCheck(skillCheck: SkillCheckState, id: string): void;
24
+ passSkillCheck(skillCheckId: string, hide?: boolean): void;
25
+ failSkillCheck(skillCheckId: string, hide?: boolean): void;
26
+ generateSaveData(): SkillsSave;
27
+ getSkillCheck(id: string): SkillCheckState;
28
+ createSkillCheckState(): SkillCheckState;
29
+ loadSaveData(data: SkillsSave): void;
30
+ setupSkills(skills: {
31
+ [key: string]: SkillData;
32
+ }): void;
33
+ getSkill(skill: string): SkillState;
34
+ getSkillLevel(skill: string): number;
35
+ getSkillXp(skill: string): number;
36
+ addXp(skill: string, xp: number): void;
37
+ setSkillLevel(skill: string, level: number): void;
38
+ incrementSkill(skill: string, amount: number): void;
39
+ levelledUp(skill: string): void;
40
+ }>;
@@ -1,155 +1,155 @@
1
- import { Parser } from '../types/parser';
2
- export declare type AddFrameOptions = Omit<SetStackOptions, 'label'> & {
3
- label?: string;
4
- };
5
- export interface MachineFrame {
6
- currentIndex: number;
7
- branchData: Parser.ParsedLabel;
8
- label: string;
9
- scope: {
10
- [key: string]: any;
11
- };
12
- onComplete?: (result: any) => void;
13
- returnValue: any;
14
- }
15
- export interface SetStackOptions {
16
- currentIndex: number;
17
- branchData: Parser.ParsedLabel;
18
- label: string;
19
- scope?: {
20
- [key: string]: any;
21
- };
22
- onComplete?: (result: any) => void;
23
- args?: any[];
24
- }
25
- export interface DataState {
26
- [key: string]: any;
27
- }
28
- export interface VMState {
29
- commandsWaitingForPlayerAnswer: Parser.Command<any, any>[];
30
- stack: MachineFrame[];
31
- script: Parser.ParsedScript;
32
- data: DataState;
33
- lastLabel: string;
34
- currentScope: {
35
- [key: string]: any;
36
- };
37
- }
38
- export interface VMSave {
39
- lastLabel: string;
40
- data: DataState;
41
- }
42
- export declare const useVM: import("pinia").StoreDefinition<"vm", VMState, {
43
- currentFrame(state: {
44
- commandsWaitingForPlayerAnswer: {
45
- args: (Parser.Primitive | {
46
- code: string;
47
- command: {
48
- commandType: string;
49
- operator: string;
50
- args: (Parser.Primitive | any)[];
51
- options: Parser.DefaultArg;
52
- staticOptions: {};
53
- };
54
- fileName: string;
55
- line: number;
56
- })[];
57
- commandType: string;
58
- options: any;
59
- code: string;
60
- staticOptions: any;
61
- operator: string;
62
- line: number;
63
- fileName: string;
64
- finishCommand?: ((res: any) => void) | undefined;
65
- }[];
66
- stack: {
67
- currentIndex: number;
68
- branchData: {
69
- branch: {
70
- code: string;
71
- command: {
72
- commandType: string;
73
- operator: string;
74
- args: (Parser.Primitive | any)[];
75
- options: Parser.DefaultArg;
76
- staticOptions: {};
77
- };
78
- fileName: string;
79
- line: number;
80
- }[];
81
- args?: string[] | undefined;
82
- };
83
- label: string;
84
- scope: {
85
- [key: string]: any;
86
- };
87
- onComplete?: ((result: any) => void) | undefined;
88
- returnValue: any;
89
- }[];
90
- script: Parser.ParsedScript;
91
- data: DataState;
92
- lastLabel: string;
93
- currentScope: {
94
- [key: string]: any;
95
- };
96
- } & import("pinia").PiniaCustomStateProperties<VMState>): MachineFrame | undefined;
97
- currentLine(): Parser.ParsedExpression<Parser.DefaultArg, {}> | undefined;
98
- commandWaitingForAnswer(): Parser.Command<any, any> | undefined;
99
- }, {
100
- generateSaveData(): VMSave;
101
- loadSaveData(data: VMSave): void;
102
- resetScope(): void;
103
- setReturnValue(value: any): void;
104
- waitForPlayerAnswer(cmd: Parser.Command<any, any>): void;
105
- popAnswerQueue(): {
106
- args: (Parser.Primitive | {
107
- code: string;
108
- command: {
109
- commandType: string;
110
- operator: string;
111
- args: (Parser.Primitive | any)[];
112
- options: Parser.DefaultArg;
113
- staticOptions: {};
114
- };
115
- fileName: string;
116
- line: number;
117
- })[];
118
- commandType: string;
119
- options: any;
120
- code: string;
121
- staticOptions: any;
122
- operator: string;
123
- line: number;
124
- fileName: string;
125
- finishCommand?: ((res: any) => void) | undefined;
126
- } | undefined;
127
- removeFromScope(vars: string[]): void;
128
- addScopedVariable(key: string, value: any): void;
129
- extendScope(scope: {
130
- [key: string]: any;
131
- }): void;
132
- loadScripts(scriptPaths: string[]): Promise<void>;
133
- start(): void;
134
- setLastLabel(label: string): void;
135
- reset(): void;
136
- setScript(script: Parser.ParsedScript): void;
137
- overrideData(data: DataState): void;
138
- setStack(stack: SetStackOptions): void;
139
- stackOptionsToStack(stack: SetStackOptions): MachineFrame;
140
- setData(path: string, value: any): void;
141
- addInstruction(path: string, value: any): void;
142
- addFrame(newStackOptions: AddFrameOptions): void;
143
- addAndRunFrame(newStackOptions: AddFrameOptions): Promise<void>;
144
- runFrame(): Promise<void>;
145
- runGame(): Promise<void>;
146
- nextLineOnly(): Promise<boolean>;
147
- nextLine(): Promise<any>;
148
- previousFrame(): Promise<any>;
149
- reachedEndOfScript(): void;
150
- runLineOnly(): Promise<void>;
151
- runLine(): Promise<void>;
152
- runLabelFunction(label: string, ...args: any[]): Promise<unknown>;
153
- runCustomFrame(stack: AddFrameOptions): void;
154
- runLabel(label: string, ...args: any[]): void;
155
- }>;
1
+ import { Parser } from '../types/parser';
2
+ export declare type AddFrameOptions = Omit<SetStackOptions, 'label'> & {
3
+ label?: string;
4
+ };
5
+ export interface MachineFrame {
6
+ currentIndex: number;
7
+ branchData: Parser.ParsedLabel;
8
+ label: string;
9
+ scope: {
10
+ [key: string]: any;
11
+ };
12
+ onComplete?: (result: any) => void;
13
+ returnValue: any;
14
+ }
15
+ export interface SetStackOptions {
16
+ currentIndex: number;
17
+ branchData: Parser.ParsedLabel;
18
+ label: string;
19
+ scope?: {
20
+ [key: string]: any;
21
+ };
22
+ onComplete?: (result: any) => void;
23
+ args?: any[];
24
+ }
25
+ export interface DataState {
26
+ [key: string]: any;
27
+ }
28
+ export interface VMState {
29
+ commandsWaitingForPlayerAnswer: Parser.Command<any, any>[];
30
+ stack: MachineFrame[];
31
+ script: Parser.ParsedScript;
32
+ data: DataState;
33
+ lastLabel: string;
34
+ currentScope: {
35
+ [key: string]: any;
36
+ };
37
+ }
38
+ export interface VMSave {
39
+ lastLabel: string;
40
+ data: DataState;
41
+ }
42
+ export declare const useVM: import("pinia").StoreDefinition<"vm", VMState, {
43
+ currentFrame(state: {
44
+ commandsWaitingForPlayerAnswer: {
45
+ args: (Parser.Primitive | {
46
+ code: string;
47
+ command: {
48
+ commandType: string;
49
+ operator: string;
50
+ args: (Parser.Primitive | any)[];
51
+ options: Parser.DefaultArg;
52
+ staticOptions: {};
53
+ };
54
+ fileName: string;
55
+ line: number;
56
+ })[];
57
+ commandType: string;
58
+ options: any;
59
+ code: string;
60
+ staticOptions: any;
61
+ operator: string;
62
+ line: number;
63
+ fileName: string;
64
+ finishCommand?: ((res: any) => void) | undefined;
65
+ }[];
66
+ stack: {
67
+ currentIndex: number;
68
+ branchData: {
69
+ branch: {
70
+ code: string;
71
+ command: {
72
+ commandType: string;
73
+ operator: string;
74
+ args: (Parser.Primitive | any)[];
75
+ options: Parser.DefaultArg;
76
+ staticOptions: {};
77
+ };
78
+ fileName: string;
79
+ line: number;
80
+ }[];
81
+ args?: string[] | undefined;
82
+ };
83
+ label: string;
84
+ scope: {
85
+ [key: string]: any;
86
+ };
87
+ onComplete?: ((result: any) => void) | undefined;
88
+ returnValue: any;
89
+ }[];
90
+ script: Parser.ParsedScript;
91
+ data: DataState;
92
+ lastLabel: string;
93
+ currentScope: {
94
+ [key: string]: any;
95
+ };
96
+ } & import("pinia").PiniaCustomStateProperties<VMState>): MachineFrame | undefined;
97
+ currentLine(): Parser.ParsedExpression<Parser.DefaultArg, {}> | undefined;
98
+ commandWaitingForAnswer(): Parser.Command<any, any> | undefined;
99
+ }, {
100
+ generateSaveData(): VMSave;
101
+ loadSaveData(data: VMSave): void;
102
+ resetScope(): void;
103
+ setReturnValue(value: any): void;
104
+ waitForPlayerAnswer(cmd: Parser.Command<any, any>): void;
105
+ popAnswerQueue(): {
106
+ args: (Parser.Primitive | {
107
+ code: string;
108
+ command: {
109
+ commandType: string;
110
+ operator: string;
111
+ args: (Parser.Primitive | any)[];
112
+ options: Parser.DefaultArg;
113
+ staticOptions: {};
114
+ };
115
+ fileName: string;
116
+ line: number;
117
+ })[];
118
+ commandType: string;
119
+ options: any;
120
+ code: string;
121
+ staticOptions: any;
122
+ operator: string;
123
+ line: number;
124
+ fileName: string;
125
+ finishCommand?: ((res: any) => void) | undefined;
126
+ } | undefined;
127
+ removeFromScope(vars: string[]): void;
128
+ addScopedVariable(key: string, value: any): void;
129
+ extendScope(scope: {
130
+ [key: string]: any;
131
+ }): void;
132
+ loadScripts(scriptPaths: string[]): Promise<void>;
133
+ start(): void;
134
+ setLastLabel(label: string): void;
135
+ reset(): void;
136
+ setScript(script: Parser.ParsedScript): void;
137
+ overrideData(data: DataState): void;
138
+ setStack(stack: SetStackOptions): void;
139
+ stackOptionsToStack(stack: SetStackOptions): MachineFrame;
140
+ setData(path: string, value: any): void;
141
+ addInstruction(path: string, value: any): void;
142
+ addFrame(newStackOptions: AddFrameOptions): void;
143
+ addAndRunFrame(newStackOptions: AddFrameOptions): Promise<void>;
144
+ runFrame(): Promise<void>;
145
+ runGame(): Promise<void>;
146
+ nextLineOnly(): Promise<boolean>;
147
+ nextLine(): Promise<any>;
148
+ previousFrame(): Promise<any>;
149
+ reachedEndOfScript(): void;
150
+ runLineOnly(): Promise<void>;
151
+ runLine(): Promise<void>;
152
+ runLabelFunction(label: string, ...args: any[]): Promise<unknown>;
153
+ runCustomFrame(stack: AddFrameOptions): void;
154
+ runLabel(label: string, ...args: any[]): void;
155
+ }>;