reacthub-pixitweenjs 0.2.109-alpha.7 → 0.3.0-alpha.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.
Files changed (215) hide show
  1. package/LICENSE +8 -16
  2. package/LICENSE.md +79 -239
  3. package/README.md +241 -103
  4. package/dist/components/AepComposition/Aep3DPostFx.d.ts +7 -0
  5. package/dist/components/AepComposition/Aep3DPrecompPlane.d.ts +9 -0
  6. package/dist/components/AepComposition/Aep3DScene.d.ts +14 -0
  7. package/dist/components/AepComposition/Aep3DShapeMesh.d.ts +13 -0
  8. package/dist/components/AepComposition/Aep3DTextMesh.d.ts +17 -0
  9. package/dist/components/AepComposition/AepAssetResolver.d.ts +13 -0
  10. package/dist/components/AepComposition/AepAudioLayer.d.ts +28 -0
  11. package/dist/components/AepComposition/AepComposition.d.ts +16 -0
  12. package/dist/components/AepComposition/AepLayerProvider.d.ts +30 -0
  13. package/dist/components/AepComposition/AepLayerRouter.d.ts +5 -0
  14. package/dist/components/AepComposition/AepMsdfTextMesh.d.ts +17 -0
  15. package/dist/components/AepComposition/AepPrecompRenderContext.d.ts +23 -0
  16. package/dist/components/AepComposition/AepPrecompRenderer.d.ts +8 -0
  17. package/dist/components/AepComposition/AepTextOverrideContext.d.ts +8 -0
  18. package/dist/components/AepComposition/AepThemeContext.d.ts +8 -0
  19. package/dist/components/AepComposition/composeTransform3D.d.ts +27 -0
  20. package/dist/components/AepComposition/index.d.ts +39 -0
  21. package/dist/components/AepComposition/matteSourceIds.d.ts +2 -0
  22. package/dist/components/AepComposition/msdfAtlasRegistry.d.ts +16 -0
  23. package/dist/components/AepComposition/pathToThreeShape.d.ts +4 -0
  24. package/dist/components/AepComposition/resolveParentChain.d.ts +3 -0
  25. package/dist/components/AepComposition/resolvePostFxList.d.ts +2 -0
  26. package/dist/components/AepComposition/shouldSplitText.d.ts +26 -0
  27. package/dist/components/AepComposition/threeTextureFromPixi.d.ts +8 -0
  28. package/dist/components/AepComposition/useAepLayerTransform.d.ts +18 -0
  29. package/dist/components/AepComposition/useAepLayerTransform3D.d.ts +8 -0
  30. package/dist/components/AepComposition/useMsdfAtlasRegistry.d.ts +6 -0
  31. package/dist/components/AepComposition/usePixiRenderTexture.d.ts +14 -0
  32. package/dist/components/AepComposition/useResolveAsset.d.ts +8 -0
  33. package/dist/components/AepMask/AepMaskContainer.d.ts +9 -0
  34. package/dist/components/AepMask/PixiTrackMatte.d.ts +10 -0
  35. package/dist/components/AepMask/drawAepMask.d.ts +3 -0
  36. package/dist/components/AepMask/index.d.ts +5 -0
  37. package/dist/components/PixiAudioSprite/HowlerAudioSprite.d.ts +5 -7
  38. package/dist/components/PixiAudioSprite/PixiAudioSprite.d.ts +6 -2
  39. package/dist/components/PixiAudioSprite/useAudioVisualizer.d.ts +2 -2
  40. package/dist/components/PixiAudioSprite/wave-config.d.ts +0 -1
  41. package/dist/components/PixiGifSprite/PixiGifGsapSync.d.ts +11 -10
  42. package/dist/components/PixiImageSprite/PixiImageSprite.d.ts +11 -2
  43. package/dist/components/PixiLottieSprite/PixiLottieSprite.d.ts +5 -2
  44. package/dist/components/PixiNullObject/PixiNullObject.d.ts +25 -0
  45. package/dist/components/PixiNullObject/index.d.ts +2 -0
  46. package/dist/components/PixiPreComp/PixiPreComp.d.ts +29 -0
  47. package/dist/components/PixiPreComp/index.d.ts +3 -0
  48. package/dist/components/PixiPreComp/validatePrecompDepth.d.ts +2 -0
  49. package/dist/components/PixiRemotionSprite/PixiRemotionGifSprite.d.ts +24 -0
  50. package/dist/components/PixiRemotionSprite/PixiRemotionImageSprite.d.ts +18 -0
  51. package/dist/components/PixiRemotionSprite/PixiRemotionSprite.d.ts +5 -2
  52. package/dist/components/PixiRemotionSprite/PixiRemotionVideoCanvaSprite.d.ts +20 -0
  53. package/dist/components/PixiRemotionSprite/index.d.ts +4 -0
  54. package/dist/components/PixiSVGSprite/PixiMorphSvgSprite.d.ts +35 -0
  55. package/dist/components/PixiSVGSprite/PixiSvgPathSprite.d.ts +11 -4
  56. package/dist/components/PixiSVGSprite/index.d.ts +1 -0
  57. package/dist/components/PixiShapeLayer/PixiShapeLayer.d.ts +43 -0
  58. package/dist/components/PixiShapeLayer/drawShape.d.ts +20 -0
  59. package/dist/components/PixiShapeLayer/index.d.ts +4 -0
  60. package/dist/components/PixiShapeLayer/samplePath.d.ts +5 -0
  61. package/dist/components/PixiTextSprite/PixiTextSplit.d.ts +26 -0
  62. package/dist/components/PixiTextSprite/PixiTextSprite.d.ts +17 -5
  63. package/dist/components/PixiTextSprite/index.d.ts +3 -0
  64. package/dist/components/PixiTextSprite/resolveTextSplitFills.d.ts +27 -0
  65. package/dist/components/PixiTextSprite/textAnimator.d.ts +22 -0
  66. package/dist/components/PixiThreeSprite/PixiThreeSprite.d.ts +14 -0
  67. package/dist/components/PixiThreeSprite/index.d.ts +2 -0
  68. package/dist/components/PixiUnifiedTransformer/PixiUnifiedTransformer.d.ts +20 -8
  69. package/dist/components/PixiVideoSprite/PixiVideoCanvasSync.d.ts +3 -1
  70. package/dist/components/PixiVideoSprite/PixiVideoSprite.d.ts +5 -2
  71. package/dist/components/index.d.ts +5 -0
  72. package/dist/events/Events.d.ts +0 -1
  73. package/dist/hocs/AbstractContainer.d.ts +3 -1
  74. package/dist/hocs/BorderMaskContainer.d.ts +28 -0
  75. package/dist/hocs/OverlayTilingSprite.d.ts +3 -3
  76. package/dist/hocs/drawMaskShape.d.ts +3 -0
  77. package/dist/hocs/index.d.ts +5 -0
  78. package/dist/hooks/aep/buildAudioLevelTimeline.d.ts +7 -0
  79. package/dist/hooks/aep/buildBezierPathTimeline.d.ts +13 -0
  80. package/dist/hooks/aep/buildColorValueTimeline.d.ts +24 -0
  81. package/dist/hooks/aep/buildLayerTimeline.d.ts +20 -0
  82. package/dist/hooks/aep/buildScalarValueTimeline.d.ts +6 -0
  83. package/dist/hooks/aep/buildVec2ValueTimeline.d.ts +17 -0
  84. package/dist/hooks/aep/easeCache.d.ts +3 -0
  85. package/dist/hooks/aep/effectRegistry.d.ts +5 -0
  86. package/dist/hooks/aep/effects/brightnessContrast.d.ts +2 -0
  87. package/dist/hooks/aep/effects/dropShadow.d.ts +2 -0
  88. package/dist/hooks/aep/effects/fastBoxBlur.d.ts +2 -0
  89. package/dist/hooks/aep/effects/gaussianBlur.d.ts +2 -0
  90. package/dist/hooks/aep/effects/glow.d.ts +2 -0
  91. package/dist/hooks/aep/effects/hueSaturation.d.ts +2 -0
  92. package/dist/hooks/aep/effects/index.d.ts +9 -0
  93. package/dist/hooks/aep/effects/levels.d.ts +2 -0
  94. package/dist/hooks/aep/effects/tint.d.ts +2 -0
  95. package/dist/hooks/aep/effects/types.d.ts +8 -0
  96. package/dist/hooks/aep/index.d.ts +22 -0
  97. package/dist/hooks/aep/interpolateBezierPath.d.ts +3 -0
  98. package/dist/hooks/aep/sampleAnimatable.d.ts +13 -0
  99. package/dist/hooks/aep/useAepBezierPathAnimator.d.ts +12 -0
  100. package/dist/hooks/aep/useAepColorAnimator.d.ts +11 -0
  101. package/dist/hooks/aep/useAepCurrentFrame.d.ts +1 -0
  102. package/dist/hooks/aep/useAepEffectKeyframes.d.ts +4 -0
  103. package/dist/hooks/aep/useAepEffects.d.ts +3 -0
  104. package/dist/hooks/aep/useAepKeyframes.d.ts +15 -0
  105. package/dist/hooks/aep/useAepTextLayout.d.ts +12 -0
  106. package/dist/hooks/aep/useAepValueAnimator.d.ts +2 -0
  107. package/dist/hooks/aep/useAepVec2Animator.d.ts +10 -0
  108. package/dist/hooks/aep/useTypefaceMetrics.d.ts +2 -0
  109. package/dist/hooks/index.d.ts +2 -0
  110. package/dist/hooks/useSpriteFilters.d.ts +39 -0
  111. package/dist/hooks/withFiltersHook.d.ts +1 -1
  112. package/dist/importers/aep/bodymovin-color-controls.d.ts +23 -0
  113. package/dist/importers/aep/bodymovin-color.d.ts +1 -0
  114. package/dist/importers/aep/bodymovin-keyframe.d.ts +42 -0
  115. package/dist/importers/aep/bodymovin-layer.d.ts +84 -0
  116. package/dist/importers/aep/bodymovin-transform.d.ts +12 -0
  117. package/dist/importers/aep/bodymovin.d.ts +7 -0
  118. package/dist/importers/aep/bodymovinCameras.d.ts +34 -0
  119. package/dist/importers/aep/bodymovinExtensions.d.ts +3 -0
  120. package/dist/importers/aep/bodymovinTextRuns.d.ts +13 -0
  121. package/dist/importers/aep/index.d.ts +7 -0
  122. package/dist/importers/aep/lottieLint.d.ts +23 -0
  123. package/dist/importers/aep/lottieLint.rules.d.ts +6 -0
  124. package/dist/index.d.ts +3 -0
  125. package/dist/index.es.js +60038 -29928
  126. package/dist/index.umd.js +4351 -1851
  127. package/dist/lib/pixi-essentials/bounds/AxisAlignedBounds.d.ts +121 -0
  128. package/dist/lib/pixi-essentials/bounds/OrientedBounds.d.ts +103 -0
  129. package/dist/lib/pixi-essentials/bounds/index.d.ts +2 -0
  130. package/dist/lib/pixi-essentials/index.d.ts +6 -0
  131. package/dist/lib/pixi-essentials/object-pool/AverageProvider.d.ts +28 -0
  132. package/dist/lib/pixi-essentials/object-pool/ObjectPool.d.ts +103 -0
  133. package/dist/lib/pixi-essentials/object-pool/ObjectPoolFactory.d.ts +40 -0
  134. package/dist/lib/pixi-essentials/object-pool/index.d.ts +2 -0
  135. package/dist/lib/pixi-essentials/react-bindings/Transformer.d.ts +74 -0
  136. package/dist/lib/pixi-essentials/react-bindings/index.d.ts +3 -0
  137. package/dist/lib/pixi-essentials/react-bindings/utils/applyEventProps.d.ts +13 -0
  138. package/dist/lib/pixi-essentials/transformer/Transformer.d.ts +728 -0
  139. package/dist/lib/pixi-essentials/transformer/TransformerHandle.d.ts +142 -0
  140. package/dist/lib/pixi-essentials/transformer/TransformerWireframe.d.ts +54 -0
  141. package/dist/lib/pixi-essentials/transformer/index.d.ts +5 -0
  142. package/dist/lib/pixi-essentials/transformer/utils/decomposeTransform.d.ts +11 -0
  143. package/dist/lib/pixi-essentials/transformer/utils/distanceToLine.d.ts +7 -0
  144. package/dist/lib/pixi-essentials/transformer/utils/multiplyTransform.d.ts +17 -0
  145. package/dist/lib/pixi-essentials/transformer/utils/skewTransform.d.ts +13 -0
  146. package/dist/types/BaseProps.d.ts +11 -3
  147. package/dist/types/MaskTypes.d.ts +10 -0
  148. package/dist/types/OverlayTypes.d.ts +9 -0
  149. package/dist/types/aep/asset.d.ts +43 -0
  150. package/dist/types/aep/camera.d.ts +778 -0
  151. package/dist/types/aep/composition.d.ts +82 -0
  152. package/dist/types/aep/effect.d.ts +137 -0
  153. package/dist/types/aep/index.d.ts +14 -0
  154. package/dist/types/aep/layer.d.ts +21579 -0
  155. package/dist/types/aep/light.d.ts +781 -0
  156. package/dist/types/aep/mask.d.ts +193 -0
  157. package/dist/types/aep/parse.d.ts +11 -0
  158. package/dist/types/aep/postFx.d.ts +107 -0
  159. package/dist/types/aep/text-animator.d.ts +687 -0
  160. package/dist/types/aep/text-runs.d.ts +234 -0
  161. package/dist/types/aep/theme.d.ts +72 -0
  162. package/dist/types/aep/transform.d.ts +285 -0
  163. package/dist/types/aep/transform3D.d.ts +171 -0
  164. package/dist/types/index.d.ts +3 -0
  165. package/dist/utils/AppStateProvider.d.ts +1 -0
  166. package/dist/utils/AppWrapper.d.ts +3 -0
  167. package/dist/utils/ContextBridge.d.ts +1 -1
  168. package/dist/utils/GsapAnims.d.ts +0 -1
  169. package/dist/utils/InteractionManager.d.ts +1 -10
  170. package/dist/utils/aeMath/zoomToFov.d.ts +1 -0
  171. package/dist/utils/areSpritePropsEqual.d.ts +8 -0
  172. package/dist/utils/index.d.ts +6 -0
  173. package/dist/utils/isExternalUrl.d.ts +1 -0
  174. package/dist/utils/loadSpriteTexture.d.ts +10 -0
  175. package/dist/utils/msdf/computeInstanceMatrix.d.ts +18 -0
  176. package/dist/utils/msdf/index.d.ts +4 -0
  177. package/dist/utils/msdf/loadMsdfAtlas.d.ts +9 -0
  178. package/dist/utils/msdf/msdfShader.d.ts +2 -0
  179. package/dist/utils/msdf/types.d.ts +49 -0
  180. package/dist/utils/text/resolveTextRuns.d.ts +8 -0
  181. package/dist/utils/textLayout/alignLines.d.ts +15 -0
  182. package/dist/utils/textLayout/applyVerticals.d.ts +14 -0
  183. package/dist/utils/textLayout/breakLines.d.ts +14 -0
  184. package/dist/utils/textLayout/canvasMetricsProvider.d.ts +6 -0
  185. package/dist/utils/textLayout/index.d.ts +7 -0
  186. package/dist/utils/textLayout/layoutText.d.ts +2 -0
  187. package/dist/utils/textLayout/metricsCache.d.ts +9 -0
  188. package/dist/utils/textLayout/pixiCanvasMetricsProvider.d.ts +6 -0
  189. package/dist/utils/textLayout/shapeRuns.d.ts +18 -0
  190. package/dist/utils/textLayout/typefaceMetricsProvider.d.ts +19 -0
  191. package/dist/utils/textLayout/types.d.ts +61 -0
  192. package/dist/utils/textLayout/unicode.d.ts +2 -0
  193. package/package.json +72 -47
  194. package/dist/assets/icon/transformericons/icons.d.ts +0 -8
  195. package/dist/components/PixiAudioSprite/PixiAudioSprite.stories.d.ts +0 -12
  196. package/dist/components/PixiGifSprite/PixiGifSprite.stories.d.ts +0 -163
  197. package/dist/components/PixiImageSprite/PixiImageSprite.stories.d.ts +0 -150
  198. package/dist/components/PixiLottieSprite/PixiLottieSprite.stories.d.ts +0 -159
  199. package/dist/components/PixiSVGSprite/PixiSvgPathSprite.stories.d.ts +0 -131
  200. package/dist/components/PixiSequence/PixiSequence.stories.d.ts +0 -33
  201. package/dist/components/PixiTextSprite/PixiTextSprite.stories.d.ts +0 -140
  202. package/dist/components/PixiVideoSprite/PixiVideoSprite.stories.d.ts +0 -146
  203. package/dist/favicon.svg +0 -41
  204. package/dist/hooks/withEffectsHook.d.ts +0 -5
  205. package/dist/pixitweenjs-logo-dark.svg +0 -98
  206. package/dist/pixitweenjs-logo.svg +0 -97
  207. package/dist/stories/Features/TestHowlerAudioFiles.d.ts +0 -2
  208. package/dist/stories/Features/TimelineAnimations.d.ts +0 -15
  209. package/dist/stories/Features/TimelineTest.d.ts +0 -15
  210. package/dist/stories/Features/TimelineTest.stories.d.ts +0 -23
  211. package/dist/stories/Features/TimelineTestAudios.d.ts +0 -15
  212. package/dist/stories/Features/TimelineTestWithVideos.d.ts +0 -15
  213. package/dist/stories/Features/TimelineWithGif.d.ts +0 -21
  214. package/dist/stories/Features/common.tests.d.ts +0 -411
  215. /package/dist/{.gitkeep → utils/pixiExtend.d.ts} +0 -0
