@vnejs/plugins.canvas.child.bg 0.2.4 → 0.2.6

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.
@@ -1,10 +1,10 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
+ import type { BgChangePayload } from "@vnejs/contracts.canvas.child.bg";
2
3
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgChangePayload } from "../utils/bg.js";
4
4
  export declare class LayerBgChange extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
5
5
  name: string;
6
6
  subscribe: () => void;
7
- onBgChange: ({ id, name, layer, duration, args }?: BgChangePayload) => Promise<unknown[] | undefined>;
7
+ onBgChange: ({ id, name, layer, duration, args }?: BgChangePayload) => Promise<import("@vnejs/shared").EmitResults<"vne:interact:push_pop"> | undefined>;
8
8
  getBgId: (id: string | undefined, layer: string) => Promise<string>;
9
- emitChildChange: (layer: string, childId: string, duration: number, props: Record<string, unknown>) => Promise<unknown[]> | undefined;
9
+ emitChildChange: (layer: string, childId: string, duration: number, props: Record<string, unknown>) => Promise<import("@vnejs/shared").EmitResults<"vne:layer:child_change">> | undefined;
10
10
  }
@@ -11,7 +11,7 @@ export class LayerBgChange extends ModuleCore {
11
11
  const realId = await this.getBgId(id, layer);
12
12
  if (!realId)
13
13
  return;
14
- const clonedArgs = await this.emitClone(args);
14
+ const clonedArgs = structuredClone(args);
15
15
  const src = await this.emitOne(this.EVENTS.LAYER_BG.SRC_GET, { name, layer, args: clonedArgs });
16
16
  const changeArgs = { src, isAllSrcRendered: Boolean(clonedArgs.overlays), name, args: clonedArgs };
17
17
  await this.emit(this.EVENTS.LAYER_BG.STATE_UPDATE, { id: realId, name, args: clonedArgs });
@@ -1,10 +1,11 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
2
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgHidePayload, TransitionProps } from "../utils/bg.js";
3
+ import type { BgHidePayload } from "@vnejs/contracts.canvas.child.bg";
4
+ import type { TransitionProps } from "../utils/bg.js";
4
5
  export declare class LayerBgHide extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
5
6
  name: string;
6
7
  subscribe: () => void;
7
8
  onBgHide: ({ layer, transition, duration }?: BgHidePayload) => Promise<void>;
8
9
  getTransitionProps: (transition: string, duration: number) => TransitionProps;
9
- emitStateRm: (id: string) => Promise<unknown[]> | undefined;
10
+ emitStateRm: (id: string) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:state_rm">> | undefined;
10
11
  }
@@ -1,9 +1,9 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
+ import type { BgPreloadPayload } from "@vnejs/contracts.canvas.child.bg";
2
3
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgPreloadPayload } from "../utils/bg.js";
4
4
  export declare class LayerBgPreload extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
5
5
  name: string;
6
6
  subscribe: () => void;
7
- onPreload: ({ name, mediaType, priority, overlays }?: BgPreloadPayload) => Promise<unknown[] | undefined>;
8
- loadMedia: (name: string, args: Record<string, unknown>) => Promise<unknown[]> | undefined;
7
+ onPreload: ({ name, mediaType, priority, overlays }?: BgPreloadPayload) => Promise<(import("@vnejs/shared").EmitResults<"vne:media:load"> | undefined)[] | import("@vnejs/shared").EmitResults<"vne:media:load"> | undefined>;
8
+ loadMedia: (name: string, args: Record<string, unknown>) => Promise<import("@vnejs/shared").EmitResults<"vne:media:load">> | undefined;
9
9
  }
@@ -1,10 +1,11 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
+ import type { BgShowPayload } from "@vnejs/contracts.canvas.child.bg";
2
3
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgShowPayload, TransitionProps } from "../utils/bg.js";
4
+ import type { TransitionProps } from "../utils/bg.js";
4
5
  export declare class LayerBgShow extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
5
6
  name: string;
6
7
  subscribe: () => void;
