narrat 0.11.4 → 0.18.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 (53) hide show
  1. package/CHANGELOG.md +336 -0
  2. package/LICENSE +21 -21
  3. package/README.md +30 -30
  4. package/lib/app.vue.d.ts +83 -17
  5. package/lib/components/MainMenu.vue.d.ts +8 -49
  6. package/lib/components/Skills.vue.d.ts +6 -7
  7. package/lib/components/debug/debug-menu.vue.d.ts +18 -8
  8. package/lib/components/dialog-picture.vue.d.ts +4 -5
  9. package/lib/components/hud.vue.d.ts +4 -2
  10. package/lib/components/inventory.vue.d.ts +30 -0
  11. package/lib/components/loading-bar.vue.d.ts +4 -7
  12. package/lib/components/menu.vue.d.ts +4 -48
  13. package/lib/components/notification-toast.vue.d.ts +3 -4
  14. package/lib/components/utils/modal.vue.d.ts +3 -5
  15. package/lib/components/volume-controls.vue.d.ts +1 -1
  16. package/lib/config.d.ts +10 -2
  17. package/lib/dialog-box.vue.d.ts +9 -8
  18. package/lib/exports/plugins.d.ts +0 -3
  19. package/lib/gameloop.d.ts +1 -3
  20. package/lib/index.d.ts +1 -4
  21. package/lib/index.esm.js +7643 -7219
  22. package/lib/index.js +7642 -7217
  23. package/lib/plugins/NarratPlugin.d.ts +1 -1
  24. package/lib/store.d.ts +1 -1
  25. package/lib/stores/audio-store.d.ts +11 -0
  26. package/lib/stores/dialog-store.d.ts +27 -0
  27. package/lib/stores/hud-stats-store.d.ts +20 -0
  28. package/lib/stores/inventory-store.d.ts +23 -0
  29. package/lib/stores/main-store.d.ts +268 -0
  30. package/lib/stores/notification-store.d.ts +12 -0
  31. package/lib/stores/rendering-store.d.ts +13 -0
  32. package/lib/stores/screens-store.d.ts +23 -0
  33. package/lib/stores/skills.d.ts +32 -0
  34. package/lib/stores/vm-store.d.ts +151 -0
  35. package/lib/types/dialog-box-types.d.ts +1 -1
  36. package/lib/types/game-save.d.ts +19 -17
  37. package/lib/types/state.d.ts +0 -96
  38. package/lib/utils/audio-loader.d.ts +4 -6
  39. package/lib/utils/data-helpers.d.ts +7 -5
  40. package/lib/utils/error-handling.d.ts +2 -3
  41. package/lib/utils/skillchecks.d.ts +6 -9
  42. package/lib/utils/string-helpers.d.ts +1 -3
  43. package/lib/vm/commands/add_item.d.ts +2 -0
  44. package/lib/vm/commands/choice.d.ts +1 -3
  45. package/lib/vm/commands/command-plugin.d.ts +3 -5
  46. package/lib/vm/commands/remove_item.d.ts +2 -0
  47. package/lib/vm/vm-helpers.d.ts +7 -9
  48. package/lib/vm/vm-parser.d.ts +1 -1
  49. package/lib/vm/vm.d.ts +4 -8
  50. package/package.json +85 -85
  51. package/lib/demo/bitsy/bitsy.d.ts +0 -27
  52. package/lib/display.d.ts +0 -2
  53. package/lib/plugins.d.ts +0 -22
@@ -1,12 +1,13 @@
1
1
  import { SkillData } from '@/config';
