narrat 2.0.0 → 2.0.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.
@@ -6,6 +6,7 @@ export interface DialogKey {
6
6
  text: string;
7
7
  pose?: string;
8
8
  choices?: DialogChoice[];
9
+ textField?: boolean;
9
10
  interactive: boolean;
10
11
  id: string;
11
12
  }
@@ -24,7 +24,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
24
24
  startMachine(): void;
25
25
  startGame(): Promise<void>;
26
26
  loadGame(saveFile: string): Promise<void>;
27
- playerAnswered(index: number): void;
27
+ playerAnswered(choice: number | string): void;
28
28
  menuReturn(): void;
29
29
  createError(text: string): void;
30
30
  clearErrors(): void;
@@ -206,6 +206,7 @@ export declare const useMain: import("pinia").StoreDefinition<"main", MainState,
206
206
  finishGame(): void;
207
207
  runLine(): Promise<void>;
208
208
  runLabelFunction(label: string, ...args: any[]): Promise<unknown>;
209
+ runCustomStack(stack: import("./vm-store").AddStackOptions): void;
209
210
  runLabel(label: string, ...args: any[]): void;
210
211
  }>;
211
212
  hud: import("pinia").Store<"hud", import("./hud-stats-store").HudState, {}, {
@@ -143,5 +143,6 @@ export declare const useVM: import("pinia").StoreDefinition<"vm", VMState, {
143
143
  finishGame(): void;
144
144
  runLine(): Promise<void>;
145
145
  runLabelFunction(label: string, ...args: any[]): Promise<unknown>;
146
+ runCustomStack(stack: AddStackOptions): void;
146
147
  runLabel(label: string, ...args: any[]): void;
147
148
  }>;
@@ -4,6 +4,7 @@ export interface DialogBoxParameters {
4
4
  text: string;
5
5
  styleId: string;
6
6
  choices: DialogChoice[];
7
+ textField?: boolean;
7
8
  old: boolean;
8
9
  interactive: boolean;
9
10
  }
@@ -18,7 +18,7 @@ export declare class CommandPlugin<Options, StaticOptions = {}> {
18
18
  runner: CommandRunner<Options, StaticOptions>;
19
19
  argTypes: ArgTypes;
20
20
  parser: CommandParserFunction<Options, StaticOptions>;
21
- onPlayerAnswered?: (cmd: Parser.Command<Options, StaticOptions>, choiceIndex: number) => Promise<void>;
21
+ onPlayerAnswered?: (cmd: Parser.Command<Options, StaticOptions>, choice: number | string) => Promise<void>;
22
22
  constructor(keyword: string, argTypes: ArgTypes, runner: CommandRunner<Options, StaticOptions>, parser?: CommandParserFunction<Options, StaticOptions>);
23
23
  }
24
24
  export declare type ArgTypes = ArgumentDescription[] | 'any';
@@ -0,0 +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
+ }, {}>;
package/dist/vm/vm.d.ts CHANGED
@@ -15,5 +15,5 @@ export declare const vm: VM;
15
15
  export declare function runCommand(expression: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<any>;
16
16
  export declare function generateCommand(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<Parser.Command>;
17
17
  export declare function runExpression<ReturnType = any>(expr: Parser.ParsedExpression, choices?: DialogChoice[]): Promise<ReturnType>;
18
- export declare function playerAnswered(choiceIndex: number): Promise<any>;
18
+ export declare function playerAnswered(choice: string | number): Promise<any>;
19
19
  export declare function finishGame(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "narrat",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "narrat narrative engine",
5
5
  "main": "dist/narrat.umd.js",
6
6
  "module": "dist/narrat.es.js",