@@ -0,0 +1,121 @@
1
+ import { Point } from 'pixi.js';
2
+ /**
3
+ * Rectangle object is an area defined by its position, as indicated by its top-left corner
4
+ * point (x, y) and by its width and its height.
5
+ *
6
+ * @public
7
+ */
8
+ export declare class AxisAlignedBounds {
9
+ currentID: number;
10
+ dirtyID: number;
11
+ protected _x: number;
12
+ protected _y: number;
13
+ protected _width: number;
14
+ protected _height: number;
15
+ protected _hull: [Point, Point, Point, Point];
16
+ /**
17
+ * @param [x=0] - The X coordinate of the upper-left corner of the rectangle
18
+ * @param [y=0] - The Y coordinate of the upper-left corner of the rectangle
19
+ * @param [width=0] - The overall width of this rectangle
20
+ * @param [height=0] - The overall height of this rectangle
21
+ */
22
+ constructor(x?: number, y?: number, width?: number, height?: number);
23
+ get x(): number;
24
+ set x(value: number);
25
+ get y(): number;
26
+ set y(value: number);
27
+ get width(): number;
28
+ set width(value: number);
29
+ get height(): number;
30
+ set height(value: number);
31
+ get hull(): Point[];
32
+ get topLeft(): Point;
33
+ get topRight(): Point;
34
+ get bottomRight(): Point;
35
+ get bottomLeft(): Point;
36
+ protected isDirty(): boolean;
37
+ protected update(): void;
38
+ /**
39
+ * returns the left edge of the rectangle
40
+ *
41
+ * @member {number}
42
+ */
43
+ get left(): number;
44
+ /**
45
+ * returns the right edge of the rectangle
46
+ */
47
+ get right(): number;
48
+ /**
49
+ * returns the top edge of the rectangle
50
+ */
51
+ get top(): number;
52
+ /**
53
+ * returns the bottom edge of the rectangle
54
+ */
55
+ get bottom(): number;
56
+ /**
57
+ * Creates a clone of this Rectangle
58
+ *
59
+ * @return A copy of this AxisAlignedBounds.
60
+ */
61
+ clone(): AxisAlignedBounds;
62
+ /**
63
+ * Copies another rectangle to this one.
64
+ *
65
+ * @param rectangle - The rectangle to copy from.
66
+ * @return Returns itself.
67
+ */
68
+ copyFrom(rectangle: AxisAlignedBounds): AxisAlignedBounds;
69
+ /**
70
+ * Copies this rectangle to another one.
71
+ *
72
+ * @param rectangle - The rectangle to copy to.
73
+ * @return Returns given parameter.
74
+ */
75
+ copyTo(rectangle: AxisAlignedBounds): AxisAlignedBounds;
76
+ /**
77
+ * Checks whether the x and y coordinates given are contained within this Rectangle
78
+ *
79
+ * @param x - The X coordinate of the point to test
80
+ * @param y - The Y coordinate of the point to test
81
+ * @return Whether the x/y coordinates are within this Rectangle
82
+ */
83
+ contains(x: number, y: number): boolean;
84
+ /**
85
+ * Checks whether the given {@code bounds} are equal to this.
86
+ *
87
+ * @param bounds
88
+ */
89
+ equals(bounds: AxisAlignedBounds): boolean;
90
+ /**
91
+ * Pads the rectangle making it grow in all directions.
92
+ * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.
93
+ *
94
+ * @param [paddingX=0] - The horizontal padding amount.
95
+ * @param [paddingY=0] - The vertical padding amount.
96
+ * @return Returns itself.
97
+ */
98
+ pad(paddingX?: number, paddingY?: number): this;
99
+ /**
100
+ * Fits this rectangle around the passed one.
101
+ *
102
+ * @param rectangle - The rectangle to fit.
103
+ * @return Returns itself.
104
+ */
105
+ fit(rectangle: AxisAlignedBounds): this;
106
+ /**
107
+ * Enlarges rectangle that way its corners lie on grid
108
+ *
109
+ * @param [resolution=1] - resolution
110
+ * @param [eps=0.001] - precision
111
+ * @return Returns itself.
112
+ */
113
+ ceil(resolution?: number, eps?: number): this;
114
+ /**
115
+ * Enlarges this rectangle to include the passed rectangle.
116
+ *
117
+ * @param rectangle - The rectangle to include.
118
+ * @return Returns itself.
119
+ */
120
+ enlarge(rectangle: AxisAlignedBounds): this;
121
+ }
@@ -0,0 +1,103 @@
1
+ import { AxisAlignedBounds } from './AxisAlignedBounds';
2
+ import { Matrix, Point } from 'pixi.js';
3
+ /**
4
+ * An oriented bounding box is a rotated rectangle.
5
+ *
6
+ * An oriented bounding box is modelled by rotating its (axis-aligned) {@link OrientedBounds#innerBounds}
7
+ * by an angle {@link OrientedBounds#angle} around its center. The center of an oriented bounding box and
8
+ * its axis-aligned inner-bounds coincide.
9
+ *
10
+ * @public
11
+ */
12
+ export declare class OrientedBounds {
13
+ innerBounds: AxisAlignedBounds;
14
+ currentID: number;
15
+ dirtyID: number;
16
+ protected _rotation: number;
17
+ protected _center: Point;
18
+ protected _hull: [Point, Point, Point, Point];
19
+ protected _matrix: Matrix;
20
+ /**
21
+ * @param innerBounds
22
+ * @param angle
23
+ */
24
+ constructor(innerBounds: AxisAlignedBounds, angle?: number);
25
+ /**
26
+ * @param x
27
+ * @param y
28
+ * @param width
29
+ * @param height
30
+ * @param angle
31
+ */
32
+ constructor(x?: number, y?: number, width?: number, height?: number, angle?: number);
33
+ /**
34
+ * The angle, in radians, by which this bounding box is tilted.
35
+ */
36
+ get rotation(): number;
37
+ set rotation(value: number);
38
+ /**
39
+ * The center of this bounding box.
40
+ *
41
+ * The center of this and {@code this.innerBounds} will always coincide.
42
+ */
43
+ get center(): Point;
44
+ set center(value: Point);
45
+ /**
46
+ * The four-corners of this bounding, in clockwise order starting from the top-left.
47
+ *
48
+ * @readonly
49
+ */
50
+ get hull(): [Point, Point, Point, Point];
51
+ /**
52
+ * The top-left corner of this bounding box. The returned instance should not be modified directly.
53
+ *
54
+ * @readonly
55
+ */
56
+ get topLeft(): Point;
57
+ /**
58
+ * The top-right corner of this bounding box. The returned instance should not be modified directly.
59
+ *
60
+ * @readonly
61
+ */
62
+ get topRight(): Point;
63
+ /**
64
+ * The bottom-right corner of this bounding box. The returned instance should not be modified directly.
65
+ */
66
+ get bottomRight(): Point;
67
+ /**
68
+ * The bottom-left corner of this bounding box. The returned instance should not be modified directly.
69
+ */
70
+ get bottomLeft(): Point;
71
+ /**
72
+ * Checks whether the given {@code bounds} are equal to this.
73
+ *
74
+ * @param bounds
75
+ */
76
+ equals(bounds: OrientedBounds): boolean;
77
+ /**
78
+ * Whether this bounding box contains the given point
79
+ *
80
+ * @param point
81
+ */
82
+ contains(point: Point | number, y?: number): boolean;
83
+ /**
84
+ * Copies {@code bounds} into this instance.
85
+ *
86
+ * @param bounds
87
+ */
88
+ copyFrom(bounds: OrientedBounds): this;
89
+ /**
90
+ * Whether any internal state needs to be recalculated.
91
+ */
92
+ protected isDirty(): boolean;
93
+ /**
94
+ * This will recalculate the center, orientation matrix, and the hull vertices. It should be called only if
95
+ * {@code this.isDirty} returns true.
96
+ */
97
+ protected update(): void;
98
+ /**
99
+ * This will translate {@link OrientedBounds#innerBounds} after {@link OrientedBounds#center} is
100
+ * changed to ensure consistency.
101
+ */
102
+ private updateCenter;
103
+ }
@@ -0,0 +1,2 @@
1
+ export * from './AxisAlignedBounds';
2
+ export * from './OrientedBounds';
@@ -0,0 +1,6 @@
1
+ export { Transformer as TransformerImpl, TransformerHandle, TransformerWireframe, } from './transformer';
2
+ export type { Handle, RotateHandle, ScaleHandle, SkewHandle, ITransformerOptions, ITransformerStyle, ITransformerCursors, ITransformerColorTheme, IRotatorAnchorConfig, ITransformerHandleStyle, ITransformCommitPayload, ITransformerElementDims, ITransformerGroupBoundsSnapshot, } from './transformer';
3
+ export * from './object-pool';
4
+ export * from './bounds';
5
+ export { Transformer } from './react-bindings/Transformer';
6
+ export type { TransformerProps } from './react-bindings/Transformer';
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Provides the exponential moving average of a sequence.
3
+ *
4
+ * Ignored because not directly exposed.
5
+ *
6
+ * @internal
7
+ * @ignore
8
+ * @class
9
+ */
10
+ export declare class AverageProvider {
11
+ private _history;
12
+ private _decayRatio;
13
+ private _currentIndex;
14
+ private _average;
15
+ /**
16
+ * @ignore
17
+ * @param {number} windowSize - no. of inputs used to calculate window
18
+ * @param {number} decayRatio - quantifies the weight of previous values (b/w 0 and 1)
19
+ */
20
+ constructor(windowSize: number, decayRatio: number);
21
+ /**
22
+ * @ignore
23
+ * @param {number} input - the next value in the sequence
24
+ * @returns {number} - the moving average
25
+ */
26
+ next(input: number): number;
27
+ absDev(): number;
28
+ }
@@ -0,0 +1,103 @@
1
+ import { Ticker } from 'pixi.js';
2
+ /**
3
+ * @interface
4
+ * @public
5
+ */
6
+ export interface IObjectPoolOptions {
7
+ capacityRatio?: number;
8
+ decayRatio?: number;
9
+ reserve?: number;
10
+ }
11
+ /**
12
+ * `ObjectPool` provides the framework necessary for pooling minus the object instantiation
13
+ * method. You can use `ObjectPoolFactory` for objects that can be created using a default
14
+ * constructor.
15
+ *
16
+ * @template T
17
+ * @class
18
+ * @public
19
+ */
20
+ export declare abstract class ObjectPool<T> {
21
+ protected _freeList: Array<T>;
22
+ protected _freeCount: number;
23
+ protected _reserveCount: number;
24
+ protected _borrowRate: number;
25
+ protected _returnRate: number;
26
+ protected _flowRate: number;
27
+ protected _borrowRateAverage: number;
28
+ protected _marginAverage: number;
29
+ private _capacityRatio;
30
+ private _decayRatio;
31
+ private _borrowRateAverageProvider;
32
+ private _marginAverageProvider;
33
+ /**
34
+ * @param {IObjectPoolOptions} options
35
+ */
36
+ constructor(options?: IObjectPoolOptions);
37
+ /**
38
+ * Instantiates a new object of type `T`.
39
+ *
40
+ * @abstract
41
+ * @returns {T}
42
+ */
43
+ abstract create(): T;
44
+ /**
45
+ * The number of objects that can be stored in the pool without allocating more space.
46
+ *
47
+ * @member {number}
48
+ */
49
+ protected get capacity(): number;
50
+ protected set capacity(cp: number);
51
+ /**
52
+ * Obtains an instance from this pool.
53
+ *
54
+ * @returns {T}
55
+ */
56
+ allocate(): T;
57
+ /**
58
+ * Obtains an array of instances from this pool. This is faster than allocating multiple objects
59
+ * separately from this pool.
60
+ *
61
+ * @param {number | T[]} lengthOrArray - no. of objects to allocate OR the array itself into which
62
+ * objects are inserted. The amount to allocate is inferred from the array's length.
63
+ * @returns {T[]} array of allocated objects
64
+ */
65
+ allocateArray(lengthOrArray: number | T[]): T[];
66
+ /**
67
+ * Returns the object to the pool.
68
+ *
69
+ * @param {T} object
70
+ */
71
+ release(object: T): void;
72
+ /**
73
+ * Releases all of the objects in the passed array. These need not be allocated using `allocateArray`, however.
74
+ *
75
+ * @param {T[]} array
76
+ */
77
+ releaseArray(array: T[]): void;
78
+ /**
79
+ * Preallocates objects so that the pool size is at least `count`.
80
+ *
81
+ * @param {number} count
82
+ */
83
+ reserve(count: number): void;
84
+ /**
85
+ * Dereferences objects for the GC to collect and brings the pool size down to `count`.
86
+ *
87
+ * @param {number} count
88
+ */
89
+ limit(count: number): void;
90
+ /**
91
+ * Install the GC on the shared ticker.
92
+ *
93
+ * @param {Ticker}[ticker=Ticker.shared]
94
+ */
95
+ startGC(ticker?: Ticker): void;
96
+ /**
97
+ * Stops running the GC on the pool.
98
+ *
99
+ * @param {Ticker}[ticker=Ticker.shared]
100
+ */
101
+ stopGC(ticker?: Ticker): void;
102
+ private _gcTick;
103
+ }
@@ -0,0 +1,40 @@
1
+ import { ObjectPool } from './ObjectPool';
2
+ /**
3
+ * Factory for creating pools of objects with default constructors. It will store the pool of
4
+ * a given type and reuse it on further builds.
5
+ *
6
+ * @class
7
+ * @public
8
+ * @example
9
+ * ```js
10
+ * import { ObjectPool, ObjectPoolFactory } from '@pixi-essentials/object-pool';
11
+ *
12
+ * class AABB {}
13
+ *
14
+ * const opool: ObjectPool<AABB> = ObjectPoolFactory.build(AABB) as ObjectPool<AABB>;
15
+ *
16
+ * const temp = opool.borrowObject();
17
+ * // do something
18
+ * opool.returnObject(temp);
19
+ * ```
20
+ */
21
+ export declare class ObjectPoolFactory {
22
+ /**
23
+ * Builds an object-pool for objects constructed from the given class with a default constructor. If an
24
+ * object pool for that class was already created, an existing instance is returned.
25
+ *
26
+ * @param classConstructor
27
+ */
28
+ static build<T>(Type: {
29
+ new (): T;
30
+ }): ObjectPool<T>;
31
+ /**
32
+ * Builds an object-pool for objects built using a factory function. The factory function's context will be the
33
+ * object-pool.
34
+ *
35
+ * These types of pools are not cached and should only be used on internal data structures.
36
+ *
37
+ * @param factoryFunction
38
+ */
39
+ static buildFunctional<T>(factoryFunction: () => T): ObjectPool<T>;
40
+ }
@@ -0,0 +1,2 @@
1
+ export * from './ObjectPoolFactory';
2
+ export * from './ObjectPool';
@@ -0,0 +1,74 @@
1
+ import { Container as ContainerImpl, Matrix } from 'pixi.js';
2
+ import { Transformer as TransformerImpl, TransformerHandle as TransformerHandleImpl, Handle } from '../transformer/index';
3
+ import { ITransformerCursors, ITransformerStyle, ITransformerColorTheme, IRotatorAnchorConfig, ITransformCommitPayload, ITransformerHandleStyle } from '../transformer';
4
+ import * as React from 'react';
5
+ /** @internal */
6
+ export type TransformerProps = {
7
+ boundingBoxes?: 'all' | 'groupOnly' | 'none';
8
+ boxScalingEnabled?: boolean;
9
+ boxScalingTolerance?: number;
10
+ boxRotationEnabled?: boolean;
11
+ boxRotationTolerance?: number;
12
+ centeredScaling?: boolean;
13
+ clickThreshold?: number;
14
+ cursors?: Partial<ITransformerCursors>;
15
+ enabledHandles?: Array<string>;
16
+ group?: ContainerImpl[];
17
+ handleConstructor?: typeof TransformerHandleImpl;
18
+ handleStyle?: Partial<ITransformerHandleStyle>;
19
+ lockAspectRatio?: boolean;
20
+ projectionTransform?: Matrix;
21
+ rotateEnabled?: boolean;
22
+ rotationSnaps?: number[];
23
+ rotationSnapTolerance?: number;
24
+ scaleEnabled?: boolean;
25
+ skewEnabled?: boolean;
26
+ skewRadius?: number;
27
+ skewSnaps?: number[];
28
+ skewSnapTolerance?: number;
29
+ translateEnabled?: boolean;
30
+ transientGroupTilt?: boolean;
31
+ transformchange?: () => void;
32
+ transformstart?: (event: {
33
+ handle: Handle | null;
34
+ transformType: 'translate' | 'scale' | 'rotate' | 'skew' | 'none';
35
+ }) => void;
36
+ wireframeStyle?: Partial<ITransformerStyle>;
37
+ colorTheme?: Partial<ITransformerColorTheme>;
38
+ rotatorAnchor?: Partial<IRotatorAnchorConfig>;
39
+ nestedSelectionEnabled?: boolean;
40
+ focusedElementBorderColor?: number;
41
+ focusedElementBorderThickness?: number;
42
+ focusedElementBorderStyle?: 'solid' | 'dashed' | 'dotted';
43
+ focusedElementBorderDashPattern?: [number, number];
44
+ showNonFocusedBorders?: boolean;
45
+ individualBorderColor?: number;
46
+ individualBorderThickness?: number;
47
+ individualBorderAlpha?: number;
48
+ individualBorderStyle?: 'solid' | 'dashed' | 'dotted';
49
+ individualBorderDashPattern?: [number, number];
50
+ elementfocused?: (element: ContainerImpl, index: number) => void;
51
+ elementfocuscleared?: () => void;
52
+ transformcommit?: (payload: ITransformCommitPayload) => void;
53
+ focusedElementIndex?: number;
54
+ onFocusChange?: (index: number, element: ContainerImpl | null) => void;
55
+ };
56
+ /**
57
+ * Pixi v8 React binding for the imperative `Transformer` class.
58
+ *
59
+ * The v7 implementation used `@pixi/react`'s `PixiComponent('Name', { create,
60
+ * applyProps })` factory plus `applyDefaultProps`. Both are gone in
61
+ * `@pixi/react@8`: the new model registers custom intrinsics via `extend({})`,
62
+ * or mounts arbitrary Pixi display objects imperatively as children of a
63
+ * declarative `<pixiContainer>` via a ref.
64
+ *
65
+ * This component takes the **imperative** route: it renders an invisible
66
+ * `<pixiContainer ref={parentRef}>`, instantiates the `TransformerImpl` class
67
+ * once in a `useEffect`, attaches it to the parent's child list, and re-runs
68
+ * the `applyProps` body on every prop change. Cleanup removes the instance and
69
+ * destroys it.
70
+ *
71
+ * @see https://react.pixijs.io/getting-started/
72
+ * @see https://github.com/SukantPal/pixi-essentials/tree/master/packages/transformer
73
+ */
74
+ export declare const Transformer: React.ForwardRefExoticComponent<TransformerProps & React.RefAttributes<TransformerImpl>>;
@@ -0,0 +1,3 @@
1
+ export { Transformer } from './Transformer';
2
+ export type { TransformerProps } from './Transformer';
3
+ export type { ITransformerColorTheme, IRotatorAnchorConfig } from '../transformer';
@@ -0,0 +1,13 @@
1
+ import { Container } from 'pixi.js';
2
+ /**
3
+ * Removes old listeners and applies the new ones passed in the props.
4
+ *
5
+ * Pixi v8 removed `DisplayObject` — `Container` is the new base class and
6
+ * still extends `EventEmitter`, so the on/off API is identical.
7
+ *
8
+ * @param container - container emitting events
9
+ * @param events - object mapping handler prop-names to the fired events
10
+ * @param oldProps - old props. If calling on first props being passed, this should be `{}`.
11
+ * @param newProps - new props.
12
+ */
13
+ export declare function applyEventProps(container: Container, events: Record<string, string>, oldProps: any, newProps: any): void;