narrat 2.9.3 → 2.10.1

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 (152) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +136 -128
  3. package/dist/app.vue.d.ts +78 -78
  4. package/dist/components/MainMenu.vue.d.ts +7 -7
  5. package/dist/components/SkillsWindow.vue.d.ts +28 -28
  6. package/dist/components/StartMenu.vue.d.ts +46 -46
  7. package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +46 -46
  8. package/dist/components/debug/debug-menu.vue.d.ts +51 -51
  9. package/dist/components/dialog-picture.vue.d.ts +11 -11
  10. package/dist/components/engine-splash/engine-splash.vue.d.ts +54 -54
  11. package/dist/components/game-dialog.vue.d.ts +65 -65
  12. package/dist/components/game-splash/game-splash.vue.d.ts +46 -46
  13. package/dist/components/hud.vue.d.ts +20 -20
  14. package/dist/components/in-game.vue.d.ts +46 -46
  15. package/dist/components/inventory/inventory-section.vue.d.ts +61 -61
  16. package/dist/components/inventory/item-details.vue.d.ts +76 -76
  17. package/dist/components/inventory-ui.vue.d.ts +39 -39
  18. package/dist/components/loading-bar.vue.d.ts +10 -10
  19. package/dist/components/menu-buttons.vue.d.ts +46 -46
  20. package/dist/components/notification-toast.vue.d.ts +6 -6
  21. package/dist/components/quests/QuestDetails.vue.d.ts +64 -64
  22. package/dist/components/quests/QuestDisplay.vue.d.ts +64 -64
  23. package/dist/components/quests/quests-list-section.vue.d.ts +75 -75
  24. package/dist/components/quests-ui.vue.d.ts +22 -22
  25. package/dist/components/save-slots.vue.d.ts +79 -79
  26. package/dist/components/saves/save-slot-ui.vue.d.ts +108 -108
  27. package/dist/components/screen-layer.vue.d.ts +76 -76
  28. package/dist/components/screen-objects/screen-object.vue.d.ts +68 -0
  29. package/dist/components/screens.vue.d.ts +46 -46
  30. package/dist/components/tabs/TabsController.vue.d.ts +72 -72
  31. package/dist/components/tabs/tab-selector.vue.d.ts +82 -82
  32. package/dist/components/tooltips/tooltips-ui.vue.d.ts +46 -46
  33. package/dist/components/transitions/NarratTransition.vue.d.ts +97 -97
  34. package/dist/components/utils/alert-modal.vue.d.ts +82 -82
  35. package/dist/components/utils/floating-tooltip.vue.d.ts +62 -62
  36. package/dist/components/utils/modal-window.vue.d.ts +18 -18
  37. package/dist/components/utils/yes-no.vue.d.ts +106 -106
  38. package/dist/components/volume-controls.vue.d.ts +18 -18
  39. package/dist/config/audio-config.d.ts +58 -58
  40. package/dist/config/buttons-config.d.ts +68 -64
  41. package/dist/config/characters-config.d.ts +36 -0
  42. package/dist/config/common-config.d.ts +80 -80
  43. package/dist/config/config-input.d.ts +231 -213
  44. package/dist/config/config-output.d.ts +232 -212
  45. package/dist/config/items-config.d.ts +71 -71
  46. package/dist/config/layout-config.d.ts +26 -26
  47. package/dist/config/quests-config.d.ts +48 -48
  48. package/dist/config/screens-config.d.ts +133 -128
  49. package/dist/config/skills-config.d.ts +70 -70
  50. package/dist/config/tooltips-config.d.ts +15 -15
  51. package/dist/config.d.ts +182 -164
  52. package/dist/constants.d.ts +12 -12
  53. package/dist/demo/demo.d.ts +1 -1
  54. package/dist/dialog-box.vue.d.ts +71 -71
  55. package/dist/exports/components.d.ts +2 -2
  56. package/dist/exports/config.d.ts +1 -1
  57. package/dist/exports/display.d.ts +2 -2
  58. package/dist/exports/events.d.ts +1 -1
  59. package/dist/exports/others.d.ts +1 -1
  60. package/dist/exports/plugins.d.ts +47 -38
  61. package/dist/exports/stores.d.ts +11 -11
  62. package/dist/favicon.svg +30 -30
  63. package/dist/gamepad/gamepad.d.ts +1 -1
  64. package/dist/hooks/util-hooks.d.ts +1 -0
  65. package/dist/lib.d.ts +18 -18
  66. package/dist/main.d.ts +6 -6
  67. package/dist/menu-buttons/menu-buttons.d.ts +7 -7
  68. package/dist/narrat.es.js +15682 -15571
  69. package/dist/narrat.es.js.map +1 -1
  70. package/dist/narrat.umd.js +119 -119
  71. package/dist/narrat.umd.js.map +1 -1
  72. package/dist/plugins/NarratPlugin.d.ts +11 -11
  73. package/dist/stores/audio-store.d.ts +56 -56
  74. package/dist/stores/config-store.d.ts +6 -6
  75. package/dist/stores/dialog-store.d.ts +35 -35
  76. package/dist/stores/hud-stats-store.d.ts +20 -20
  77. package/dist/stores/inventory-store.d.ts +49 -49
  78. package/dist/stores/main-store.d.ts +1627 -1797
  79. package/dist/stores/menu-store.d.ts +45 -45
  80. package/dist/stores/notification-store.d.ts +15 -15
  81. package/dist/stores/quest-log.d.ts +37 -37
  82. package/dist/stores/rendering-store.d.ts +20 -19
  83. package/dist/stores/screen-objects-store.d.ts +67 -0
  84. package/dist/stores/screens-store.d.ts +34 -33
  85. package/dist/stores/skills.d.ts +39 -39
  86. package/dist/stores/tooltip-store.d.ts +18 -18
  87. package/dist/stores/vm-store.d.ts +181 -181
  88. package/dist/style.css +1 -1
  89. package/dist/types/app-types.d.ts +8 -9
  90. package/dist/types/dialog-box-types.d.ts +11 -11
  91. package/dist/types/game-save.d.ts +40 -40
  92. package/dist/types/parser.d.ts +93 -93
  93. package/dist/types/state.d.ts +3 -3
  94. package/dist/utils/InputsListener.d.ts +9 -9
  95. package/dist/utils/ajax.d.ts +2 -2
  96. package/dist/utils/audio-loader.d.ts +10 -10
  97. package/dist/utils/characters.d.ts +4 -5
  98. package/dist/utils/data-helpers.d.ts +31 -32
  99. package/dist/utils/data-helpers.test.d.ts +1 -1
  100. package/dist/utils/debounce.d.ts +14 -14
  101. package/dist/utils/error-handling.d.ts +4 -4
  102. package/dist/utils/getWindow.d.ts +1 -1
  103. package/dist/utils/helpers.d.ts +6 -6
  104. package/dist/utils/images-loader.d.ts +7 -7
  105. package/dist/utils/logger.d.ts +11 -11
  106. package/dist/utils/object-iterators.d.ts +9 -9
  107. package/dist/utils/promises.d.ts +1 -1
  108. package/dist/utils/randomId.d.ts +1 -1
  109. package/dist/utils/save-helpers.d.ts +16 -16
  110. package/dist/utils/skillchecks.d.ts +17 -17
  111. package/dist/utils/string-helpers.d.ts +5 -5
  112. package/dist/utils/time-helpers.d.ts +2 -2
  113. package/dist/utils/tooltip-utils.d.ts +2 -2
  114. package/dist/utils/transition.d.ts +21 -21
  115. package/dist/utils/type-utils.d.ts +2 -2
  116. package/dist/utils/typed-emitter.d.ts +18 -18
  117. package/dist/utils/viewport-utils.d.ts +3 -0
  118. package/dist/utils/vue-directives.d.ts +2 -2
  119. package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
  120. package/dist/vm/commands/array-commands.d.ts +42 -42
  121. package/dist/vm/commands/audio-commands.d.ts +15 -15
  122. package/dist/vm/commands/choice.d.ts +38 -38
  123. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  124. package/dist/vm/commands/command-helpers.d.ts +3 -3
  125. package/dist/vm/commands/command-plugin.d.ts +43 -43
  126. package/dist/vm/commands/flow-commands.d.ts +27 -27
  127. package/dist/vm/commands/if.d.ts +10 -10
  128. package/dist/vm/commands/index.d.ts +2 -2
  129. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  130. package/dist/vm/commands/logic-command.d.ts +42 -42
  131. package/dist/vm/commands/math-commands.d.ts +30 -30
  132. package/dist/vm/commands/notify.d.ts +6 -6
  133. package/dist/vm/commands/quest-commands.d.ts +30 -30
  134. package/dist/vm/commands/random-commands.d.ts +13 -13
  135. package/dist/vm/commands/screen-commands.d.ts +18 -18
  136. package/dist/vm/commands/set.d.ts +6 -6
  137. package/dist/vm/commands/skill-commands.d.ts +33 -33
  138. package/dist/vm/commands/sprite-commands.d.ts +16 -9
  139. package/dist/vm/commands/stats-commands.d.ts +12 -12
  140. package/dist/vm/commands/string-commands.d.ts +9 -9
  141. package/dist/vm/commands/text-field.d.ts +7 -7
  142. package/dist/vm/commands/text.d.ts +14 -14
  143. package/dist/vm/commands/time-commands.d.ts +16 -16
  144. package/dist/vm/commands/util-commands.d.ts +4 -4
  145. package/dist/vm/commands/wait.d.ts +4 -4
  146. package/dist/vm/vm-helpers.d.ts +19 -19
  147. package/dist/vm/vm-parser.d.ts +19 -19
  148. package/dist/vm/vm-parser.test.d.ts +1 -1
  149. package/dist/vm/vm.d.ts +21 -21
  150. package/package.json +2 -2
  151. package/dist/stores/sprites-store.d.ts +0 -54
  152. package/dist/types/character-types.d.ts +0 -27
