@vnejs/contracts.views.screens.gamemenu 0.2.1 → 0.2.2

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/events.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export declare const SUBSCRIBE_EVENTS: {
2
2
  readonly SHOW: "vne:gamemenu:show";
3
3
  readonly HIDE: "vne:gamemenu:hide";
4
+ readonly ITEMS: "vne:gamemenu:items";
4
5
  readonly CLICK: "vne:gamemenu:click";
5
6
  readonly UPDATE: "vne:gamemenu:update";
6
7
  readonly STATE_UPDATE: "vne:gamemenu:state_update";
package/dist/events.js CHANGED
@@ -1,6 +1,7 @@
1
1
  export const SUBSCRIBE_EVENTS = {
2
2
  SHOW: "vne:gamemenu:show",
3
3
  HIDE: "vne:gamemenu:hide",
4
+ ITEMS: "vne:gamemenu:items",
4
5
  CLICK: "vne:gamemenu:click",
5
6
  UPDATE: "vne:gamemenu:update",
6
7
  STATE_UPDATE: "vne:gamemenu:state_update",
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export type PluginName = typeof PLUGIN_NAME;
6
6
  export { SUBSCRIBE_EVENTS };
7
7
  export type { SubscribeEvents } from "./events.js";
8
8
  export { PARAMS };
9
- export type { GameMenuItem, GameMenuItemOnClickContext, Params, ViewProps } from "./params.js";
9
+ export type { GameMenuItem, GameMenuItemFactory, GameMenuItemOnClickContext, Params, ViewProps } from "./params.js";
10
10
  declare module "@vnejs/shared" {
11
11
  interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {
12
12
  }
package/dist/params.d.ts CHANGED
@@ -4,10 +4,11 @@ export type GameMenuItemOnClickContext = Pick<Module, "emit" | "emitOne" | "emit
4
4
  export type GameMenuItem = {
5
5
  locKey: string;
6
6
  onClick: (module: GameMenuItemOnClickContext) => void | Promise<void>;
7
- disabled?: boolean;
8
- hided?: boolean;
7
+ isDisabled?: boolean;
8
+ isHided?: boolean;
9
9
  };
10
- export declare const ITEMS: GameMenuItem[];
10
+ export type GameMenuItemFactory = (module: Module) => GameMenuItem;
11
+ export declare const ITEMS: GameMenuItemFactory[];
11
12
  export declare const TRANSITION: number;
12
13
  export declare const ZINDEX: number;
13
14
  export declare const LOC_LABEL: string;
@@ -30,7 +31,7 @@ declare const VIEW_PROPS_DEFAULT: {
30
31
  export type ViewProps = WidenViewProps<typeof VIEW_PROPS_DEFAULT>;
31
32
  export declare const VIEW_PROPS: ViewProps;
32
33
  declare const PARAMS_DEFAULT: {
33
- ITEMS: GameMenuItem[];
34
+ ITEMS: GameMenuItemFactory[];
34
35
  TRANSITION: number;
35
36
  ZINDEX: number;
36
37
  LOC_LABEL: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/contracts.views.screens.gamemenu",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Contracts for @vnejs/plugins.views.screens.gamemenu",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/events.ts CHANGED
@@ -2,6 +2,7 @@ export const SUBSCRIBE_EVENTS = {
2
2
  SHOW: "vne:gamemenu:show",
3
3
  HIDE: "vne:gamemenu:hide",
4
4
 
5
+ ITEMS: "vne:gamemenu:items",
5
6
  CLICK: "vne:gamemenu:click",
6
7
 
7
8
  UPDATE: "vne:gamemenu:update",
package/src/index.ts CHANGED
@@ -9,7 +9,7 @@ export type PluginName = typeof PLUGIN_NAME;
9
9
  export { SUBSCRIBE_EVENTS };
10
10
  export type { SubscribeEvents } from "./events.js";
11
11
  export { PARAMS };
12
- export type { GameMenuItem, GameMenuItemOnClickContext, Params, ViewProps } from "./params.js";
12
+ export type { GameMenuItem, GameMenuItemFactory, GameMenuItemOnClickContext, Params, ViewProps } from "./params.js";
13
13
 
14
14
  declare module "@vnejs/shared" {
15
15
  interface VnePluginEventsMap extends Record<typeof PLUGIN_NAME, typeof SUBSCRIBE_EVENTS> {}
package/src/params.ts CHANGED
@@ -6,11 +6,13 @@ export type GameMenuItemOnClickContext = Pick<Module, "emit" | "emitOne" | "emit
6
6
  export type GameMenuItem = {
7
7
  locKey: string;
8
8
  onClick: (module: GameMenuItemOnClickContext) => void | Promise<void>;
9
- disabled?: boolean;
10
- hided?: boolean;
9
+ isDisabled?: boolean;
10
+ isHided?: boolean;
11
11
  };
12
12
 
13
- export const ITEMS: GameMenuItem[] = [];
13
+ export type GameMenuItemFactory = (module: Module) => GameMenuItem;
14
+
15
+ export const ITEMS: GameMenuItemFactory[] = [];
14
16
 
15
17
  export const TRANSITION: number = 500;
16
18
  export const ZINDEX: number = 3000;