narrat 3.2.0 → 3.2.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.
- package/dist/app.vue.d.ts +78 -78
- package/dist/components/MainMenu.vue.d.ts +4 -4
- package/dist/components/SkillsWindow.vue.d.ts +28 -28
- package/dist/components/StartMenu.vue.d.ts +2 -2
- package/dist/components/achievements/achievement-tile.vue.d.ts +15 -15
- package/dist/components/achievements/achievements-section.vue.d.ts +34 -34
- package/dist/components/achievements/achievements-ui.vue.d.ts +32 -32
- package/dist/components/auto-play/AutoPlayFeedback.vue.d.ts +2 -2
- package/dist/components/debug/debug-menu.vue.d.ts +53 -53
- package/dist/components/dialog-picture.vue.d.ts +11 -11
- package/dist/components/engine-splash/engine-splash.vue.d.ts +4 -4
- package/dist/components/game-dialog.vue.d.ts +11 -11
- package/dist/components/game-splash/game-splash.vue.d.ts +2 -2
- package/dist/components/hud.vue.d.ts +20 -20
- package/dist/components/in-game.vue.d.ts +2 -2
- package/dist/components/inventory/inventory-section.vue.d.ts +34 -34
- package/dist/components/inventory/item-details.vue.d.ts +16 -16
- package/dist/components/inventory-ui.vue.d.ts +39 -39
- package/dist/components/loading-bar.vue.d.ts +10 -10
- package/dist/components/menu-buttons.vue.d.ts +2 -2
- package/dist/components/notification-toast.vue.d.ts +2 -2
- package/dist/components/quests/QuestDetails.vue.d.ts +13 -13
- package/dist/components/quests/QuestDisplay.vue.d.ts +13 -13
- package/dist/components/quests/quests-list-section.vue.d.ts +50 -50
- package/dist/components/quests-ui.vue.d.ts +22 -22
- package/dist/components/save-slots.vue.d.ts +16 -16
- package/dist/components/saves/save-slot-ui.vue.d.ts +32 -32
- package/dist/components/screen-layer.vue.d.ts +28 -28
- package/dist/components/screen-objects/screen-object.vue.d.ts +21 -21
- package/dist/components/screens.vue.d.ts +2 -2
- package/dist/components/settings/setting-widget.vue.d.ts +15 -15
- package/dist/components/settings/settings-menu.vue.d.ts +2 -2
- package/dist/components/tabs/TabsController.vue.d.ts +28 -28
- package/dist/components/tabs/tab-selector.vue.d.ts +29 -29
- package/dist/components/tooltips/tooltips-ui.vue.d.ts +2 -2
- package/dist/components/transitions/NarratTransition.vue.d.ts +32 -32
- package/dist/components/utils/__tests__/alert-modal.spec.d.ts +1 -1
- package/dist/components/utils/__tests__/floating-tooltip.spec.d.ts +1 -1
- package/dist/components/utils/alert-modal.vue.d.ts +20 -20
- package/dist/components/utils/floating-tooltip.vue.d.ts +56 -56
- package/dist/components/utils/modal-window.vue.d.ts +18 -18
- package/dist/components/utils/yes-no.vue.d.ts +30 -30
- package/dist/components/volume-controls.vue.d.ts +18 -18
- package/dist/config/achievements-config.d.ts +58 -58
- package/dist/config/audio-config.d.ts +58 -58
- package/dist/config/buttons-config.d.ts +68 -68
- package/dist/config/characters-config.d.ts +36 -36
- package/dist/config/common-config.d.ts +81 -81
- package/dist/config/config-input.d.ts +286 -286
- package/dist/config/config-output.d.ts +280 -280
- package/dist/config/items-config.d.ts +71 -71
- package/dist/config/layout-config.d.ts +27 -27
- package/dist/config/quests-config.d.ts +48 -48
- package/dist/config/screens-config.d.ts +133 -133
- package/dist/config/settings-config.d.ts +113 -113
- package/dist/config/skillchecks-config.d.ts +73 -73
- package/dist/config/skills-config.d.ts +51 -51
- package/dist/config/tooltips-config.d.ts +16 -16
- package/dist/config.d.ts +235 -235
- package/dist/constants.d.ts +14 -11
- package/dist/demo/demo.d.ts +1 -1
- package/dist/dialog-box.vue.d.ts +34 -34
- package/dist/examples/default/scripts.d.ts +2 -2
- package/dist/examples/demo/scripts.d.ts +2 -2
- package/dist/examples/empty/scripts.d.ts +2 -2
- package/dist/examples/rpg/scripts.d.ts +2 -2
- package/dist/exports/components.d.ts +2 -2
- package/dist/exports/config.d.ts +4 -4
- package/dist/exports/display.d.ts +2 -2
- package/dist/exports/events.d.ts +1 -1
- package/dist/exports/inputs.d.ts +1 -1
- package/dist/exports/others.d.ts +1 -1
- package/dist/exports/plugins.d.ts +69 -69
- package/dist/exports/stores.d.ts +17 -17
- package/dist/exports/utils.d.ts +12 -12
- package/dist/hmr/hmr.d.ts +4 -4
- package/dist/hooks/util-hooks.d.ts +1 -1
- package/dist/inputs/Inputs.d.ts +96 -96
- package/dist/inputs/useNavigation.d.ts +30 -30
- package/dist/lib.d.ts +22 -22
- package/dist/main.d.ts +9 -9
- package/dist/menu-buttons/menu-buttons.d.ts +7 -7
- package/dist/narrat.es.js +6121 -6113
- package/dist/narrat.es.js.map +1 -1
- package/dist/narrat.umd.js +87 -87
- package/dist/narrat.umd.js.map +1 -1
- package/dist/plugins/NarratPlugin.d.ts +12 -12
- package/dist/stores/__tests__/achievements-store.spec.d.ts +1 -1
- package/dist/stores/__tests__/notifications-store.spec.d.ts +1 -1
- package/dist/stores/achievements-store.d.ts +27 -27
- package/dist/stores/audio-store.d.ts +57 -57
- package/dist/stores/config-store.d.ts +7 -7
- package/dist/stores/dialog-store.d.ts +35 -35
- package/dist/stores/gamepad-store.d.ts +11 -11
- package/dist/stores/hud-stats-store.d.ts +21 -21
- package/dist/stores/inputs-store.d.ts +23 -23
- package/dist/stores/inventory-store.d.ts +40 -40
- package/dist/stores/main-store.d.ts +2058 -2058
- package/dist/stores/menu-store.d.ts +46 -46
- package/dist/stores/notification-store.d.ts +22 -22
- package/dist/stores/quest-log.d.ts +38 -38
- package/dist/stores/rendering-store.d.ts +20 -20
- package/dist/stores/screen-objects-store.d.ts +82 -82
- package/dist/stores/screens-store.d.ts +36 -36
- package/dist/stores/settings-store.d.ts +93 -93
- package/dist/stores/skills.d.ts +40 -40
- package/dist/stores/start-menu-store.d.ts +7 -7
- package/dist/stores/tooltip-store.d.ts +18 -18
- package/dist/stores/vm-store.d.ts +189 -189
- package/dist/tests/mock-config.d.ts +3 -3
- package/dist/tests/tests.setup.d.ts +1 -1
- package/dist/types/app-types.d.ts +14 -14
- package/dist/types/dialog-box-types.d.ts +11 -11
- package/dist/types/game-save.d.ts +51 -51
- package/dist/types/parser.d.ts +93 -93
- package/dist/types/state.d.ts +3 -3
- package/dist/utils/InputsListener.d.ts +9 -9
- package/dist/utils/Vector2.d.ts +49 -49
- package/dist/utils/ajax.d.ts +2 -2
- package/dist/utils/audio-loader.d.ts +10 -10
- package/dist/utils/characters.d.ts +4 -4
- package/dist/utils/data-helpers.d.ts +50 -50
- package/dist/utils/data-helpers.test.d.ts +1 -1
- package/dist/utils/debounce.d.ts +14 -14
- package/dist/utils/error-handling.d.ts +4 -4
- package/dist/utils/gameloop.d.ts +10 -10
- package/dist/utils/getWindow.d.ts +1 -1
- package/dist/utils/helpers.d.ts +6 -6
- package/dist/utils/images-loader.d.ts +7 -7
- package/dist/utils/logger.d.ts +11 -11
- package/dist/utils/object-iterators.d.ts +9 -9
- package/dist/utils/promises.d.ts +1 -1
- package/dist/utils/randomId.d.ts +1 -1
- package/dist/utils/save-helpers.d.ts +18 -18
- package/dist/utils/skillchecks.d.ts +26 -26
- package/dist/utils/skillchecks.test.d.ts +1 -1
- package/dist/utils/string-helpers.d.ts +5 -5
- package/dist/utils/time-helpers.d.ts +2 -2
- package/dist/utils/tooltip-utils.d.ts +2 -2
- package/dist/utils/transition.d.ts +21 -21
- package/dist/utils/type-utils.d.ts +2 -2
- package/dist/utils/typed-emitter.d.ts +18 -18
- package/dist/utils/viewport-utils.d.ts +3 -3
- package/dist/utils/vue-directives.d.ts +2 -2
- package/dist/vm/commands/achievements-commands.d.ts +6 -6
- package/dist/vm/commands/arithmetic-commands.d.ts +23 -23
- package/dist/vm/commands/array-commands.d.ts +42 -42
- package/dist/vm/commands/audio-commands.d.ts +19 -19
- package/dist/vm/commands/choice.d.ts +35 -35
- package/dist/vm/commands/clear_dialog.d.ts +2 -2
- package/dist/vm/commands/command-helpers.d.ts +3 -3
- package/dist/vm/commands/command-plugin.d.ts +43 -43
- package/dist/vm/commands/flow-commands.d.ts +28 -28
- package/dist/vm/commands/if.d.ts +15 -15
- package/dist/vm/commands/index.d.ts +2 -2
- package/dist/vm/commands/inventory-commands.d.ts +15 -15
- package/dist/vm/commands/logic-command.d.ts +42 -42
- package/dist/vm/commands/math-commands.d.ts +30 -30
- package/dist/vm/commands/notify.d.ts +8 -8
- package/dist/vm/commands/quest-commands.d.ts +30 -30
- package/dist/vm/commands/random-commands.d.ts +13 -13
- package/dist/vm/commands/screen-commands.d.ts +18 -18
- package/dist/vm/commands/set.d.ts +6 -6
- package/dist/vm/commands/settings-commands.d.ts +8 -8
- package/dist/vm/commands/skill-commands.d.ts +39 -39
- package/dist/vm/commands/sprite-commands.d.ts +19 -19
- package/dist/vm/commands/stats-commands.d.ts +12 -12
- package/dist/vm/commands/string-commands.d.ts +9 -9
- package/dist/vm/commands/text-field.d.ts +7 -7
- package/dist/vm/commands/text.d.ts +14 -14
- package/dist/vm/commands/time-commands.d.ts +16 -16
- package/dist/vm/commands/util-commands.d.ts +4 -4
- package/dist/vm/commands/wait.d.ts +4 -4
- package/dist/vm/vm-helpers.d.ts +20 -20
- package/dist/vm/vm-parser.d.ts +22 -22
- package/dist/vm/vm-parser.test.d.ts +1 -1
- package/dist/vm/vm.d.ts +26 -26
- package/package.json +3 -3
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { NarratPlugin } from '../plugins/NarratPlugin';
|
|
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
|
+
import { NarratPlugin } from '../plugins/NarratPlugin';
|
|
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, };
|
package/dist/exports/stores.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export { useAudio } from '../stores/audio-store';
|
|
2
|
-
export { useConfig } from '../stores/config-store';
|
|
3
|
-
export { useDialogStore } from '../stores/dialog-store';
|
|
4
|
-
export { useHud } from '../stores/hud-stats-store';
|
|
5
|
-
export { useInputs } from '../stores/inputs-store';
|
|
6
|
-
export { useInventory } from '../stores/inventory-store';
|
|
7
|
-
export { useMain } from '../stores/main-store';
|
|
8
|
-
export { useMenu } from '../stores/menu-store';
|
|
9
|
-
export { useNotifications } from '../stores/notification-store';
|
|
10
|
-
export { useQuests } from '../stores/quest-log';
|
|
11
|
-
export { useRenderingStore } from '../stores/rendering-store';
|
|
12
|
-
export { useScreenObjects } from '../stores/screen-objects-store';
|
|
13
|
-
export { useScreens } from '../stores/screens-store';
|
|
14
|
-
export { useSkills } from '../stores/skills';
|
|
15
|
-
export { useTooltips } from '../stores/tooltip-store';
|
|
16
|
-
export { useVM } from '../stores/vm-store';
|
|
17
|
-
export { useAchievements } from '../stores/achievements-store';
|
|
1
|
+
export { useAudio } from '../stores/audio-store';
|
|
2
|
+
export { useConfig } from '../stores/config-store';
|
|
3
|
+
export { useDialogStore } from '../stores/dialog-store';
|
|
4
|
+
export { useHud } from '../stores/hud-stats-store';
|
|
5
|
+
export { useInputs } from '../stores/inputs-store';
|
|
6
|
+
export { useInventory } from '../stores/inventory-store';
|
|
7
|
+
export { useMain } from '../stores/main-store';
|
|
8
|
+
export { useMenu } from '../stores/menu-store';
|
|
9
|
+
export { useNotifications } from '../stores/notification-store';
|
|
10
|
+
export { useQuests } from '../stores/quest-log';
|
|
11
|
+
export { useRenderingStore } from '../stores/rendering-store';
|
|
12
|
+
export { useScreenObjects } from '../stores/screen-objects-store';
|
|
13
|
+
export { useScreens } from '../stores/screens-store';
|
|
14
|
+
export { useSkills } from '../stores/skills';
|
|
15
|
+
export { useTooltips } from '../stores/tooltip-store';
|
|
16
|
+
export { useVM } from '../stores/vm-store';
|
|
17
|
+
export { useAchievements } from '../stores/achievements-store';
|
package/dist/exports/utils.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export { error, warning } from '../utils/error-handling';
|
|
2
|
-
export { processText, findVariable } from '../utils/string-helpers';
|
|
3
|
-
export { getFile, loadDataFile } from '../utils/ajax';
|
|
4
|
-
export { getWindow } from '../utils/getWindow';
|
|
5
|
-
export { InputsListener, inputEvents } from '../utils/InputsListener';
|
|
6
|
-
export type { InputEvents } from '../utils/InputsListener';
|
|
7
|
-
export { LogManager, logManager, logger } from '../utils/logger';
|
|
8
|
-
export { timeout } from '../utils/promises';
|
|
9
|
-
export { randomId } from '../utils/randomId';
|
|
10
|
-
export { Vec2 } from '../utils/Vector2';
|
|
11
|
-
export type { Vector2 } from '../utils/Vector2';
|
|
12
|
-
export { gameloop } from '../utils/gameloop';
|
|
1
|
+
export { error, warning } from '../utils/error-handling';
|
|
2
|
+
export { processText, findVariable } from '../utils/string-helpers';
|
|
3
|
+
export { getFile, loadDataFile } from '../utils/ajax';
|
|
4
|
+
export { getWindow } from '../utils/getWindow';
|
|
5
|
+
export { InputsListener, inputEvents } from '../utils/InputsListener';
|
|
6
|
+
export type { InputEvents } from '../utils/InputsListener';
|
|
7
|
+
export { LogManager, logManager, logger } from '../utils/logger';
|
|
8
|
+
export { timeout } from '../utils/promises';
|
|
9
|
+
export { randomId } from '../utils/randomId';
|
|
10
|
+
export { Vec2 } from '../utils/Vector2';
|
|
11
|
+
export type { Vector2 } from '../utils/Vector2';
|
|
12
|
+
export { gameloop } from '../utils/gameloop';
|
package/dist/hmr/hmr.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NarratScript } from '../types/app-types';
|
|
2
|
-
import { ModuleNamespace } from 'vite/types/hot';
|
|
3
|
-
export declare function handleHMR(newModule: ModuleNamespace | undefined): void;
|
|
4
|
-
export declare function isNarratScript(scriptModule: any): scriptModule is NarratScript;
|
|
1
|
+
import { NarratScript } from '../types/app-types';
|
|
2
|
+
import { ModuleNamespace } from 'vite/types/hot';
|
|
3
|
+
export declare function handleHMR(newModule: ModuleNamespace | undefined): void;
|
|
4
|
+
export declare function isNarratScript(scriptModule: any): scriptModule is NarratScript;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/inputs/Inputs.d.ts
CHANGED
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
import { Vector2 } from '../utils/Vector2';
|
|
2
|
-
export type NarratGamepadButton = {
|
|
3
|
-
index: number;
|
|
4
|
-
state: GamepadButton;
|
|
5
|
-
previous: GamepadButton;
|
|
6
|
-
};
|
|
7
|
-
export type NarratGamepad = {
|
|
8
|
-
id: string;
|
|
9
|
-
gamepad: Gamepad;
|
|
10
|
-
buttons: NarratGamepadButton[];
|
|
11
|
-
};
|
|
12
|
-
export type ButtonEvent = (action: ButtonAction, state: ButtonActionState, previousState: ButtonActionState) => void;
|
|
13
|
-
export type AnalogEvent = (action: AnalogAction, state: AnalogActionState, previousState: AnalogActionState) => void;
|
|
14
|
-
export interface ButtonKeybind {
|
|
15
|
-
keyboardKey?: string;
|
|
16
|
-
gamepadButton?: number;
|
|
17
|
-
}
|
|
18
|
-
export interface AnalogKeybind {
|
|
19
|
-
left: string;
|
|
20
|
-
right: string;
|
|
21
|
-
up: string;
|
|
22
|
-
down: string;
|
|
23
|
-
}
|
|
24
|
-
export interface ButtonAction {
|
|
25
|
-
id: string;
|
|
26
|
-
type: 'button';
|
|
27
|
-
action: 'press' | 'release';
|
|
28
|
-
keybinds: ButtonKeybind[];
|
|
29
|
-
}
|
|
30
|
-
export interface AnalogAction {
|
|
31
|
-
id: string;
|
|
32
|
-
type: 'analog';
|
|
33
|
-
keybinds: AnalogKeybind[];
|
|
34
|
-
}
|
|
35
|
-
export interface ButtonActionState {
|
|
36
|
-
config: ButtonAction;
|
|
37
|
-
active: boolean;
|
|
38
|
-
justPressed: boolean;
|
|
39
|
-
justReleased: boolean;
|
|
40
|
-
}
|
|
41
|
-
export interface AnalogDirectionState {
|
|
42
|
-
left: number;
|
|
43
|
-
right: number;
|
|
44
|
-
up: number;
|
|
45
|
-
down: number;
|
|
46
|
-
}
|
|
47
|
-
export interface AnalogActionState {
|
|
48
|
-
config: AnalogAction;
|
|
49
|
-
value: Vector2;
|
|
50
|
-
fullState: AnalogDirectionState;
|
|
51
|
-
}
|
|
52
|
-
export type Action = ButtonAction | AnalogAction;
|
|
53
|
-
export type ActionState = ButtonActionState | AnalogActionState;
|
|
54
|
-
export type ButtonActionStatus = {
|
|
55
|
-
state: ButtonActionState;
|
|
56
|
-
previous: ButtonActionState;
|
|
57
|
-
};
|
|
58
|
-
export type AnalogActionStatus = {
|
|
59
|
-
state: AnalogActionState;
|
|
60
|
-
previous: AnalogActionState;
|
|
61
|
-
};
|
|
62
|
-
export type ActionStatus = ButtonActionStatus | AnalogActionStatus;
|
|
63
|
-
export declare class Inputs {
|
|
64
|
-
gameActions: {
|
|
65
|
-
[key: string]: Action;
|
|
66
|
-
};
|
|
67
|
-
keyboardState: {
|
|
68
|
-
[key: string]: {
|
|
69
|
-
current: boolean;
|
|
70
|
-
previous: boolean;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
actions: {
|
|
74
|
-
[key: string]: ActionStatus;
|
|
75
|
-
};
|
|
76
|
-
gamepad: NarratGamepad | null;
|
|
77
|
-
startListening(): void;
|
|
78
|
-
updateGamepad(): void;
|
|
79
|
-
setupNarratGamepad(gamepad: Gamepad): NarratGamepad;
|
|
80
|
-
updateAllNarratButtons(gamepad: Gamepad, narratGamepad: NarratGamepad): void;
|
|
81
|
-
getNarratButtonFromGamepad(previous: GamepadButton, gamepadButton: GamepadButton, index: number): NarratGamepadButton;
|
|
82
|
-
addAction(action: Action): void;
|
|
83
|
-
getAnalog(actionId: string): AnalogActionState;
|
|
84
|
-
getButton(actionId: string): ButtonActionState;
|
|
85
|
-
getKeyboardState(key: string): {
|
|
86
|
-
current: boolean;
|
|
87
|
-
previous: boolean;
|
|
88
|
-
};
|
|
89
|
-
getGamepadState(key: number): {
|
|
90
|
-
current: GamepadButton;
|
|
91
|
-
previous: GamepadButton;
|
|
92
|
-
} | null;
|
|
93
|
-
debugGamepad(): void;
|
|
94
|
-
update(): void;
|
|
95
|
-
}
|
|
96
|
-
export declare const inputs: Inputs;
|
|
1
|
+
import { Vector2 } from '../utils/Vector2';
|
|
2
|
+
export type NarratGamepadButton = {
|
|
3
|
+
index: number;
|
|
4
|
+
state: GamepadButton;
|
|
5
|
+
previous: GamepadButton;
|
|
6
|
+
};
|
|
7
|
+
export type NarratGamepad = {
|
|
8
|
+
id: string;
|
|
9
|
+
gamepad: Gamepad;
|
|
10
|
+
buttons: NarratGamepadButton[];
|
|
11
|
+
};
|
|
12
|
+
export type ButtonEvent = (action: ButtonAction, state: ButtonActionState, previousState: ButtonActionState) => void;
|
|
13
|
+
export type AnalogEvent = (action: AnalogAction, state: AnalogActionState, previousState: AnalogActionState) => void;
|
|
14
|
+
export interface ButtonKeybind {
|
|
15
|
+
keyboardKey?: string;
|
|
16
|
+
gamepadButton?: number;
|
|
17
|
+
}
|
|
18
|
+
export interface AnalogKeybind {
|
|
19
|
+
left: string;
|
|
20
|
+
right: string;
|
|
21
|
+
up: string;
|
|
22
|
+
down: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ButtonAction {
|
|
25
|
+
id: string;
|
|
26
|
+
type: 'button';
|
|
27
|
+
action: 'press' | 'release';
|
|
28
|
+
keybinds: ButtonKeybind[];
|
|
29
|
+
}
|
|
30
|
+
export interface AnalogAction {
|
|
31
|
+
id: string;
|
|
32
|
+
type: 'analog';
|
|
33
|
+
keybinds: AnalogKeybind[];
|
|
34
|
+
}
|
|
35
|
+
export interface ButtonActionState {
|
|
36
|
+
config: ButtonAction;
|
|
37
|
+
active: boolean;
|
|
38
|
+
justPressed: boolean;
|
|
39
|
+
justReleased: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface AnalogDirectionState {
|
|
42
|
+
left: number;
|
|
43
|
+
right: number;
|
|
44
|
+
up: number;
|
|
45
|
+
down: number;
|
|
46
|
+
}
|
|
47
|
+
export interface AnalogActionState {
|
|
48
|
+
config: AnalogAction;
|
|
49
|
+
value: Vector2;
|
|
50
|
+
fullState: AnalogDirectionState;
|
|
51
|
+
}
|
|
52
|
+
export type Action = ButtonAction | AnalogAction;
|
|
53
|
+
export type ActionState = ButtonActionState | AnalogActionState;
|
|
54
|
+
export type ButtonActionStatus = {
|
|
55
|
+
state: ButtonActionState;
|
|
56
|
+
previous: ButtonActionState;
|
|
57
|
+
};
|
|
58
|
+
export type AnalogActionStatus = {
|
|
59
|
+
state: AnalogActionState;
|
|
60
|
+
previous: AnalogActionState;
|
|
61
|
+
};
|
|
62
|
+
export type ActionStatus = ButtonActionStatus | AnalogActionStatus;
|
|
63
|
+
export declare class Inputs {
|
|
64
|
+
gameActions: {
|
|
65
|
+
[key: string]: Action;
|
|
66
|
+
};
|
|
67
|
+
keyboardState: {
|
|
68
|
+
[key: string]: {
|
|
69
|
+
current: boolean;
|
|
70
|
+
previous: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
actions: {
|
|
74
|
+
[key: string]: ActionStatus;
|
|
75
|
+
};
|
|
76
|
+
gamepad: NarratGamepad | null;
|
|
77
|
+
startListening(): void;
|
|
78
|
+
updateGamepad(): void;
|
|
79
|
+
setupNarratGamepad(gamepad: Gamepad): NarratGamepad;
|
|
80
|
+
updateAllNarratButtons(gamepad: Gamepad, narratGamepad: NarratGamepad): void;
|
|
81
|
+
getNarratButtonFromGamepad(previous: GamepadButton, gamepadButton: GamepadButton, index: number): NarratGamepadButton;
|
|
82
|
+
addAction(action: Action): void;
|
|
83
|
+
getAnalog(actionId: string): AnalogActionState;
|
|
84
|
+
getButton(actionId: string): ButtonActionState;
|
|
85
|
+
getKeyboardState(key: string): {
|
|
86
|
+
current: boolean;
|
|
87
|
+
previous: boolean;
|
|
88
|
+
};
|
|
89
|
+
getGamepadState(key: number): {
|
|
90
|
+
current: GamepadButton;
|
|
91
|
+
previous: GamepadButton;
|
|
92
|
+
} | null;
|
|
93
|
+
debugGamepad(): void;
|
|
94
|
+
update(): void;
|
|
95
|
+
}
|
|
96
|
+
export declare const inputs: Inputs;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { InputListener } from '../stores/inputs-store';
|
|
2
|
-
import { Ref } from 'vue';
|
|
3
|
-
export type GridNavigationOptions = {
|
|
4
|
-
mode: 'grid';
|
|
5
|
-
columns: number;
|
|
6
|
-
};
|
|
7
|
-
export type ListNavigationOptions = {
|
|
8
|
-
mode: 'list';
|
|
9
|
-
};
|
|
10
|
-
export type NavigationOptions = {
|
|
11
|
-
mode: 'grid' | 'list';
|
|
12
|
-
container: Ref<HTMLElement | null>;
|
|
13
|
-
listener: InputListener;
|
|
14
|
-
loopForbidden?: boolean;
|
|
15
|
-
onSelected?: (index: number) => void;
|
|
16
|
-
} & (GridNavigationOptions | ListNavigationOptions);
|
|
17
|
-
export declare function useNavigation(options: NavigationOptions): {
|
|
18
|
-
selectedIndex: Ref<number>;
|
|
19
|
-
selectedElement: import("vue").ComputedRef<Element | null>;
|
|
20
|
-
currentColumn: import("vue").ComputedRef<number>;
|
|
21
|
-
buttonDown: () => void;
|
|
22
|
-
buttonUp: () => void;
|
|
23
|
-
buttonLeft: () => void;
|
|
24
|
-
buttonRight: () => void;
|
|
25
|
-
selectUp: () => void;
|
|
26
|
-
selectDown: () => void;
|
|
27
|
-
selectPrevious: () => void;
|
|
28
|
-
selectNext: () => void;
|
|
29
|
-
select: (index: number) => void;
|
|
30
|
-
};
|
|
1
|
+
import { InputListener } from '../stores/inputs-store';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
export type GridNavigationOptions = {
|
|
4
|
+
mode: 'grid';
|
|
5
|
+
columns: number;
|
|
6
|
+
};
|
|
7
|
+
export type ListNavigationOptions = {
|
|
8
|
+
mode: 'list';
|
|
9
|
+
};
|
|
10
|
+
export type NavigationOptions = {
|
|
11
|
+
mode: 'grid' | 'list';
|
|
12
|
+
container: Ref<HTMLElement | null>;
|
|
13
|
+
listener: InputListener;
|
|
14
|
+
loopForbidden?: boolean;
|
|
15
|
+
onSelected?: (index: number) => void;
|
|
16
|
+
} & (GridNavigationOptions | ListNavigationOptions);
|
|
17
|
+
export declare function useNavigation(options: NavigationOptions): {
|
|
18
|
+
selectedIndex: Ref<number>;
|
|
19
|
+
selectedElement: import("vue").ComputedRef<Element | null>;
|
|
20
|
+
currentColumn: import("vue").ComputedRef<number>;
|
|
21
|
+
buttonDown: () => void;
|
|
22
|
+
buttonUp: () => void;
|
|
23
|
+
buttonLeft: () => void;
|
|
24
|
+
buttonRight: () => void;
|
|
25
|
+
selectUp: () => void;
|
|
26
|
+
selectDown: () => void;
|
|
27
|
+
selectPrevious: () => void;
|
|
28
|
+
selectNext: () => void;
|
|
29
|
+
select: (index: number) => void;
|
|
30
|
+
};
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { App } from 'vue';
|
|
2
|
-
import type { NarratScript } from './types/app-types';
|
|
3
|
-
import 'es6-promise/auto';
|
|
4
|
-
export * from './main';
|
|
5
|
-
export type Narrat = {
|
|
6
|
-
app: App;
|
|
7
|
-
};
|
|
8
|
-
declare global {
|
|
9
|
-
export interface Window {
|
|
10
|
-
narrat: Narrat;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export * from './exports/plugins';
|
|
14
|
-
export * from './exports/display';
|
|
15
|
-
export * from './exports/config';
|
|
16
|
-
export * from './exports/events';
|
|
17
|
-
export * from './exports/inputs';
|
|
18
|
-
export * from './exports/stores';
|
|
19
|
-
export * from './exports/others';
|
|
20
|
-
export * from './exports/components';
|
|
21
|
-
export * from './exports/utils';
|
|
22
|
-
export { NarratScript };
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import type { NarratScript } from './types/app-types';
|
|
3
|
+
import 'es6-promise/auto';
|
|
4
|
+
export * from './main';
|
|
5
|
+
export type Narrat = {
|
|
6
|
+
app: App;
|
|
7
|
+
};
|
|
8
|
+
declare global {
|
|
9
|
+
export interface Window {
|
|
10
|
+
narrat: Narrat;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export * from './exports/plugins';
|
|
14
|
+
export * from './exports/display';
|
|
15
|
+
export * from './exports/config';
|
|
16
|
+
export * from './exports/events';
|
|
17
|
+
export * from './exports/inputs';
|
|
18
|
+
export * from './exports/stores';
|
|
19
|
+
export * from './exports/others';
|
|
20
|
+
export * from './exports/components';
|
|
21
|
+
export * from './exports/utils';
|
|
22
|
+
export { NarratScript };
|
package/dist/main.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import 'es6-promise/auto';
|
|
2
|
-
import 'virtual:windi.css';
|
|
3
|
-
import 'virtual:windi-devtools';
|
|
4
|
-
import './css/main.css';
|
|
5
|
-
import { AppOptionsInput } from './types/app-types';
|
|
6
|
-
import { ModuleNamespace } from 'vite/types/hot';
|
|
7
|
-
export type HMRCallback = (mod: ModuleNamespace | undefined) => void;
|
|
8
|
-
export declare function startApp(optionsInput: AppOptionsInput): Promise<any>;
|
|
9
|
-
export declare function registerComponent(name: string, component: any): void;
|
|
1
|
+
import 'es6-promise/auto';
|
|
2
|
+
import 'virtual:windi.css';
|
|
3
|
+
import 'virtual:windi-devtools';
|
|
4
|
+
import './css/main.css';
|
|
5
|
+
import { AppOptionsInput } from './types/app-types';
|
|
6
|
+
import { ModuleNamespace } from 'vite/types/hot';
|
|
7
|
+
export type HMRCallback = (mod: ModuleNamespace | undefined) => void;
|
|
8
|
+
export declare function startApp(optionsInput: AppOptionsInput): Promise<any>;
|
|
9
|
+
export declare function registerComponent(name: string, component: any): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MenuState, MenuTabState } from '../stores/menu-store';
|
|
2
|
-
export declare function registerDefaultMenuButtons(app: any): void;
|
|
3
|
-
export declare function registerMenuButton(id: string, config: MenuState, components: {
|
|
4
|
-
[key: string]: any;
|
|
5
|
-
}): void;
|
|
6
|
-
export declare function registerMenuTab(id: string, config: MenuTabState, component: any): void;
|
|
7
|
-
export declare function addMenuButtonsFromPlugins(): void;
|
|
1
|
+
import { MenuState, MenuTabState } from '../stores/menu-store';
|
|
2
|
+
export declare function registerDefaultMenuButtons(app: any): void;
|
|
3
|
+
export declare function registerMenuButton(id: string, config: MenuState, components: {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function registerMenuTab(id: string, config: MenuTabState, component: any): void;
|
|
7
|
+
export declare function addMenuButtonsFromPlugins(): void;
|