narrat 2.2.13 → 2.2.14-test

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 (136) hide show
  1. package/LICENSE +21 -21
  2. package/dist/app.vue.d.ts +92 -92
  3. package/dist/components/MainMenu.vue.d.ts +12 -12
  4. package/dist/components/Skills.vue.d.ts +22 -22
  5. package/dist/components/StartMenu.vue.d.ts +46 -46
  6. package/dist/components/debug/debug-menu.vue.d.ts +48 -48
  7. package/dist/components/dialog-picture.vue.d.ts +9 -9
  8. package/dist/components/game-dialog.vue.d.ts +65 -65
  9. package/dist/components/hud.vue.d.ts +14 -14
  10. package/dist/components/inventory-ui.vue.d.ts +30 -30
  11. package/dist/components/loading-bar.vue.d.ts +10 -10
  12. package/dist/components/menu-buttons.vue.d.ts +26 -26
  13. package/dist/components/notification-toast.vue.d.ts +6 -6
  14. package/dist/components/quests-ui.vue.d.ts +20 -20
  15. package/dist/components/save-slots.vue.d.ts +58 -58
  16. package/dist/components/screen-layer.vue.d.ts +76 -76
  17. package/dist/components/screens.vue.d.ts +46 -46
  18. package/dist/components/transitions/NarratTransition.vue.d.ts +101 -101
  19. package/dist/components/utils/modal.vue.d.ts +6 -6
  20. package/dist/components/volume-controls.vue.d.ts +18 -18
  21. package/dist/config.d.ts +178 -178
  22. package/dist/constants.d.ts +8 -8
  23. package/dist/defaultConfig.d.ts +2 -2
  24. package/dist/demo/demo.d.ts +1 -1
  25. package/dist/dialog-box.vue.d.ts +41 -41
  26. package/dist/exports/config.d.ts +1 -1
  27. package/dist/exports/display.d.ts +2 -2
  28. package/dist/exports/plugins.d.ts +20 -20
  29. package/dist/favicon.svg +30 -30
  30. package/dist/{lib/lib.d.ts → lib.d.ts} +14 -15
  31. package/dist/main.d.ts +6 -6
  32. package/dist/narrat.es.js +23731 -21080
  33. package/dist/narrat.es.js.map +1 -1
  34. package/dist/narrat.umd.js +91 -91
  35. package/dist/narrat.umd.js.map +1 -1
  36. package/dist/plugins/NarratPlugin.d.ts +11 -11
  37. package/dist/stores/audio-store.d.ts +48 -48
  38. package/dist/stores/dialog-store.d.ts +32 -32
  39. package/dist/stores/hud-stats-store.d.ts +22 -22
  40. package/dist/stores/inventory-store.d.ts +37 -37
  41. package/dist/stores/main-store.d.ts +391 -391
  42. package/dist/stores/notification-store.d.ts +15 -15
  43. package/dist/stores/quest-log.d.ts +39 -39
  44. package/dist/stores/rendering-store.d.ts +13 -13
  45. package/dist/stores/screens-store.d.ts +35 -35
  46. package/dist/stores/skills.d.ts +40 -40
  47. package/dist/stores/vm-store.d.ts +178 -178
  48. package/dist/style.css +1 -1
  49. package/dist/types/app-types.d.ts +5 -5
  50. package/dist/types/character-types.d.ts +27 -27
  51. package/dist/types/dialog-box-types.d.ts +11 -11
  52. package/dist/types/game-save.d.ts +30 -30
  53. package/dist/types/parser.d.ts +93 -93
  54. package/dist/types/state.d.ts +3 -3
  55. package/dist/utils/InputsListener.d.ts +9 -9
  56. package/dist/utils/ajax.d.ts +1 -1
  57. package/dist/utils/audio-loader.d.ts +10 -10
  58. package/dist/utils/characters.d.ts +5 -5
  59. package/dist/utils/data-helpers.d.ts +25 -25
  60. package/dist/utils/debounce.d.ts +14 -14
  61. package/dist/utils/error-handling.d.ts +3 -3
  62. package/dist/utils/helpers.d.ts +6 -6
  63. package/dist/utils/images-loader.d.ts +6 -6
  64. package/dist/utils/logger.d.ts +11 -11
  65. package/dist/utils/object-iterators.d.ts +8 -8
  66. package/dist/utils/promises.d.ts +1 -1
  67. package/dist/utils/randomId.d.ts +1 -1
  68. package/dist/utils/save-helpers.d.ts +15 -15
  69. package/dist/utils/skillchecks.d.ts +17 -17
  70. package/dist/utils/string-helpers.d.ts +3 -3
  71. package/dist/utils/time-helpers.d.ts +2 -2
  72. package/dist/utils/transition.d.ts +15 -15
  73. package/dist/utils/type-utils.d.ts +1 -1
  74. package/dist/utils/typed-emitter.d.ts +18 -18
  75. package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
  76. package/dist/vm/commands/audio-commands.d.ts +15 -15
  77. package/dist/vm/commands/choice.d.ts +37 -37
  78. package/dist/vm/commands/clear_dialog.d.ts +2 -2
  79. package/dist/vm/commands/command-helpers.d.ts +3 -3
  80. package/dist/vm/commands/command-plugin.d.ts +43 -43
  81. package/dist/vm/commands/flow-commands.d.ts +18 -18
  82. package/dist/vm/commands/if.d.ts +10 -10
  83. package/dist/vm/commands/index.d.ts +2 -2
  84. package/dist/vm/commands/inventory-commands.d.ts +15 -15
  85. package/dist/vm/commands/logic-command.d.ts +42 -42
  86. package/dist/vm/commands/math-commands.d.ts +30 -30
  87. package/dist/vm/commands/notify.d.ts +6 -6
  88. package/dist/vm/commands/quest-commands.d.ts +30 -30
  89. package/dist/vm/commands/random-commands.d.ts +10 -10
  90. package/dist/vm/commands/screen-commands.d.ts +15 -15
  91. package/dist/vm/commands/set.d.ts +6 -6
  92. package/dist/vm/commands/skill-commands.d.ts +30 -30
  93. package/dist/vm/commands/stats-commands.d.ts +12 -12
  94. package/dist/vm/commands/string-commands.d.ts +9 -9
  95. package/dist/vm/commands/text-field.d.ts +7 -7
  96. package/dist/vm/commands/text.d.ts +14 -14
  97. package/dist/vm/commands/wait.d.ts +4 -4
  98. package/dist/vm/vm-helpers.d.ts +18 -18
  99. package/dist/vm/vm-parser.d.ts +19 -19
  100. package/dist/vm/vm-parser.test.d.ts +1 -1
  101. package/dist/vm/vm.d.ts +18 -18
  102. package/package.json +88 -88
  103. package/README.md +0 -120
  104. package/dist/img/backgrounds/map.png +0 -0
  105. package/dist/img/backgrounds/narrat.png +0 -0
  106. package/dist/img/backgrounds/rpg.png +0 -0
  107. package/dist/img/backgrounds/test-layers.gif +0 -0
  108. package/dist/img/characters/cat_idle.jpg +0 -0
  109. package/dist/img/characters/helper_cat.png +0 -0
  110. package/dist/img/characters/inner_voice.png +0 -0
  111. package/dist/img/enemies/goblin.png +0 -0
  112. package/dist/img/enemies/skeleton.png +0 -0
  113. package/dist/img/enemies/slime.png +0 -0
  114. package/dist/img/h01.gif +0 -0
  115. package/dist/img/items/book.png +0 -0
  116. package/dist/img/items/bread.png +0 -0
  117. package/dist/img/levels/cave.png +0 -0
  118. package/dist/img/levels/dungeon.png +0 -0
  119. package/dist/img/levels/dungeon_F.png +0 -0
  120. package/dist/img/levels/dungeon_FL.png +0 -0
  121. package/dist/img/levels/dungeon_FR.png +0 -0
  122. package/dist/img/levels/dungeon_FRL.png +0 -0
  123. package/dist/img/levels/dungeon_LR.png +0 -0
  124. package/dist/img/levels/grass.png +0 -0
  125. package/dist/img/players/wizard.png +0 -0
  126. package/dist/img/skills/agility.jpg +0 -0
  127. package/dist/img/skills/logic.jpg +0 -0
  128. package/dist/img/splash-texture.png +0 -0
  129. package/dist/img/ui/energy.png +0 -0
  130. package/dist/img/ui/front.png +0 -0
  131. package/dist/img/ui/left.png +0 -0
  132. package/dist/img/ui/money.png +0 -0
  133. package/dist/img/ui/park-button.png +0 -0
  134. package/dist/img/ui/right.png +0 -0
  135. package/dist/img/ui/shop-button.png +0 -0
  136. package/dist/img/ui/start.png +0 -0