7
- onBgShow: ({ name, layer, transition, duration, args, hideOldBgsOnShow }?: BgShowPayload) => Promise<[...(unknown[] | undefined)[], unknown[] | undefined] | undefined>;
8
+ onBgShow: ({ name, layer, transition, duration, args, hideOldBgsOnShow }?: BgShowPayload) => Promise<[...(import("@vnejs/shared").EmitResults<"vne:layer_bg:state_rm"> | undefined)[], import("@vnejs/shared").EmitResults<"vne:layer:childs_rm"> | undefined] | undefined>;
8
9
  getTransitionProps: (transition: string, duration: number) => TransitionProps;
9
- emitStateRm: (id: string) => Promise<unknown[]> | undefined;
10
+ emitStateRm: (id: string) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:state_rm">> | undefined;
10
11
  }
@@ -6,7 +6,7 @@ export class LayerBgShow extends ModuleCore {
6
6
  this.on(this.EVENTS.LAYER_BG.SHOW, this.onBgShow);
7
7
  };
8
8
  onBgShow = async ({ name, layer, transition, duration, args = {}, hideOldBgsOnShow = true } = {}) => {
9
- const clonedArgs = await this.emitClone(args);
9
+ const clonedArgs = structuredClone(args);
10
10
  const shouldHideOldImages = hideOldBgsOnShow || clonedArgs.hideOldBgsOnShow;
11
11
  const id = clonedArgs.id || crypto.randomUUID();
12
12
  const oldChildsId = shouldHideOldImages
@@ -1,6 +1,6 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
+ import type { BgSrcGetPayload } from "@vnejs/contracts.canvas.child.bg";
2
3
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgSrcGetPayload } from "../utils/bg.js";
4
4
  export declare class LayerBgStaff extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
5
5
  name: string;
6
6
  subscribe: () => void;
@@ -7,7 +7,7 @@ export class LayerBgStaff extends ModuleCore {
7
7
  this.on(this.EVENTS.LAYER_BG.SRC_GET, this.onBgGetSrc);
8
8
  };
