narrat 0.9.3 → 0.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 (39) hide show
  1. package/lib/app.vue.d.ts +2 -1
  2. package/lib/components/MainMenu.vue.d.ts +1 -0
  3. package/lib/components/Skills.vue.d.ts +4 -0
  4. package/lib/demo/bitsy/bitsy.d.ts +27 -0
  5. package/lib/dialog-box.vue.d.ts +1 -0
  6. package/lib/display.d.ts +2 -0
  7. package/lib/index.d.ts +11 -0
  8. package/lib/index.esm.js +1323 -892
  9. package/lib/index.js +1324 -890
  10. package/lib/plugins/NarratPlugin.d.ts +11 -0
  11. package/lib/plugins.d.ts +9 -0
  12. package/lib/utils/error-handling.d.ts +1 -1
  13. package/lib/utils/logger.d.ts +9 -5
  14. package/lib/utils/skillchecks.d.ts +18 -0
  15. package/lib/vm/commands/add.d.ts +3 -0
  16. package/lib/vm/commands/add_level.d.ts +2 -0
  17. package/lib/vm/commands/add_stat.d.ts +3 -0
  18. package/lib/vm/commands/add_xp.d.ts +2 -0
  19. package/lib/vm/commands/choice.d.ts +6 -0
  20. package/lib/vm/commands/clear_dialog.d.ts +3 -0
  21. package/lib/vm/commands/command-plugin.d.ts +22 -0
  22. package/lib/vm/commands/if.d.ts +2 -0
  23. package/lib/vm/commands/index.d.ts +2 -0
  24. package/lib/vm/commands/jump.d.ts +2 -0
  25. package/lib/vm/commands/notify.d.ts +2 -0
  26. package/lib/vm/commands/pause.d.ts +2 -0
  27. package/lib/vm/commands/play.d.ts +3 -0
  28. package/lib/vm/commands/set.d.ts +2 -0
  29. package/lib/vm/commands/set_button.d.ts +2 -0
  30. package/lib/vm/commands/set_screen.d.ts +3 -0
  31. package/lib/vm/commands/set_stat.d.ts +3 -0
  32. package/lib/vm/commands/stop.d.ts +2 -0
  33. package/lib/vm/commands/talk.d.ts +2 -0
  34. package/lib/vm/commands/text.d.ts +2 -0
  35. package/lib/vm/commands/wait.d.ts +2 -0
  36. package/lib/vm/vm-helpers.d.ts +17 -0
  37. package/lib/vm/vm-parser.d.ts +9 -0
  38. package/lib/vm/vm.d.ts +20 -0
  39. package/package.json +2 -1
package/lib/app.vue.d.ts CHANGED
@@ -12,6 +12,7 @@ declare const _default: import("vue").DefineComponent<{
12
12
  gameLoaded: boolean;
13
13
  loadingStep: string;
14
14
  loadingPercentage: number;
15
+ hasSave: boolean;
15
16
  }, {
16
17
  dialog(): DialogKey[];
17
18
  openModal(): string | false;
@@ -19,7 +20,6 @@ declare const _default: import("vue").DefineComponent<{
19
20
  lastDialog(): DialogKey | undefined;
20
21
  command(): Parser.Command;
21
22
  picture(): string | undefined;
22
- saveFile(): string | null;
23
23
  backgroundStyle(): any;
24
24
  layoutWidth(): number;
25
25
  gameTitle(): string;
@@ -45,6 +45,7 @@ declare const _default: import("vue").DefineComponent<{
45
45
  dialogContainerStyle(): any;
46
46
  }, {
47
47
  setupMachine(): Promise<any>;
48
+ getSaveFile(): string | null;
48
49
  startGame(): Promise<void>;
49
50
  loadGame(): Promise<void>;
50
51
  isDialogActive(i: number): boolean;
@@ -2,6 +2,7 @@ declare const _default: import("vue").DefineComponent<Readonly<import("vue").Com
2
2
  [x: string]: unknown;
3
3
  }>>, unknown, void, {}, {
4
4
  quit(): void;
5
+ close(): void;
5
6
  mainMenu(): void;
6
7
  getPlayTimeString(): string;
7
8
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<(readonly unknown[] & {
@@ -10,11 +10,15 @@ declare const _default: import("vue").DefineComponent<{
10
10
  skillConf(): {
11
11
  [key: string]: SkillData;
12
12
  };
13
+ xpPerLevel(): number;
13
14
  }, {
14
15
  getSkillStyle(skill: string): any;
15
16
  getSkillName(skill: string): string;
16
17
  clickSkill(skill: string): void;
17
18
  closeSkill(): void;
19
+ xpBarWidth(xp: number): {
20
+ width: string;
21
+ };
18
22
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
19
23
  close?: unknown;
20
24
  } & {
@@ -0,0 +1,27 @@
1
+ import { NarratPlugin } from '@/index';
2
+ import { CommandPlugin } from '@/vm/commands/command-plugin';
3
+ import { State } from 'vue';
4
+ import { ActionContext } from 'vuex';
5
+ declare global {
6
+ interface Window {
7
+ defaultFontName: string;
8
+ attachCanvas: (canvas: HTMLCanvasElement) => void;
9
+ loadGame: (gameData: any, defaultFontData: any) => void;
10
+ }
11
+ }
12
+ export declare function bitsyHacks(): void;
13
+ export declare function attachBitsyGameToNarrat(): HTMLCanvasElement;
14
+ export interface BitsyPluginOptions {
15
+ showOnGameStart?: boolean;
16
+ }
17
+ export declare class BitsyPlugin extends NarratPlugin {
18
+ canvas: HTMLCanvasElement;
19
+ customCommands: CommandPlugin[];
20
+ options: BitsyPluginOptions;
21
+ oldInputs: any;
22
+ onGameMounted(): void;
23
+ constructor(options?: BitsyPluginOptions);
24
+ showBitsyCommand({ dispatch, commit }: ActionContext<State, State>): Promise<void>;
25
+ hideBitsyCommand({ dispatch, commit }: ActionContext<State, State>): Promise<any>;
26
+ hideBitsy(): void;
27
+ }
@@ -21,6 +21,7 @@ declare const _default: import("vue").DefineComponent<{
21
21
  }, {
22
22
  chooseOption(choice: DialogChoice): void;
23
23
  dialogStyle(choice: DialogChoice): any;
24
+ dialogClass(choice: DialogChoice): "strike-anim";
24
25
  }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{
25
26
  options?: unknown;
26
27
  active?: unknown;
@@ -0,0 +1,2 @@
1
+ import { aspectRatioFit } from './utils/helpers';
2
+ export { aspectRatioFit };
package/lib/index.d.ts CHANGED
@@ -2,8 +2,19 @@ import 'es6-promise/auto';
2
2
  import './/sass/main.css';
3
3
  import './lib';
4
4
  import { GameConfig } from './types/app-types';
5
+ import * as plugins from './plugins';
6
+ import * as display from './display';
7
+ import * as config from './config';
5
8
  export interface AppOptions {
6
9
  logging: boolean;
7
10
  debug: boolean;
8
11
  }
9
12
  export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;
13
+ export { plugins, config, display };
14
+ declare const _default: {
15
+ startApp: typeof startApp;
16
+ plugins: typeof plugins;
17
+ display: typeof display;
18
+ config: typeof config;
19
+ };
20
+ export default _default;