narrat 3.2.2 → 3.2.4

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 (178) hide show
  1. package/dist/app.vue.d.ts +78 -78
  2. package/dist/components/MainMenu.vue.d.ts +4 -4
  3. package/dist/components/SkillsWindow.vue.d.ts +28 -28
  4. package/dist/components/StartMenu.vue.d.ts +2 -2
  5. package/dist/components/achievements/achievement-tile.vue.d.ts +15 -15
  6. package/dist/components/achievements/achievements-section.vue.d.ts +34 -34
  7. package/dist/components/achievements/achievements-ui.vue.d.ts +32 -32
  8. package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +2 -2
  9. package/dist/components/debug/debug-menu.vue.d.ts +53 -53
  10. package/dist/components/dialog-picture.vue.d.ts +11 -11
  11. package/dist/components/engine-splash/engine-splash.vue.d.ts +4 -4
  12. package/dist/components/game-dialog.vue.d.ts +11 -11
  13. package/dist/components/game-splash/game-splash.vue.d.ts +2 -2
  14. package/dist/components/hud.vue.d.ts +20 -20
  15. package/dist/components/in-game.vue.d.ts +2 -2
  16. package/dist/components/inventory/inventory-section.vue.d.ts +34 -34
  17. package/dist/components/inventory/item-details.vue.d.ts +16 -16
  18. package/dist/components/inventory-ui.vue.d.ts +39 -39
  19. package/dist/components/loading-bar.vue.d.ts +10 -10
  20. package/dist/components/menu-buttons.vue.d.ts +2 -2
  21. package/dist/components/notification-toast.vue.d.ts +2 -2
  22. package/dist/components/quests/QuestDetails.vue.d.ts +13 -13
  23. package/dist/components/quests/QuestDisplay.vue.d.ts +13 -13
  24. package/dist/components/quests/quests-list-section.vue.d.ts +50 -50
  25. package/dist/components/quests-ui.vue.d.ts +22 -22
  26. package/dist/components/save-slots.vue.d.ts +16 -16
  27. package/dist/components/saves/save-slot-ui.vue.d.ts +32 -32
  28. package/dist/components/screen-layer.vue.d.ts +28 -28
  29. package/dist/components/screen-objects/screen-object.vue.d.ts +21 -21
  30. package/dist/components/screens.vue.d.ts +2 -2
  31. package/dist/components/settings/setting-widget.vue.d.ts +15 -15
  32. package/dist/components/settings/settings-menu.vue.d.ts +2 -2
  33. package/dist/components/tabs/TabsController.vue.d.ts +28 -28
  34. package/dist/components/tabs/tab-selector.vue.d.ts +29 -29
  35. package/dist/components/tooltips/tooltips-ui.vue.d.ts +2 -2
  36. package/dist/components/transitions/NarratTransition.vue.d.ts +32 -32
  37. package/dist/components/utils/__tests__/alert-modal.spec.d.ts +1 -1
  38. package/dist/components/utils/__tests__/floating-tooltip.spec.d.ts +1 -1
  39. package/dist/components/utils/alert-modal.vue.d.ts +20 -20
  40. package/dist/components/utils/floating-tooltip.vue.d.ts +56 -56
  41. package/dist/components/utils/modal-window.vue.d.ts +18 -18
  42. package/dist/components/utils/yes-no.vue.d.ts +30 -30
  43. package/dist/components/volume-controls.vue.d.ts +18 -18
  44. package/dist/config/achievements-config.d.ts +58 -58
  45. package/dist/config/audio-config.d.ts +58 -58
  46. package/dist/config/buttons-config.d.ts +68 -68
  47. package/dist/config/characters-config.d.ts +36 -38
  48. package/dist/config/common-config.d.ts +81 -81
  49. package/dist/config/config-input.d.ts +286 -288
  50. package/dist/config/config-output.d.ts +280 -282
  51. package/dist/config/items-config.d.ts +71 -71
  52. package/dist/config/layout-config.d.ts +27 -27
  53. package/dist/config/quests-config.d.ts +48 -48
  54. package/dist/config/screens-config.d.ts +133 -133
  55. package/dist/config/settings-config.d.ts +113 -113
  56. package/dist/config/skillchecks-config.d.ts +73 -73
  57. package/dist/config/skills-config.d.ts +51 -51
  58. package/dist/config/tooltips-config.d.ts +16 -16
  59. package/dist/config.d.ts +235 -237
  60. package/dist/constants.d.ts +14 -14
  61. package/dist/demo/demo.d.ts +1 -1
  62. package/dist/dialog-box.vue.d.ts +34 -34
  63. package/dist/examples/default/scripts.d.ts +2 -2
  64. package/dist/examples/demo/scripts.d.ts +2 -2
  65. package/dist/examples/empty/scripts.d.ts +2 -2
  66. package/dist/examples/rpg/scripts.d.ts +2 -2
  67. package/dist/exports/components.d.ts +2 -2
  68. package/dist/exports/config.d.ts +4 -4
  69. package/dist/exports/display.d.ts +2 -2
  70. package/dist/exports/events.d.ts +1 -1
  71. package/dist/exports/inputs.d.ts +1 -1
  72. package/dist/exports/others.d.ts +1 -1
  73. package/dist/exports/plugins.d.ts +69 -69
  74. package/dist/exports/stores.d.ts +17 -17
  75. package/dist/exports/utils.d.ts +12 -12
  76. package/dist/hmr/hmr.d.ts +4 -4
  77. package/dist/hooks/util-hooks.d.ts +1 -1
  78. package/dist/inputs/Inputs.d.ts +96 -96
  79. package/dist/inputs/useNavigation.d.ts +30 -30
  80. package/dist/lib.d.ts +22 -22
  81. package/dist/main.d.ts +9 -9
  82. package/dist/menu-buttons/menu-buttons.d.ts +7 -7
  83. package/dist/narrat.es.js +17212 -16195
  84. package/dist/narrat.es.js.map +1 -1
  85. package/dist/narrat.umd.js +131 -131
  86. package/dist/narrat.umd.js.map +1 -1
  87. package/dist/plugins/NarratPlugin.d.ts +12 -12
  88. package/dist/stores/__tests__/achievements-store.spec.d.ts +1 -1
  89. package/dist/stores/__tests__/notifications-store.spec.d.ts +1 -1
  90. package/dist/stores/achievements-store.d.ts +27 -27
  91. package/dist/stores/audio-store.d.ts +57 -57
  92. package/dist/stores/config-store.d.ts +7 -16
  93. package/dist/stores/dialog-store.d.ts +35 -35
  94. package/dist/stores/gamepad-store.d.ts +11 -11
  95. package/dist/stores/hud-stats-store.d.ts +21 -21
  96. package/dist/stores/inputs-store.d.ts +23 -23
  97. package/dist/stores/inventory-store.d.ts +40 -40
  98. package/dist/stores/main-store.d.ts +2058 -2058
  99. package/dist/stores/menu-store.d.ts +46 -46
  100. package/dist/stores/notification-store.d.ts +22 -22
  101. package/dist/stores/quest-log.d.ts +38 -38
  102. package/dist/stores/rendering-store.d.ts +20 -20
  103. package/dist/stores/screen-objects-store.d.ts +82 -82
  104. package/dist/stores/screens-store.d.ts +36 -36
  105. package/dist/stores/settings-store.d.ts +93 -93
  106. package/dist/stores/skills.d.ts +40 -40
  107. package/dist/stores/start-menu-store.d.ts +7 -7
  108. package/dist/stores/tooltip-store.d.ts +18 -18
  109. package/dist/stores/vm-store.d.ts +189 -189
  110. package/dist/tests/mock-config.d.ts +3 -3
  111. package/dist/tests/tests.setup.d.ts +1 -1
  112. package/dist/types/app-types.d.ts +14 -14
  113. package/dist/types/dialog-box-types.d.ts +11 -11
  114. package/dist/types/game-save.d.ts +51 -51
  115. package/dist/types/parser.d.ts +93 -93
  116. package/dist/types/state.d.ts +3 -3
  117. package/dist/utils/InputsListener.d.ts +9 -9
  118. package/dist/utils/Vector2.d.ts +49 -49
  119. package/dist/utils/ajax.d.ts +2 -2
  120. package/dist/utils/audio-loader.d.ts +10 -10
  121. package/dist/utils/characters.d.ts +4 -4
  122. package/dist/utils/data-helpers.d.ts +50 -50
  123. package/dist/utils/data-helpers.test.d.ts +1 -1
  124. package/dist/utils/debounce.d.ts +14 -14
  125. package/dist/utils/error-handling.d.ts +4 -4
  126. package/dist/utils/gameloop.d.ts +10 -10
  127. package/dist/utils/getWindow.d.ts +1 -1
  128. package/dist/utils/helpers.d.ts +6 -6
  129. package/dist/utils/images-loader.d.ts +7 -7
  130. package/dist/utils/logger.d.ts +11 -11
  131. package/dist/utils/object-iterators.d.ts +9 -9
  132. package/dist/utils/promises.d.ts +1 -1
  133. package/dist/utils/randomId.d.ts +1 -1
  134. package/dist/utils/save-helpers.d.ts +18 -18
  135. package/dist/utils/skillchecks.d.ts +26 -26
  136. package/dist/utils/skillchecks.test.d.ts +1 -1
  137. package/dist/utils/string-helpers.d.ts +5 -5
  138. package/dist/utils/time-helpers.d.ts +2 -2
  139. package/dist/utils/tooltip-utils.d.ts +2 -2
  140. package/dist/utils/transition.d.ts +21 -21
  141. package/dist/utils/type-utils.d.ts +2 -2
  142. package/dist/utils/typed-emitter.d.ts +18 -18
  143. package/dist/utils/viewport-utils.d.ts +3 -3
  144. package/dist/utils/vue-directives.d.ts +2 -2
  145. package/dist/vm/commands/achievements-commands.d.ts +6 -6
  146. package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
  147. package/dist/vm/commands/array-commands.d.ts +42 -42
  148. package/dist/vm/commands/audio-commands.d.ts +19 -19
  149. package/dist/vm/commands/choice.d.ts +35 -35
  150. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  151. package/dist/vm/commands/command-helpers.d.ts +3 -3
  152. package/dist/vm/commands/command-plugin.d.ts +43 -43
  153. package/dist/vm/commands/flow-commands.d.ts +28 -28
  154. package/dist/vm/commands/if.d.ts +15 -15
  155. package/dist/vm/commands/index.d.ts +2 -2
  156. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  157. package/dist/vm/commands/logic-command.d.ts +42 -42
  158. package/dist/vm/commands/math-commands.d.ts +30 -30
  159. package/dist/vm/commands/notify.d.ts +8 -8
  160. package/dist/vm/commands/quest-commands.d.ts +30 -30
  161. package/dist/vm/commands/random-commands.d.ts +13 -13
  162. package/dist/vm/commands/screen-commands.d.ts +18 -18
  163. package/dist/vm/commands/set.d.ts +6 -6
  164. package/dist/vm/commands/settings-commands.d.ts +8 -8
  165. package/dist/vm/commands/skill-commands.d.ts +39 -39
  166. package/dist/vm/commands/sprite-commands.d.ts +19 -19
  167. package/dist/vm/commands/stats-commands.d.ts +12 -12
  168. package/dist/vm/commands/string-commands.d.ts +9 -9
  169. package/dist/vm/commands/text-field.d.ts +7 -7
  170. package/dist/vm/commands/text.d.ts +14 -14
  171. package/dist/vm/commands/time-commands.d.ts +16 -16
  172. package/dist/vm/commands/util-commands.d.ts +4 -10
  173. package/dist/vm/commands/wait.d.ts +4 -4
  174. package/dist/vm/vm-helpers.d.ts +20 -20
  175. package/dist/vm/vm-parser.d.ts +22 -22
  176. package/dist/vm/vm-parser.test.d.ts +1 -1
  177. package/dist/vm/vm.d.ts +26 -26
  178. package/package.json +1 -1
