narrat 2.10.7 → 2.11.0

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 (154) hide show
  1. package/dist/app.vue.d.ts +78 -78
  2. package/dist/components/MainMenu.vue.d.ts +7 -7
  3. package/dist/components/SkillsWindow.vue.d.ts +28 -28
  4. package/dist/components/StartMenu.vue.d.ts +46 -46
  5. package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +46 -46
  6. package/dist/components/debug/debug-menu.vue.d.ts +51 -51
  7. package/dist/components/dialog-picture.vue.d.ts +11 -11
  8. package/dist/components/engine-splash/engine-splash.vue.d.ts +54 -54
  9. package/dist/components/game-dialog.vue.d.ts +65 -65
  10. package/dist/components/game-splash/game-splash.vue.d.ts +46 -46
  11. package/dist/components/hud.vue.d.ts +20 -20
  12. package/dist/components/in-game.vue.d.ts +46 -46
  13. package/dist/components/inventory/inventory-section.vue.d.ts +61 -61
  14. package/dist/components/inventory/item-details.vue.d.ts +76 -76
  15. package/dist/components/inventory-ui.vue.d.ts +39 -39
  16. package/dist/components/loading-bar.vue.d.ts +10 -10
  17. package/dist/components/menu-buttons.vue.d.ts +46 -46
  18. package/dist/components/notification-toast.vue.d.ts +6 -6
  19. package/dist/components/quests/QuestDetails.vue.d.ts +64 -64
  20. package/dist/components/quests/QuestDisplay.vue.d.ts +64 -64
  21. package/dist/components/quests/quests-list-section.vue.d.ts +75 -75
  22. package/dist/components/quests-ui.vue.d.ts +22 -22
  23. package/dist/components/save-slots.vue.d.ts +79 -79
  24. package/dist/components/saves/save-slot-ui.vue.d.ts +108 -108
  25. package/dist/components/screen-layer.vue.d.ts +76 -76
  26. package/dist/components/screen-objects/screen-object.vue.d.ts +68 -68
  27. package/dist/components/screens.vue.d.ts +46 -46
  28. package/dist/components/tabs/TabsController.vue.d.ts +72 -72
  29. package/dist/components/tabs/tab-selector.vue.d.ts +82 -82
  30. package/dist/components/tooltips/tooltips-ui.vue.d.ts +46 -46
  31. package/dist/components/transitions/NarratTransition.vue.d.ts +97 -97
  32. package/dist/components/utils/alert-modal.vue.d.ts +82 -82
  33. package/dist/components/utils/floating-tooltip.vue.d.ts +62 -62
  34. package/dist/components/utils/modal-window.vue.d.ts +18 -18
  35. package/dist/components/utils/yes-no.vue.d.ts +106 -106
  36. package/dist/components/volume-controls.vue.d.ts +18 -18
  37. package/dist/config/audio-config.d.ts +58 -58
  38. package/dist/config/buttons-config.d.ts +68 -68
  39. package/dist/config/characters-config.d.ts +36 -36
  40. package/dist/config/common-config.d.ts +80 -80
  41. package/dist/config/config-input.d.ts +231 -231
  42. package/dist/config/config-output.d.ts +232 -232
  43. package/dist/config/items-config.d.ts +71 -71
  44. package/dist/config/layout-config.d.ts +26 -26
  45. package/dist/config/quests-config.d.ts +48 -48
  46. package/dist/config/screens-config.d.ts +133 -133
  47. package/dist/config/skills-config.d.ts +70 -70
  48. package/dist/config/tooltips-config.d.ts +15 -15
  49. package/dist/config.d.ts +182 -182
  50. package/dist/constants.d.ts +12 -12
  51. package/dist/demo/demo.d.ts +1 -1
  52. package/dist/dialog-box.vue.d.ts +71 -71
  53. package/dist/exports/components.d.ts +2 -2
  54. package/dist/exports/config.d.ts +2 -2
  55. package/dist/exports/display.d.ts +2 -2
  56. package/dist/exports/events.d.ts +1 -1
  57. package/dist/exports/inputs.d.ts +1 -1
  58. package/dist/exports/others.d.ts +1 -1
  59. package/dist/exports/plugins.d.ts +67 -67
  60. package/dist/exports/stores.d.ts +16 -16
  61. package/dist/exports/utils.d.ts +12 -12
  62. package/dist/gamepad/gamepad.d.ts +1 -1
  63. package/dist/hooks/util-hooks.d.ts +1 -1
  64. package/dist/inputs/Inputs.d.ts +61 -61
  65. package/dist/lib.d.ts +20 -20
  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 +820 -808
  69. package/dist/narrat.es.js.map +1 -1
  70. package/dist/narrat.umd.js +5 -5
  71. package/dist/narrat.umd.js.map +1 -1
  72. package/dist/plugins/NarratPlugin.d.ts +12 -12
  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 +21 -20
  77. package/dist/stores/inputs-store.d.ts +14 -14
  78. package/dist/stores/inventory-store.d.ts +40 -49
  79. package/dist/stores/main-store.d.ts +1667 -1637
  80. package/dist/stores/menu-store.d.ts +45 -45
  81. package/dist/stores/notification-store.d.ts +15 -15
  82. package/dist/stores/quest-log.d.ts +38 -37
  83. package/dist/stores/rendering-store.d.ts +20 -20
  84. package/dist/stores/screen-objects-store.d.ts +80 -80
  85. package/dist/stores/screens-store.d.ts +36 -34
  86. package/dist/stores/skills.d.ts +40 -39
  87. package/dist/stores/start-menu-store.d.ts +7 -7
  88. package/dist/stores/tooltip-store.d.ts +18 -18
  89. package/dist/stores/vm-store.d.ts +181 -181
  90. package/dist/types/app-types.d.ts +8 -8
  91. package/dist/types/dialog-box-types.d.ts +11 -11
  92. package/dist/types/game-save.d.ts +41 -41
  93. package/dist/types/parser.d.ts +93 -93
  94. package/dist/types/state.d.ts +3 -3
  95. package/dist/utils/InputsListener.d.ts +9 -9
  96. package/dist/utils/Vector2.d.ts +49 -49
  97. package/dist/utils/ajax.d.ts +2 -2
  98. package/dist/utils/audio-loader.d.ts +10 -10
  99. package/dist/utils/characters.d.ts +4 -4
  100. package/dist/utils/data-helpers.d.ts +35 -35
  101. package/dist/utils/data-helpers.test.d.ts +1 -1
  102. package/dist/utils/debounce.d.ts +14 -14
  103. package/dist/utils/error-handling.d.ts +4 -4
  104. package/dist/utils/gameloop.d.ts +10 -10
  105. package/dist/utils/getWindow.d.ts +1 -1
  106. package/dist/utils/helpers.d.ts +6 -6
  107. package/dist/utils/images-loader.d.ts +7 -7
  108. package/dist/utils/logger.d.ts +11 -11
  109. package/dist/utils/object-iterators.d.ts +9 -9
  110. package/dist/utils/promises.d.ts +1 -1
  111. package/dist/utils/randomId.d.ts +1 -1
  112. package/dist/utils/save-helpers.d.ts +16 -16
  113. package/dist/utils/skillchecks.d.ts +17 -17
  114. package/dist/utils/string-helpers.d.ts +5 -5
  115. package/dist/utils/time-helpers.d.ts +2 -2
  116. package/dist/utils/tooltip-utils.d.ts +2 -2
  117. package/dist/utils/transition.d.ts +21 -21
  118. package/dist/utils/type-utils.d.ts +2 -2
  119. package/dist/utils/typed-emitter.d.ts +18 -18
  120. package/dist/utils/viewport-utils.d.ts +3 -3
  121. package/dist/utils/vue-directives.d.ts +2 -2
  122. package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
  123. package/dist/vm/commands/array-commands.d.ts +42 -42
  124. package/dist/vm/commands/audio-commands.d.ts +15 -15
  125. package/dist/vm/commands/choice.d.ts +38 -38
  126. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  127. package/dist/vm/commands/command-helpers.d.ts +3 -3
  128. package/dist/vm/commands/command-plugin.d.ts +43 -43
  129. package/dist/vm/commands/flow-commands.d.ts +27 -27
  130. package/dist/vm/commands/if.d.ts +10 -10
  131. package/dist/vm/commands/index.d.ts +2 -2
  132. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  133. package/dist/vm/commands/logic-command.d.ts +42 -42
  134. package/dist/vm/commands/math-commands.d.ts +30 -30
  135. package/dist/vm/commands/notify.d.ts +6 -6
  136. package/dist/vm/commands/quest-commands.d.ts +30 -30
  137. package/dist/vm/commands/random-commands.d.ts +13 -13
  138. package/dist/vm/commands/screen-commands.d.ts +18 -18
  139. package/dist/vm/commands/set.d.ts +6 -6
  140. package/dist/vm/commands/skill-commands.d.ts +39 -39
  141. package/dist/vm/commands/sprite-commands.d.ts +16 -16
  142. package/dist/vm/commands/stats-commands.d.ts +12 -12
  143. package/dist/vm/commands/string-commands.d.ts +9 -9
  144. package/dist/vm/commands/text-field.d.ts +7 -7
  145. package/dist/vm/commands/text.d.ts +14 -14
  146. package/dist/vm/commands/time-commands.d.ts +16 -16
  147. package/dist/vm/commands/util-commands.d.ts +4 -4
  148. package/dist/vm/commands/wait.d.ts +4 -4
  149. package/dist/vm/vm-helpers.d.ts +19 -19
  150. package/dist/vm/vm-parser.d.ts +19 -19
  151. package/dist/vm/vm-parser.test.d.ts +1 -1
  152. package/dist/vm/vm.d.ts +21 -21
  153. package/package.json +27 -27
  154. package/LICENSE +0 -21
