@vnejs/contracts.canvas.child.sprite 0.2.1 → 0.2.3

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/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
8
8
  export type { Constants } from "./const.js";
9
9
  export { SUBSCRIBE_EVENTS };
10
10
  export type { SubscribeEvents } from "./events.js";
11
- export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITION_SHOW_NAMES, TRANSITION_HIDE_NAMES, POSITIONS, POSITION_NAMES, SPRITE_INFO, } from "./params.js";
11
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITION_SHOW_NAMES, TRANSITION_HIDE_NAMES, POSITIONS, POSITION_NAMES, SPRITE_INFO } from "./params.js";
12
12
  export type { Params, SpriteBoxProps, SpriteInfo, SpriteTransitionProps } from "./params.js";
13
13
  export { SPRITE_LINE_COMMAND } from "./scenario-command.js";
14
14
  declare module "@vnejs/shared" {
package/dist/index.js CHANGED
@@ -3,5 +3,5 @@ import { SUBSCRIBE_EVENTS } from "./events.js";
3
3
  export const PLUGIN_NAME = "LAYER_SPRITE";
4
4
  export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
5
5
  export { SUBSCRIBE_EVENTS };
6
- export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITION_SHOW_NAMES, TRANSITION_HIDE_NAMES, POSITIONS, POSITION_NAMES, SPRITE_INFO, } from "./params.js";
6
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITION_SHOW_NAMES, TRANSITION_HIDE_NAMES, POSITIONS, POSITION_NAMES, SPRITE_INFO } from "./params.js";
7
7
  export { SPRITE_LINE_COMMAND } from "./scenario-command.js";
package/dist/params.d.ts CHANGED
@@ -15,7 +15,8 @@ export type SpriteTransitionProps = {
15
15
  };
16
16
  export type SpriteInfo = {
17
17
  mapOverlays?: (overlays: Record<string, string>) => Record<string, string>;
18
- getSrc?: (variation: string, realOverlays: Record<string, string>, options: Record<string, unknown>, otherArgs: Record<string, unknown>) => Array<string | ({
18
+ /** Overlay src list. Empty string and other falsy entries keep the slot and render as a transparent image. */
19
+ getSrc?: (variation: string, realOverlays: Record<string, string>, options: Record<string, unknown>, otherArgs: Record<string, unknown>) => Array<string | false | null | undefined | ({
19
20
  src?: Array<{
20
21
  url: string;
21
22
  } & Record<string, unknown>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/contracts.canvas.child.sprite",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Contracts for @vnejs/plugins.canvas.child.sprite",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -11,16 +11,7 @@ export { CONSTANTS, ACTIONS, LAYER_CHILD_TYPE } from "./const.js";
11
11
  export type { Constants } from "./const.js";
12
12
  export { SUBSCRIBE_EVENTS };
13
13
  export type { SubscribeEvents } from "./events.js";
14
- export {
15
- PARAMS,
16
- TRANSITIONS_SHOW,
17
- TRANSITIONS_HIDE,
18
- TRANSITION_SHOW_NAMES,
19
- TRANSITION_HIDE_NAMES,
20
- POSITIONS,
21
- POSITION_NAMES,
22
- SPRITE_INFO,
23
- } from "./params.js";
14
+ export { PARAMS, TRANSITIONS_SHOW, TRANSITIONS_HIDE, TRANSITION_SHOW_NAMES, TRANSITION_HIDE_NAMES, POSITIONS, POSITION_NAMES, SPRITE_INFO } from "./params.js";
24
15
  export type { Params, SpriteBoxProps, SpriteInfo, SpriteTransitionProps } from "./params.js";
25
16
  export { SPRITE_LINE_COMMAND } from "./scenario-command.js";
26
17
 
package/src/params.ts CHANGED
@@ -18,12 +18,13 @@ export type SpriteTransitionProps = {
18
18
 
19
19
  export type SpriteInfo = {
20
20
  mapOverlays?: (overlays: Record<string, string>) => Record<string, string>;
21
+ /** Overlay src list. Empty string and other falsy entries keep the slot and render as a transparent image. */
21
22
  getSrc?: (
22
23
  variation: string,
23
24
  realOverlays: Record<string, string>,
24
25
  options: Record<string, unknown>,
25
26
  otherArgs: Record<string, unknown>,
26
- ) => Array<string | { src?: Array<{ url: string } & Record<string, unknown>> } & Record<string, unknown>>;
27
+ ) => Array<string | false | null | undefined | ({ src?: Array<{ url: string } & Record<string, unknown>> } & Record<string, unknown>)>;
27
28
  };
28
29
 
29
30
  export const TRANSITIONS_SHOW: Record<string, (boxProps: SpriteBoxProps) => SpriteTransitionProps> = {