2
- import { SkillsState } from '@/types/state';
2
+ import { SkillsState } from '@/stores/skills';
3
3
  declare const _default: import("vue").DefineComponent<{
4
4
  close: any;
5
- }, unknown, {
5
+ }, {
6
+ skills: import("vue").ComputedRef<SkillsState>;
7
+ }, {
6
8
  chosenSkill: boolean | String;
7
9
  }, {
8
10
  skillsToDisplay(): SkillsState;
9
- skills(): SkillsState;
10
11
  skillConf(): {
11
12
  [key: string]: SkillData;
12
13
  };
@@ -19,11 +20,9 @@ declare const _default: import("vue").DefineComponent<{
19
20
  xpBarWidth(xp: number): {
20
21
  width: string;
21
22
  };
22
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
23
- close?: unknown;
24
- } & {
23
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
25
24
  close: any;
26
- } & {}> & {}, {
25
+ }>>, {
27
26
  close: any;
28
27
  }>;
29
28
  export default _default;
@@ -1,6 +1,10 @@
1
- import { ErrorState, SkillCheckState, SkillsState } from '@/types/state';
2
1
  import { Parser } from '@/types/parser';
3
- declare const _default: import("vue").DefineComponent<{}, {}, {
2
+ declare const _default: import("vue").DefineComponent<{}, {
3
+ skills: import("vue").ComputedRef<import("@/stores/skills").SkillsState>;
4
+ skillChecks: import("vue").ComputedRef<{
5
+ [key: string]: import("@/stores/skills").SkillCheckState;
6
+ }>;
7
+ }, {
4
8
  showDebug: boolean;
5
9
  jumping: boolean;
6
10
  searchString: string;
@@ -8,14 +12,20 @@ declare const _default: import("vue").DefineComponent<{}, {}, {
8
12
  matchCursor: number;
9
13
  }, {
10
14
  labels(): string[];
11
- errors(): ErrorState[];
12
- skills(): SkillsState;
13
- skillChecks(): {
14
- [key: string]: SkillCheckState;
15
- };
16
15
  variables(): {
17
16
  [key: string]: any;
18
17
  };
18
+ playing: () => boolean;
19
+ errors: () => {
20
+ text: string;
21
+ }[];
22
+ playTime: () => {
23
+ start: number;
24
+ previousPlaytime: number;
25
+ };
26
+ flowState: () => "menu" | "playing";
27
+ data: () => import("@/stores/vm-store").DataState;
28
+ script: () => Parser.ParsedScript;
19
29
  }, {
20
30
  finishJumping(): void;
21
31
  labelSelected(event: any): void;
@@ -34,5 +44,5 @@ declare const _default: import("vue").DefineComponent<{}, {}, {
34
44
  countWordsInString(string: string): number;
35
45
  countWordsInScriptBranch(branch: Parser.Branch): number;
36
46
  getPlayTimeString(): string;
37
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
47
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
38
48
  export default _default;
@@ -2,9 +2,8 @@ declare const _default: import("vue").DefineComponent<{
2
2
  pictureUrl: StringConstructor;
3
3
  }, unknown, unknown, {
4
4
  boxStyle(): any;
5
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
6
- pictureUrl?: unknown;
7
- } & {} & {
8
- pictureUrl?: string;
9
- }> & {}, {}>;
5
+ layoutMode: () => "horizontal" | "vertical";
6
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ pictureUrl: StringConstructor;
8
+ }>>, {}>;
10
9
  export default _default;
@@ -1,10 +1,12 @@
1
1
  import { HudStatConfig } from '@/config';
2
- import { HudStatsState } from '@/types/state';
2
+ import { HudStatsState } from '@/stores/hud-stats-store';
3
3
  declare const _default: import("vue").DefineComponent<{}, {}, void, {
4
4
  statsConfig(): {
5
5
  [key: string]: HudStatConfig;
6
6
  };
7
7
  stats(): HudStatsState;
8
8
  hudStyle(): any;
9
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
9
+ layoutMode: () => "horizontal" | "vertical";
10
+ hudStats: () => HudStatsState;
11
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
10
12
  export default _default;
@@ -0,0 +1,30 @@
1
+ import { ItemData } from '@/config';
2
+ import { ItemState } from '@/stores/inventory-store';
3
+ declare const _default: import("vue").DefineComponent<{
4
+ close: any;
5
+ }, {
6
+ items: import("vue").ComputedRef<{
7
+ [key: string]: ItemState;
8
+ }>;
9
+ }, {
10
+ chosenId: string | false;
11
+ }, {
12
+ itemsToDisplay(): {
13
+ [key: string]: ItemState;
14
+ };
15
+ chosenItem(): null | ItemState;
16
+ chosenItemConf(): null | ItemData;
17
+ itemConf(): {
18
+ [key: string]: ItemData;
19
+ };
20
+ }, {
21
+ getItemStyle(item: string): any;
22
+ getItemName(item: string): string;
23
+ clickItem(item: string): void;
24
+ closeItem(): void;
25
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
+ close: any;
27
+ }>>, {
28
+ close: any;
29
+ }>;
30
+ export default _default;
@@ -3,11 +3,8 @@ declare const _default: import("vue").DefineComponent<{
3
3
  step: StringConstructor;
4
4
  }, unknown, unknown, {}, {
5
5
  loadingStyle(): any;
6
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
7
- percentage?: unknown;
8
- step?: unknown;
9
- } & {} & {
10
- percentage?: number;
11
- step?: string;
12
- }> & {}, {}>;
6
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ percentage: NumberConstructor;
8
+ step: StringConstructor;
9
+ }>>, {}>;
13
10
  export default _default;
@@ -4,60 +4,16 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
4
4
  activeMenu: string | false;
5
5
  }, {
6
6
  showSkills(): boolean;
7
+ showInventory(): boolean;
7
8
  }, {
8
9
  openMenu(): void;
9
10
  openSkills(): void;
11
+ openInventory(): void;
10
12
  closeMenu(): void;
11
13
  toggleMenu(): void;
12
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<(readonly unknown[] & {
13
- [x: number]: string;
14
- } & {
15
- [Symbol.iterator]?: IterableIterator<string>;
16
- length?: number;
17
- toString?: string;
18
- toLocaleString?: string;
19
- concat?: string[];
20
- join?: string;
21
- slice?: string[];
22
- indexOf?: (searchElement: string, fromIndex?: number) => number;
23
- lastIndexOf?: (searchElement: string, fromIndex?: number) => number;
24
- every?: {
25
- <S extends string>(predicate: (value: string, index: number, array: readonly string[]) => value is S, thisArg?: any): this is readonly S[];
26
- (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any): boolean;
27
- };
28
- some?: (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any) => boolean;
29
- forEach?: (callbackfn: (value: string, index: number, array: readonly string[]) => void, thisArg?: any) => void;
30
- map?: <U>(callbackfn: (value: string, index: number, array: readonly string[]) => U, thisArg?: any) => U[];
31
- filter?: {
32
- <S_1 extends string>(predicate: (value: string, index: number, array: readonly string[]) => value is S_1, thisArg?: any): S_1[];
33
- (predicate: (value: string, index: number, array: readonly string[]) => unknown, thisArg?: any): string[];
34
- };
35
- reduce?: {
36
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string): string;
37
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string, initialValue: string): string;
38
- <U_1>(callbackfn: (previousValue: U_1, currentValue: string, currentIndex: number, array: readonly string[]) => U_1, initialValue: U_1): U_1;
39
- };
40
- reduceRight?: {
41
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string): string;
42
- (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: readonly string[]) => string, initialValue: string): string;
43
- <U_2>(callbackfn: (previousValue: U_2, currentValue: string, currentIndex: number, array: readonly string[]) => U_2, initialValue: U_2): U_2;
44
- };
45
- find?: {
46
- <S_2 extends string>(predicate: (this: void, value: string, index: number, obj: readonly string[]) => value is S_2, thisArg?: any): S_2;
47
- (predicate: (value: string, index: number, obj: readonly string[]) => unknown, thisArg?: any): string;
48
- };
49
- findIndex?: (predicate: (value: string, index: number, obj: readonly string[]) => unknown, thisArg?: any) => number;
50
- entries?: IterableIterator<[number, string]>;
51
- keys?: IterableIterator<number>;
52
- values?: IterableIterator<string>;
53
- includes?: (searchElement: string, fromIndex?: number) => boolean;
54
- flatMap?: <U_3, This = undefined>(callback: (this: This, value: string, index: number, array: string[]) => U_3 | readonly U_3[], thisArg?: This) => U_3[];
55
- flat?: unknown[];
56
- }) | ({
57
- [x: string]: unknown;
58
- } & {} & {
14
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, readonly string[] | Readonly<import("vue").ExtractPropTypes<Readonly<import("vue").ComponentObjectPropsOptions<{
59
15
  [x: string]: unknown;
60
- })> & {}, {
16
+ }>>>>, {
61
17
  [x: number]: string;
62
18
  } | {}>;
63
19
  export default _default;
@@ -1,7 +1,6 @@
1
- import { NotificationState } from '@/types/state';
2
1
  declare const _default: import("vue").DefineComponent<{}, {}, void, {
3
- notifications(): {
4
- [key: string]: NotificationState;
2
+ notifications: () => {
3
+ [key: string]: import("@/stores/notification-store").NotificationState;
5
4
  };
6
- }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
5
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
7
6
  export default _default;
@@ -1,8 +1,6 @@
1
1
  declare const _default: import("vue").DefineComponent<{
2
2
  containerCssClass: StringConstructor;
3
- }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
4
- containerCssClass?: unknown;
5
- } & {} & {
6
- containerCssClass?: string;
7
- }> & {}, {}>;
3
+ }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
4
+ containerCssClass: StringConstructor;
5
+ }>>, {}>;
8
6
  export default _default;