9
9
  onBgGetSrc = async ({ name = "", args = {} } = {}) => {
10
- const clonedArgs = await this.emitClone(args);
10
+ const clonedArgs = structuredClone(args);
11
11
  const injections = (await this.emitReals(this.EVENTS.LAYER_BG.ARGS_INJECT, { args: clonedArgs }));
12
12
  const { overlays } = applyArgsInjections(clonedArgs, injections);
13
13
  return overlays ? this.getBgSrcOverlays(name, overlays) : this.getBgSrcOne(name);
@@ -1,6 +1,6 @@
1
1
  import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
2
2
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
3
- import type { BgRecord, BgState, BgStateIdPayload, BgStateLayerPayload } from "../utils/bg.js";
3
+ import type { BgRecord, BgState, BgStateIdPayload, BgStateLayerPayload } from "@vnejs/contracts.canvas.child.bg";
4
4
  export declare class LayerBgState extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams, BgState> {
5
5
  name: string;
6
6
  subscribe: () => void;
@@ -11,19 +11,19 @@ export declare class LayerBgState extends ModuleCore<BgPluginEvents, BgPluginCon
11
11
  onBgStateRm: ({ id }?: BgStateIdPayload) => void;
12
12
  onStateSet: (payload: ModuleGlobalStateRegistry) => Promise<void>;
13
13
  onStateClear: () => Promise<void>;
14
- onStatePreload: ({ [this.name]: state }: Record<string, BgState>) => Promise<(unknown[] | undefined)[]>;
14
+ onStatePreload: ({ [this.name]: state }: Record<string, BgState>) => Promise<(import("@vnejs/shared").EmitResults<"vne:layer_bg:src_get"> | undefined)[]>;
15
15
  onMemoryCleared: () => Promise<void>;
16
16
  clearState: () => Promise<void>;
17
- preloadState: (state: BgState) => Promise<(unknown[] | undefined)[]>;
17
+ preloadState: (state: BgState) => Promise<(import("@vnejs/shared").EmitResults<"vne:layer_bg:src_get"> | undefined)[]>;
18
18
  cloneBgAndChangeWithNewId: (bg: BgRecord, id: string) => Promise<unknown>;
19
19
  cloneBgAndChange: (bg: BgRecord) => Promise<unknown>;
20
20
  cloneBgAndHide: (bg: BgRecord) => Promise<unknown>;
21
21
  cloneBgAndShow: (bg: BgRecord) => Promise<unknown>;
22
22
  emitEventWithBg: (bg: BgRecord, cb: (bg: BgRecord) => unknown) => unknown;
23
- emitBgSrcGet: (bg: BgRecord) => Promise<unknown[]> | undefined;
24
- emitBgChange: (bg: BgRecord) => Promise<unknown[]> | undefined;
25
- emitBgHide: (bg: BgRecord) => Promise<unknown[]> | undefined;
26
- emitBgShow: (bg: BgRecord) => Promise<unknown[]> | undefined;
23
+ emitBgSrcGet: (bg: BgRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:src_get">> | undefined;
24
+ emitBgChange: (bg: BgRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:change">> | undefined;
25
+ emitBgHide: (bg: BgRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:hide">> | undefined;
26
+ emitBgShow: (bg: BgRecord) => Promise<import("@vnejs/shared").EmitResults<"vne:layer_bg:show">> | undefined;
27
27
  getBgsByLayerFromState: (acc: Record<string, BgRecord[]>, img: BgRecord) => Record<string, BgRecord[]>;
28
28
  getDefaultState: () => BgState;
29
29
  }
@@ -24,8 +24,8 @@ export class LayerBgState extends ModuleCore {
24
24
  this.state.bgs = this.state.bgs.filter((e) => e.id !== id);
25
25
  };
26
26
  onStateSet = async (payload) => {
27
- const clonedStateOld = await this.emitClone(this.state);
28
- const clonedStateNew = await this.emitClone(this.getStateSlice(payload));
27
+ const clonedStateOld = structuredClone(this.state);
28
+ const clonedStateNew = structuredClone(this.getStateSlice(payload));
29
29
  await this.preloadState(clonedStateNew);
30
30
  const oldBgsByLayer = clonedStateOld.bgs.reduce(this.getBgsByLayerFromState, {});
31
31
  const newBgsByLayer = clonedStateNew.bgs.reduce(this.getBgsByLayerFromState, {});
@@ -60,10 +60,10 @@ export class LayerBgState extends ModuleCore {
60
60
  this.shared.viewForceAnimationSources.rm(`${this.name}.clear`);
61
61
  };
62
62
  preloadState = (state) => Promise.all(state.bgs.map(this.emitBgSrcGet));
63
- cloneBgAndChangeWithNewId = async (bg, id) => this.emitEventWithBg({ ...(await this.emitClone(bg)), id }, this.emitBgChange);
64
- cloneBgAndChange = async (bg) => this.emitEventWithBg(await this.emitClone(bg), this.emitBgChange);
65
- cloneBgAndHide = async (bg) => this.emitEventWithBg(await this.emitClone(bg), this.emitBgHide);
66
- cloneBgAndShow = async (bg) => this.emitEventWithBg(await this.emitClone(bg), this.emitBgShow);
63
+ cloneBgAndChangeWithNewId = async (bg, id) => this.emitEventWithBg({ ...structuredClone(bg), id }, this.emitBgChange);
64
+ cloneBgAndChange = async (bg) => this.emitEventWithBg(structuredClone(bg), this.emitBgChange);
65
+ cloneBgAndHide = async (bg) => this.emitEventWithBg(structuredClone(bg), this.emitBgHide);
66
+ cloneBgAndShow = async (bg) => this.emitEventWithBg(structuredClone(bg), this.emitBgShow);
67
67
  emitEventWithBg = (bg, cb) => cb(bg);
68
68
  emitBgSrcGet = (bg) => this.emit(this.EVENTS.LAYER_BG.SRC_GET, bg);
69
69
  emitBgChange = (bg) => this.emit(this.EVENTS.LAYER_BG.CHANGE, bg);
@@ -1,56 +1,5 @@
1
- import type { BgArgs, BgPreloadPayload } from "@vnejs/contracts.canvas.child.bg";
2
- export type { BgArgs, BgPreloadPayload };
3
- export type BgArgsInject = Partial<BgArgs>;
4
- export type BgArgsInjectPayload = {
5
- args?: BgArgs;
6
- };
1
+ import type { BgArgs, BgArgsInject } from "@vnejs/contracts.canvas.child.bg";
7
2
  export declare const applyArgsInjections: (base: BgArgs, injections: BgArgsInject[]) => BgArgs;
8
- export type BgRecord = {
9
- id: string;
10
- name?: string;
11
- layer?: string;
12
- args?: BgArgs;
13
- transition?: string;
14
- duration?: number;
15
- hideOldBgsOnShow?: boolean;
16
- };
17
- export type BgState = {
18
- bgs: BgRecord[];
19
- };
20
- export type BgShowPayload = {
21
- name?: string;
22
- layer?: string;
23
- transition?: string;
24
- duration?: number;
25
- args?: BgArgs;
26
- hideOldBgsOnShow?: boolean;
27
- };
28
- export type BgHidePayload = {
29
- layer?: string;
30
- transition?: string;
31
- duration?: number;
32
- };
33
- export type BgChangePayload = {
34
- id?: string;
35
- name?: string;
36
- layer?: string;
37
- duration?: number;
38
- args?: BgArgs;
39
- };
40
- export type BgSrcGetPayload = {
41
- name?: string;
42
- layer?: string;
43
- args?: BgArgs;
44
- };
45
- export type BgStateLayerPayload = {
46
- layer?: string;
47
- };
48
- export type BgStateIdPayload = {
49
- id?: string;
50
- name?: string;
51
- layer?: string;
52
- args?: BgArgs;
53
- };
54
3
  export type TransitionProps = {
55
4
  initialProps?: Record<string, unknown>;
56
5
  finishProps?: Record<string, unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/plugins.canvas.child.bg",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,8 +1,9 @@
1
1
  import { createPromiseResolve } from "@vnejs/helpers";
2
2
  import { ModuleCore } from "@vnejs/module.core";
3
3
 
4
+ import type { BgArgs, BgChangePayload, BgRecord } from "@vnejs/contracts.canvas.child.bg";
5
+
4
6
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
5
- import type { BgArgs, BgChangePayload, BgRecord } from "../utils/bg.js";
6
7
 
7
8
  export class LayerBgChange extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
8
9
  name = "layer.bg.change";
@@ -18,7 +19,7 @@ export class LayerBgChange extends ModuleCore<BgPluginEvents, BgPluginConstants,
18
19
 
19
20
  if (!realId) return;
20
21
 
21
- const clonedArgs = await this.emitClone<BgArgs>(args);
22
+ const clonedArgs = structuredClone(args);
22
23
 
23
24
  const src = await this.emitOne(this.EVENTS.LAYER_BG.SRC_GET, { name, layer, args: clonedArgs });
24
25
 
@@ -2,7 +2,9 @@ import { createPromiseResolve } from "@vnejs/helpers";
2
2
  import { ModuleCore } from "@vnejs/module.core";
3
3
 
4
4
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
5
- import type { BgHidePayload, BgStateIdPayload, TransitionProps } from "../utils/bg.js";
5
+ import type { BgHidePayload, BgStateIdPayload } from "@vnejs/contracts.canvas.child.bg";
6
+
7
+ import type { TransitionProps } from "../utils/bg.js";
6
8
 
7
9
  export class LayerBgHide extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
8
10
  name = "layer.bg.hide";
@@ -1,7 +1,8 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
2
 
3
+ import type { BgPreloadPayload } from "@vnejs/contracts.canvas.child.bg";
4
+
3
5
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
4
- import type { BgPreloadPayload } from "../utils/bg.js";
5
6
 
6
7
  export class LayerBgPreload extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
7
8
  name = "layer.bg.preload";
@@ -1,8 +1,10 @@
1
1
  import { createPromiseResolve } from "@vnejs/helpers";
2
2
  import { ModuleCore } from "@vnejs/module.core";
3
3
 
4
+ import type { BgArgs, BgShowPayload, BgStateIdPayload } from "@vnejs/contracts.canvas.child.bg";
5
+
4
6
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
5
- import type { BgArgs, BgShowPayload, BgStateIdPayload, TransitionProps } from "../utils/bg.js";
7
+ import type { TransitionProps } from "../utils/bg.js";
6
8
 
7
9
  export class LayerBgShow extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams> {
8
10
  name = "layer.bg.show";
@@ -12,7 +14,7 @@ export class LayerBgShow extends ModuleCore<BgPluginEvents, BgPluginConstants, B
12
14
  };
13
15
 
14
16
  onBgShow = async ({ name, layer, transition, duration, args = {}, hideOldBgsOnShow = true }: BgShowPayload = {}) => {
15
- const clonedArgs = await this.emitClone<BgArgs>(args);
17
+ const clonedArgs = structuredClone(args);
16
18
 
17
19
  const shouldHideOldImages = hideOldBgsOnShow || clonedArgs.hideOldBgsOnShow;
18
20
 
@@ -1,7 +1,8 @@
1
1
  import { ModuleCore } from "@vnejs/module.core";
2
2
 
3
+ import type { BgArgs, BgArgsInject, BgSrcGetPayload } from "@vnejs/contracts.canvas.child.bg";
4
+
3
5
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
4
- import type { BgArgs, BgArgsInject, BgSrcGetPayload } from "../utils/bg.js";
5
6
  import { applyArgsInjections } from "../utils/bg.js";
6
7
 
7
8
  const mediaToSrcs = (q: { src: string }) => ({ url: q.src });
@@ -14,7 +15,7 @@ export class LayerBgStaff extends ModuleCore<BgPluginEvents, BgPluginConstants,
14
15
  };
15
16
 
16
17
  onBgGetSrc = async ({ name = "", args = {} }: BgSrcGetPayload = {}) => {
17
- const clonedArgs = await this.emitClone<BgArgs>(args);
18
+ const clonedArgs = structuredClone(args);
18
19
  const injections = (await this.emitReals(this.EVENTS.LAYER_BG.ARGS_INJECT, { args: clonedArgs })) as BgArgsInject[];
19
20
  const { overlays } = applyArgsInjections(clonedArgs, injections);
20
21
 
@@ -1,7 +1,7 @@
1
1
  import { ModuleCore, type ModuleGlobalStateRegistry } from "@vnejs/module.core";
2
2
 
3
3
  import type { BgPluginConstants, BgPluginEvents, BgPluginParams, BgPluginSettings } from "../types.js";
4
- import type { BgRecord, BgState, BgStateIdPayload, BgStateLayerPayload } from "../utils/bg.js";
4
+ import type { BgRecord, BgState, BgStateIdPayload, BgStateLayerPayload } from "@vnejs/contracts.canvas.child.bg";
5
5
 
6
6
  export class LayerBgState extends ModuleCore<BgPluginEvents, BgPluginConstants, BgPluginSettings, BgPluginParams, BgState> {
7
7
  name = "layer.bg.state";
@@ -37,8 +37,8 @@ export class LayerBgState extends ModuleCore<BgPluginEvents, BgPluginConstants,
37
37
  };
38
38
 
39
39
  onStateSet = async (payload: ModuleGlobalStateRegistry) => {
40
- const clonedStateOld = await this.emitClone<BgState>(this.state);
41
- const clonedStateNew = await this.emitClone<BgState>(this.getStateSlice(payload));
40
+ const clonedStateOld = structuredClone(this.state);
41
+ const clonedStateNew = structuredClone(this.getStateSlice(payload));
42
42
 
43
43
  await this.preloadState(clonedStateNew);
44
44
 
@@ -87,13 +87,13 @@ export class LayerBgState extends ModuleCore<BgPluginEvents, BgPluginConstants,
87
87
 
88
88
  preloadState = (state: BgState) => Promise.all(state.bgs.map(this.emitBgSrcGet));
89
89
 
90
- cloneBgAndChangeWithNewId = async (bg: BgRecord, id: string) => this.emitEventWithBg({ ...(await this.emitClone<BgRecord>(bg)), id }, this.emitBgChange);
90
+ cloneBgAndChangeWithNewId = async (bg: BgRecord, id: string) => this.emitEventWithBg({ ...structuredClone(bg), id }, this.emitBgChange);
91
91
 
92
- cloneBgAndChange = async (bg: BgRecord) => this.emitEventWithBg(await this.emitClone<BgRecord>(bg), this.emitBgChange);
92
+ cloneBgAndChange = async (bg: BgRecord) => this.emitEventWithBg(structuredClone(bg), this.emitBgChange);
93
93
 
94
- cloneBgAndHide = async (bg: BgRecord) => this.emitEventWithBg(await this.emitClone<BgRecord>(bg), this.emitBgHide);
94
+ cloneBgAndHide = async (bg: BgRecord) => this.emitEventWithBg(structuredClone(bg), this.emitBgHide);
95
95
 
96
- cloneBgAndShow = async (bg: BgRecord) => this.emitEventWithBg(await this.emitClone<BgRecord>(bg), this.emitBgShow);
96
+ cloneBgAndShow = async (bg: BgRecord) => this.emitEventWithBg(structuredClone(bg), this.emitBgShow);
97
97
 
98
98
  emitEventWithBg = (bg: BgRecord, cb: (bg: BgRecord) => unknown) => cb(bg);
99
99
 
package/src/utils/bg.ts CHANGED
@@ -1,12 +1,4 @@
1
- import type { BgArgs, BgPreloadPayload } from "@vnejs/contracts.canvas.child.bg";
2
-
3
- export type { BgArgs, BgPreloadPayload };
4
-
5
- export type BgArgsInject = Partial<BgArgs>;
6
-
7
- export type BgArgsInjectPayload = {
8
- args?: BgArgs;
9
- };
1
+ import type { BgArgs, BgArgsInject } from "@vnejs/contracts.canvas.child.bg";
10
2
 
11
3
  export const applyArgsInjections = (base: BgArgs, injections: BgArgsInject[]): BgArgs =>
12
4
  injections.reduce(
@@ -18,60 +10,6 @@ export const applyArgsInjections = (base: BgArgs, injections: BgArgsInject[]): B
18
10
  base,
19
11
  );
20
12
 
21
- export type BgRecord = {
22
- id: string;
23
- name?: string;
24
- layer?: string;
25
- args?: BgArgs;
26
- transition?: string;
27
- duration?: number;
28
- hideOldBgsOnShow?: boolean;
29
- };
30
-
31
- export type BgState = {
32
- bgs: BgRecord[];
33
- };
34
-
35
- export type BgShowPayload = {
36
- name?: string;
37
- layer?: string;
38
- transition?: string;
39
- duration?: number;
40
- args?: BgArgs;
41
- hideOldBgsOnShow?: boolean;
42
- };
43
-
44
- export type BgHidePayload = {
45
- layer?: string;
46
- transition?: string;
47
- duration?: number;
48
- };
49
-
50
- export type BgChangePayload = {
51
- id?: string;
52
- name?: string;
53
- layer?: string;
54
- duration?: number;
55
- args?: BgArgs;
56
- };
57
-
58
- export type BgSrcGetPayload = {
59
- name?: string;
60
- layer?: string;
61
- args?: BgArgs;
62
- };
63
-
64
- export type BgStateLayerPayload = {
65
- layer?: string;
66
- };
67
-
68
- export type BgStateIdPayload = {
69
- id?: string;
70
- name?: string;
71
- layer?: string;
72
- args?: BgArgs;
73
- };
74
-
75
13
  export type TransitionProps = {
76
14
  initialProps?: Record<string, unknown>;
77
15
  finishProps?: Record<string, unknown>;