narrat 3.3.8 → 3.5.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.
- package/README.md +1 -1
- package/dist/components/achievements/achievements-ui.vue.d.ts +2 -1
- package/dist/components/dialog-picture.vue.d.ts +18 -2
- package/dist/components/utils/floating-tooltip.vue.d.ts +14 -0
- package/dist/config/achievements-config.d.ts +8 -4
- package/dist/config/animations-config.d.ts +64 -0
- package/dist/config/characters-config.d.ts +3 -0
- package/dist/config/common-config.d.ts +2 -0
- package/dist/config/config-input.d.ts +4 -0
- package/dist/config/config-output.d.ts +43 -20
- package/dist/config.d.ts +42 -22
- package/dist/demo/themes-demo.d.ts +1 -0
- package/dist/exports/exports.d.ts +1 -0
- package/dist/exports/others.d.ts +1 -0
- package/dist/exports/plugins-list.d.ts +3 -0
- package/dist/exports/plugins.d.ts +1 -69
- package/dist/exports/utils.d.ts +1 -0
- package/dist/inputs/Inputs.d.ts +2 -0
- package/dist/main.d.ts +2 -0
- package/dist/narrat.es.js +15781 -15184
- package/dist/narrat.es.js.map +1 -1
- package/dist/narrat.umd.js +126 -109
- package/dist/narrat.umd.js.map +1 -1
- package/dist/plugins/narrat-themes/NarratThemesPlugin.d.ts +40 -0
- package/dist/plugins/narrat-themes/fun-theme/index.d.ts +2 -0
- package/dist/plugins/narrat-themes/index.d.ts +2 -0
- package/dist/plugins/narrat-themes/text-only/index.d.ts +2 -0
- package/dist/plugins/plugins.d.ts +69 -0
- package/dist/stores/inputs-store.d.ts +1 -0
- package/dist/stores/inventory-store.d.ts +1 -0
- package/dist/stores/main-store.d.ts +5029 -217
- package/dist/stores/rendering-store.d.ts +13 -0
- package/dist/style.css +1 -1
- package/dist/types/app-types.d.ts +5 -0
- package/dist/types/game-save.d.ts +2 -0
- package/dist/utils/animation.d.ts +8 -0
- package/dist/utils/data-helpers.d.ts +330 -0
- package/dist/utils/interact-utils.d.ts +15 -0
- package/dist/utils/save-helpers.d.ts +1 -1
- package/dist/vm/commands/util-commands.d.ts +13 -1
- package/package.json +1 -1
|
@@ -1,69 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { CommandPlugin, generateParser } from '../vm/commands/command-plugin';
|
|
3
|
-
import type { CommandRunner } from '../vm/commands/command-plugin';
|
|
4
|
-
import { StoreDefinition } from 'pinia';
|
|
5
|
-
import { MenuState, MenuTabState } from '../stores/menu-store';
|
|
6
|
-
import { CustomSetting } from '../config/settings-config';
|
|
7
|
-
export type NarratLifecycleHook = <T extends [...any[]]>(...args: T) => void;
|
|
8
|
-
export interface NarratCustomStoreActions {
|
|
9
|
-
save?: () => any;
|
|
10
|
-
load?: (data: any) => void;
|
|
11
|
-
setup?: () => Promise<void>;
|
|
12
|
-
start?: () => void;
|
|
13
|
-
reset: () => void;
|
|
14
|
-
}
|
|
15
|
-
export type UseCustomStore = StoreDefinition<string, any, any, NarratCustomStoreActions>;
|
|
16
|
-
export interface CustomStores {
|
|
17
|
-
[key: string]: UseCustomStore;
|
|
18
|
-
}
|
|
19
|
-
export interface CustomMenuButton {
|
|
20
|
-
menuId: string;
|
|
21
|
-
config: MenuState;
|
|
22
|
-
components: {
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export interface CustomMenuTab {
|
|
27
|
-
menuId: string;
|
|
28
|
-
config: MenuTabState;
|
|
29
|
-
component: any;
|
|
30
|
-
}
|
|
31
|
-
export type NarratPluginObject<T> = {
|
|
32
|
-
pluginId: string;
|
|
33
|
-
onPageLoaded?: NarratLifecycleHook;
|
|
34
|
-
onNarratSetup?: NarratLifecycleHook;
|
|
35
|
-
onAppMounted?: NarratLifecycleHook;
|
|
36
|
-
onAssetsLoaded?: NarratLifecycleHook;
|
|
37
|
-
onGameSetup?: NarratLifecycleHook;
|
|
38
|
-
onGameStart?: NarratLifecycleHook;
|
|
39
|
-
onGameMounted?: NarratLifecycleHook;
|
|
40
|
-
onGameUnmounted?: NarratLifecycleHook;
|
|
41
|
-
customCommands?: CommandPlugin<T>[];
|
|
42
|
-
customStores?: CustomStores;
|
|
43
|
-
customMenuButtons?: CustomMenuButton[];
|
|
44
|
-
customMenuTabs?: CustomMenuTab[];
|
|
45
|
-
startMenuButtons?: CustomStartMenuButton[];
|
|
46
|
-
customSettings?: Record<string, CustomSetting>;
|
|
47
|
-
save?: () => any;
|
|
48
|
-
load?: (data: any) => void;
|
|
49
|
-
reset?: () => void;
|
|
50
|
-
loadingPromises?: Promise<any>[];
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Custom buttons that get added to the start menu (where the New Game etc buttons are)
|
|
54
|
-
* Action option is to provide a function to run on click
|
|
55
|
-
* popupComponent option is to provide a component to display in a modal window on click (for custom pieces of UI)
|
|
56
|
-
*/
|
|
57
|
-
export interface CustomStartMenuButton {
|
|
58
|
-
id: string;
|
|
59
|
-
text: string;
|
|
60
|
-
action?: () => void;
|
|
61
|
-
popupComponent?: {
|
|
62
|
-
name: string;
|
|
63
|
-
component: any;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
declare function registerPlugin<T>(plugin: NarratPluginObject<T>): void;
|
|
67
|
-
declare function addCommand<T>(command: CommandPlugin<T>): void;
|
|
68
|
-
export { CommandRunner };
|
|
69
|
-
export { CommandPlugin, NarratPlugin, registerPlugin, addCommand, generateParser, };
|
|
1
|
+
export * from '../plugins/plugins';
|
package/dist/exports/utils.d.ts
CHANGED
|
@@ -10,4 +10,5 @@ export { randomId } from '../utils/randomId';
|
|
|
10
10
|
export { Vec2 } from '../utils/Vector2';
|
|
11
11
|
export type { Vector2 } from '../utils/Vector2';
|
|
12
12
|
export { gameloop } from '../utils/gameloop';
|
|
13
|
+
export { debounce } from '../utils/debounce';
|
|
13
14
|
export * from '../utils/construct-narrat';
|
package/dist/inputs/Inputs.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export type AnalogActionStatus = {
|
|
|
62
62
|
};
|
|
63
63
|
export type ActionStatus = ButtonActionStatus | AnalogActionStatus;
|
|
64
64
|
export declare class Inputs extends EventTarget {
|
|
65
|
+
gamepadAvailable: boolean;
|
|
65
66
|
gameActions: {
|
|
66
67
|
[key: string]: Action;
|
|
67
68
|
};
|
|
@@ -77,6 +78,7 @@ export declare class Inputs extends EventTarget {
|
|
|
77
78
|
lastInputMethodUsed: InputMode;
|
|
78
79
|
gamepad: NarratGamepad | null;
|
|
79
80
|
kbEvent(): void;
|
|
81
|
+
getGamepads(): (Gamepad | null)[];
|
|
80
82
|
gamepadEvent(): void;
|
|
81
83
|
mouseEvent(): void;
|
|
82
84
|
changeLastInput(inputMode: InputMode): void;
|
package/dist/main.d.ts
CHANGED
|
@@ -6,4 +6,6 @@ import { AppOptionsInput } from './types/app-types';
|
|
|
6
6
|
import { ModuleNamespace } from 'vite/types/hot';
|
|
7
7
|
export type HMRCallback = (mod: ModuleNamespace | undefined) => void;
|
|
8
8
|
export declare function startApp(optionsInput: AppOptionsInput): Promise<any>;
|
|
9
|
+
export declare function stopApp(): Promise<void>;
|
|
10
|
+
export declare function restartApp(): Promise<any>;
|
|
9
11
|
export declare function registerComponent(name: string, component: any): void;
|