@@ -1,26 +1,26 @@
1
- import { SkillCheckParams } from '../vm/vm-helpers';
2
- import { SkillCheckOptionsConfig } from '../config/skillchecks-config';
3
- export type Roll = {
4
- unmodified: number;
5
- modified: number;
6
- };
7
- export type DiceRoll = Roll[];
8
- export declare function getSkillCheckDifficultyScore(value: number, level: number): number;
9
- export declare function getSkillCheckDifficultyText(value: number, level: number): string;
10
- export declare function getSkillCheckText({ skill, skillCheckId, value, }: {
11
- skill: string;
12
- skillCheckId: string;
13
- value: number;
14
- }): {
15
- difficultyText: string;
16
- allowed: boolean;
17
- };
18
- export declare function getPassiveSkillCheckText(success: boolean, params: SkillCheckParams): string;
19
- export declare function calculateSkillCheckRoll(skill: string): {
20
- roll: number;
21
- rolls: DiceRoll;
22
- };
23
- export declare function rollAllDice(options: SkillCheckOptionsConfig, skill: string): DiceRoll;
24
- export declare function rollDice(diceRange: [number, number]): number;
25
- export declare function resolveSkillCheck(params: SkillCheckParams): boolean;
26
- export declare function checkIfRollSucceeded(roll: number, value: number): boolean;
1
+ import { SkillCheckParams } from '../vm/vm-helpers';
2
+ import { SkillCheckOptionsConfig } from '../config/skillchecks-config';
3
+ export type Roll = {
4
+ unmodified: number;
5
+ modified: number;
6
+ };
7
+ export type DiceRoll = Roll[];
8
+ export declare function getSkillCheckDifficultyScore(value: number, level: number): number;
9
+ export declare function getSkillCheckDifficultyText(value: number, level: number): string;
10
+ export declare function getSkillCheckText({ skill, skillCheckId, value, }: {
11
+ skill: string;
12
+ skillCheckId: string;
13
+ value: number;
14
+ }): {
15
+ difficultyText: string;
16
+ allowed: boolean;
17
+ };
18
+ export declare function getPassiveSkillCheckText(success: boolean, params: SkillCheckParams): string;
19
+ export declare function calculateSkillCheckRoll(skill: string): {
20
+ roll: number;
21
+ rolls: DiceRoll;
22
+ };
23
+ export declare function rollAllDice(options: SkillCheckOptionsConfig, skill: string): DiceRoll;
24
+ export declare function rollDice(diceRange: [number, number]): number;
25
+ export declare function resolveSkillCheck(params: SkillCheckParams): boolean;
26
+ export declare function checkIfRollSucceeded(roll: number, value: number): boolean;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,5 +1,5 @@
1
- export declare function processText(text: string): string;
2
- export declare function findVariable(text: string): any;
3
- export declare const stringRegex: RegExp;
4
- export declare const isParsedTokenString: (arg: any) => boolean;
5
- export declare function findAllHtmlTags(txt: string): RegExpExecArray[];
1
+ export declare function processText(text: string): string;
2
+ export declare function findVariable(text: string): any;
3
+ export declare const stringRegex: RegExp;
4
+ export declare const isParsedTokenString: (arg: any) => boolean;
5
+ export declare function findAllHtmlTags(txt: string): RegExpExecArray[];
@@ -1,2 +1,2 @@
1
- export declare function getPlayTime(startedAt: number, previousTime: number): number;
2
- export declare function toHHMMSS(time: number | string): string;
1
+ export declare function getPlayTime(startedAt: number, previousTime: number): number;
2
+ export declare function toHHMMSS(time: number | string): string;
@@ -1,2 +1,2 @@
1
- export declare function processTooltipsInText(text: string): string;
2
- export declare function addTooltipToKeyword(_: string, $1: string): string;
1
+ export declare function processTooltipsInText(text: string): string;
2
+ export declare function addTooltipToKeyword(_: string, $1: string): string;
@@ -1,21 +1,21 @@
1
- export interface TransitionState extends AddTransition {
2
- oldScreen?: string | null;
3
- duration: number;
4
- resolve: () => void;
5
- }
6
- export type TransitionMode = 'screen' | 'button';
7
- export declare function isTransitionMode(mode: any): mode is TransitionMode;
8
- export interface TransitionSettings {
9
- delay?: number;
10
- duration?: number;
11
- }
12
- export declare const transitionSettings: {
13
- [key: string]: TransitionSettings;
14
- };
15
- export declare function getTransitionSettings(name: string): TransitionSettings;
16
- export declare function generateTransitionState(transition: AddTransition, oldScreen: string | null, resolve: () => void): TransitionState;
17
- export type AddTransition = {
18
- transition: string;
19
- duration?: number;
20
- delay?: number;
21
- };
1
+ export interface TransitionState extends AddTransition {
2
+ oldScreen?: string | null;
3
+ duration: number;
4
+ resolve: () => void;
5
+ }
6
+ export type TransitionMode = 'screen' | 'button';
7
+ export declare function isTransitionMode(mode: any): mode is TransitionMode;
8
+ export interface TransitionSettings {
9
+ delay?: number;
10
+ duration?: number;
11
+ }
12
+ export declare const transitionSettings: {
13
+ [key: string]: TransitionSettings;
14
+ };
15
+ export declare function getTransitionSettings(name: string): TransitionSettings;
16
+ export declare function generateTransitionState(transition: AddTransition, oldScreen: string | null, resolve: () => void): TransitionState;
17
+ export type AddTransition = {
18
+ transition: string;
19
+ duration?: number;
20
+ delay?: number;
21
+ };
@@ -1,2 +1,2 @@
1
- export declare const generateObjectFromList: <T extends readonly string[]>(list: T) => { [K in T[number]]: K; };
2
- export declare const isPromise: <T>(value: any) => value is Promise<T>;
1
+ export declare const generateObjectFromList: <T extends readonly string[]>(list: T) => { [K in T[number]]: K; };
2
+ export declare const isPromise: <T>(value: any) => value is Promise<T>;
@@ -1,18 +1,18 @@
1
- export interface InputEvents {
2
- keydown: (event: KeyboardEvent) => void;
3
- }
4
- export type EventsList<List> = {
5
- [key in keyof List]: (...args: any[]) => void;
6
- };
7
- export type EventsMap<List extends EventsList<List>> = {
8
- [key in keyof List]: Set<List[key]>;
9
- };
10
- export declare class TypedEmitter<List extends EventsList<List>> {
11
- listeners: EventsMap<List>;
12
- on<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
13
- off<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
14
- once<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
15
- emit<Event extends keyof List>(event: Event, ...args: any[]): void;
16
- clear(): void;
17
- private addEventToMap;
18
- }
1
+ export interface InputEvents {
2
+ keydown: (event: KeyboardEvent) => void;
3
+ }
4
+ export type EventsList<List> = {
5
+ [key in keyof List]: (...args: any[]) => void;
6
+ };
7
+ export type EventsMap<List extends EventsList<List>> = {
8
+ [key in keyof List]: Set<List[key]>;
9
+ };
10
+ export declare class TypedEmitter<List extends EventsList<List>> {
11
+ listeners: EventsMap<List>;
12
+ on<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
13
+ off<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
14
+ once<Event extends keyof List>(event: Event, listener: List[Event]): List[Event];
15
+ emit<Event extends keyof List>(event: Event, ...args: any[]): void;
16
+ clear(): void;
17
+ private addEventToMap;
18
+ }
@@ -1,3 +1,3 @@
1
- import { ButtonConfig } from '../config/buttons-config';
2
- import { ScreenObjectState } from '../stores/screen-objects-store';
3
- export declare function isViewportElementClickable(conf: ButtonConfig | ScreenObjectState): boolean | undefined;
1
+ import { ButtonConfig } from '../config/buttons-config';
2
+ import { ScreenObjectState } from '../stores/screen-objects-store';
3
+ export declare function isViewportElementClickable(conf: ButtonConfig | ScreenObjectState): boolean | undefined;
@@ -1,2 +1,2 @@
1
- import { App } from 'vue';
2
- export declare function addDirectives(vue: App): void;
1
+ import { App } from 'vue';
2
+ export declare function addDirectives(vue: App): void;
@@ -1,6 +1,6 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export type AchievementIdArg = {
3
- id: string;
4
- };
5
- export declare const unlockAchievement: CommandPlugin<AchievementIdArg, {}>;
6
- export declare const hasAchievementPlugin: CommandPlugin<AchievementIdArg, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export type AchievementIdArg = {
3
+ id: string;
4
+ };
5
+ export declare const unlockAchievement: CommandPlugin<AchievementIdArg, {}>;
6
+ export declare const hasAchievementPlugin: CommandPlugin<AchievementIdArg, {}>;
@@ -1,23 +1,23 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const additionPlugin: CommandPlugin<{
3
- a: number;
4
- b: number;
5
- }, {}>;
6
- export declare const substractionPlugin: CommandPlugin<{
7
- a: number;
8
- b: number;
9
- }, {}>;
10
- export declare const negPlugin: CommandPlugin<{
11
- a: number;
12
- }, {}>;
13
- export declare const absPlugin: CommandPlugin<{
14
- a: number;
15
- }, {}>;
16
- export declare const multiplicationPlugin: CommandPlugin<{
17
- a: number;
18
- b: number;
19
- }, {}>;
20
- export declare const divisionPlugin: CommandPlugin<{
21
- a: number;
22
- b: number;
23
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const additionPlugin: CommandPlugin<{
3
+ a: number;
4
+ b: number;
5
+ }, {}>;
6
+ export declare const substractionPlugin: CommandPlugin<{
7
+ a: number;
8
+ b: number;
9
+ }, {}>;
10
+ export declare const negPlugin: CommandPlugin<{
11
+ a: number;
12
+ }, {}>;
13
+ export declare const absPlugin: CommandPlugin<{
14
+ a: number;
15
+ }, {}>;
16
+ export declare const multiplicationPlugin: CommandPlugin<{
17
+ a: number;
18
+ b: number;
19
+ }, {}>;
20
+ export declare const divisionPlugin: CommandPlugin<{
21
+ a: number;
22
+ b: number;
23
+ }, {}>;
@@ -1,42 +1,42 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const shuffleCommand: CommandPlugin<{
3
- array: any[];
4
- }, {}>;
5
- export declare const pushCommand: CommandPlugin<{
6
- array: any[];
7
- value: any;
8
- }, {}>;
9
- export declare const popCommand: CommandPlugin<{
10
- array: any[];
11
- }, {}>;
12
- export declare const shiftCommand: CommandPlugin<{
13
- array: any[];
14
- }, {}>;
15
- export declare const joinCommand: CommandPlugin<{
16
- array: any[];
17
- separator?: string | undefined;
18
- }, {}>;
19
- export declare const concatCommand: CommandPlugin<{
20
- array: any[];
21
- }, {}>;
22
- export declare const includesCommand: CommandPlugin<{
23
- array: any[];
24
- searchElement: any;
25
- }, {}>;
26
- export declare const reverseCommand: CommandPlugin<{
27
- array: any[];
28
- }, {}>;
29
- export declare const sliceCommand: CommandPlugin<{
30
- array: any[];
31
- start: number;
32
- end?: number | undefined;
33
- }, {}>;
34
- export declare const spliceCommand: CommandPlugin<{
35
- array: any[];
36
- start: number;
37
- end?: number | undefined;
38
- }, {}>;
39
- export declare const arrayFindIndexCommand: CommandPlugin<{
40
- array: any[];
41
- predicateLabel: string;
42
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const shuffleCommand: CommandPlugin<{
3
+ array: any[];
4
+ }, {}>;
5
+ export declare const pushCommand: CommandPlugin<{
6
+ array: any[];
7
+ value: any;
8
+ }, {}>;
9
+ export declare const popCommand: CommandPlugin<{
10
+ array: any[];
11
+ }, {}>;
12
+ export declare const shiftCommand: CommandPlugin<{
13
+ array: any[];
14
+ }, {}>;
15
+ export declare const joinCommand: CommandPlugin<{
16
+ array: any[];
17
+ separator?: string | undefined;
18
+ }, {}>;
19
+ export declare const concatCommand: CommandPlugin<{
20
+ array: any[];
21
+ }, {}>;
22
+ export declare const includesCommand: CommandPlugin<{
23
+ array: any[];
24
+ searchElement: any;
25
+ }, {}>;
26
+ export declare const reverseCommand: CommandPlugin<{
27
+ array: any[];
28
+ }, {}>;
29
+ export declare const sliceCommand: CommandPlugin<{
30
+ array: any[];
31
+ start: number;
32
+ end?: number | undefined;
33
+ }, {}>;
34
+ export declare const spliceCommand: CommandPlugin<{
35
+ array: any[];
36
+ start: number;
37
+ end?: number | undefined;
38
+ }, {}>;
39
+ export declare const arrayFindIndexCommand: CommandPlugin<{
40
+ array: any[];
41
+ predicateLabel: string;
42
+ }, {}>;
@@ -1,19 +1,19 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export interface PlayCommandArgs {
3
- mode: string;
4
- audio: string;
5
- channel?: number;
6
- }
7
- export declare const playCommand: CommandPlugin<PlayCommandArgs, {}>;
8
- export declare const resumeCommand: CommandPlugin<{
9
- mode: string;
10
- channel?: number | undefined;
11
- }, {}>;
12
- export declare const pauseCommand: CommandPlugin<{
13
- mode: string;
14
- channel?: number | undefined;
15
- }, {}>;
16
- export declare const stopCommand: CommandPlugin<{
17
- mode: string;
18
- channel?: number | undefined;
19
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export interface PlayCommandArgs {
3
+ mode: string;
4
+ audio: string;
5
+ channel?: number;
6
+ }
7
+ export declare const playCommand: CommandPlugin<PlayCommandArgs, {}>;
8
+ export declare const resumeCommand: CommandPlugin<{
9
+ mode: string;
10
+ channel?: number | undefined;
11
+ }, {}>;
12
+ export declare const pauseCommand: CommandPlugin<{
13
+ mode: string;
14
+ channel?: number | undefined;
15
+ }, {}>;
16
+ export declare const stopCommand: CommandPlugin<{
17
+ mode: string;
18
+ channel?: number | undefined;
19
+ }, {}>;
@@ -1,35 +1,35 @@
1
- import { SkillCheckParams } from '../../vm/vm-helpers';
2
- import { CommandParserFunction, CommandParsingContext, CommandPlugin, CommandRunner } from './command-plugin';
3
- import { Parser } from '../../types/parser';
4
- export declare const runChoice: CommandRunner<ChoiceOptions, StaticChoiceOptions>;
5
- export declare function parseChoiceOption(ctx: CommandParsingContext, choice: Parser.Line): BranchingChoiceInfo;
6
- export interface BranchingChoiceInfo {
7
- prompt: Parser.ParsedExpression;
8
- branch?: Parser.Branch;
9
- skillBranches?: {
10
- success: Parser.Branch;
11
- failure: Parser.Branch;
12
- };
13
- }
14
- export interface StaticChoiceOptions {
15
- choices: BranchingChoiceInfo[];
16
- prompt: Parser.ParsedExpression;
17
- }
18
- export interface ChoiceOptions {
19
- }
20
- export declare const choiceParser: CommandParserFunction<ChoiceOptions, StaticChoiceOptions>;
21
- export declare const choicePlugin: CommandPlugin<ChoiceOptions, StaticChoiceOptions>;
22
- export interface ChoicePromptOptions {
23
- promptText: string;
24
- condition: boolean;
25
- }
26
- export interface ChoicePromptReturnValue {
27
- text: string | null;
28
- skillCheck?: {
29
- allowed?: boolean;
30
- options: SkillCheckParams;
31
- };
32
- }
33
- export type ChoicePromptReturn = ChoicePromptReturnValue;
34
- /** Custom "fake" instruction generated on choice prompts to process their optional conditions */
35
- export declare const choicePromptCommandPlugin: CommandPlugin<ChoicePromptOptions, {}>;
1
+ import { SkillCheckParams } from '../../vm/vm-helpers';
2
+ import { CommandParserFunction, CommandParsingContext, CommandPlugin, CommandRunner } from './command-plugin';
3
+ import { Parser } from '../../types/parser';
4
+ export declare const runChoice: CommandRunner<ChoiceOptions, StaticChoiceOptions>;
5
+ export declare function parseChoiceOption(ctx: CommandParsingContext, choice: Parser.Line): BranchingChoiceInfo;
6
+ export interface BranchingChoiceInfo {
7
+ prompt: Parser.ParsedExpression;
8
+ branch?: Parser.Branch;
9
+ skillBranches?: {
10
+ success: Parser.Branch;
11
+ failure: Parser.Branch;
12
+ };
13
+ }
14
+ export interface StaticChoiceOptions {
15
+ choices: BranchingChoiceInfo[];
16
+ prompt: Parser.ParsedExpression;
17
+ }
18
+ export interface ChoiceOptions {
19
+ }
20
+ export declare const choiceParser: CommandParserFunction<ChoiceOptions, StaticChoiceOptions>;
21
+ export declare const choicePlugin: CommandPlugin<ChoiceOptions, StaticChoiceOptions>;
22
+ export interface ChoicePromptOptions {
23
+ promptText: string;
24
+ condition: boolean;
25
+ }
26
+ export interface ChoicePromptReturnValue {
27
+ text: string | null;
28
+ skillCheck?: {
29
+ allowed?: boolean;
30
+ options: SkillCheckParams;
31
+ };
32
+ }
33
+ export type ChoicePromptReturn = ChoicePromptReturnValue;
34
+ /** Custom "fake" instruction generated on choice prompts to process their optional conditions */
35
+ export declare const choicePromptCommandPlugin: CommandPlugin<ChoicePromptOptions, {}>;
@@ -1,2 +1,2 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const clearDialogPlugin: CommandPlugin<{}, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const clearDialogPlugin: CommandPlugin<{}, {}>;
@@ -1,3 +1,3 @@
1
- import { Parser } from '../../types/parser';
2
- export declare function commandRuntimeError(cmd: Parser.Command<any, any>, errorText: string): void;
3
- export declare function commandLog(cmd: Parser.Command<any, any>, ...log: any[]): void;
1
+ import { Parser } from '../../types/parser';
2
+ export declare function commandRuntimeError(cmd: Parser.Command<any, any>, errorText: string): void;
3
+ export declare function commandLog(cmd: Parser.Command<any, any>, ...log: any[]): void;
@@ -1,43 +1,43 @@
1
- import { Parser } from '../../types/parser';
2
- import { ParserContext } from '../vm-parser';
3
- import { DialogChoice } from '../../stores/dialog-store';
4
- export type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
5
- export type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
6
- newLine: number;
7
- };
8
- export type ProcessCommandsFunction = (ctx: ParserContext, lines: Parser.Line[], parentLine: Parser.Line | undefined) => Parser.Branch;
9
- export interface CommandParsingContext {
10
- parserContext: ParserContext;
11
- processCommandsFunction: ProcessCommandsFunction;
12
- line: Parser.Line;
13
- lines: Parser.Line[];
14
- currentLine: number;
15
- }
16
- export type OnPlayerAnswered<Options, StaticOptions> = (cmd: Parser.Command<Options, StaticOptions>, choice: number | string) => Promise<any>;
17
- export interface CommandPluginOptions<Options, StaticOptions = {}> {
18
- keyword: string;
19
- argTypes: ArgTypes;
20
- runner: CommandRunner<Options, StaticOptions>;
21
- parser?: CommandParserFunction<Options, StaticOptions>;
22
- onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
23
- returnAfterPlayerAnswer?: boolean;
24
- }
25
- export declare class CommandPlugin<Options, StaticOptions = {}> {
26
- keyword: string;
27
- runner: CommandRunner<Options, StaticOptions>;
28
- argTypes: ArgTypes;
29
- parser: CommandParserFunction<Options, StaticOptions>;
30
- onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
31
- returnAfterPlayerAnswer: boolean;
32
- constructor(keyword: string, argTypes: ArgTypes, runner: CommandRunner<Options, StaticOptions>, parser?: CommandParserFunction<Options, StaticOptions>);
33
- run(cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]): Promise<any>;
34
- processPlayerAnswer(cmd: Parser.Command<Options, StaticOptions>, choice: number | string): Promise<any>;
35
- static FromOptions<Options, StaticOptions = {}>(options: CommandPluginOptions<Options, StaticOptions>): CommandPlugin<Options, StaticOptions>;
36
- }
37
- export type ArgTypes = ArgumentDescription[] | 'any';
38
- export interface ArgumentDescription {
39
- name: string;
40
- type: 'string' | 'number' | 'boolean' | 'any' | 'rest';
41
- optional?: boolean;
42
- }
43
- export declare function generateParser<Options, StaticOptions = {}>(keyword: string, argTypes: ArgTypes): CommandParserFunction<Options, StaticOptions>;
1
+ import { Parser } from '../../types/parser';
2
+ import { ParserContext } from '../vm-parser';
3
+ import { DialogChoice } from '../../stores/dialog-store';
4
+ export type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
5
+ export type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
6
+ newLine: number;
7
+ };
8
+ export type ProcessCommandsFunction = (ctx: ParserContext, lines: Parser.Line[], parentLine: Parser.Line | undefined) => Parser.Branch;
9
+ export interface CommandParsingContext {
10
+ parserContext: ParserContext;
11
+ processCommandsFunction: ProcessCommandsFunction;
12
+ line: Parser.Line;
13
+ lines: Parser.Line[];
14
+ currentLine: number;
15
+ }
16
+ export type OnPlayerAnswered<Options, StaticOptions> = (cmd: Parser.Command<Options, StaticOptions>, choice: number | string) => Promise<any>;
17
+ export interface CommandPluginOptions<Options, StaticOptions = {}> {
18
+ keyword: string;
19
+ argTypes: ArgTypes;
20
+ runner: CommandRunner<Options, StaticOptions>;
21
+ parser?: CommandParserFunction<Options, StaticOptions>;
22
+ onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
23
+ returnAfterPlayerAnswer?: boolean;
24
+ }
25
+ export declare class CommandPlugin<Options, StaticOptions = {}> {
26
+ keyword: string;
27
+ runner: CommandRunner<Options, StaticOptions>;
28
+ argTypes: ArgTypes;
29
+ parser: CommandParserFunction<Options, StaticOptions>;
30
+ onPlayerAnswered?: OnPlayerAnswered<Options, StaticOptions>;
31
+ returnAfterPlayerAnswer: boolean;
32
+ constructor(keyword: string, argTypes: ArgTypes, runner: CommandRunner<Options, StaticOptions>, parser?: CommandParserFunction<Options, StaticOptions>);
33
+ run(cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]): Promise<any>;
34
+ processPlayerAnswer(cmd: Parser.Command<Options, StaticOptions>, choice: number | string): Promise<any>;
35
+ static FromOptions<Options, StaticOptions = {}>(options: CommandPluginOptions<Options, StaticOptions>): CommandPlugin<Options, StaticOptions>;
36
+ }
37
+ export type ArgTypes = ArgumentDescription[] | 'any';
38
+ export interface ArgumentDescription {
39
+ name: string;
40
+ type: 'string' | 'number' | 'boolean' | 'any' | 'rest';
41
+ optional?: boolean;
42
+ }
43
+ export declare function generateParser<Options, StaticOptions = {}>(keyword: string, argTypes: ArgTypes): CommandParserFunction<Options, StaticOptions>;
@@ -1,28 +1,28 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const jumpCommand: CommandPlugin<{
3
- label: string;
4
- }, {}>;
5
- export declare const runLabelPlugin: CommandPlugin<{
6
- label: string;
7
- }, {}>;
8
- export declare const defineVariablePlugin: CommandPlugin<{
9
- name: string;
10
- value: any;
11
- }, {}>;
12
- export declare const returnPlugin: CommandPlugin<{
13
- value: any;
14
- }, {}>;
15
- export declare const logPlugin: CommandPlugin<{
16
- value: any;
17
- }, {}>;
18
- export declare const returnMainMenuPlugin: CommandPlugin<{}, {}>;
19
- export declare const savePlugin: CommandPlugin<{
20
- name?: string | undefined;
21
- }, {}>;
22
- export declare const savePromptPlugin: CommandPlugin<{
23
- name?: string | undefined;
24
- }, {}>;
25
- export declare const resetGlobalPlugin: CommandPlugin<{}, {}>;
26
- export declare const newCommandPlugin: CommandPlugin<{
27
- name?: string | undefined;
28
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const jumpCommand: CommandPlugin<{
3
+ label: string;
4
+ }, {}>;
5
+ export declare const runLabelPlugin: CommandPlugin<{
6
+ label: string;
7
+ }, {}>;
8
+ export declare const defineVariablePlugin: CommandPlugin<{
9
+ name: string;
10
+ value: any;
11
+ }, {}>;
12
+ export declare const returnPlugin: CommandPlugin<{
13
+ value: any;
14
+ }, {}>;
15
+ export declare const logPlugin: CommandPlugin<{
16
+ value: any;
17
+ }, {}>;
18
+ export declare const returnMainMenuPlugin: CommandPlugin<{}, {}>;
19
+ export declare const savePlugin: CommandPlugin<{
20
+ name?: string | undefined;
21
+ }, {}>;
22
+ export declare const savePromptPlugin: CommandPlugin<{
23
+ name?: string | undefined;
24
+ }, {}>;
25
+ export declare const resetGlobalPlugin: CommandPlugin<{}, {}>;
26
+ export declare const newCommandPlugin: CommandPlugin<{
27
+ name?: string | undefined;
28
+ }, {}>;
@@ -1,15 +1,15 @@
1
- import { CommandPlugin } from './command-plugin';
2
- import { Parser } from '../../types/parser';
3
- export interface IfOptions {
4
- condition: boolean;
5
- }
6
- export interface ElseIfOptions {
7
- branch: Parser.Branch;
8
- condition: Parser.ParsedExpression;
9
- }
10
- export interface IfStaticOptions {
11
- success: Parser.Branch;
12
- elseifs: ElseIfOptions[];
13
- failure?: Parser.Branch;
14
- }
15
- export declare const ifCommand: CommandPlugin<IfOptions, IfStaticOptions>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ import { Parser } from '../../types/parser';
3
+ export interface IfOptions {
4
+ condition: boolean;
5
+ }
6
+ export interface ElseIfOptions {
7
+ branch: Parser.Branch;
8
+ condition: Parser.ParsedExpression;
9
+ }
10
+ export interface IfStaticOptions {
11
+ success: Parser.Branch;
12
+ elseifs: ElseIfOptions[];
13
+ failure?: Parser.Branch;
14
+ }
15
+ export declare const ifCommand: CommandPlugin<IfOptions, IfStaticOptions>;
@@ -1,2 +1,2 @@
1
- import { VM } from '../vm';
2
- export declare function registerBaseCommands(vm: VM): void;
1
+ import { VM } from '../vm';
2
+ export declare function registerBaseCommands(vm: VM): void;