@@ -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,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,15 +1,15 @@
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 pauseCommand: CommandPlugin<{
9
- mode: string;
10
- channel?: number | undefined;
11
- }, {}>;
12
- export declare const stopCommand: CommandPlugin<{
13
- mode: string;
14
- channel?: number | undefined;
15
- }, {}>;
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 pauseCommand: CommandPlugin<{
9
+ mode: string;
10
+ channel?: number | undefined;
11
+ }, {}>;
12
+ export declare const stopCommand: CommandPlugin<{
13
+ mode: string;
14
+ channel?: number | undefined;
15
+ }, {}>;
@@ -1,38 +1,38 @@
1
- import { CommandParserFunction, CommandParsingContext, CommandPlugin, CommandRunner } from './command-plugin';
2
- import { Parser } from '../../types/parser';
3
- export declare const runChoice: CommandRunner<ChoiceOptions, StaticChoiceOptions>;
4
- export declare function parseChoiceOption(ctx: CommandParsingContext, choice: Parser.Line): BranchingChoiceInfo;
5
- export interface BranchingChoiceInfo {
6
- prompt: Parser.ParsedExpression;
7
- branch?: Parser.Branch;
8
- skillBranches?: {
9
- success: Parser.Branch;
10
- failure: Parser.Branch;
11
- };
12
- }
13
- export interface StaticChoiceOptions {
14
- choices: BranchingChoiceInfo[];
15
- prompt: Parser.ParsedExpression;
16
- }
17
- export interface ChoiceOptions {
18
- }
19
- export declare const choiceParser: CommandParserFunction<ChoiceOptions, StaticChoiceOptions>;
20
- export declare const choicePlugin: CommandPlugin<ChoiceOptions, StaticChoiceOptions>;
21
- export interface ChoicePromptOptions {
22
- promptText: string;
23
- condition: boolean;
24
- }
25
- export interface ChoicePromptReturnValue {
26
- text: string | null;
27
- skillCheck?: {
28
- allowed: boolean;
29
- skillId: string;
30
- skillCheckId: string;
31
- difficulty: number;
32
- hideAfterRoll?: boolean;
33
- repeatable?: boolean;
34
- };
35
- }
36
- export declare type ChoicePromptReturn = ChoicePromptReturnValue;
37
- /** Custom "fake" instruction generated on choice prompts to process their optional conditions */
38
- export declare const choicePromptCommandPlugin: CommandPlugin<ChoicePromptOptions, {}>;
1
+ import { CommandParserFunction, CommandParsingContext, CommandPlugin, CommandRunner } from './command-plugin';
2
+ import { Parser } from '../../types/parser';
3
+ export declare const runChoice: CommandRunner<ChoiceOptions, StaticChoiceOptions>;
4
+ export declare function parseChoiceOption(ctx: CommandParsingContext, choice: Parser.Line): BranchingChoiceInfo;
5
+ export interface BranchingChoiceInfo {
6
+ prompt: Parser.ParsedExpression;
7
+ branch?: Parser.Branch;
8
+ skillBranches?: {
9
+ success: Parser.Branch;
10
+ failure: Parser.Branch;
11
+ };
12
+ }
13
+ export interface StaticChoiceOptions {
14
+ choices: BranchingChoiceInfo[];
15
+ prompt: Parser.ParsedExpression;
16
+ }
17
+ export interface ChoiceOptions {
18
+ }
19
+ export declare const choiceParser: CommandParserFunction<ChoiceOptions, StaticChoiceOptions>;
20
+ export declare const choicePlugin: CommandPlugin<ChoiceOptions, StaticChoiceOptions>;
21
+ export interface ChoicePromptOptions {
22
+ promptText: string;
23
+ condition: boolean;
24
+ }
25
+ export interface ChoicePromptReturnValue {
26
+ text: string | null;
27
+ skillCheck?: {
28
+ allowed: boolean;
29
+ skillId: string;
30
+ skillCheckId: string;
31
+ difficulty: number;
32
+ hideAfterRoll?: boolean;
33
+ repeatable?: boolean;
34
+ };
35
+ }
36
+ export declare type ChoicePromptReturn = ChoicePromptReturnValue;
37
+ /** Custom "fake" instruction generated on choice prompts to process their optional conditions */
38
+ 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 declare type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
5
- export declare type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
6
- newLine: number;
7
- };
8
- export declare 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 declare 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 declare 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 declare type CommandRunner<Options, StaticOptions = {}> = (cmd: Parser.Command<Options, StaticOptions>, choices?: DialogChoice[]) => Promise<any>;
5
+ export declare type CommandParserFunction<Options, StaticOptions = {}> = (ctx: CommandParsingContext, command: Parser.ParsedExpression<Options, StaticOptions>) => {
6
+ newLine: number;
7
+ };
8
+ export declare 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 declare 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 declare 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,27 +1,27 @@
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 newCommandPlugin: CommandPlugin<{
26
- name?: string | undefined;
27
- }, {}>;
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 newCommandPlugin: CommandPlugin<{
26
+ name?: string | undefined;
27
+ }, {}>;
@@ -1,10 +1,10 @@
1
- import { CommandPlugin } from './command-plugin';
2
- import { Parser } from '../../types/parser';
3
- export interface IfOptions {
4
- condition: boolean;
5
- }
6
- export interface IfStaticOptions {
7
- success: Parser.Branch;
8
- failure?: Parser.Branch;
9
- }
10
- 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 IfStaticOptions {
7
+ success: Parser.Branch;
8
+ failure?: Parser.Branch;
9
+ }
10
+ 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;
@@ -1,15 +1,15 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export interface InventoryChangeArgs {
3
- id: string;
4
- amount: number;
5
- }
6
- export declare const addItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
7
- export declare const removeItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
8
- export declare const hasItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
9
- export declare const itemAmountPlugin: CommandPlugin<InventoryChangeArgs, {}>;
10
- export declare const enableInteractionPlugin: CommandPlugin<{
11
- tag: string;
12
- }, {}>;
13
- export declare const disableInteractionPlugin: CommandPlugin<{
14
- tag: string;
15
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export interface InventoryChangeArgs {
3
+ id: string;
4
+ amount: number;
5
+ }
6
+ export declare const addItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
7
+ export declare const removeItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
8
+ export declare const hasItemPlugin: CommandPlugin<InventoryChangeArgs, {}>;
9
+ export declare const itemAmountPlugin: CommandPlugin<InventoryChangeArgs, {}>;
10
+ export declare const enableInteractionPlugin: CommandPlugin<{
11
+ tag: string;
12
+ }, {}>;
13
+ export declare const disableInteractionPlugin: CommandPlugin<{
14
+ tag: string;
15
+ }, {}>;
@@ -1,42 +1,42 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const equalPlugin: CommandPlugin<{
3
- a: number;
4
- b: number;
5
- }, {}>;
6
- export declare const greaterThanPlugin: CommandPlugin<{
7
- a: number;
8
- b: number;
9
- }, {}>;
10
- export declare const lesserThanPlugin: CommandPlugin<{
11
- a: number;
12
- b: number;
13
- }, {}>;
14
- export declare const greaterOrEqualPlugin: CommandPlugin<{
15
- a: number;
16
- b: number;
17
- }, {}>;
18
- export declare const lesserOrEqualPlugin: CommandPlugin<{
19
- a: number;
20
- b: number;
21
- }, {}>;
22
- export declare const notEqualPlugin: CommandPlugin<{
23
- a: number;
24
- b: number;
25
- }, {}>;
26
- export declare const notPlugin: CommandPlugin<{
27
- a: number;
28
- b: number;
29
- }, {}>;
30
- export declare const andPlugin: CommandPlugin<{
31
- a: number;
32
- b: number;
33
- }, {}>;
34
- export declare const orPlugin: CommandPlugin<{
35
- a: number;
36
- b: number;
37
- }, {}>;
38
- export declare const ternaryPlugin: CommandPlugin<{
39
- a: boolean;
40
- b: any;
41
- c: any;
42
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const equalPlugin: CommandPlugin<{
3
+ a: number;
4
+ b: number;
5
+ }, {}>;
6
+ export declare const greaterThanPlugin: CommandPlugin<{
7
+ a: number;
8
+ b: number;
9
+ }, {}>;
10
+ export declare const lesserThanPlugin: CommandPlugin<{
11
+ a: number;
12
+ b: number;
13
+ }, {}>;
14
+ export declare const greaterOrEqualPlugin: CommandPlugin<{
15
+ a: number;
16
+ b: number;
17
+ }, {}>;
18
+ export declare const lesserOrEqualPlugin: CommandPlugin<{
19
+ a: number;
20
+ b: number;
21
+ }, {}>;
22
+ export declare const notEqualPlugin: CommandPlugin<{
23
+ a: number;
24
+ b: number;
25
+ }, {}>;
26
+ export declare const notPlugin: CommandPlugin<{
27
+ a: number;
28
+ b: number;
29
+ }, {}>;
30
+ export declare const andPlugin: CommandPlugin<{
31
+ a: number;
32
+ b: number;
33
+ }, {}>;
34
+ export declare const orPlugin: CommandPlugin<{
35
+ a: number;
36
+ b: number;
37
+ }, {}>;
38
+ export declare const ternaryPlugin: CommandPlugin<{
39
+ a: boolean;
40
+ b: any;
41
+ c: any;
42
+ }, {}>;
@@ -1,30 +1,30 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const minPlugin: CommandPlugin<{
3
- min: number;
4
- value: number;
5
- }, {}>;
6
- export declare const maxPlugin: CommandPlugin<{
7
- max: number;
8
- value: number;
9
- }, {}>;
10
- export declare const clampPlugin: CommandPlugin<{
11
- min: number;
12
- max: number;
13
- value: number;
14
- }, {}>;
15
- export declare const floorPlugin: CommandPlugin<{
16
- value: number;
17
- }, {}>;
18
- export declare const ceilPlugin: CommandPlugin<{
19
- value: number;
20
- }, {}>;
21
- export declare const roundPlugin: CommandPlugin<{
22
- value: number;
23
- }, {}>;
24
- export declare const sqrtPlugin: CommandPlugin<{
25
- value: number;
26
- }, {}>;
27
- export declare const powPlugin: CommandPlugin<{
28
- base: number;
29
- exponent: number;
30
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const minPlugin: CommandPlugin<{
3
+ min: number;
4
+ value: number;
5
+ }, {}>;
6
+ export declare const maxPlugin: CommandPlugin<{
7
+ max: number;
8
+ value: number;
9
+ }, {}>;
10
+ export declare const clampPlugin: CommandPlugin<{
11
+ min: number;
12
+ max: number;
13
+ value: number;
14
+ }, {}>;
15
+ export declare const floorPlugin: CommandPlugin<{
16
+ value: number;
17
+ }, {}>;
18
+ export declare const ceilPlugin: CommandPlugin<{
19
+ value: number;
20
+ }, {}>;
21
+ export declare const roundPlugin: CommandPlugin<{
22
+ value: number;
23
+ }, {}>;
24
+ export declare const sqrtPlugin: CommandPlugin<{
25
+ value: number;
26
+ }, {}>;
27
+ export declare const powPlugin: CommandPlugin<{
28
+ base: number;
29
+ exponent: number;
30
+ }, {}>;
@@ -1,6 +1,6 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const notifyPlugin: CommandPlugin<{
3
- text: string;
4
- }, {}>;
5
- export declare const disableNotifications: CommandPlugin<{}, {}>;
6
- export declare const enableNotifications: CommandPlugin<{}, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const notifyPlugin: CommandPlugin<{
3
+ text: string;
4
+ }, {}>;
5
+ export declare const disableNotifications: CommandPlugin<{}, {}>;
6
+ export declare const enableNotifications: CommandPlugin<{}, {}>;