canvasengine 2.0.0-beta.6 → 2.0.0-beta.61

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.
Files changed (164) hide show
  1. package/dist/DebugRenderer-DkjTAc48.js +1384 -0
  2. package/dist/DebugRenderer-DkjTAc48.js.map +1 -0
  3. package/dist/components/Button.d.ts +185 -0
  4. package/dist/components/Button.d.ts.map +1 -0
  5. package/dist/components/Canvas.d.ts +17 -0
  6. package/dist/components/Canvas.d.ts.map +1 -0
  7. package/dist/components/DOMElement.d.ts +54 -0
  8. package/dist/components/DOMElement.d.ts.map +1 -0
  9. package/dist/components/DOMSprite.d.ts +127 -0
  10. package/dist/components/DOMSprite.d.ts.map +1 -0
  11. package/dist/components/FocusContainer.d.ts +129 -0
  12. package/dist/components/FocusContainer.d.ts.map +1 -0
  13. package/dist/components/Graphic.d.ts +64 -0
  14. package/dist/components/Graphic.d.ts.map +1 -0
  15. package/dist/components/Joystick.d.ts +36 -0
  16. package/dist/components/Joystick.d.ts.map +1 -0
  17. package/dist/components/NineSliceSprite.d.ts +16 -0
  18. package/dist/components/NineSliceSprite.d.ts.map +1 -0
  19. package/dist/components/ParticleEmitter.d.ts +4 -0
  20. package/dist/components/ParticleEmitter.d.ts.map +1 -0
  21. package/dist/components/Scene.d.ts +2 -0
  22. package/dist/components/Scene.d.ts.map +1 -0
  23. package/dist/components/Text.d.ts +24 -0
  24. package/dist/components/Text.d.ts.map +1 -0
  25. package/dist/components/TilingSprite.d.ts +17 -0
  26. package/dist/components/TilingSprite.d.ts.map +1 -0
  27. package/dist/components/Video.d.ts +14 -0
  28. package/dist/components/Video.d.ts.map +1 -0
  29. package/dist/components/index.d.ts +20 -0
  30. package/dist/components/index.d.ts.map +1 -0
  31. package/dist/components/types/DisplayObject.d.ts +118 -0
  32. package/dist/components/types/DisplayObject.d.ts.map +1 -0
  33. package/dist/components/types/MouseEvent.d.ts +4 -0
  34. package/dist/components/types/MouseEvent.d.ts.map +1 -0
  35. package/dist/components/types/Spritesheet.d.ts +248 -0
  36. package/dist/components/types/Spritesheet.d.ts.map +1 -0
  37. package/dist/components/types/index.d.ts +4 -0
  38. package/dist/components/types/index.d.ts.map +1 -0
  39. package/dist/directives/Controls.d.ts +112 -0
  40. package/dist/directives/Controls.d.ts.map +1 -0
  41. package/dist/directives/ControlsBase.d.ts +199 -0
  42. package/dist/directives/ControlsBase.d.ts.map +1 -0
  43. package/dist/directives/Drag.d.ts +69 -0
  44. package/dist/directives/Drag.d.ts.map +1 -0
  45. package/dist/directives/Flash.d.ts +116 -0
  46. package/dist/directives/Flash.d.ts.map +1 -0
  47. package/dist/directives/FocusNavigation.d.ts +52 -0
  48. package/dist/directives/FocusNavigation.d.ts.map +1 -0
  49. package/dist/directives/FogVisibility.d.ts +47 -0
  50. package/dist/directives/FogVisibility.d.ts.map +1 -0
  51. package/dist/directives/GamepadControls.d.ts +224 -0
  52. package/dist/directives/GamepadControls.d.ts.map +1 -0
  53. package/dist/directives/JoystickControls.d.ts +171 -0
  54. package/dist/directives/JoystickControls.d.ts.map +1 -0
  55. package/dist/directives/KeyboardControls.d.ts +219 -0
  56. package/dist/directives/KeyboardControls.d.ts.map +1 -0
  57. package/dist/directives/Scheduler.d.ts +36 -0
  58. package/dist/directives/Scheduler.d.ts.map +1 -0
  59. package/dist/directives/Shake.d.ts +98 -0
  60. package/dist/directives/Shake.d.ts.map +1 -0
  61. package/dist/directives/Sound.d.ts +25 -0
  62. package/dist/directives/Sound.d.ts.map +1 -0
  63. package/dist/directives/Transition.d.ts +10 -0
  64. package/dist/directives/Transition.d.ts.map +1 -0
  65. package/dist/directives/ViewportCull.d.ts +11 -0
  66. package/dist/directives/ViewportCull.d.ts.map +1 -0
  67. package/dist/directives/ViewportFollow.d.ts +18 -0
  68. package/dist/directives/ViewportFollow.d.ts.map +1 -0
  69. package/dist/directives/index.d.ts +14 -0
  70. package/dist/directives/index.d.ts.map +1 -0
  71. package/dist/dist-BOOc43Qm.js +778 -0
  72. package/dist/dist-BOOc43Qm.js.map +1 -0
  73. package/dist/engine/FocusManager.d.ts +174 -0
  74. package/dist/engine/FocusManager.d.ts.map +1 -0
  75. package/dist/engine/animation.d.ts +72 -0
  76. package/dist/engine/animation.d.ts.map +1 -0
  77. package/dist/engine/bootstrap.d.ts +52 -0
  78. package/dist/engine/bootstrap.d.ts.map +1 -0
  79. package/dist/engine/directive.d.ts +13 -0
  80. package/dist/engine/directive.d.ts.map +1 -0
  81. package/dist/engine/reactive.d.ts +135 -0
  82. package/dist/engine/reactive.d.ts.map +1 -0
  83. package/dist/engine/signal.d.ts +73 -0
  84. package/dist/engine/signal.d.ts.map +1 -0
  85. package/dist/engine/trigger.d.ts +54 -0
  86. package/dist/engine/trigger.d.ts.map +1 -0
  87. package/dist/engine/utils.d.ts +89 -0
  88. package/dist/engine/utils.d.ts.map +1 -0
  89. package/dist/hooks/addContext.d.ts +2 -0
  90. package/dist/hooks/addContext.d.ts.map +1 -0
  91. package/dist/hooks/useFocus.d.ts +60 -0
  92. package/dist/hooks/useFocus.d.ts.map +1 -0
  93. package/dist/hooks/useProps.d.ts +42 -0
  94. package/dist/hooks/useProps.d.ts.map +1 -0
  95. package/dist/hooks/useRef.d.ts +4 -0
  96. package/dist/hooks/useRef.d.ts.map +1 -0
  97. package/dist/index.d.ts +19 -1107
  98. package/dist/index.d.ts.map +1 -0
  99. package/dist/index.global.js +8 -0
  100. package/dist/index.global.js.map +1 -0
  101. package/dist/index.js +14708 -3135
  102. package/dist/index.js.map +1 -1
  103. package/dist/utils/Ease.d.ts +17 -0
  104. package/dist/utils/Ease.d.ts.map +1 -0
  105. package/dist/utils/GlobalAssetLoader.d.ts +141 -0
  106. package/dist/utils/GlobalAssetLoader.d.ts.map +1 -0
  107. package/dist/utils/RadialGradient.d.ts +57 -0
  108. package/dist/utils/RadialGradient.d.ts.map +1 -0
  109. package/dist/utils/functions.d.ts +2 -0
  110. package/dist/utils/functions.d.ts.map +1 -0
  111. package/dist/utils/tabindex.d.ts +16 -0
  112. package/dist/utils/tabindex.d.ts.map +1 -0
  113. package/package.json +16 -9
  114. package/src/components/Button.ts +399 -0
  115. package/src/components/Canvas.ts +82 -51
  116. package/src/components/Container.ts +21 -2
  117. package/src/components/DOMContainer.ts +379 -0
  118. package/src/components/DOMElement.ts +556 -0
  119. package/src/components/DOMSprite.ts +1040 -0
  120. package/src/components/DisplayObject.ts +422 -201
  121. package/src/components/FocusContainer.ts +368 -0
  122. package/src/components/Graphic.ts +239 -73
  123. package/src/components/Joystick.ts +363 -0
  124. package/src/components/Mesh.ts +222 -0
  125. package/src/components/NineSliceSprite.ts +4 -1
  126. package/src/components/ParticleEmitter.ts +12 -8
  127. package/src/components/Sprite.ts +418 -52
  128. package/src/components/Text.ts +270 -26
  129. package/src/components/Viewport.ts +122 -63
  130. package/src/components/index.ts +9 -2
  131. package/src/components/types/DisplayObject.ts +53 -5
  132. package/src/components/types/Spritesheet.ts +0 -118
  133. package/src/directives/Controls.ts +254 -0
  134. package/src/directives/ControlsBase.ts +267 -0
  135. package/src/directives/Drag.ts +357 -52
  136. package/src/directives/Flash.ts +419 -0
  137. package/src/directives/FocusNavigation.ts +113 -0
  138. package/src/directives/FogVisibility.ts +273 -0
  139. package/src/directives/GamepadControls.ts +537 -0
  140. package/src/directives/JoystickControls.ts +396 -0
  141. package/src/directives/KeyboardControls.ts +85 -430
  142. package/src/directives/Scheduler.ts +21 -5
  143. package/src/directives/Shake.ts +298 -0
  144. package/src/directives/Sound.ts +94 -31
  145. package/src/directives/ViewportFollow.ts +40 -9
  146. package/src/directives/index.ts +13 -6
  147. package/src/engine/FocusManager.ts +510 -0
  148. package/src/engine/animation.ts +175 -21
  149. package/src/engine/bootstrap.ts +140 -6
  150. package/src/engine/directive.ts +4 -4
  151. package/src/engine/reactive.ts +980 -177
  152. package/src/engine/signal.ts +241 -47
  153. package/src/engine/trigger.ts +34 -7
  154. package/src/engine/utils.ts +19 -3
  155. package/src/hooks/useFocus.ts +91 -0
  156. package/src/hooks/useProps.ts +1 -1
  157. package/src/index.ts +8 -2
  158. package/src/types/pixi-cull.d.ts +7 -0
  159. package/src/utils/GlobalAssetLoader.ts +257 -0
  160. package/src/utils/functions.ts +7 -0
  161. package/src/utils/tabindex.ts +70 -0
  162. package/testing/index.ts +35 -4
  163. package/tsconfig.json +18 -0
  164. package/vite.config.ts +39 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NineSliceSprite.d.ts","sourceRoot":"","sources":["../../src/components/NineSliceSprite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkD,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAG3D,UAAU,oBAAqB,SAAQ,kBAAkB;IACrD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AA8BD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,qEAE1D"}