@@ -3,5 +3,5 @@ declare const _default: import("vue").DefineComponent<{}, {}, {
3
3
  }, {}, {
4
4
  changeVolume(event: Event): void;
5
5
  toggleMute(): void;
6
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{} & {} & {}> & ({} | {}), {}>;
6
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
7
7
  export default _default;
package/lib/config.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { Commit } from 'vuex';
2
1
  export declare function setConfig(conf: Config): void;
3
2
  export declare function getConfig(): Config;
4
- export declare function getSkillConfig(commit: Commit, id: string): SkillData;
3
+ export declare function getSkillConfig(id: string): SkillData;
4
+ export declare function getItemConfig(id: string): ItemData;
5
5
  export interface Config {
6
6
  gameTitle: string;
7
7
  images: {
@@ -66,6 +66,14 @@ export interface Config {
66
66
  hudStats: {
67
67
  [key: string]: HudStatConfig;
68
68
  };
69
+ items: {
70
+ [key: string]: ItemData;
71
+ };
72
+ }
73
+ export interface ItemData {
74
+ name: string;
75
+ description: string;
76
+ icon: string;
69
77
  }
70
78
  export interface HudStatConfig {
71
79
  name: string;
@@ -1,7 +1,7 @@
1
1
  import { PropType } from 'vue';
2
+ import { DialogChoice } from './stores/dialog-store';
2
3
  import { DialogStyle } from './types/character-types';
3
4
  import { DialogBoxParameters } from './types/dialog-box-types';
4
- import { DialogChoice } from './types/state';
5
5
  declare const _default: import("vue").DefineComponent<{
6
6
  options: {
7
7
  type: PropType<DialogBoxParameters>;
@@ -18,17 +18,18 @@ declare const _default: import("vue").DefineComponent<{
18
18
  textStyle(): any;
19
19
  choices(): DialogChoice[] | undefined;
20
20
  canInteract(): boolean;
21
+ paused: () => boolean;
21
22
  }, {
22
23
  chooseOption(choice: DialogChoice): void;
23
24
  dialogStyle(choice: DialogChoice): any;
24
25
  dialogClass(choice: DialogChoice): "strike-anim";
25
- }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
26
- options?: unknown;
27
- active?: unknown;
28
- } & {
29
- options: DialogBoxParameters;
30
- active: boolean;
31
- } & {}> & {}, {
26
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
27
+ options: {
28
+ type: PropType<DialogBoxParameters>;
29
+ required: true;
30
+ };
31
+ active: BooleanConstructor;
32
+ }>>, {
32
33
  active: boolean;
33
34
  }>;
34
35
  export default _default;
@@ -1,5 +1,3 @@
1
- import { State } from 'vue';
2
- import { ActionContext } from 'vuex';
3
1
  import { NarratPlugin } from '../plugins/NarratPlugin';
4
2
  import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
5
3
  import type { CommandRunner } from '../vm/commands/command-plugin';
@@ -17,6 +15,5 @@ declare type NarratPluginObject = {
17
15
  };
18
16
  declare function registerPlugin(plugin: NarratPluginObject): void;
19
17
  declare function addCommand(command: CommandPlugin): void;
20
- export declare type NarratActionContext = ActionContext<State, State>;
21
18
  export { CommandRunner };
22
19
  export { CommandPlugin, NarratPluginObject, NarratPlugin, registerPlugin, addCommand, generateParser, };
package/lib/gameloop.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { State } from 'vue';
2
- import { Store } from 'vuex';
3
- export declare function startGameLoop(appStore: Store<State>): void;
1
+ export declare function startGameLoop(): void;
4
2
  export declare function gameLoop(): void;
5
3
  export declare function mouseclick(e: MouseEvent): void;
package/lib/index.d.ts CHANGED
@@ -1,17 +1,14 @@
1
1
  import 'es6-promise/auto';
2
2
  import './/sass/main.css';
3
- import { App, State } from 'vue';
3
+ import { App } from 'vue';
4
4
  import { GameConfig } from './types/app-types';
5
- import { Store } from 'vuex';
6
5
  export interface AppOptions {
7
6
  logging: boolean;
8
7
  debug: boolean;
9
8
  }
10
9
  export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;
11
10
  export declare type Narrat = {
12
- store: Store<State>;
13
11
  app: App;
14
- state: State;
15
12
  };
16
13
  declare global {
17
14
  export interface Window {