@zyzgroup/core-web 0.0.77 → 0.0.79
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/animate_ce.css +615 -0
- package/dist/zyzgroup_core_web.iife.js +16 -16
- package/dist/zyzgroup_core_web.iife.js.map +1 -1
- package/dist/zyzgroup_core_web.js +13475 -12617
- package/dist/zyzgroup_core_web.js.map +1 -1
- package/dist/zyzgroup_core_web.umd.cjs +16 -16
- package/dist/zyzgroup_core_web.umd.cjs.map +1 -1
- package/package.json +1 -1
- package/types/YZWorker.d.ts.map +1 -1
- package/types/ajax.d.ts +0 -1
- package/types/ajax.d.ts.map +1 -1
- package/types/animate/Clock.d.ts +14 -0
- package/types/animate/Clock.d.ts.map +1 -0
- package/types/animate/Timeline.d.ts +43 -0
- package/types/animate/Timeline.d.ts.map +1 -0
- package/types/animate/{YZAnimate.d.ts → _YZAnimate.d.ts} +3 -3
- package/types/animate/_YZAnimate.d.ts.map +1 -0
- package/types/animate/index.d.ts +3 -2
- package/types/animate/index.d.ts.map +1 -1
- package/types/animate/schedule.d.ts +11 -0
- package/types/animate/schedule.d.ts.map +1 -0
- package/types/animate/tween/BezierEasing.d.ts +8 -0
- package/types/animate/tween/BezierEasing.d.ts.map +1 -0
- package/types/animate/tween/Easing.d.ts +1 -0
- package/types/animate/tween/Easing.d.ts.map +1 -1
- package/types/animate/tween/Group.d.ts.map +1 -1
- package/types/animate/tween/Interpolation.d.ts +3 -1
- package/types/animate/tween/Interpolation.d.ts.map +1 -1
- package/types/animate/tween/Now.d.ts +0 -2
- package/types/animate/tween/Now.d.ts.map +1 -1
- package/types/animate/tween/Tween.d.ts.map +1 -1
- package/types/animate/tween/index.d.ts +8 -3
- package/types/animate/tween/index.d.ts.map +1 -1
- package/types/canvas/YZCanvas.d.ts +6 -5
- package/types/canvas/YZCanvas.d.ts.map +1 -1
- package/types/canvas/YZCanvasContext.d.ts.map +1 -1
- package/types/dom/DOMEventBus.d.ts +48 -30
- package/types/dom/DOMEventBus.d.ts.map +1 -1
- package/types/dom/DOMKey.d.ts +18 -0
- package/types/dom/DOMKey.d.ts.map +1 -1
- package/types/dom/DOMUtil.d.ts +17 -3
- package/types/dom/DOMUtil.d.ts.map +1 -1
- package/types/env.d.ts.map +1 -1
- package/types/image/bitmap.d.ts +5 -4
- package/types/image/bitmap.d.ts.map +1 -1
- package/types/image/image.d.ts +5 -0
- package/types/image/image.d.ts.map +1 -1
- package/types/index.d.ts +1 -4
- package/types/index.d.ts.map +1 -1
- package/types/loaders/AudioLoader.d.ts +12 -0
- package/types/loaders/AudioLoader.d.ts.map +1 -0
- package/types/loaders/Cache.d.ts +10 -0
- package/types/loaders/Cache.d.ts.map +1 -0
- package/types/loaders/FileLoader.d.ts +16 -0
- package/types/loaders/FileLoader.d.ts.map +1 -0
- package/types/loaders/ImageBitmapLoader.d.ts +14 -0
- package/types/loaders/ImageBitmapLoader.d.ts.map +1 -0
- package/types/loaders/ImageLoader.d.ts +11 -0
- package/types/loaders/ImageLoader.d.ts.map +1 -0
- package/types/loaders/Loader.d.ts +25 -0
- package/types/loaders/Loader.d.ts.map +1 -0
- package/types/loaders/LoadingManager.d.ts +29 -0
- package/types/loaders/LoadingManager.d.ts.map +1 -0
- package/types/loaders/index.d.ts +5 -0
- package/types/loaders/index.d.ts.map +1 -0
- package/types/math/Matrix.d.ts +65 -32
- package/types/math/Matrix.d.ts.map +1 -1
- package/types/math/Shape.d.ts +127 -84
- package/types/math/Shape.d.ts.map +1 -1
- package/types/math/ShapeCombo.d.ts +38 -0
- package/types/math/ShapeCombo.d.ts.map +1 -0
- package/types/math/ShapeGroup.d.ts +28 -14
- package/types/math/ShapeGroup.d.ts.map +1 -1
- package/types/math/index.d.ts +1 -15
- package/types/math/index.d.ts.map +1 -1
- package/types/math/line/Arc.d.ts +25 -0
- package/types/math/line/Arc.d.ts.map +1 -0
- package/types/math/{CubicBezier.d.ts → line/CubicBezier.d.ts} +20 -12
- package/types/math/line/CubicBezier.d.ts.map +1 -0
- package/types/math/line/L.d.ts +33 -0
- package/types/math/line/L.d.ts.map +1 -0
- package/types/math/line/PathD.d.ts +82 -0
- package/types/math/line/PathD.d.ts.map +1 -0
- package/types/math/line/QuadraticBezier.d.ts +30 -0
- package/types/math/line/QuadraticBezier.d.ts.map +1 -0
- package/types/math/line/index.d.ts +6 -0
- package/types/math/line/index.d.ts.map +1 -0
- package/types/math/math/cameras/Camera.d.ts +12 -0
- package/types/math/math/cameras/Camera.d.ts.map +1 -0
- package/types/math/math/constants.d.ts +211 -0
- package/types/math/math/constants.d.ts.map +1 -0
- package/types/math/math/controls/Controls.d.ts +25 -0
- package/types/math/math/controls/Controls.d.ts.map +1 -0
- package/types/math/math/controls/OrbitControls.d.ts +1 -0
- package/types/math/math/controls/OrbitControls.d.ts.map +1 -0
- package/types/math/math/core/BufferAttribute.d.ts +94 -0
- package/types/math/math/core/BufferAttribute.d.ts.map +1 -0
- package/types/math/math/core/BufferGeometry.d.ts +1 -0
- package/types/math/math/core/BufferGeometry.d.ts.map +1 -0
- package/types/math/math/core/EventDispatcher.d.ts +14 -0
- package/types/math/math/core/EventDispatcher.d.ts.map +1 -0
- package/types/math/math/core/GLBufferAttribute.d.ts +19 -0
- package/types/math/math/core/GLBufferAttribute.d.ts.map +1 -0
- package/types/math/math/core/Layers.d.ts +14 -0
- package/types/math/math/core/Layers.d.ts.map +1 -0
- package/types/math/math/core/Object3D.d.ts +91 -0
- package/types/math/math/core/Object3D.d.ts.map +1 -0
- package/types/math/math/index.d.ts +10 -0
- package/types/math/math/index.d.ts.map +1 -0
- package/types/math/math/interpolants/Interpolant.d.ts +14 -0
- package/types/math/math/interpolants/Interpolant.d.ts.map +1 -0
- package/types/math/math/math/Box2.d.ts +30 -0
- package/types/math/math/math/Box2.d.ts.map +1 -0
- package/types/math/math/math/Box3.d.ts +46 -0
- package/types/math/math/math/Box3.d.ts.map +1 -0
- package/types/math/math/math/Color.d.ts +59 -0
- package/types/math/math/math/Color.d.ts.map +1 -0
- package/types/math/math/math/ColorManagement.d.ts +20 -0
- package/types/math/math/math/ColorManagement.d.ts.map +1 -0
- package/types/math/math/math/Cylindrical.d.ts +14 -0
- package/types/math/math/math/Cylindrical.d.ts.map +1 -0
- package/types/math/math/math/Euler.d.ts +35 -0
- package/types/math/math/math/Euler.d.ts.map +1 -0
- package/types/math/math/math/Frustum.d.ts +21 -0
- package/types/math/math/math/Frustum.d.ts.map +1 -0
- package/types/math/math/math/Line3.d.ts +21 -0
- package/types/math/math/math/Line3.d.ts.map +1 -0
- package/types/math/math/math/Matrix.d.ts +16 -0
- package/types/math/math/math/Matrix.d.ts.map +1 -0
- package/types/math/math/math/Matrix2.d.ts +19 -0
- package/types/math/math/math/Matrix2.d.ts.map +1 -0
- package/types/math/math/math/Matrix3.d.ts +46 -0
- package/types/math/math/math/Matrix3.d.ts.map +1 -0
- package/types/math/math/math/Matrix4.d.ts +66 -0
- package/types/math/math/math/Matrix4.d.ts.map +1 -0
- package/types/math/math/math/Plane.d.ts +32 -0
- package/types/math/math/math/Plane.d.ts.map +1 -0
- package/types/math/math/math/Quaternion.d.ts +52 -0
- package/types/math/math/math/Quaternion.d.ts.map +1 -0
- package/types/math/math/math/Ray.d.ts +32 -0
- package/types/math/math/math/Ray.d.ts.map +1 -0
- package/types/math/math/math/Sphere.d.ts +29 -0
- package/types/math/math/math/Sphere.d.ts.map +1 -0
- package/types/math/math/math/Spherical.d.ts +15 -0
- package/types/math/math/math/Spherical.d.ts.map +1 -0
- package/types/math/math/math/SphericalHarmonics3.d.ts +21 -0
- package/types/math/math/math/SphericalHarmonics3.d.ts.map +1 -0
- package/types/math/math/math/Triangle.d.ts +35 -0
- package/types/math/math/math/Triangle.d.ts.map +1 -0
- package/types/math/math/math/Vector.d.ts +19 -0
- package/types/math/math/math/Vector.d.ts.map +1 -0
- package/types/math/math/math/Vector2.d.ts +66 -0
- package/types/math/math/math/Vector2.d.ts.map +1 -0
- package/types/math/math/math/Vector3.d.ts +80 -0
- package/types/math/math/math/Vector3.d.ts.map +1 -0
- package/types/math/math/math/Vector4.d.ts +64 -0
- package/types/math/math/math/Vector4.d.ts.map +1 -0
- package/types/math/math.d.ts +6 -1
- package/types/math/math.d.ts.map +1 -1
- package/types/math/shapes/Arrow.d.ts.map +1 -1
- package/types/math/{ComboConfetti.d.ts → shapes/Confetti.d.ts} +10 -8
- package/types/math/shapes/Confetti.d.ts.map +1 -0
- package/types/math/shapes/Cross.d.ts +2 -3
- package/types/math/shapes/Cross.d.ts.map +1 -1
- package/types/math/{Ellipse.d.ts → shapes/Ellipse.d.ts} +9 -5
- package/types/math/shapes/Ellipse.d.ts.map +1 -0
- package/types/math/shapes/Fox.d.ts.map +1 -1
- package/types/math/shapes/Heart.d.ts +6 -3
- package/types/math/shapes/Heart.d.ts.map +1 -1
- package/types/math/shapes/HeartVariant.d.ts +6 -3
- package/types/math/shapes/HeartVariant.d.ts.map +1 -1
- package/types/math/{Light3D.d.ts → shapes/Light3D.d.ts} +2 -5
- package/types/math/shapes/Light3D.d.ts.map +1 -0
- package/types/math/shapes/Line.d.ts +19 -0
- package/types/math/shapes/Line.d.ts.map +1 -0
- package/types/math/shapes/LinePicture.d.ts +15 -0
- package/types/math/shapes/LinePicture.d.ts.map +1 -0
- package/types/math/shapes/LineQuadraticBezier.d.ts +21 -0
- package/types/math/shapes/LineQuadraticBezier.d.ts.map +1 -0
- package/types/math/shapes/Point.d.ts +85 -0
- package/types/math/shapes/Point.d.ts.map +1 -0
- package/types/math/{Point3D.d.ts → shapes/Point3D.d.ts} +4 -6
- package/types/math/shapes/Point3D.d.ts.map +1 -0
- package/types/math/{Point3Ds.d.ts → shapes/Point3Ds.d.ts} +3 -3
- package/types/math/shapes/Point3Ds.d.ts.map +1 -0
- package/types/math/shapes/Points.d.ts +28 -0
- package/types/math/shapes/Points.d.ts.map +1 -0
- package/types/math/shapes/Rabbit.d.ts +4 -3
- package/types/math/shapes/Rabbit.d.ts.map +1 -1
- package/types/math/shapes/Rect.d.ts +33 -0
- package/types/math/shapes/Rect.d.ts.map +1 -0
- package/types/math/shapes/Ring.d.ts +7 -4
- package/types/math/shapes/Ring.d.ts.map +1 -1
- package/types/math/shapes/RingIndicator.d.ts +34 -0
- package/types/math/shapes/RingIndicator.d.ts.map +1 -0
- package/types/math/shapes/Sector.d.ts +15 -4
- package/types/math/shapes/Sector.d.ts.map +1 -1
- package/types/math/shapes/Segment.d.ts +10 -3
- package/types/math/shapes/Segment.d.ts.map +1 -1
- package/types/math/shapes/Ship.d.ts +4 -2
- package/types/math/shapes/Ship.d.ts.map +1 -1
- package/types/math/shapes/Slider.d.ts +7 -13
- package/types/math/shapes/Slider.d.ts.map +1 -1
- package/types/math/shapes/Star.d.ts +5 -3
- package/types/math/shapes/Star.d.ts.map +1 -1
- package/types/math/{Text.d.ts → shapes/Text.d.ts} +3 -4
- package/types/math/shapes/Text.d.ts.map +1 -0
- package/types/math/shapes/Tip.d.ts +8 -9
- package/types/math/shapes/Tip.d.ts.map +1 -1
- package/types/math/shapes/Tree.d.ts +2 -2
- package/types/math/shapes/Tree.d.ts.map +1 -1
- package/types/math/shapes/index.d.ts +12 -0
- package/types/math/shapes/index.d.ts.map +1 -1
- package/types/patch.d.ts.map +1 -1
- package/types/position.d.ts +11 -15
- package/types/position.d.ts.map +1 -1
- package/types/svg/DOMSVGUtil.d.ts +1 -13
- package/types/svg/DOMSVGUtil.d.ts.map +1 -1
- package/types/svg/YZSVG.d.ts +7 -6
- package/types/svg/YZSVG.d.ts.map +1 -1
- package/types/theme.d.ts +3 -3
- package/types/theme.d.ts.map +1 -1
- package/types/YZRequestIdleCallback.d.ts +0 -14
- package/types/YZRequestIdleCallback.d.ts.map +0 -1
- package/types/animate/YZAnimate.d.ts.map +0 -1
- package/types/animate/requestAnimationFrameCycle.d.ts +0 -15
- package/types/animate/requestAnimationFrameCycle.d.ts.map +0 -1
- package/types/animate/tween/cubicBezierToEase.d.ts +0 -4
- package/types/animate/tween/cubicBezierToEase.d.ts.map +0 -1
- package/types/math/Arc.d.ts +0 -27
- package/types/math/Arc.d.ts.map +0 -1
- package/types/math/ComboConfetti.d.ts.map +0 -1
- package/types/math/CubicBezier.d.ts.map +0 -1
- package/types/math/Ellipse.d.ts.map +0 -1
- package/types/math/Light3D.d.ts.map +0 -1
- package/types/math/Line.d.ts +0 -28
- package/types/math/Line.d.ts.map +0 -1
- package/types/math/PathD.d.ts +0 -82
- package/types/math/PathD.d.ts.map +0 -1
- package/types/math/PathDGroup.d.ts +0 -30
- package/types/math/PathDGroup.d.ts.map +0 -1
- package/types/math/Point.d.ts +0 -58
- package/types/math/Point.d.ts.map +0 -1
- package/types/math/Point3D.d.ts.map +0 -1
- package/types/math/Point3Ds.d.ts.map +0 -1
- package/types/math/Points.d.ts +0 -23
- package/types/math/Points.d.ts.map +0 -1
- package/types/math/QuadraticBezier.d.ts +0 -26
- package/types/math/QuadraticBezier.d.ts.map +0 -1
- package/types/math/Rect.d.ts +0 -25
- package/types/math/Rect.d.ts.map +0 -1
- package/types/math/RenderGroup.d.ts +0 -18
- package/types/math/RenderGroup.d.ts.map +0 -1
- package/types/math/Text.d.ts.map +0 -1
- package/types/microTask.d.ts +0 -2
- package/types/microTask.d.ts.map +0 -1
- package/types/nextTick.d.ts +0 -3
- package/types/nextTick.d.ts.map +0 -1
- package/types/reactive.d.ts +0 -14
- package/types/reactive.d.ts.map +0 -1
- package/types/three/three.d.ts +0 -2
- package/types/three/three.d.ts.map +0 -1
package/types/math/Shape.d.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
1
|
import { EventBusRaw, EventBusListeners } from "@zyzgroup/core-common";
|
|
2
2
|
import { TSVGParsedPathData } from "../svg/DOMSVGUtil";
|
|
3
3
|
import { YZCanvasContext } from "../canvas/YZCanvasContext";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { RenderGroup } from "./RenderGroup";
|
|
4
|
+
import { PathD } from "./line/";
|
|
5
|
+
import { Matrix } from "./Matrix";
|
|
6
|
+
import { TweenRawOptions } from "../animate";
|
|
8
7
|
export type TShapeOptions = {
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
d?: string | TSVGParsedPathData[] | PathD;
|
|
9
|
+
originMatrix?: Matrix;
|
|
10
|
+
independentTransformInGroup?: boolean;
|
|
11
|
+
centerX?: number;
|
|
12
|
+
centerY?: number;
|
|
11
13
|
x?: number;
|
|
12
14
|
y?: number;
|
|
13
15
|
degree?: number;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
scalar?: number;
|
|
17
|
+
scalarX?: number;
|
|
18
|
+
scalarY?: number;
|
|
19
|
+
diffXInGroup?: number;
|
|
20
|
+
diffYInGroup?: number;
|
|
21
|
+
diffDegreeInGroup?: number;
|
|
22
|
+
diffScalarXInGroup?: number;
|
|
23
|
+
diffScalarYInGroup?: number;
|
|
20
24
|
vx?: number;
|
|
21
25
|
vy?: number;
|
|
22
26
|
ax?: number;
|
|
23
27
|
ay?: number;
|
|
24
28
|
mass?: number;
|
|
25
29
|
attrs?: Record<string, string | CanvasGradient>;
|
|
30
|
+
isShow?: boolean;
|
|
26
31
|
enableDrag?: boolean;
|
|
27
32
|
alongPath?: PathD;
|
|
28
33
|
targetToAfterDragFree?: {
|
|
@@ -31,128 +36,166 @@ export type TShapeOptions = {
|
|
|
31
36
|
easing?: number;
|
|
32
37
|
};
|
|
33
38
|
followMouse?: boolean;
|
|
34
|
-
isShow?: boolean;
|
|
35
39
|
strokeArmyAnts?: boolean;
|
|
36
|
-
shapeGroup?: ShapeGroup;
|
|
37
|
-
renderGroup?: RenderGroup;
|
|
38
|
-
autoRender?: boolean;
|
|
39
40
|
};
|
|
40
41
|
export interface ShapeEventBusListeners extends EventBusListeners {
|
|
41
|
-
|
|
42
|
+
draging(dx: number, dy: number, excludeShapeInGroup?: Shape): void;
|
|
43
|
+
clicked(shape: Shape): void;
|
|
42
44
|
}
|
|
43
|
-
export type
|
|
45
|
+
export type TShapeRunOptions = {
|
|
44
46
|
gravity?: number;
|
|
45
47
|
friction?: number;
|
|
46
48
|
};
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
+
export type TShapeRunEasingOptions = TShapeRunOptions & {
|
|
50
|
+
easing?: number;
|
|
51
|
+
};
|
|
52
|
+
export type TShapeRunSpringOptions = TShapeRunOptions & {
|
|
53
|
+
spring?: number;
|
|
54
|
+
};
|
|
55
|
+
export declare class Shape extends EventBusRaw<ShapeEventBusListeners> {
|
|
49
56
|
id: string;
|
|
57
|
+
originD?: string | TSVGParsedPathData[] | PathD;
|
|
58
|
+
originMatrix?: Matrix;
|
|
59
|
+
independentTransformInGroup: boolean;
|
|
60
|
+
forceCXY: boolean;
|
|
50
61
|
cX: number;
|
|
51
62
|
cY: number;
|
|
52
63
|
x: number;
|
|
53
|
-
prevX: number;
|
|
54
64
|
y: number;
|
|
55
|
-
prevY: number;
|
|
56
65
|
degree: number;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
prevSkewxDegreeOnOrigin: number;
|
|
65
|
-
prevSkewyDegreeOnOrigin: number;
|
|
66
|
-
transformBaseOnSelfInRenderGroup: boolean;
|
|
66
|
+
scalarX: number;
|
|
67
|
+
scalarY: number;
|
|
68
|
+
diffXInGroup: number;
|
|
69
|
+
diffYInGroup: number;
|
|
70
|
+
diffDegreeInGroup: number;
|
|
71
|
+
diffScalarXInGroup: number;
|
|
72
|
+
diffScalarYInGroup: number;
|
|
67
73
|
vx: number;
|
|
68
74
|
vy: number;
|
|
69
75
|
ax: number;
|
|
70
76
|
ay: number;
|
|
71
77
|
mass: number;
|
|
72
|
-
attrs
|
|
78
|
+
private attrs;
|
|
73
79
|
enableDrag: boolean;
|
|
74
80
|
alongPath?: PathD;
|
|
75
81
|
isDragging: boolean;
|
|
76
82
|
isMouseIn: boolean;
|
|
77
|
-
mouseX: number;
|
|
78
|
-
mouseY: number;
|
|
79
83
|
targetToAfterDragFree?: {
|
|
80
84
|
targetX: number;
|
|
81
85
|
targetY: number;
|
|
82
86
|
easing?: number;
|
|
83
87
|
};
|
|
84
88
|
followMouse: boolean;
|
|
85
|
-
isShow: boolean;
|
|
86
|
-
now: number;
|
|
87
|
-
frameRate: number;
|
|
88
89
|
strokeArmyAnts: boolean;
|
|
89
90
|
strokeArmyAntsOffset: number;
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
strokeDashTotalLength: number;
|
|
92
|
+
isShow: boolean;
|
|
92
93
|
el?: HTMLElement | SVGElement;
|
|
93
94
|
pathd?: PathD;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
usePathDtoCanvasContext: boolean;
|
|
96
|
+
parent?: Shape;
|
|
97
|
+
shapes: Shape[];
|
|
97
98
|
constructor(options?: TShapeOptions);
|
|
99
|
+
forceSetCXY(cX: number, cY: number): void;
|
|
100
|
+
shapeInit(): void;
|
|
101
|
+
initPathD(): PathD;
|
|
102
|
+
frameStart(mouse?: {
|
|
103
|
+
x: number;
|
|
104
|
+
y: number;
|
|
105
|
+
}): void;
|
|
106
|
+
frameUpdate(mouse?: {
|
|
107
|
+
x: number;
|
|
108
|
+
y: number;
|
|
109
|
+
}, ctx?: YZCanvasContext): void;
|
|
110
|
+
frameEnd(mouse?: {
|
|
111
|
+
x: number;
|
|
112
|
+
y: number;
|
|
113
|
+
}): void;
|
|
114
|
+
toSVGPathData(): TSVGParsedPathData[];
|
|
115
|
+
toSVGPathD(): string;
|
|
116
|
+
toCanvasContext(ctx: YZCanvasContext): void;
|
|
117
|
+
getBoundingClientRect(): {
|
|
118
|
+
x: number;
|
|
119
|
+
y: number;
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
} | null;
|
|
123
|
+
get center(): {
|
|
124
|
+
x: number;
|
|
125
|
+
y: number;
|
|
126
|
+
};
|
|
127
|
+
trim(): void;
|
|
128
|
+
isPointInPath(x: number, y: number, ctx: YZCanvasContext | SVGSVGElement): boolean;
|
|
129
|
+
isPointInStroke(x: number, y: number, ctx: YZCanvasContext | SVGSVGElement): boolean;
|
|
130
|
+
clone(): any;
|
|
131
|
+
copy(shape: Shape): this;
|
|
98
132
|
save(): void;
|
|
99
133
|
restore(): void;
|
|
100
|
-
group(...ss: Shape[]): void;
|
|
101
|
-
ungroup(): void;
|
|
102
134
|
setAttr(obj: Record<string, string | CanvasGradient>): void;
|
|
103
135
|
setAttr(name: string, value: string | CanvasGradient): void;
|
|
104
136
|
getAttr(name: string, defaultValue: string | CanvasGradient): string | CanvasGradient;
|
|
105
137
|
getAttr(name: string): string | CanvasGradient | undefined;
|
|
138
|
+
getAttrs(): Record<string, string | CanvasGradient>;
|
|
106
139
|
hasAttr(name: string): boolean;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
140
|
+
distance(target: {
|
|
141
|
+
x: number;
|
|
142
|
+
y: number;
|
|
143
|
+
}): number;
|
|
144
|
+
rotateTo(target: {
|
|
145
|
+
x: number;
|
|
146
|
+
y: number;
|
|
147
|
+
}): void;
|
|
148
|
+
followTo(target: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
}, length?: number): void;
|
|
152
|
+
followAccelerationTo(target: {
|
|
153
|
+
x: number;
|
|
154
|
+
y: number;
|
|
155
|
+
}, length?: number): void;
|
|
122
156
|
checkCollision(target: Shape): void;
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
157
|
+
checkWall(options: {
|
|
158
|
+
wall: {
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
width: number;
|
|
162
|
+
height: number;
|
|
163
|
+
};
|
|
164
|
+
bounce?: number;
|
|
165
|
+
}): void;
|
|
166
|
+
gravitateTo(target: Shape): void;
|
|
167
|
+
run(options?: TShapeRunOptions): void;
|
|
168
|
+
runEaseTo(target: {
|
|
127
169
|
x: number;
|
|
128
170
|
y: number;
|
|
129
|
-
}, options?:
|
|
130
|
-
|
|
131
|
-
} & ShapeNextFrameOptions): void;
|
|
132
|
-
nextFrameSpringTo(target: {
|
|
171
|
+
}, options?: TShapeRunEasingOptions): void;
|
|
172
|
+
runSpringTo(target: {
|
|
133
173
|
x: number;
|
|
134
174
|
y: number;
|
|
135
175
|
} | {
|
|
136
176
|
x: number;
|
|
137
177
|
y: number;
|
|
138
|
-
}[], options?:
|
|
139
|
-
|
|
140
|
-
} & ShapeNextFrameOptions): void;
|
|
141
|
-
static comboSpringChain(shapes: Shape[], options?: {
|
|
142
|
-
spring?: number;
|
|
143
|
-
} & ShapeNextFrameOptions): void;
|
|
144
|
-
static comboSpringConnect(shapes: Shape[], options?: {
|
|
178
|
+
}[], options?: TShapeRunSpringOptions): void;
|
|
179
|
+
springMassTo(target: Shape, options?: {
|
|
145
180
|
springLength?: number;
|
|
146
181
|
spring?: number;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
182
|
+
}): number;
|
|
183
|
+
getTotalLength(): number;
|
|
184
|
+
interpolate(t: number): {
|
|
185
|
+
x: number;
|
|
186
|
+
y: number;
|
|
187
|
+
};
|
|
188
|
+
getPointAtLength(length: number): {
|
|
189
|
+
x: number;
|
|
190
|
+
y: number;
|
|
191
|
+
alpha: number;
|
|
192
|
+
};
|
|
193
|
+
trailPath(trail: Shape, progress?: number): {
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
alpha: number;
|
|
197
|
+
};
|
|
198
|
+
strokeDashTween(frameDuration?: number, options?: TweenRawOptions): void;
|
|
156
199
|
}
|
|
157
200
|
export default Shape;
|
|
158
201
|
//# sourceMappingURL=Shape.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shape.d.ts","sourceRoot":"","sources":["../../src/math/Shape.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Shape.d.ts","sourceRoot":"","sources":["../../src/math/Shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,WAAW,EACX,iBAAiB,EAWlB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAY,eAAe,EAAc,MAAM,YAAY,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,CAAC,EAAE,MAAM,GAAG,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IAKtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IAGX,MAAM,CAAC,EAAE,MAAM,CAAC;IAGhB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,CAAC;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AC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAChC,OAAO,CAAC,EAAE,sBAAsB;IAU3B,WAAW,CAChB,MAAM,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,EAC7D,OAAO,CAAC,EAAE,sBAAsB;IAc3B,YAAY,CACjB,MAAM,EAAE,KAAK,EACb,OAAO,CAAC,EAAE;QACR,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GACA,MAAM;IAkBT,cAAc,IAAI,MAAM;IAIxB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAIhD,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG;QAChC,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;KACf;IAIM,SAAS,CACd,KAAK,EAAE,KAAK,EACZ,QAAQ,SAAI,GACX;QACD,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,EAAE,MAAM,CAAC;QACV,KAAK,EAAE,MAAM,CAAC;KACf;IAMM,eAAe,CAAC,aAAa,SAAO,EAAE,OAAO,CAAC,EAAE,eAAe;CAqBvE;AAED,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { TweenRawOptions } from "../animate";
|
|
2
|
+
import { Shape, TShapeRunSpringOptions } from "./Shape";
|
|
3
|
+
import { Points } from "./shapes";
|
|
4
|
+
import { ShapeGroup } from "./ShapeGroup";
|
|
5
|
+
type TShapeComboRunSpringOptions = TShapeRunSpringOptions & {
|
|
6
|
+
springLength?: number;
|
|
7
|
+
};
|
|
8
|
+
export declare class ShapeCombo {
|
|
9
|
+
private shapes;
|
|
10
|
+
constructor(shapes: Shape[]);
|
|
11
|
+
run(options?: {
|
|
12
|
+
wall?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
};
|
|
18
|
+
bounce?: number;
|
|
19
|
+
}): void;
|
|
20
|
+
gravitate(): void;
|
|
21
|
+
springChain(options?: TShapeRunSpringOptions): void;
|
|
22
|
+
springConnect(options?: TShapeComboRunSpringOptions): void;
|
|
23
|
+
springMass(wall: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
}, options?: TShapeComboRunSpringOptions): number[][];
|
|
29
|
+
polymorph(): (offset: number) => Shape;
|
|
30
|
+
polymorphGroup(): (offset: number) => ShapeGroup;
|
|
31
|
+
polymorphTween(frameDuration?: number, options?: TweenRawOptions & {
|
|
32
|
+
draw?: (shape: Shape) => void;
|
|
33
|
+
}): void;
|
|
34
|
+
static generatePointsShape(centerX: number, centerY: number, sideDistance: number, sideCount: number): Points;
|
|
35
|
+
static generateRosettaShape(x: number, y: number, rx: number, ry: number, n: number): Shape;
|
|
36
|
+
}
|
|
37
|
+
export default ShapeCombo;
|
|
38
|
+
//# sourceMappingURL=ShapeCombo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ShapeCombo.d.ts","sourceRoot":"","sources":["../../src/math/ShapeCombo.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,eAAe,EAAc,MAAM,YAAY,CAAC;AAEnE,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,KAAK,2BAA2B,GAAG,sBAAsB,GAAG;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;C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-1,21 +1,35 @@
|
|
|
1
1
|
import { Shape, TShapeOptions } from "./Shape";
|
|
2
|
-
import {
|
|
3
|
-
import { TSVGParsedPathData } from "../svg/DOMSVGUtil";
|
|
2
|
+
import { TweenRawOptions } from "../animate";
|
|
4
3
|
import { YZCanvasContext } from "../canvas";
|
|
5
4
|
export declare class ShapeGroup extends Shape {
|
|
6
|
-
|
|
7
|
-
renderGroup: RenderGroup;
|
|
5
|
+
private shapesCountChange;
|
|
8
6
|
constructor(options?: TShapeOptions);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
shapeInit(): void;
|
|
8
|
+
frameStart(mouse?: {
|
|
9
|
+
x: number;
|
|
10
|
+
y: number;
|
|
11
|
+
}): void;
|
|
12
|
+
frameUpdate(mouse?: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}, ctx?: YZCanvasContext): void;
|
|
16
|
+
addShape(shapes: Shape | Shape[]): void;
|
|
17
|
+
getBoundingClientRect(): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
} | null;
|
|
23
|
+
setAttrs(obj: Record<string, string | CanvasGradient>): void;
|
|
24
|
+
setAttrs(name: string, value: string | CanvasGradient): void;
|
|
25
|
+
sortPathD(): void;
|
|
26
|
+
expendFill(larger: ShapeGroup): void;
|
|
27
|
+
strokeDashTween(frameDuration?: number, options?: Omit<TweenRawOptions, "onStart" | "onUpdate" | "onComplete"> & {
|
|
28
|
+
type?: "parallel" | "sequence";
|
|
29
|
+
onGroupStart?: () => void;
|
|
30
|
+
onGroupUpdate?: () => void;
|
|
31
|
+
onGroupComplete?: () => void;
|
|
32
|
+
}): void;
|
|
19
33
|
}
|
|
20
34
|
export default ShapeGroup;
|
|
21
35
|
//# sourceMappingURL=ShapeGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeGroup.d.ts","sourceRoot":"","sources":["../../src/math/ShapeGroup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShapeGroup.d.ts","sourceRoot":"","sources":["../../src/math/ShapeGroup.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAY,eAAe,EAAc,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,qBAAa,UAAW,SAAQ,KAAK;IACnC,OAAO,CAAC,iBAAiB,CAAS;gBAEtB,OAAO,CAAC,EAAE,aAAa;IAK5B,SAAS;IAIT,UAAU,CAAC,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAoB3C,WAAW,CAAC,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,CAAC,EAAE,eAAe;IAenE,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE;IAiBhC,qBAAqB;;;;;;IA+BrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC,GAAG,IAAI;IAC5D,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAoB5D,SAAS;IAaT,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAyBpC,eAAe,CACpB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,UAAU,GAAG,YAAY,CAAC,GAAG;QACvE,IAAI,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;QAC/B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;QAC1B,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;KAC9B;CAiEJ;AAED,eAAe,UAAU,CAAC"}
|
package/types/math/index.d.ts
CHANGED
|
@@ -2,20 +2,6 @@ export * from "./Matrix";
|
|
|
2
2
|
export * from "./math";
|
|
3
3
|
export * from "./Shape";
|
|
4
4
|
export * from "./ShapeGroup";
|
|
5
|
-
export * from "./
|
|
6
|
-
export * from "./PathDGroup";
|
|
7
|
-
export * from "./Point";
|
|
8
|
-
export * from "./Ellipse";
|
|
9
|
-
export * from "./Points";
|
|
10
|
-
export * from "./Point3D";
|
|
11
|
-
export * from "./Point3Ds";
|
|
12
|
-
export * from "./Rect";
|
|
13
|
-
export * from "./Line";
|
|
14
|
-
export * from "./Arc";
|
|
15
|
-
export * from "./QuadraticBezier";
|
|
16
|
-
export * from "./CubicBezier";
|
|
17
|
-
export * from "./PathD";
|
|
18
|
-
export * from "./Text";
|
|
5
|
+
export * from "./ShapeCombo";
|
|
19
6
|
export * from "./shapes/";
|
|
20
|
-
export * from "./ComboConfetti";
|
|
21
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/math/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AAEvB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAE7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TSVGParsedPathData } from "../../svg/DOMSVGUtil";
|
|
2
|
+
import { YZCanvasContext } from "../../canvas";
|
|
3
|
+
import { L, TLOptions } from "./L";
|
|
4
|
+
export type TCArcOptions = {
|
|
5
|
+
rx: number;
|
|
6
|
+
ry: number;
|
|
7
|
+
xAxisRotate?: number;
|
|
8
|
+
largeArcFlag?: number;
|
|
9
|
+
sweepFlag?: number;
|
|
10
|
+
toX: number;
|
|
11
|
+
toY: number;
|
|
12
|
+
} & TLOptions;
|
|
13
|
+
export declare class Arc extends L {
|
|
14
|
+
rx: number;
|
|
15
|
+
ry: number;
|
|
16
|
+
xAxisRotate: number;
|
|
17
|
+
largeArcFlag: number;
|
|
18
|
+
sweepFlag: number;
|
|
19
|
+
constructor(options: TCArcOptions);
|
|
20
|
+
toSVGPathData(): TSVGParsedPathData[];
|
|
21
|
+
toCanvasContext(ctx: YZCanvasContext): void;
|
|
22
|
+
convert(x1: number, y1: number, x2: number, y2: number, rx: number, ry: number, phi: number, fa: number, fs: number): number[];
|
|
23
|
+
}
|
|
24
|
+
export default Arc;
|
|
25
|
+
//# sourceMappingURL=Arc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Arc.d.ts","sourceRoot":"","sources":["../../../src/math/line/Arc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAEnC,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,SAAS,CAAC;AAEd,qBAAa,GAAI,SAAQ,CAAC;IAEjB,EAAE,EAAE,MAAM,CAAC;IAEX,EAAE,EAAE,MAAM,CAAC;IAEX,WAAW,EAAE,MAAM,CAAC;IAEpB,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,YAAY;IAYjC,aAAa,IAAI,kBAAkB,EAAE;IAerC,eAAe,CAAC,GAAG,EAAE,eAAe,GAAG,IAAI;IA0B3C,OAAO,CACL,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM;CAkDb;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -1,30 +1,38 @@
|
|
|
1
|
-
import { TSVGParsedPathData } from "
|
|
2
|
-
import { YZCanvasContext } from "
|
|
3
|
-
import {
|
|
4
|
-
import Point from "./Point";
|
|
5
|
-
import Rect from "./Rect";
|
|
1
|
+
import { TSVGParsedPathData } from "../../svg/DOMSVGUtil";
|
|
2
|
+
import { YZCanvasContext } from "../../canvas";
|
|
3
|
+
import { L, TLOptions } from "./L";
|
|
6
4
|
export type TCubicBezierOptions = {
|
|
7
5
|
c1x: number;
|
|
8
6
|
c1y: number;
|
|
9
7
|
c2x: number;
|
|
10
8
|
c2y: number;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} &
|
|
14
|
-
export declare class CubicBezier extends
|
|
9
|
+
toX?: number;
|
|
10
|
+
toY?: number;
|
|
11
|
+
} & TLOptions;
|
|
12
|
+
export declare class CubicBezier extends L {
|
|
15
13
|
c1x: number;
|
|
16
14
|
c1y: number;
|
|
17
15
|
c2x: number;
|
|
18
16
|
c2y: number;
|
|
19
17
|
constructor(options: TCubicBezierOptions);
|
|
20
|
-
|
|
21
|
-
toSVGPathData(): TSVGParsedPathData;
|
|
18
|
+
toSVGPathData(): TSVGParsedPathData[];
|
|
22
19
|
toCanvasContext(ctx: YZCanvasContext): void;
|
|
23
|
-
getBoundingClientRect():
|
|
20
|
+
getBoundingClientRect(): {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
dots: {
|
|
26
|
+
X: number;
|
|
27
|
+
Y: number;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
24
30
|
interpolate(t: number): {
|
|
25
31
|
x: number;
|
|
26
32
|
y: number;
|
|
27
33
|
};
|
|
34
|
+
static base3(t: number, p1: number, p2: number, p3: number, p4: number): number;
|
|
35
|
+
static bezlen(x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, z?: number): number;
|
|
28
36
|
length(z?: number): number;
|
|
29
37
|
getTatLen(ll: number): number;
|
|
30
38
|
getPointAtSegmentLength(length: number): {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CubicBezier.d.ts","sourceRoot":"","sources":["../../../src/math/line/CubicBezier.ts"],"names":[],"mappings":"AAAA,OAAmB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAEnC,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,GAAG,SAAS,CAAC;AAEd,qBAAa,WAAY,SAAQ,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;gBAEP,OAAO,EAAE,mBAAmB;IAUxC,aAAa,IAAI,kBAAkB,EAAE;IAIrC,eAAe,CAAC,GAAG,EAAE,eAAe;IAWpC,qBAAqB;;;;;;;;;;IA6IrB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAehD,MAAM,CAAC,KAAK,CACV,CAAC,EAAE,MAAM,EACT,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,MAAM;IAWT,MAAM,CAAC,MAAM,CACX,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,CAAC,SAAI,GACJ,MAAM;IAsBT,MAAM,CAAC,CAAC,SAAI,GAAG,MAAM;IAerB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAyB7B,uBAAuB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;CA6DvC;AAED,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { YZCanvasContext } from "../../canvas";
|
|
2
|
+
import { type TSVGParsedPathData } from "../../svg/DOMSVGUtil";
|
|
3
|
+
export type TLOptions = {
|
|
4
|
+
x?: number;
|
|
5
|
+
y?: number;
|
|
6
|
+
toX?: number;
|
|
7
|
+
toY?: number;
|
|
8
|
+
};
|
|
9
|
+
export declare class L {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
toX: number;
|
|
13
|
+
toY: number;
|
|
14
|
+
constructor(options?: TLOptions);
|
|
15
|
+
toSVGPathData(): TSVGParsedPathData[];
|
|
16
|
+
toCanvasContext(ctx: YZCanvasContext): void;
|
|
17
|
+
getBoundingClientRect(): {
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
};
|
|
23
|
+
interpolate(t: number): {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
};
|
|
27
|
+
intersection(line: L): {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
} | null;
|
|
31
|
+
}
|
|
32
|
+
export default L;
|
|
33
|
+
//# sourceMappingURL=L.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"L.d.ts","sourceRoot":"","sources":["../../../src/math/line/L.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,MAAM,MAAM,SAAS,GAAG;IACtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAGF,qBAAa,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;gBAEA,OAAO,CAAC,EAAE,SAAS;IAO/B,aAAa,IAAI,kBAAkB,EAAE;IAIrC,eAAe,CAAC,GAAG,EAAE,eAAe;IAIpC,qBAAqB;;;;;;IA8BrB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;IAOhD,YAAY,CAAC,IAAI,EAAE,CAAC,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;CA0BvD;AAED,eAAe,CAAC,CAAC"}
|