@@ -0,0 +1,4 @@
1
+ import { Element } from '../engine/reactive';
2
+ import { ComponentInstance } from './DisplayObject';
3
+ export declare function ParticlesEmitter(props: any): Element<ComponentInstance>;
4
+ //# sourceMappingURL=ParticleEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParticleEmitter.d.ts","sourceRoot":"","sources":["../../src/components/ParticleEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AAGjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAoCpD,wBAAgB,gBAAgB,CAAC,KAAK,KAAA,8BAErC"}
@@ -0,0 +1,2 @@
1
+ export declare function Scene(props: any): import('..').Element<import('./DisplayObject').ComponentInstance> | Promise<import('..').Element<import('./DisplayObject').ComponentInstance>>;
2
+ //# sourceMappingURL=Scene.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../src/components/Scene.ts"],"names":[],"mappings":"AAGA,wBAAgB,KAAK,CAAC,KAAK,KAAA,kJAE1B"}
@@ -0,0 +1,24 @@
1
+ import { TextStyle } from 'pixi.js';
2
+ import { Element } from '../engine/reactive';
3
+ import { DisplayObjectProps } from './types/DisplayObject';
4
+ export interface TextProps extends DisplayObjectProps {
5
+ text?: string;
6
+ style?: Partial<TextStyle>;
7
+ color?: string;
8
+ size?: string | number;
9
+ fontFamily?: string;
10
+ typewriter?: {
11
+ speed?: number;
12
+ start?: () => void;
13
+ onComplete?: () => void;
14
+ skip?: () => void;
15
+ sound?: {
16
+ src: string;
17
+ volume?: number;
18
+ rate?: number;
19
+ };
20
+ };
21
+ context?: any;
22
+ }
23
+ export declare function Text(props: TextProps): Element<import('./DisplayObject').ComponentInstance>;
24
+ //# sourceMappingURL=Text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/components/Text.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAsC,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAS3D,MAAM,WAAW,SAAU,SAAQ,kBAAkB;IACnD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;QACxB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;QAClB,KAAK,CAAC,EAAE;YACN,GAAG,EAAE,MAAM,CAAC;YACZ,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,IAAI,CAAC,EAAE,MAAM,CAAC;SACf,CAAC;KACH,CAAC;IACF,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAmWD,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,wDAEpC"}
@@ -0,0 +1,17 @@
1
+ import { DisplayObjectProps } from './types/DisplayObject';
2
+ interface TilingSpriteProps extends DisplayObjectProps {
3
+ image?: string;
4
+ tileScale?: {
5
+ x: number;
6
+ y: number;
7
+ };
8
+ tilePosition?: {
9
+ x: number;
10
+ y: number;
11
+ };
12
+ width?: number;
13
+ height?: number;
14
+ }
15
+ export declare function TilingSprite(props: TilingSpriteProps): import('..').Element<import('./DisplayObject').ComponentInstance>;
16
+ export {};
17
+ //# sourceMappingURL=TilingSprite.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TilingSprite.d.ts","sourceRoot":"","sources":["../../src/components/TilingSprite.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,UAAU,iBAAkB,SAAQ,kBAAkB;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACrC,YAAY,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAyBD,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,qEAEpD"}
@@ -0,0 +1,14 @@
1
+ import { Texture } from 'pixi.js';
2
+ interface VideoProps {
3
+ src: string;
4
+ paused?: boolean;
5
+ loop?: boolean;
6
+ muted?: boolean;
7
+ loader?: {
8
+ onComplete?: (texture: Texture) => void;
9
+ onProgress?: (progress: number) => void;
10
+ };
11
+ }
12
+ export declare function Video(props: VideoProps): import('..').Element<import('./DisplayObject').ComponentInstance> | Promise<import('..').Element<import('./DisplayObject').ComponentInstance>>;
13
+ export {};
14
+ //# sourceMappingURL=Video.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../src/components/Video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAMlC,UAAU,UAAU;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE;QACL,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;QACxC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;KAC3C,CAAC;CACL;AAED,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,kJA4FtC"}
@@ -0,0 +1,20 @@
1
+ export { Canvas } from './Canvas';
2
+ export { Container } from './Container';
3
+ export { Graphics, Rect, Circle, Ellipse, Triangle, Svg } from './Graphic';
4
+ export { Mesh } from './Mesh';
5
+ export { Scene } from './Scene';
6
+ export { ParticlesEmitter } from './ParticleEmitter';
7
+ export { Sprite } from './Sprite';
8
+ export { Video } from './Video';
9
+ export { Text } from './Text';
10
+ export { TilingSprite } from './TilingSprite';
11
+ export { Viewport } from './Viewport';
12
+ export { NineSliceSprite } from './NineSliceSprite';
13
+ export { type ComponentInstance } from './DisplayObject';
14
+ export { DOMContainer } from './DOMContainer';
15
+ export { DOMElement } from './DOMElement';
16
+ export { DOMSprite } from './DOMSprite';
17
+ export { Button, ButtonState, type ButtonProps, type ButtonStyle } from './Button';
18
+ export { Joystick, type JoystickSettings } from './Joystick';
19
+ export { FocusContainer, Navigation, type FocusContainerProps } from './FocusContainer';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC1E,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAClF,OAAO,EAAE,QAAQ,EAAE,KAAK,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,118 @@
1
+ import { SignalOrPrimitive } from '.';
2
+ import { DragProps } from '../../directives/Drag';
3
+ import { ViewportFollowProps } from '../../directives/ViewportFollow';
4
+ import { ShakeProps } from '../../directives/Shake';
5
+ import { FlashProps } from '../../directives/Flash';
6
+ import { FogVisibilityProps } from '../../directives/FogVisibility';
7
+ import * as PIXI from "pixi.js";
8
+ export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
9
+ export type JustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
10
+ export type AlignContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
11
+ export type Size = number | `${number}%`;
12
+ export type EdgeSize = SignalOrPrimitive<Size | [Size, Size] | [Size, Size, Size, Size]>;
13
+ export type ObjectFit = 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
14
+ export type ObjectPosition = string;
15
+ export type TransformOrigin = string;
16
+ export type PositionType = 'relative' | 'absolute' | 'static';
17
+ export type ObservablePointSignal = [number, number] | SignalOrPrimitive<[number, number]> | {
18
+ x: number;
19
+ y: number;
20
+ } | SignalOrPrimitive<{
21
+ x: number;
22
+ y: number;
23
+ }>;
24
+ export interface DisplayObjectProps {
25
+ attach?: any;
26
+ ref?: string;
27
+ x?: SignalOrPrimitive<number>;
28
+ y?: SignalOrPrimitive<number>;
29
+ width?: SignalOrPrimitive<Size>;
30
+ height?: SignalOrPrimitive<Size>;
31
+ minWidth?: SignalOrPrimitive<Size>;
32
+ minHeight?: SignalOrPrimitive<Size>;
33
+ maxWidth?: SignalOrPrimitive<Size>;
34
+ maxHeight?: SignalOrPrimitive<Size>;
35
+ aspectRatio?: SignalOrPrimitive<number>;
36
+ flexGrow?: SignalOrPrimitive<number>;
37
+ flexShrink?: SignalOrPrimitive<number>;
38
+ flexBasis?: SignalOrPrimitive<Size>;
39
+ rowGap?: SignalOrPrimitive<number>;
40
+ columnGap?: SignalOrPrimitive<number>;
41
+ positionType?: PositionType;
42
+ top?: SignalOrPrimitive<Size>;
43
+ right?: SignalOrPrimitive<Size>;
44
+ bottom?: SignalOrPrimitive<Size>;
45
+ left?: SignalOrPrimitive<Size>;
46
+ objectFit?: ObjectFit;
47
+ objectPosition?: ObjectPosition;
48
+ transformOrigin?: TransformOrigin;
49
+ children?: any[];
50
+ flexDirection?: FlexDirection;
51
+ justifyContent?: JustifyContent;
52
+ alpha?: SignalOrPrimitive<number>;
53
+ margin?: EdgeSize;
54
+ padding?: EdgeSize;
55
+ border?: EdgeSize;
56
+ absolute?: SignalOrPrimitive<boolean>;
57
+ scale?: ObservablePointSignal | number;
58
+ anchor?: ObservablePointSignal;
59
+ skew?: ObservablePointSignal;
60
+ tint?: SignalOrPrimitive<number>;
61
+ rotation?: SignalOrPrimitive<number>;
62
+ angle?: SignalOrPrimitive<number>;
63
+ zIndex?: SignalOrPrimitive<number>;
64
+ roundPixels?: SignalOrPrimitive<boolean>;
65
+ cursor?: SignalOrPrimitive<string>;
66
+ visible?: SignalOrPrimitive<boolean>;
67
+ pivot?: ObservablePointSignal;
68
+ filters?: any[];
69
+ blendMode?: SignalOrPrimitive<PIXI.BLEND_MODES>;
70
+ blur?: SignalOrPrimitive<number>;
71
+ /**
72
+ * Optional metadata used by presets (for example `SpriteShadows`)
73
+ * to mark this display object as a shadow caster.
74
+ */
75
+ shadowCaster?: any;
76
+ /**
77
+ * Optional metadata used by presets (for example `Footprints`)
78
+ * to mark this display object as a footprint caster.
79
+ */
80
+ footprintCaster?: any;
81
+ drag?: DragProps;
82
+ viewportFollow?: ViewportFollowProps;
83
+ shake?: ShakeProps;
84
+ flash?: FlashProps;
85
+ fogVisibility?: FogVisibilityProps;
86
+ click?: PIXI.FederatedEventHandler;
87
+ mousedown?: PIXI.FederatedEventHandler;
88
+ mouseenter?: PIXI.FederatedEventHandler;
89
+ mouseleave?: PIXI.FederatedEventHandler;
90
+ mousemove?: PIXI.FederatedEventHandler;
91
+ mouseout?: PIXI.FederatedEventHandler;
92
+ mouseover?: PIXI.FederatedEventHandler;
93
+ mouseup?: PIXI.FederatedEventHandler;
94
+ mouseupoutside?: PIXI.FederatedEventHandler;
95
+ pointercancel?: PIXI.FederatedEventHandler;
96
+ pointerdown?: PIXI.FederatedEventHandler;
97
+ pointerenter?: PIXI.FederatedEventHandler;
98
+ pointerleave?: PIXI.FederatedEventHandler;
99
+ pointermove?: PIXI.FederatedEventHandler;
100
+ pointerout?: PIXI.FederatedEventHandler;
101
+ pointerover?: PIXI.FederatedEventHandler;
102
+ pointertap?: PIXI.FederatedEventHandler;
103
+ pointerup?: PIXI.FederatedEventHandler;
104
+ pointerupoutside?: PIXI.FederatedEventHandler;
105
+ rightclick?: PIXI.FederatedEventHandler;
106
+ rightdown?: PIXI.FederatedEventHandler;
107
+ rightup?: PIXI.FederatedEventHandler;
108
+ rightupoutside?: PIXI.FederatedEventHandler;
109
+ tap?: PIXI.FederatedEventHandler;
110
+ touchcancel?: PIXI.FederatedEventHandler;
111
+ touchend?: PIXI.FederatedEventHandler;
112
+ touchendoutside?: PIXI.FederatedEventHandler;
113
+ touchmove?: PIXI.FederatedEventHandler;
114
+ touchstart?: PIXI.FederatedEventHandler;
115
+ wheel?: PIXI.FederatedEventHandler<PIXI.FederatedWheelEvent>;
116
+ tabindex?: SignalOrPrimitive<number>;
117
+ }
118
+ //# sourceMappingURL=DisplayObject.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayObject.d.ts","sourceRoot":"","sources":["../../../src/components/types/DisplayObject.ts"],"names":[],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AAC;IACvC,gBAAgB,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC9C,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACxC,SAAS,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACvC,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACrC,cAAc,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC5C,GAAG,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACjC,WAAW,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACzC,QAAQ,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACtC,eAAe,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAC7C,SAAS,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACvC,UAAU,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IACxC,KAAK,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC7D,QAAQ,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;CACxC"}
@@ -0,0 +1,4 @@
1
+ export interface MouseEvent {
2
+ click?: (e: any) => void;
3
+ }
4
+ //# sourceMappingURL=MouseEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MouseEvent.d.ts","sourceRoot":"","sources":["../../../src/components/types/MouseEvent.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACvB,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAA;CAC3B"}
@@ -0,0 +1,248 @@
1
+ export interface TransformOptions {
2
+ /**
3
+ * The global value of opacity (between 0 and 1)
4
+ *
5
+ * @prop {number} [opacity]
6
+ * @memberof Spritesheet
7
+ * */
8
+ opacity?: number;
9
+ /**
10
+ * The global value of pivot.
11
+ *
12
+ * Invariant under rotation, scaling, and skewing. The projection of into the parent's space of the pivot is equal to position, regardless of the other three transformations. In other words, It is the center of rotation, scaling, and skewing.
13
+ *
14
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
15
+ *
16
+ * ```ts
17
+ * pivot: [0.5, 0.8]
18
+ * ```
19
+ *
20
+ * @prop {Array<number>} [pivot]
21
+ * @memberof Spritesheet
22
+ * */
23
+ pivot?: number[];
24
+ /**
25
+ * The global value of anchor.
26
+ *
27
+ * Position of the origin point
28
+ *
29
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
30
+ *
31
+ * ```ts
32
+ * anchor: [0.5, 0.8]
33
+ * ```
34
+ *
35
+ * @prop {Array<number>} [anchor]
36
+ * @memberof Spritesheet
37
+ * */
38
+ anchor?: number[];
39
+ /**
40
+ * Defines the actual size of the sprite that is inside a larger rectangle.
41
+ * For example, if the texture rectangle is 192x192 while the character, which is in the center, is only 64x64 then set `spriteRealSize: 64`. This way the character will be well positioned in relation to the animations that have a different rectangle
42
+ *
43
+ * > You can also put `spriteRealSize: { width: 64, height: 64 }` but be aware that the width is not concerned because it will always be centered while the height depends on the hitbox
44
+ *
45
+ * @prop {{ width: number, height: number } | number} [spriteRealSize]
46
+ * @since 3.2.0
47
+ * @memberof Spritesheet
48
+ * */
49
+ spriteRealSize?: {
50
+ width: number;
51
+ height: number;
52
+ } | number;
53
+ /**
54
+ * The global value of rotation
55
+ *
56
+ * Rotation. This will rotate the display object's projection by this angle (in radians).
57
+ *
58
+ * @prop {number} [angle]
59
+ * @memberof Spritesheet
60
+ * */
61
+ angle?: number;
62
+ /**
63
+ * The global value of rotation
64
+ *
65
+ * Rotation. This is an alias for rotation, but in degrees.
66
+ *
67
+ * @prop {number} [rotation]
68
+ * @memberof Spritesheet
69
+ * */
70
+ rotation?: number;
71
+ /**
72
+ * The global value of scale.
73
+ *
74
+ * Scaling. This will stretch (or compress) the display object's projection. The scale factors are along the local coordinate axes. In other words, the display object is scaled before rotated or skewed. The center of scaling is the pivot.
75
+ *
76
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
77
+ *
78
+ * ```ts
79
+ * scale: [0.5, 0.8]
80
+ * ```
81
+ *
82
+ * @prop {Array<number>} [scale]
83
+ * @memberof Spritesheet
84
+ * */
85
+ scale?: number[];
86
+ /**
87
+ * The global value of skew.
88
+ *
89
+ * Skewing. This can be used to deform a rectangular display object into a parallelogram.
90
+ *
91
+ * In PixiJS, skew has a slightly different behaviour than the conventional meaning. It can be thought of the net rotation applied to the coordinate axes (separately). For example, if "skew.x" is ⍺ and "skew.y" is β, then the line x = 0 will be rotated by ⍺ (y = -x*cot⍺) and the line y = 0 will be rotated by β (y = x*tanβ). A line y = x*tanϴ (i.e. a line at angle ϴ to the x-axis in local-space) will be rotated by an angle between ⍺ and β.
92
+ *
93
+ * It can be observed that if skew is applied equally to both axes, then it will be equivalent to applying a rotation. Indeed, if "skew.x" = -ϴ and "skew.y" = ϴ, it will produce an equivalent of "rotation" = ϴ.
94
+ *
95
+ * Another quite interesting observation is that "skew.x", "skew.y", rotation are communtative operations. Indeed, because rotation is essentially a careful combination of the two.
96
+ *
97
+ * The array has two elements: [x, y]. If y is omitted, both x and y will be set to x.
98
+ *
99
+ * @prop {Array<number>} [skew]
100
+ * @memberof Spritesheet
101
+ * */
102
+ skew?: number[];
103
+ /**
104
+ * The global value of X translation
105
+ *
106
+ * @prop {number} [x]
107
+ * @memberof Spritesheet
108
+ * */
109
+ x?: number;
110
+ /**
111
+ * The global value of Y translation
112
+ *
113
+ * @prop {number} [y]
114
+ * @memberof Spritesheet
115
+ * */
116
+ y?: number;
117
+ /**
118
+ * The global value of visible
119
+ *
120
+ * @prop {boolean} [visible]
121
+ * @memberof Spritesheet
122
+ * */
123
+ visible?: boolean;
124
+ /**
125
+ * Define the sound that will be played for all animations in the spritesheet. Remember to create the sound before with the @Sound decorator
126
+ *
127
+ * @prop {string} [sound]
128
+ * @memberof Spritesheet
129
+ * */
130
+ sound?: string;
131
+ }
132
+ export interface FrameOptions extends TransformOptions {
133
+ time: number;
134
+ frameX?: number;
135
+ frameY?: number;
136
+ }
137
+ export interface TextureOptions {
138
+ /**
139
+ * The number of frames on the width
140
+ *
141
+ * @prop {number} framesWidth
142
+ * @memberof Spritesheet
143
+ * */
144
+ framesWidth?: number;
145
+ /**
146
+ * The number of frames on the height
147
+ *
148
+ * @prop {number} framesHeight
149
+ * @memberof Spritesheet
150
+ * */
151
+ framesHeight?: number;
152
+ /**
153
+ * The width of the image (in pixels)
154
+ *
155
+ * @prop {number} width
156
+ * @memberof Spritesheet
157
+ * */
158
+ width?: number;
159
+ /**
160
+ * The height of the image (in pixels)
161
+ *
162
+ * @prop {number} height
163
+ * @memberof Spritesheet
164
+ * */
165
+ height?: number;
166
+ /**
167
+ * Takes a width of a rectangle in the image. Equivalent to `width / framesWidth`
168
+ *
169
+ * @prop {number} [rectWidth]
170
+ * @memberof Spritesheet
171
+ * */
172
+ rectWidth?: number;
173
+ /**
174
+ * Takes a height of a rectangle in the image. Equivalent to `height / framesHeight`
175
+ *
176
+ * @prop {number} [rectHeight]
177
+ * @memberof Spritesheet
178
+ * */
179
+ rectHeight?: number;
180
+ /**
181
+ * To take the texture, start at a well defined X and Y position. Otherwise, it starts at 0,0
182
+ *
183
+ * @prop {number} [offset]
184
+ * @memberof Spritesheet
185
+ * */
186
+ offset?: {
187
+ x: number;
188
+ y: number;
189
+ };
190
+ }
191
+ export type AnimationFrames = FrameOptions[][] | ((...args: any) => FrameOptions[][]);
192
+ export interface TexturesOptions extends TextureOptions, TransformOptions {
193
+ animations: AnimationFrames;
194
+ }
195
+ export interface SpritesheetOptions extends TransformOptions, TextureOptions {
196
+ textures?: {
197
+ [animationName: string]: Partial<TexturesOptions> & Pick<TexturesOptions, 'animations'>;
198
+ };
199
+ }
200
+ type SpritesheetImageOptions = SpritesheetOptions & {
201
+ /**
202
+ * The link to the image
203
+ *
204
+ * > Do not use the `images` property
205
+ * > Remember to wrap the link to the image with the `require` function.
206
+ *
207
+ * ```ts
208
+ * image: require('./assets/hero.png')
209
+ * ```
210
+ *
211
+ * @prop {string} [image]
212
+ * @memberof Spritesheet
213
+ * */
214
+ image?: string;
215
+ /**
216
+ * Spritesheet identifier.
217
+ *
218
+ * > Do not use the `images` property
219
+ *
220
+ * @prop {string} [id]
221
+ * @memberof Spritesheet
222
+ * */
223
+ id: string;
224
+ };
225
+ type SpritesheetImagesOptions = SpritesheetOptions & {
226
+ /**
227
+ * Put the different images that are concerned by the properties below.
228
+ * The key of the object is the identifier of the spritesheet and the value and the link to the image.
229
+ *
230
+ * > Remember to wrap the link to the image with the `require` function.
231
+ *
232
+ * ```ts
233
+ * images: {
234
+ * hero: require('./assets/hero.png')
235
+ * }
236
+ * ```
237
+ *
238
+ * @prop { { [id: string]: string } } [images]
239
+ * @memberof Spritesheet
240
+ * */
241
+ images?: {
242
+ [id: string]: string;
243
+ };
244
+ };
245
+ export declare function Spritesheet(options: SpritesheetImageOptions): any;
246
+ export declare function Spritesheet(options: SpritesheetImagesOptions): any;
247
+ export {};
248
+ //# sourceMappingURL=Spritesheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Spritesheet.d.ts","sourceRoot":"","sources":["../../../src/components/types/Spritesheet.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B;;;;;SAKK;IACL,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;;;;;;;;SAaK;IACL,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAEhB;;;;;;;;;;;;;QAaI;IACJ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB;;;;;;;;;SASK;IACL,cAAc,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAA;IAE3D;;;;;;;SAOK;IACL,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;;;;SAOK;IACL,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;;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AAQ,CAAC,EAAE;QACP,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA;KAC1F,CAAA;CACJ;AAED,KAAK,uBAAuB,GAAG,kBAAkB,GAAG;IAChD;;;;;;;;;;;;SAYK;IACL,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;QAOI;IACJ,EAAE,EAAE,MAAM,CAAA;CACb,CAAA;AACD,KAAK,wBAAwB,GAAG,kBAAkB,GAAG;IACjD;;;;;;;;;;;;;;SAcK;IACL,MAAM,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CACpC,CAAA;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,uBAAuB,OAAC;AAC7D,wBAAgB,WAAW,CAAC,OAAO,EAAE,wBAAwB,OAAC"}
@@ -0,0 +1,4 @@
1
+ import { Signal } from '@signe/reactive';
2
+ import { AnimatedSignal } from '../../engine/animation';
3
+ export type SignalOrPrimitive<T> = T | Signal<T> | AnimatedSignal<T>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,112 @@
1
+ import { Directive } from '../engine/directive';
2
+ import { Element } from '../engine/reactive';
3
+ import { Controls } from './ControlsBase';
4
+ import { KeyboardControls } from './KeyboardControls';
5
+ import { GamepadControls } from './GamepadControls';
6
+ import { JoystickControls } from './JoystickControls';
7
+ /**
8
+ * Controls directive that coordinates keyboard, gamepad, and joystick input systems
9
+ *
10
+ * This directive automatically activates keyboard, gamepad, and joystick controls when available.
11
+ * The gamepad is automatically enabled if joypad.js is detected in the environment.
12
+ *
13
+ * All systems share the same control configuration and can work simultaneously.
14
+ *
15
+ * @example
16
+ * ```html
17
+ * <Sprite
18
+ * image="path/to/image.png"
19
+ * controls={controlsConfig}
20
+ * x={x}
21
+ * y={y}
22
+ * />
23
+ * ```
24
+ */
25
+ export declare class ControlsDirective extends Directive {
26
+ private keyboardControls;
27
+ private gamepadControls;
28
+ private joystickControls;
29
+ private freezeSubscription;
30
+ private element;
31
+ /**
32
+ * Initialize the controls directive
33
+ * Sets up keyboard, gamepad, and joystick controls if available
34
+ */
35
+ onInit(element: Element<any>): void;
36
+ /**
37
+ * Mount hook (no specific action needed)
38
+ */
39
+ onMount(element: Element<any>): void;
40
+ /**
41
+ * Update controls configuration
42
+ * Updates both keyboard and gamepad controls
43
+ */
44
+ onUpdate(props: any, element: Element<any>): void;
45
+ /**
46
+ * Cleanup and destroy all control systems
47
+ */
48
+ onDestroy(element: Element<any>): void;
49
+ /**
50
+ * Get a control by input name
51
+ * Delegates to keyboard controls (primary system)
52
+ *
53
+ * @param inputName - Name of the input/key
54
+ * @returns BoundKey if found, undefined otherwise
55
+ */
56
+ getControl(inputName: string): import('./ControlsBase').BoundKey | undefined;
57
+ /**
58
+ * Get all bound controls
59
+ * Delegates to keyboard controls (primary system)
60
+ *
61
+ * @returns Object mapping input names to BoundKey objects
62
+ */
63
+ getControls(): {
64
+ [key: string]: import('./ControlsBase').BoundKey;
65
+ };
66
+ /**
67
+ * Apply a control action programmatically
68
+ * Applies to both keyboard and gamepad if available
69
+ *
70
+ * @param controlName - Name of the control
71
+ * @param isDown - Whether the control is pressed (true) or released (false)
72
+ * @param payload - Optional payload to pass to keyDown/keyUp callbacks (e.g., { power: 0.8 })
73
+ * @returns Promise that resolves when the action is complete
74
+ */
75
+ applyControl(controlName: string | number, isDown?: boolean, payload?: any): Promise<void>;
76
+ /**
77
+ * Stop listening to inputs
78
+ * Stops keyboard, gamepad, and joystick input processing
79
+ */
80
+ stopInputs(): void;
81
+ /**
82
+ * Resume listening to inputs
83
+ * Resumes keyboard, gamepad, and joystick input processing
84
+ */
85
+ listenInputs(): void;
86
+ /**
87
+ * Get the current controls configuration
88
+ * Returns keyboard controls options (both systems share the same config)
89
+ *
90
+ * @returns The controls options object
91
+ */
92
+ get options(): Controls;
93
+ /**
94
+ * Get the keyboard controls instance
95
+ *
96
+ * @returns KeyboardControls instance or null
97
+ */
98
+ get keyboard(): KeyboardControls | null;
99
+ /**
100
+ * Get the gamepad controls instance
101
+ *
102
+ * @returns GamepadControls instance or null
103
+ */
104
+ get gamepad(): GamepadControls | null;
105
+ /**
106
+ * Get the joystick controls instance
107
+ *
108
+ * @returns JoystickControls instance or null
109
+ */
110
+ get joystick(): JoystickControls | null;
111
+ }
112
+ //# sourceMappingURL=Controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Controls.d.ts","sourceRoot":"","sources":["../../src/directives/Controls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAmB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAgB,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAiB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAkB,MAAM,oBAAoB,CAAC;AAItE;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;IAC5C,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,eAAe,CAAgC;IACvD,OAAO,CAAC,gBAAgB,CAAiC;IACzD,OAAO,CAAC,kBAAkB,CAA6B;IACvD,OAAO,CAAC,OAAO,CAAwB;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