package/dist/config.d.ts CHANGED
@@ -1,178 +1,178 @@
1
- import { TransitionSettings } from './utils/transition';
2
- export declare function setConfig(conf: Config): void;
3
- export declare function getConfig(): Config;
4
- export declare function getSkillConfig(id: string): SkillData;
5
- export declare function getImageUrl(imageKeyOrUrl: string): string;
6
- export declare function getAssetUrl(assetPath: string): string;
7
- export declare function getButtonConfig(button: string): ButtonConfig;
8
- export declare function getItemConfig(id: string): ItemData;
9
- export declare function getQuestConfig(questId: string): QuestData;
10
- export declare function getObjectiveConfig(quest: string, objectiveId: string): ObjectiveData;
11
- export interface AppOptions {
12
- baseAssetsPath?: string;
13
- logging: boolean;
14
- debug: boolean;
15
- }
16
- export interface Config {
17
- baseAssetsPath?: string;
18
- gameTitle: string;
19
- images: {
20
- [key: string]: string;
21
- };
22
- layout: {
23
- backgrounds: {
24
- width: number;
25
- height: number;
26
- };
27
- dialogBottomPadding: number;
28
- minTextWidth: number;
29
- mobileDialogHeightPercentage: number;
30
- verticalLayoutThreshold: number;
31
- portraits: {
32
- width: number;
33
- height: number;
34
- };
35
- };
36
- gameFlow: {
37
- labelToJumpOnScriptEnd?: string;
38
- };
39
- screens: {
40
- [key: string]: ScreenConfig;
41
- };
42
- buttons: {
43
- [key: string]: ButtonConfig;
44
- };
45
- skills: {
46
- [key: string]: SkillData;
47
- };
48
- skillOptions: {
49
- xpPerLevel: number;
50
- notifyLevelUp: boolean;
51
- };
52
- skillChecks: {
53
- rollRange: number;
54
- skillMultiplier: number;
55
- failureChance: number;
56
- difficultyText: Array<[number, string]>;
57
- };
58
- scripts: string[];
59
- audio: {
60
- [key: string]: AudioConfig;
61
- };
62
- audioOptions: {
63
- volume: number;
64
- defaultMusic?: string;
65
- musicFadeInTime: number;
66
- musicFadeInDelay: number;
67
- musicFadeOutTime: number;
68
- };
69
- sound?: {
70
- [key: string]: AudioConfig;
71
- };
72
- music?: {
73
- [key: string]: AudioConfig;
74
- };
75
- notifications: {
76
- timeOnScreen: number;
77
- alsoPrintInDialogue?: boolean;
78
- };
79
- hudStats: {
80
- [key: string]: HudStatConfig;
81
- };
82
- items: {
83
- [key: string]: ItemData;
84
- };
85
- interactionTags: {
86
- [key: string]: {
87
- onlyInteractOutsideOfScripts: boolean;
88
- };
89
- };
90
- quests: {
91
- [key: string]: QuestData;
92
- };
93
- transitions: {
94
- [key: string]: TransitionSettings;
95
- };
96
- audioTriggers: {
97
- [key: string]: string;
98
- };
99
- menuButtons: {
100
- [key: string]: MenuButtonData;
101
- };
102
- debugging: {
103
- showScriptFinishedMessage?: boolean;
104
- };
105
- }
106
- export interface ScreenConfig {
107
- background: string;
108
- buttons: Array<string | InlineButtonConfig>;
109
- }
110
- export interface MenuButtonData {
111
- text: string;
112
- }
113
- export interface QuestData {
114
- title: string;
115
- description: string;
116
- objectives: {
117
- [key: string]: ObjectiveData;
118
- };
119
- }
120
- export interface ObjectiveData {
121
- description: string;
122
- hidden?: boolean;
123
- }
124
- export interface ItemData {
125
- name: string;
126
- description: string;
127
- icon: string;
128
- onUse?: {
129
- action: 'jump' | 'run';
130
- label: string;
131
- };
132
- tag?: string;
133
- }
134
- export interface HudStatConfig {
135
- name: string;
136
- icon: string;
137
- startingValue: number;
138
- minValue?: number;
139
- maxValue?: number;
140
- }
141
- export interface AudioConfig {
142
- src: string;
143
- path?: string;
144
- volume?: number;
145
- rate?: number;
146
- html5?: boolean;
147
- }
148
- export interface MusicConfig extends AudioConfig {
149
- loop?: boolean;
150
- }
151
- export interface ButtonConfig {
152
- enabled: boolean;
153
- background?: string;
154
- text?: string;
155
- position: {
156
- left: number;
157
- top: number;
158
- width?: number;
159
- height?: number;
160
- };
161
- anchor?: {
162
- x: number;
163
- y: number;
164
- };
165
- action: string;
166
- actionType?: 'jump' | 'run';
167
- tag?: string;
168
- }
169
- export interface InlineButtonConfig extends ButtonConfig {
170
- id: string;
171
- }
172
- export interface SkillData {
173
- name: string;
174
- description: string;
175
- startingLevel: number;
176
- hidden?: boolean;
177
- icon: string;
178
- }
1
+ import { TransitionSettings } from './utils/transition';
2
+ export declare function setConfig(conf: Config): void;
3
+ export declare function getConfig(): Config;
4
+ export declare function getSkillConfig(id: string): SkillData;
5
+ export declare function getImageUrl(imageKeyOrUrl: string): string;
6
+ export declare function getAssetUrl(assetPath: string): string;
7
+ export declare function getButtonConfig(button: string): ButtonConfig;
8
+ export declare function getItemConfig(id: string): ItemData;
9
+ export declare function getQuestConfig(questId: string): QuestData;
10
+ export declare function getObjectiveConfig(quest: string, objectiveId: string): ObjectiveData;
11
+ export interface AppOptions {
12
+ baseAssetsPath?: string;
13
+ logging: boolean;
14
+ debug: boolean;
15
+ }
16
+ export interface Config {
17
+ baseAssetsPath?: string;
18
+ gameTitle: string;
19
+ images: {
20
+ [key: string]: string;
21
+ };
22
+ layout: {
23
+ backgrounds: {
24
+ width: number;
25
+ height: number;
26
+ };
27
+ dialogBottomPadding: number;
28
+ minTextWidth: number;
29
+ mobileDialogHeightPercentage: number;
30
+ verticalLayoutThreshold: number;
31
+ portraits: {
32
+ width: number;
33
+ height: number;
34
+ };
35
+ };
36
+ gameFlow: {
37
+ labelToJumpOnScriptEnd?: string;
38
+ };
39
+ screens: {
40
+ [key: string]: ScreenConfig;
41
+ };
42
+ buttons: {
43
+ [key: string]: ButtonConfig;
44
+ };
45
+ skills: {
46
+ [key: string]: SkillData;
47
+ };
48
+ skillOptions: {
49
+ xpPerLevel: number;
50
+ notifyLevelUp: boolean;
51
+ };
52
+ skillChecks: {
53
+ rollRange: number;
54
+ skillMultiplier: number;
55
+ failureChance: number;
56
+ difficultyText: Array<[number, string]>;
57
+ };
58
+ scripts: string[];
59
+ audio: {
60
+ [key: string]: AudioConfig;
61
+ };
62
+ audioOptions: {
63
+ volume: number;
64
+ defaultMusic?: string;
65
+ musicFadeInTime: number;
66
+ musicFadeInDelay: number;
67
+ musicFadeOutTime: number;
68
+ };
69
+ sound?: {
70
+ [key: string]: AudioConfig;
71
+ };
72
+ music?: {
73
+ [key: string]: AudioConfig;
74
+ };
75
+ notifications: {
76
+ timeOnScreen: number;
77
+ alsoPrintInDialogue?: boolean;
78
+ };
79
+ hudStats: {
80
+ [key: string]: HudStatConfig;
81
+ };
82
+ items: {
83
+ [key: string]: ItemData;
84
+ };
85
+ interactionTags: {
86
+ [key: string]: {
87
+ onlyInteractOutsideOfScripts: boolean;
88
+ };
89
+ };
90
+ quests: {
91
+ [key: string]: QuestData;
92
+ };
93
+ transitions: {
94
+ [key: string]: TransitionSettings;
95
+ };
96
+ audioTriggers: {
97
+ [key: string]: string;
98
+ };
99
+ menuButtons: {
100
+ [key: string]: MenuButtonData;
101
+ };
102
+ debugging: {
103
+ showScriptFinishedMessage?: boolean;
104
+ };
105
+ }
106
+ export interface ScreenConfig {
107
+ background: string;
108
+ buttons: Array<string | InlineButtonConfig>;
109
+ }
110
+ export interface MenuButtonData {
111
+ text: string;
112
+ }
113
+ export interface QuestData {
114
+ title: string;
115
+ description: string;
116
+ objectives: {
117
+ [key: string]: ObjectiveData;
118
+ };
119
+ }
120
+ export interface ObjectiveData {
121
+ description: string;
122
+ hidden?: boolean;
123
+ }
124
+ export interface ItemData {
125
+ name: string;
126
+ description: string;
127
+ icon: string;
128
+ onUse?: {
129
+ action: 'jump' | 'run';
130
+ label: string;
131
+ };
132
+ tag?: string;
133
+ }
134
+ export interface HudStatConfig {
135
+ name: string;
136
+ icon: string;
137
+ startingValue: number;
138
+ minValue?: number;
139
+ maxValue?: number;
140
+ }
141
+ export interface AudioConfig {
142
+ src: string;
143
+ path?: string;
144
+ volume?: number;
145
+ rate?: number;
146
+ html5?: boolean;
147
+ }
148
+ export interface MusicConfig extends AudioConfig {
149
+ loop?: boolean;
150
+ }
151
+ export interface ButtonConfig {
152
+ enabled: boolean;
153
+ background?: string;
154
+ text?: string;
155
+ position: {
156
+ left: number;
157
+ top: number;
158
+ width?: number;
159
+ height?: number;
160
+ };
161
+ anchor?: {
162
+ x: number;
163
+ y: number;
164
+ };
165
+ action: string;
166
+ actionType?: 'jump' | 'run';
167
+ tag?: string;
168
+ }
169
+ export interface InlineButtonConfig extends ButtonConfig {
170
+ id: string;
171
+ }
172
+ export interface SkillData {
173
+ name: string;
174
+ description: string;
175
+ startingLevel: number;
176
+ hidden?: boolean;
177
+ icon: string;
178
+ }
@@ -1,8 +1,8 @@
1
- export declare const SAVE_FILE = "gameSave";
2
- export declare const PRE_SIGNAL = "###_--_~=:;";
3
- export declare const JUMP_SIGNAL = "###_--_~=:;_JUMP";
4
- export declare const RETURN_SIGNAL = "###_--_~=:;_RETURN";
5
- export declare const OK_SIGNAL = "###_--_~=:;_OK";
6
- export declare const STOP_SIGNAL = "###_--_~=:;_STOP";
7
- export declare type ReturnSignal = typeof JUMP_SIGNAL | typeof RETURN_SIGNAL | typeof OK_SIGNAL | typeof STOP_SIGNAL;
8
- export declare function isReturnSignal(s: string): s is ReturnSignal;
1
+ export declare const SAVE_FILE = "gameSave";
2
+ export declare const PRE_SIGNAL = "###_--_~=:;";
3
+ export declare const JUMP_SIGNAL = "###_--_~=:;_JUMP";
4
+ export declare const RETURN_SIGNAL = "###_--_~=:;_RETURN";
5
+ export declare const OK_SIGNAL = "###_--_~=:;_OK";
6
+ export declare const STOP_SIGNAL = "###_--_~=:;_STOP";
7
+ export declare type ReturnSignal = typeof JUMP_SIGNAL | typeof RETURN_SIGNAL | typeof OK_SIGNAL | typeof STOP_SIGNAL;
8
+ export declare function isReturnSignal(s: string): s is ReturnSignal;
@@ -1,2 +1,2 @@
1
- import { Config } from './config';
2
- export declare const defaultConfig: Config;
1
+ import { Config } from './config';
2
+ export declare const defaultConfig: Config;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,41 +1,41 @@
1
- import { PropType } from 'vue';
2
- import { DialogChoice } from './stores/dialog-store';
3
- import { DialogStyle } from './types/character-types';
4
- import { DialogBoxParameters } from './types/dialog-box-types';
5
- declare const _default: import("vue").DefineComponent<{
6
- options: {
7
- type: PropType<DialogBoxParameters>;
8
- required: true;
9
- };
10
- active: BooleanConstructor;
11
- }, unknown, {
12
- playerText: string;
13
- passed: boolean;
14
- listener: any;
15
- timeout: any;
16
- }, {
17
- preText(): string;
18
- style(): DialogStyle;
19
- dialogBoxStyle(): any;
20
- titleStyle(): any;
21
- textStyle(): any;
22
- choices(): DialogChoice[] | undefined;
23
- canInteract(): boolean;
24
- paused: () => boolean;
25
- }, {
26
- clearListeners(): void;
27
- chooseOption(choice: DialogChoice | number): void;
28
- finishLine(): void;
29
- dialogStyle(choice: DialogChoice): any;
30
- dialogClass(choice: DialogChoice): "strike-anim" | undefined;
31
- submitText(): void;
32
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
- options: {
34
- type: PropType<DialogBoxParameters>;
35
- required: true;
36
- };
37
- active: BooleanConstructor;
38
- }>>, {
39
- active: boolean;
40
- }>;
41
- export default _default;
1
+ import { PropType } from 'vue';
2
+ import { DialogChoice } from './stores/dialog-store';
3
+ import { DialogStyle } from './types/character-types';
4
+ import { DialogBoxParameters } from './types/dialog-box-types';
5
+ declare const _default: import("vue").DefineComponent<{
6
+ options: {
7
+ type: PropType<DialogBoxParameters>;
8
+ required: true;
9
+ };
10
+ active: BooleanConstructor;
11
+ }, unknown, {
12
+ playerText: string;
13
+ passed: boolean;
14
+ listener: any;
15
+ timeout: any;
16
+ }, {
17
+ preText(): string;
18
+ style(): DialogStyle;
19
+ dialogBoxStyle(): any;
20
+ titleStyle(): any;
21
+ textStyle(): any;
22
+ choices(): DialogChoice[] | undefined;
23
+ canInteract(): boolean;
24
+ paused: () => boolean;
25
+ }, {
26
+ clearListeners(): void;
27
+ chooseOption(choice: DialogChoice | number): void;
28
+ finishLine(): void;
29
+ dialogStyle(choice: DialogChoice): any;
30
+ dialogClass(choice: DialogChoice): "strike-anim" | undefined;
31
+ submitText(): void;
32
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
33
+ options: {
34
+ type: PropType<DialogBoxParameters>;
35
+ required: true;
36
+ };
37
+ active: BooleanConstructor;
38
+ }>>, {
39
+ active: boolean;
40
+ }>;
41
+ export default _default;
@@ -1 +1 @@
1
- export { getConfig } from '../config';
1
+ export { getConfig } from '../config';
@@ -1,2 +1,2 @@
1
- import { aspectRatioFit } from '../utils/helpers';
2
- export { aspectRatioFit };
1
+ import { aspectRatioFit } from '../utils/helpers';
2
+ export { aspectRatioFit };
@@ -1,20 +1,20 @@
1
- import { NarratPlugin } from '../plugins/NarratPlugin';
2
- import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
3
- import type { CommandRunner } from '../vm/commands/command-plugin';
4
- export declare type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
5
- declare type NarratPluginObject<T> = {
6
- onPageLoaded?: NarratLifecycleHook;
7
- onNarratSetup?: NarratLifecycleHook;
8
- onAppMounted?: NarratLifecycleHook;
9
- onAssetsLoaded?: NarratLifecycleHook;
10
- onGameSetup?: NarratLifecycleHook;
11
- onGameStart?: NarratLifecycleHook;
12
- onGameMounted?: NarratLifecycleHook;
13
- onGameUnmounted?: NarratLifecycleHook;
14
- customCommands?: CommandPlugin<T>[];
15
- };
16
- declare function registerPlugin<T>(plugin: NarratPluginObject<T>): void;
17
- declare function addCommand<T>(command: CommandPlugin<T>): void;
18
- export { CommandRunner };
19
- export { CommandPlugin, NarratPlugin, registerPlugin, addCommand, generateParser, };
20
- export type { NarratPluginObject };
1
+ import { NarratPlugin } from '../plugins/NarratPlugin';
2
+ import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
3
+ import type { CommandRunner } from '../vm/commands/command-plugin';
4
+ export declare type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
5
+ declare type NarratPluginObject<T> = {
6
+ onPageLoaded?: NarratLifecycleHook;
7
+ onNarratSetup?: NarratLifecycleHook;
8
+ onAppMounted?: NarratLifecycleHook;
9
+ onAssetsLoaded?: NarratLifecycleHook;
10
+ onGameSetup?: NarratLifecycleHook;
11
+ onGameStart?: NarratLifecycleHook;
12
+ onGameMounted?: NarratLifecycleHook;
13
+ onGameUnmounted?: NarratLifecycleHook;
14
+ customCommands?: CommandPlugin<T>[];
15
+ };
16
+ declare function registerPlugin<T>(plugin: NarratPluginObject<T>): void;
17
+ declare function addCommand<T>(command: CommandPlugin<T>): void;
18
+ export { CommandRunner };
19
+ export { CommandPlugin, NarratPlugin, registerPlugin, addCommand, generateParser, };
20
+ export type { NarratPluginObject };
package/dist/favicon.svg CHANGED
@@ -1,30 +1,30 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Rat" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 595.3 595.3" style="enable-background:new 0 0 595.3 595.3;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{fill:#E23B33;}
7
- </style>
8
- <path id="Rat_Shape" class="st0" d="M556.9,82.5c-10.8-24.3-47-57.1-71.3-65.6c-24.3-8.4-64.1-0.3-88.7,22.3
9
- c-20,18.4-26,28.2-29.1,37c-2.1,5.9-4.8,13.5-6,20.9v0c-0.5,4.1-4.5,7-8.6,6.1c-10.4-2.3-29.5-6-44.4-6.3
10
- c-13.7-0.2-30.1,3.2-40.4,5.7c-4.5,1.1-8.8-2.2-8.8-6.8c-0.1-5.3-1.1-12.3-4.8-19.6c-8.5-16.9-19.6-32.6-57.8-47.4
11
- c-31.9-12.4-75.1-9.7-100.8,1.8c-28.1,12.6-42.4,37.9-54,61.8c-14.4,29.8-14.9,83.6-6.4,104c12.8,30.7,35.8,47.2,52.6,53
12
- c11.3,3.8,28.2,3.7,38.2,3.3c4.2-0.2,7.7,3.3,7.5,7.5c-0.7,13.6-0.9,41.5,7,61.4c7.7,19.4,29.7,62.3,50.7,101.2
13
- c0,0.1-14.6,2.9-31.4,6.8c-23.9,5.5-52.6,12.7-54.3,13.7c-3.5,2.1-3,10-2.7,12c0.5,3.4,5.3,8.1,6.9,8.3c3.9,0.3,31.3-7.6,55.7-14.6
14
- c18.5-5.3,34.9-9.3,35.5-8.2c5.1,9.3,10,18,14.4,25.8c5.2,9.1,10.7,16.4,14.1,23.6c1.1,2.3-16.6,5.8-32.5,14.7
15
- c-16.4,9.1-29.7,21-32.3,24c-1.8,2.1-3,6-1.2,10.7c1.1,2.9,10,5.7,12.4,5.1c6.8-1.7,16.5-12.5,33.1-21.1
16
- c16.3-8.5,32.9-14.9,33.8-13.6c9.7,14.3,16.9,21.6,22.6,31.2c9.8,16.5,27.3,45.9,46.6,39.5c6.4-2.1,31.1-33.6,53.3-68.6
17
- c1.3-2.1,16.1,11.3,30.4,23.2c13.8,11.4,22.7,20.6,27.1,21.4c5.4,1,14.2-7.7,14.1-14.7c-0.1-2.7-14.3-13.8-29.1-26.2
18
- c-14.5-12.1-30.1-22.8-29.2-24.3c7.6-12,14.5-23.7,20.1-33.9c4.3-7.8,8.9-16,13-24.7c0.6-1.2,15.9,3,31.4,7.1c15.3,4,26.7,10,31,8
19
- c6.9-3,11.6-13.8,9.4-18.3c-1.1-2.3-17-7.3-33.2-12c-14.2-4.1-28-6.5-27.7-7.3c15.5-34,28.8-64.8,27.6-69.6
20
- c-1.7-7.1,2.6-11.9,7-36.5c3.2-18.1,4.7-40.9,5.2-51.7c0.2-3.5,2.8-6.3,6.3-6.7c3.1-0.3,6.9-0.9,10.5-1.9c7.8-2,18.6-7.8,36.4-20.6
21
- c17.9-12.8,38.7-49.6,44.4-67.8S567.6,106.8,556.9,82.5z M265.1,336.2c-8.1,4-13,7-26.4,9.6c-6.9,1.4-29.4-0.2-40.7-4.6
22
- c-10.5-4.1-19.9-7.6-30-15.4s-15.7-13.2-15.7-15.3c0-4.4,6-9.4,11-9.4c5.1,0,14.5,9.2,29.7,16.6c14.3,7,17.9,6.1,25.4,7.3
23
- c2.9,0.5,7.7,0.6,10.7,0.4c14.1-1.3,21.4-5.9,25.3-8.8c4-3,13.7-12.9,17.2-12.5c8,1,18.9,3.4,18.9,7.1
24
- C290.4,319,273.2,332.1,265.1,336.2z M320.9,521.4c-4.3,3.7-17.7,13.5-23.3,13.5c-2.8,0-7.4-8.2-11.5-16.8
25
- c-4.1-8.5-9.1-21.1-9.1-31.6c0-4.6,6-7.4,13.4-9.2c7.2-1.7,27.3-1.8,29.9-1.1c6.8,1.7,12.9,2.2,12.7,6.4c-0.4,12.7-7,18.9-8.3,24.3
26
- C323.4,512.3,323.4,519.2,320.9,521.4z M431.1,320.3c-9.2,7.4-10.6,8.1-24.9,13.7c-11.3,4.4-28.6,5.8-41.6,3.6
27
- c-12.2-2.1-22.3-4.6-29.5-10.1c-9.7-7.3-16.4-15.1-16.4-19.8c0-3.7,6.4-4.3,14.5-4.9c3.5-0.3,9.3,5.9,13.2,9.2
28
- c8.1,6.8,14.8,8,28.8,9.9c2.9,0.4,7.8,0.4,10.7,0.1c7.5-0.9,12-0.4,25.8-8.2c20-11.2,17.8-14.4,25.1-12.6c2.2,0.6,5.8,1.2,5.6,5.6
29
- C442.4,309,440.5,312.7,431.1,320.3z"/>
30
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Rat" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 595.3 595.3" style="enable-background:new 0 0 595.3 595.3;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{fill:#E23B33;}
7
+ </style>
8
+ <path id="Rat_Shape" class="st0" d="M556.9,82.5c-10.8-24.3-47-57.1-71.3-65.6c-24.3-8.4-64.1-0.3-88.7,22.3
9
+ c-20,18.4-26,28.2-29.1,37c-2.1,5.9-4.8,13.5-6,20.9v0c-0.5,4.1-4.5,7-8.6,6.1c-10.4-2.3-29.5-6-44.4-6.3
10
+ c-13.7-0.2-30.1,3.2-40.4,5.7c-4.5,1.1-8.8-2.2-8.8-6.8c-0.1-5.3-1.1-12.3-4.8-19.6c-8.5-16.9-19.6-32.6-57.8-47.4
11
+ c-31.9-12.4-75.1-9.7-100.8,1.8c-28.1,12.6-42.4,37.9-54,61.8c-14.4,29.8-14.9,83.6-6.4,104c12.8,30.7,35.8,47.2,52.6,53
12
+ c11.3,3.8,28.2,3.7,38.2,3.3c4.2-0.2,7.7,3.3,7.5,7.5c-0.7,13.6-0.9,41.5,7,61.4c7.7,19.4,29.7,62.3,50.7,101.2
13
+ c0,0.1-14.6,2.9-31.4,6.8c-23.9,5.5-52.6,12.7-54.3,13.7c-3.5,2.1-3,10-2.7,12c0.5,3.4,5.3,8.1,6.9,8.3c3.9,0.3,31.3-7.6,55.7-14.6
14
+ c18.5-5.3,34.9-9.3,35.5-8.2c5.1,9.3,10,18,14.4,25.8c5.2,9.1,10.7,16.4,14.1,23.6c1.1,2.3-16.6,5.8-32.5,14.7
15
+ c-16.4,9.1-29.7,21-32.3,24c-1.8,2.1-3,6-1.2,10.7c1.1,2.9,10,5.7,12.4,5.1c6.8-1.7,16.5-12.5,33.1-21.1
16
+ c16.3-8.5,32.9-14.9,33.8-13.6c9.7,14.3,16.9,21.6,22.6,31.2c9.8,16.5,27.3,45.9,46.6,39.5c6.4-2.1,31.1-33.6,53.3-68.6
17
+ c1.3-2.1,16.1,11.3,30.4,23.2c13.8,11.4,22.7,20.6,27.1,21.4c5.4,1,14.2-7.7,14.1-14.7c-0.1-2.7-14.3-13.8-29.1-26.2
18
+ c-14.5-12.1-30.1-22.8-29.2-24.3c7.6-12,14.5-23.7,20.1-33.9c4.3-7.8,8.9-16,13-24.7c0.6-1.2,15.9,3,31.4,7.1c15.3,4,26.7,10,31,8
19
+ c6.9-3,11.6-13.8,9.4-18.3c-1.1-2.3-17-7.3-33.2-12c-14.2-4.1-28-6.5-27.7-7.3c15.5-34,28.8-64.8,27.6-69.6
20
+ c-1.7-7.1,2.6-11.9,7-36.5c3.2-18.1,4.7-40.9,5.2-51.7c0.2-3.5,2.8-6.3,6.3-6.7c3.1-0.3,6.9-0.9,10.5-1.9c7.8-2,18.6-7.8,36.4-20.6
21
+ c17.9-12.8,38.7-49.6,44.4-67.8S567.6,106.8,556.9,82.5z M265.1,336.2c-8.1,4-13,7-26.4,9.6c-6.9,1.4-29.4-0.2-40.7-4.6
22
+ c-10.5-4.1-19.9-7.6-30-15.4s-15.7-13.2-15.7-15.3c0-4.4,6-9.4,11-9.4c5.1,0,14.5,9.2,29.7,16.6c14.3,7,17.9,6.1,25.4,7.3
23
+ c2.9,0.5,7.7,0.6,10.7,0.4c14.1-1.3,21.4-5.9,25.3-8.8c4-3,13.7-12.9,17.2-12.5c8,1,18.9,3.4,18.9,7.1
24
+ C290.4,319,273.2,332.1,265.1,336.2z M320.9,521.4c-4.3,3.7-17.7,13.5-23.3,13.5c-2.8,0-7.4-8.2-11.5-16.8
25
+ c-4.1-8.5-9.1-21.1-9.1-31.6c0-4.6,6-7.4,13.4-9.2c7.2-1.7,27.3-1.8,29.9-1.1c6.8,1.7,12.9,2.2,12.7,6.4c-0.4,12.7-7,18.9-8.3,24.3
26
+ C323.4,512.3,323.4,519.2,320.9,521.4z M431.1,320.3c-9.2,7.4-10.6,8.1-24.9,13.7c-11.3,4.4-28.6,5.8-41.6,3.6
27
+ c-12.2-2.1-22.3-4.6-29.5-10.1c-9.7-7.3-16.4-15.1-16.4-19.8c0-3.7,6.4-4.3,14.5-4.9c3.5-0.3,9.3,5.9,13.2,9.2
28
+ c8.1,6.8,14.8,8,28.8,9.9c2.9,0.4,7.8,0.4,10.7,0.1c7.5-0.9,12-0.4,25.8-8.2c20-11.2,17.8-14.4,25.1-12.6c2.2,0.6,5.8,1.2,5.6,5.6
29
+ C442.4,309,440.5,312.7,431.1,320.3z"/>
30
+ </svg>
@@ -1,15 +1,14 @@
1
- import { App } from 'vue';
2
- import 'es6-promise/auto';
3
- import './/../sass/main.css';
4
- export * from '../main';
5
- export declare type Narrat = {
6
- app: App;
7
- };
8
- declare global {
9
- export interface Window {
10
- narrat: Narrat;
11
- }
12
- }
13
- export * from '../exports/plugins';
14
- export * from '../exports/display';
15
- export * from '../exports/config';
1
+ import { App } from 'vue';
2
+ import 'es6-promise/auto';
3
+ export * from './main';
4
+ export declare type Narrat = {
5
+ app: App;
6
+ };
7
+ declare global {
8
+ export interface Window {
9
+ narrat: Narrat;
10
+ }
11
+ }
12
+ export * from './exports/plugins';
13
+ export * from './exports/display';
14
+ export * from './exports/config';
package/dist/main.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import 'es6-promise/auto';
2
- import 'virtual:windi.css';
3
- import './/sass/main.css';
4
- import { GameConfig } from './types/app-types';
5
- import { AppOptions } from './config';
6
- export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;
1
+ import 'es6-promise/auto';
2
+ import 'virtual:windi.css';
3
+ import './css/main.css';
4
+ import { GameConfig } from './types/app-types';
5
+ import { AppOptions } from './config';
6
+ export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;