@@ -1,13 +1,13 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const randomIntPlugin: CommandPlugin<{
3
- a: number;
4
- b: number;
5
- }, {}>;
6
- export declare const randomFloatPlugin: CommandPlugin<{
7
- a: number;
8
- b: number;
9
- }, {}>;
10
- export declare const randomFromArgsPlugin: CommandPlugin<{}, {}>;
11
- export declare const randomFromArrayPlugin: CommandPlugin<{
12
- a: any[];
13
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const randomIntPlugin: CommandPlugin<{
3
+ a: number;
4
+ b: number;
5
+ }, {}>;
6
+ export declare const randomFloatPlugin: CommandPlugin<{
7
+ a: number;
8
+ b: number;
9
+ }, {}>;
10
+ export declare const randomFromArgsPlugin: CommandPlugin<{}, {}>;
11
+ export declare const randomFromArrayPlugin: CommandPlugin<{
12
+ a: any[];
13
+ }, {}>;
@@ -1,18 +1,18 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const setScreenCommand: CommandPlugin<{
3
- screen: string;
4
- layer?: number | undefined;
5
- transitionName?: string | undefined;
6
- transitionDuration?: number | undefined;
7
- transitionDelay?: number | undefined;
8
- }, {}>;
9
- export declare const emptyLayerCommand: CommandPlugin<{
10
- layer: number;
11
- transitionName?: string | undefined;
12
- transitionDuration?: number | undefined;
13
- transitionDelay?: number | undefined;
14
- }, {}>;
15
- export declare const setButtonCommand: CommandPlugin<{
16
- buttonId: string;
17
- state: any;
18
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const setScreenCommand: CommandPlugin<{
3
+ screen: string;
4
+ layer?: number | undefined;
5
+ transitionName?: string | undefined;
6
+ transitionDuration?: number | undefined;
7
+ transitionDelay?: number | undefined;
8
+ }, {}>;
9
+ export declare const emptyLayerCommand: CommandPlugin<{
10
+ layer: number;
11
+ transitionName?: string | undefined;
12
+ transitionDuration?: number | undefined;
13
+ transitionDelay?: number | undefined;
14
+ }, {}>;
15
+ export declare const setButtonCommand: CommandPlugin<{
16
+ buttonId: string;
17
+ state: any;
18
+ }, {}>;
@@ -1,6 +1,6 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const setCommand: CommandPlugin<any, {}>;
3
- export declare const addPlugin: CommandPlugin<{
4
- key: any;
5
- value: number;
6
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const setCommand: CommandPlugin<any, {}>;
3
+ export declare const addPlugin: CommandPlugin<{
4
+ key: any;
5
+ value: number;
6
+ }, {}>;
@@ -1,39 +1,39 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export interface AddLevelArgs {
3
- skillKey: string;
4
- amount: number;
5
- }
6
- export declare const addLevelPlugin: CommandPlugin<AddLevelArgs, {}>;
7
- export declare const setLevelPlugin: CommandPlugin<{
8
- skill: string;
9
- level: number;
10
- }, {}>;
11
- export interface AddXpArgs {
12
- xpKey: string;
13
- xpToAdd: number;
14
- }
15
- export declare const addXpPlugin: CommandPlugin<AddXpArgs, {}>;
16
- export interface GetLevelArgs {
17
- skillKey: string;
18
- }
19
- export declare const getLevelPlugin: CommandPlugin<GetLevelArgs, {}>;
20
- export interface GetXpArgs {
21
- xpKey: string;
22
- }
23
- export declare const getXpPlugin: CommandPlugin<GetXpArgs, {}>;
24
- export interface RollArgs {
25
- id: string;
26
- skill: string;
27
- value: number;
28
- mode?: string;
29
- }
30
- export declare const rollPlugin: CommandPlugin<RollArgs, {}>;
31
- export declare const getSkillCheckPlugin: CommandPlugin<{
32
- skillCheckId: string;
33
- }, {}>;
34
- export declare const getSkillCheckResultPlugin: CommandPlugin<{
35
- skillCheckId: string;
36
- }, {}>;
37
- export declare const resetSkillCheck: CommandPlugin<{
38
- id: string;
39
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export interface AddLevelArgs {
3
+ skillKey: string;
4
+ amount: number;
5
+ }
6
+ export declare const addLevelPlugin: CommandPlugin<AddLevelArgs, {}>;
7
+ export declare const setLevelPlugin: CommandPlugin<{
8
+ skill: string;
9
+ level: number;
10
+ }, {}>;
11
+ export interface AddXpArgs {
12
+ xpKey: string;
13
+ xpToAdd: number;
14
+ }
15
+ export declare const addXpPlugin: CommandPlugin<AddXpArgs, {}>;
16
+ export interface GetLevelArgs {
17
+ skillKey: string;
18
+ }
19
+ export declare const getLevelPlugin: CommandPlugin<GetLevelArgs, {}>;
20
+ export interface GetXpArgs {
21
+ xpKey: string;
22
+ }
23
+ export declare const getXpPlugin: CommandPlugin<GetXpArgs, {}>;
24
+ export interface RollArgs {
25
+ id: string;
26
+ skill: string;
27
+ value: number;
28
+ mode?: string;
29
+ }
30
+ export declare const rollPlugin: CommandPlugin<RollArgs, {}>;
31
+ export declare const getSkillCheckPlugin: CommandPlugin<{
32
+ skillCheckId: string;
33
+ }, {}>;
34
+ export declare const getSkillCheckResultPlugin: CommandPlugin<{
35
+ skillCheckId: string;
36
+ }, {}>;
37
+ export declare const resetSkillCheck: CommandPlugin<{
38
+ id: string;
39
+ }, {}>;
@@ -1,16 +1,16 @@
1
- import { ScreenObjectState } from '../../stores/screen-objects-store';
2
- import { CommandPlugin } from './command-plugin';
3
- export declare const createSpriteCommand: CommandPlugin<{
4
- image: string;
5
- x: number;
6
- y: number;
7
- parent?: string | ScreenObjectState | undefined;
8
- }, {}>;
9
- export declare const createObjectCommand: CommandPlugin<{
10
- x: number;
11
- y: number;
12
- parent?: string | ScreenObjectState | undefined;
13
- }, {}>;
14
- export declare const deleteSpriteCommand: CommandPlugin<{
15
- sprite: ScreenObjectState;
16
- }, {}>;
1
+ import { ScreenObjectState } from '../../stores/screen-objects-store';
2
+ import { CommandPlugin } from './command-plugin';
3
+ export declare const createSpriteCommand: CommandPlugin<{
4
+ image: string;
5
+ x: number;
6
+ y: number;
7
+ parent?: string | ScreenObjectState | undefined;
8
+ }, {}>;
9
+ export declare const createObjectCommand: CommandPlugin<{
10
+ x: number;
11
+ y: number;
12
+ parent?: string | ScreenObjectState | undefined;
13
+ }, {}>;
14
+ export declare const deleteSpriteCommand: CommandPlugin<{
15
+ sprite: ScreenObjectState;
16
+ }, {}>;
@@ -1,12 +1,12 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const addStatPlugin: CommandPlugin<{
3
- statKey: string;
4
- amountToAdd: number;
5
- }, {}>;
6
- export declare const setStatPlugin: CommandPlugin<{
7
- statKey: string;
8
- value: number;
9
- }, {}>;
10
- export declare const getStatPlugin: CommandPlugin<{
11
- statKey: string;
12
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const addStatPlugin: CommandPlugin<{
3
+ statKey: string;
4
+ amountToAdd: number;
5
+ }, {}>;
6
+ export declare const setStatPlugin: CommandPlugin<{
7
+ statKey: string;
8
+ value: number;
9
+ }, {}>;
10
+ export declare const getStatPlugin: CommandPlugin<{
11
+ statKey: string;
12
+ }, {}>;
@@ -1,9 +1,9 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const stringConcatPlugin: CommandPlugin<{
3
- a: number;
4
- b: number;
5
- }, {}>;
6
- export declare const stringJoinPlugin: CommandPlugin<{
7
- a: number;
8
- b: number;
9
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const stringConcatPlugin: CommandPlugin<{
3
+ a: number;
4
+ b: number;
5
+ }, {}>;
6
+ export declare const stringJoinPlugin: CommandPlugin<{
7
+ a: number;
8
+ b: number;
9
+ }, {}>;
@@ -1,7 +1,7 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const textFieldPlugin: CommandPlugin<{
3
- prompt: string;
4
- }, {}>;
5
- export declare const textFieldPromptPlugin: CommandPlugin<{
6
- prompt: string;
7
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const textFieldPlugin: CommandPlugin<{
3
+ prompt: string;
4
+ }, {}>;
5
+ export declare const textFieldPromptPlugin: CommandPlugin<{
6
+ prompt: string;
7
+ }, {}>;
@@ -1,14 +1,14 @@
1
- import { CommandParserFunction, CommandPlugin } from './command-plugin';
2
- export interface TalkArgs {
3
- speaker: string;
4
- pose: string;
5
- text: string;
6
- }
7
- export declare const talkCommand: CommandPlugin<TalkArgs, {}>;
8
- export declare const thinkCommand: CommandPlugin<TalkArgs, {}>;
9
- export declare const textParser: () => CommandParserFunction<{}, {
10
- text: string;
11
- }>;
12
- export declare const textCommandPlugin: CommandPlugin<{}, {
13
- text: string;
14
- }>;
1
+ import { CommandParserFunction, CommandPlugin } from './command-plugin';
2
+ export interface TalkArgs {
3
+ speaker: string;
4
+ pose: string;
5
+ text: string;
6
+ }
7
+ export declare const talkCommand: CommandPlugin<TalkArgs, {}>;
8
+ export declare const thinkCommand: CommandPlugin<TalkArgs, {}>;
9
+ export declare const textParser: () => CommandParserFunction<{}, {
10
+ text: string;
11
+ }>;
12
+ export declare const textCommandPlugin: CommandPlugin<{}, {
13
+ text: string;
14
+ }>;
@@ -1,16 +1,16 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const nowPlugin: CommandPlugin<{}, {}>;
3
- export declare const totalPlaytimePlugin: CommandPlugin<{}, {}>;
4
- export declare const sessionPlaytimePlugin: CommandPlugin<{}, {}>;
5
- export declare const toDaysPlugin: CommandPlugin<{
6
- time: number;
7
- }, {}>;
8
- export declare const toHoursPlugin: CommandPlugin<{
9
- time: number;
10
- }, {}>;
11
- export declare const toMinutesPlugin: CommandPlugin<{
12
- time: number;
13
- }, {}>;
14
- export declare const toSecondsPlugin: CommandPlugin<{
15
- time: number;
16
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const nowPlugin: CommandPlugin<{}, {}>;
3
+ export declare const totalPlaytimePlugin: CommandPlugin<{}, {}>;
4
+ export declare const sessionPlaytimePlugin: CommandPlugin<{}, {}>;
5
+ export declare const toDaysPlugin: CommandPlugin<{
6
+ time: number;
7
+ }, {}>;
8
+ export declare const toHoursPlugin: CommandPlugin<{
9
+ time: number;
10
+ }, {}>;
11
+ export declare const toMinutesPlugin: CommandPlugin<{
12
+ time: number;
13
+ }, {}>;
14
+ export declare const toSecondsPlugin: CommandPlugin<{
15
+ time: number;
16
+ }, {}>;
@@ -1,4 +1,4 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const loadDataPlugin: CommandPlugin<{
3
- url: string;
4
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const loadDataPlugin: CommandPlugin<{
3
+ url: string;
4
+ }, {}>;
@@ -1,4 +1,4 @@
1
- import { CommandPlugin } from './command-plugin';
2
- export declare const waitCommand: CommandPlugin<{
3
- duration: number;
4
- }, {}>;
1
+ import { CommandPlugin } from './command-plugin';
2
+ export declare const waitCommand: CommandPlugin<{
3
+ duration: number;
4
+ }, {}>;
@@ -1,19 +1,19 @@
1
- import { AddDialogParams } from '../stores/dialog-store';
2
- import { SkillCheckState } from '../stores/skills';
3
- import { Parser } from '../types/parser';
4
- import { IfOptions, IfStaticOptions } from './commands/if';
5
- export interface SkillCheckParams {
6
- skill: string;
7
- value: number;
8
- id: string;
9
- hideAfterRoll?: boolean;
10
- repeatable?: boolean;
11
- }
12
- export declare function runSkillCheck(params: SkillCheckParams): SkillCheckState;
13
- export declare function runConditionCommand(command: Parser.Command<IfOptions, IfStaticOptions>): Parser.Branch | undefined;
14
- export declare function isExpression(arg: Parser.Arg): arg is Parser.ParsedExpression;
15
- export declare type Variable = string | number | boolean | undefined | null;
16
- export declare function isVariable(arg: Parser.Arg): arg is Variable;
17
- export declare function writeText(text: string): void;
18
- export declare function textCommand(dialog: AddDialogParams): Promise<void>;
19
- export declare function getLine(lines: Parser.Line[], index: number): Parser.Line | undefined;
1
+ import { AddDialogParams } from '../stores/dialog-store';
2
+ import { SkillCheckState } from '../stores/skills';
3
+ import { Parser } from '../types/parser';
4
+ import { IfOptions, IfStaticOptions } from './commands/if';
5
+ export interface SkillCheckParams {
6
+ skill: string;
7
+ value: number;
8
+ id: string;
9
+ hideAfterRoll?: boolean;
10
+ repeatable?: boolean;
11
+ }
12
+ export declare function runSkillCheck(params: SkillCheckParams): SkillCheckState;
13
+ export declare function runConditionCommand(command: Parser.Command<IfOptions, IfStaticOptions>): Parser.Branch | undefined;
14
+ export declare function isExpression(arg: Parser.Arg): arg is Parser.ParsedExpression;
15
+ export declare type Variable = string | number | boolean | undefined | null;
16
+ export declare function isVariable(arg: Parser.Arg): arg is Variable;
17
+ export declare function writeText(text: string): void;
18
+ export declare function textCommand(dialog: AddDialogParams): Promise<void>;
19
+ export declare function getLine(lines: Parser.Line[], index: number): Parser.Line | undefined;
@@ -1,19 +1,19 @@
1
- import { Parser } from '../types/parser';
2
- import { ProcessCommandsFunction } from './commands/command-plugin';
3
- export declare type ErrorFunction = (line: number, text: string) => void;
4
- export declare type ParserErrorHandler = (ctx: ParserContext, line: number, text: string) => void;
5
- export interface ParserContext {
6
- fileName: string;
7
- currentLine: number;
8
- error: ErrorFunction;
9
- processCommandsFunction: ProcessCommandsFunction;
10
- indentSize: number;
11
- }
12
- export declare function parseScript(errorHandler: ParserErrorHandler, code: string, fileName: string): Parser.ParsedScript;
13
- export declare function parseCodeLine(ctx: ParserContext, codeToProcess: string): Parser.Expression;
14
- export declare function parseCodeLineIntoTokens(code: string): Parser.Primitive[];
15
- export declare function splitIntoTokens(code: string): Parser.Primitive[];
16
- export declare function tokensToExpression(ctx: ParserContext, tokens: Parser.Primitive[]): [Parser.Expression, number];
17
- export declare function validateExpression(ctx: ParserContext, expression: Parser.Expression): void;
18
- export declare function findExpressionStart(tokens: Parser.Primitive[]): number;
19
- export declare function findExpressionEnd(tokens: Parser.Primitive[]): number;
1
+ import { Parser } from '../types/parser';
2
+ import { ProcessCommandsFunction } from './commands/command-plugin';
3
+ export declare type ErrorFunction = (line: number, text: string) => void;
4
+ export declare type ParserErrorHandler = (ctx: ParserContext, line: number, text: string) => void;
5
+ export interface ParserContext {
6
+ fileName: string;
7
+ currentLine: number;
8
+ error: ErrorFunction;
9
+ processCommandsFunction: ProcessCommandsFunction;
10
+ indentSize: number;
11
+ }
12
+ export declare function parseScript(errorHandler: ParserErrorHandler, code: string, fileName: string): Parser.ParsedScript;
13
+ export declare function parseCodeLine(ctx: ParserContext, codeToProcess: string): Parser.Expression;
14
+ export declare function parseCodeLineIntoTokens(code: string): Parser.Primitive[];
15
+ export declare function splitIntoTokens(code: string): Parser.Primitive[];
16
+ export declare function tokensToExpression(ctx: ParserContext, tokens: Parser.Primitive[]): [Parser.Expression, number];
17
+ export declare function validateExpression(ctx: ParserContext, expression: Parser.Expression): void;
18
+ export declare function findExpressionStart(tokens: Parser.Primitive[]): number;
19
+ export declare function findExpressionEnd(tokens: Parser.Primitive[]): number;
@@ -1 +1 @@
1
- export {};
1
+ export {};
package/dist/vm/vm.d.ts CHANGED
@@ -1,21 +1,21 @@
1
- import { CommandPlugin } from './commands/command-plugin';
2
- import { NarratPluginObject, NarratCustomStoreActions } from '../exports/plugins';
3
- import { Parser } from '../types/parser';
4
- import { DialogChoice } from '../stores/dialog-store';
5
- import { Pinia, Store } from 'pinia';
6
- export declare class VM {
7
- plugins: NarratPluginObject<any>[];
8
- pinia: Pinia;
9
- commands: {
10
- [key: string]: CommandPlugin<any>;
11
- };
12
- addCommand(command: CommandPlugin<any, any>): void;
13
- addPlugin(plugin: NarratPluginObject<any>): void;
14
- callHook(hookName: string, ...args: any[]): void;
15
- customStores(): [string, Store<any, any, any, NarratCustomStoreActions>][];
16
- }
17
- export declare const vm: VM;
18
- export declare function runCommand(expression: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<any>;
19
- export declare function generateCommand(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<Parser.Command>;
20
- export declare function runExpression<ReturnType = any>(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<ReturnType>;
21
- export declare function playerAnswered(choice: string | number): Promise<any>;
1
+ import { CommandPlugin } from './commands/command-plugin';
2
+ import { NarratPluginObject, NarratCustomStoreActions } from '../exports/plugins';
3
+ import { Parser } from '../types/parser';
4
+ import { DialogChoice } from '../stores/dialog-store';
5
+ import { Pinia, Store } from 'pinia';
6
+ export declare class VM {
7
+ plugins: NarratPluginObject<any>[];
8
+ pinia: Pinia;
9
+ commands: {
10
+ [key: string]: CommandPlugin<any>;
11
+ };
12
+ addCommand(command: CommandPlugin<any, any>): void;
13
+ addPlugin(plugin: NarratPluginObject<any>): void;
14
+ callHook(hookName: string, ...args: any[]): void;
15
+ customStores(): [string, Store<any, any, any, NarratCustomStoreActions>][];
16
+ }
17
+ export declare const vm: VM;
18
+ export declare function runCommand(expression: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<any>;
19
+ export declare function generateCommand(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<Parser.Command>;
20
+ export declare function runExpression<ReturnType = any>(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<ReturnType>;
21
+ export declare function playerAnswered(choice: string | number): Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "2.10.7",
3
+ "version": "2.11.0",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "dist/narrat.umd.js",
6
6
  "module": "dist/narrat.es.js",
@@ -17,6 +17,31 @@
17
17
  "files": [
18
18
  "dist/"
19
19
  ],
20
+ "scripts": {
21
+ "test-unit": "vitest",
22
+ "coverage": "vitest run --coverage",
23
+ "start": "pnpm run dev",
24
+ "rpg": "pnpm run run-example rpg",
25
+ "build-rpg": "pnpm run build-example rpg",
26
+ "empty": "pnpm run run-example empty",
27
+ "build-empty": "pnpm run build-example empty",
28
+ "test-game": "pnpm run run-example test",
29
+ "build-test-game": "pnpm run build-example test",
30
+ "demo": "pnpm run run-example demo",
31
+ "build-demo": "pnpm run build-example demo",
32
+ "run-example": "node run-example.js",
33
+ "build-example": "node build-example.js",
34
+ "dev": "pnpm run run-example default",
35
+ "generate-types": "vue-tsc --emitDeclarationOnly --outDir dist && pnpm run fix-type-aliases",
36
+ "fix-type-aliases": "tsc-alias -p tsconfig.json",
37
+ "build": "rimraf lib && vue-tsc --noEmit && vite build && pnpm run generate-types",
38
+ "preview": "vite preview",
39
+ "lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
40
+ "preversion": "pnpm run build && pnpm run lint",
41
+ "postversion": "git push && git push --tags",
42
+ "check-types": "tsc --noEmit && vue-tsc --noEmit",
43
+ "find-deadcode": "ts-prune"
44
+ },
20
45
  "keywords": [
21
46
  "game"
22
47
  ],
@@ -71,30 +96,5 @@
71
96
  "vue": "^3.2.37",
72
97
  "vue-tsc": "^0.38.2",
73
98
  "windicss": "^3.5.6"
74
- },
75
- "scripts": {
76
- "test-unit": "vitest",
77
- "coverage": "vitest run --coverage",
78
- "start": "pnpm run dev",
79
- "rpg": "pnpm run run-example rpg",
80
- "build-rpg": "pnpm run build-example rpg",
81
- "empty": "pnpm run run-example empty",
82
- "build-empty": "pnpm run build-example empty",
83
- "test-game": "pnpm run run-example test",
84
- "build-test-game": "pnpm run build-example test",
85
- "demo": "pnpm run run-example demo",
86
- "build-demo": "pnpm run build-example demo",
87
- "run-example": "node run-example.js",
88
- "build-example": "node build-example.js",
89
- "dev": "pnpm run run-example default",
90
- "generate-types": "vue-tsc --emitDeclarationOnly --outDir dist && pnpm run fix-type-aliases",
91
- "fix-type-aliases": "tsc-alias -p tsconfig.json",
92
- "build": "rimraf lib && vue-tsc --noEmit && vite build && pnpm run generate-types",
93
- "preview": "vite preview",
94
- "lint": "eslint src --ext=.js,.jsx,.ts,.tsx",
95
- "preversion": "pnpm run build && pnpm run lint",
96
- "postversion": "git push && git push --tags",
97
- "check-types": "tsc --noEmit && vue-tsc --noEmit",
98
- "find-deadcode": "ts-prune"
99
99
  }
100
- }
100
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Liana Pigeot
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.