narrat 0.11.4 → 0.11.5
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.
package/lib/exports/plugins.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { State } from 'vue';
|
|
2
1
|
import { ActionContext } from 'vuex';
|
|
3
2
|
import { NarratPlugin } from '../plugins/NarratPlugin';
|
|
4
3
|
import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
|
|
5
4
|
import type { CommandRunner } from '../vm/commands/command-plugin';
|
|
5
|
+
import { NarratState } from '@/types/state';
|
|
6
6
|
export declare type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
|
|
7
7
|
declare type NarratPluginObject = {
|
|
8
8
|
onPageLoaded?: NarratLifecycleHook;
|
|
@@ -17,6 +17,6 @@ declare type NarratPluginObject = {
|
|
|
17
17
|
};
|
|
18
18
|
declare function registerPlugin(plugin: NarratPluginObject): void;
|
|
19
19
|
declare function addCommand(command: CommandPlugin): void;
|
|
20
|
-
export declare type NarratActionContext = ActionContext<
|
|
20
|
+
export declare type NarratActionContext = ActionContext<NarratState, NarratState>;
|
|
21
21
|
export { CommandRunner };
|
|
22
22
|
export { CommandPlugin, NarratPluginObject, NarratPlugin, registerPlugin, addCommand, generateParser, };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import 'es6-promise/auto';
|
|
2
2
|
import './/sass/main.css';
|
|
3
|
-
import { App
|
|
3
|
+
import { App } from 'vue';
|
|
4
4
|
import { GameConfig } from './types/app-types';
|
|
5
5
|
import { Store } from 'vuex';
|
|
6
|
+
import { NarratState } from './types/state';
|
|
6
7
|
export interface AppOptions {
|
|
7
8
|
logging: boolean;
|
|
8
9
|
debug: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function startApp(config: GameConfig, options: AppOptions): Promise<void>;
|
|
11
12
|
export declare type Narrat = {
|
|
12
|
-
store: Store<
|
|
13
|
+
store: Store<NarratState>;
|
|
13
14
|
app: App;
|
|
14
|
-
state:
|
|
15
|
+
state: NarratState;
|
|
15
16
|
};
|
|
16
17
|
declare global {
|
|
17
18
|
export interface Window {
|
package/lib/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version: 0.11.
|
|
1
|
+
// Version: 0.11.5 - June 15, 2022 16:55:24
|
|
2
2
|
import 'es6-promise/auto';
|
|
3
3
|
import { ref, reactive, readonly, defineComponent, openBlock, createElementBlock, normalizeStyle, createElementVNode, createCommentVNode, Fragment, renderList, normalizeClass, createBlock, Transition, withCtx, renderSlot, createTextVNode, resolveComponent, withDirectives, vModelText, toDisplayString, TransitionGroup, createVNode, createApp } from 'vue';
|
|
4
4
|
import { createLogger, createStore } from 'vuex';
|
|
@@ -8751,7 +8751,7 @@ async function startApp(config, options) {
|
|
|
8751
8751
|
logManager.setupDebugger(options.debug);
|
|
8752
8752
|
const configFile = await getFile('data/config.json');
|
|
8753
8753
|
setConfig(JSON.parse(configFile));
|
|
8754
|
-
console.log('%c Narrat game engine – 0.11.
|
|
8754
|
+
console.log('%c Narrat game engine – 0.11.5 - June 15, 2022 16:55:24', 'background: #222; color: #bada55');
|
|
8755
8755
|
vm$1.callHook('onNarratSetup');
|
|
8756
8756
|
const storeSetup = setupStore(options);
|
|
8757
8757
|
store$2 = storeSetup.store;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Version: 0.11.
|
|
1
|
+
// Version: 0.11.5 - June 15, 2022 16:55:24
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
@@ -8755,7 +8755,7 @@ async function startApp(config, options) {
|
|
|
8755
8755
|
logManager.setupDebugger(options.debug);
|
|
8756
8756
|
const configFile = await getFile('data/config.json');
|
|
8757
8757
|
setConfig(JSON.parse(configFile));
|
|
8758
|
-
console.log('%c Narrat game engine – 0.11.
|
|
8758
|
+
console.log('%c Narrat game engine – 0.11.5 - June 15, 2022 16:55:24', 'background: #222; color: #bada55');
|
|
8759
8759
|
vm$1.callHook('onNarratSetup');
|
|
8760
8760
|
const storeSetup = setupStore(options);
|
|
8761
8761
|
store$2 = storeSetup.store;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { Parser } from '
|
|
2
|
-
import { DialogChoice } from '
|
|
3
|
-
import { State } from 'vue';
|
|
1
|
+
import { Parser } from '../../types/parser';
|
|
2
|
+
import { DialogChoice, NarratState } from '../../types/state';
|
|
4
3
|
import { ActionContext } from 'vuex';
|
|
5
4
|
import { ParserContext } from '../vm-parser';
|
|
6
|
-
export declare type CommandRunner = (context: ActionContext<
|
|
5
|
+
export declare type CommandRunner = (context: ActionContext<NarratState, NarratState>, cmd: Parser.Command, choices?: DialogChoice[]) => Promise<void>;
|
|
7
6
|
export declare type CommandParserFunction = (ctx: CommandParsingContext) => void;
|
|
8
7
|
export declare type ProcessCommandsFunction = (ctx: ParserContext, lines: Parser.Line[], parentLine: Parser.Line | undefined) => Parser.Branch;
|
|
9
8
|
export interface CommandParsingContext {
|
package/lib/vm/vm-parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Parser } from '
|
|
1
|
+
import { Parser } from '../types/parser';
|
|
2
2
|
import { ProcessCommandsFunction } from './commands/command-plugin';
|
|
3
3
|
export declare type ParserErrorHandler = (ctx: ParserContext, line: number, text: string) => void;
|
|
4
4
|
export interface ParserContext {
|