@antv/g 1.0.0-alpha.27 → 1.0.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +4238 -0
- package/lib/index.js +222 -0
- package/package.json +11 -10
- package/dist/AbstractRenderer.d.ts +0 -26
- package/dist/Canvas.d.ts +0 -96
- package/dist/DisplayObjectPool.d.ts +0 -7
- package/dist/__tests__/canvas.spec.d.ts +0 -1
- package/dist/__tests__/custom-element.spec.d.ts +0 -3
- package/dist/__tests__/event.spec.d.ts +0 -1
- package/dist/camera/Camera.d.ts +0 -279
- package/dist/camera/Landmark.d.ts +0 -28
- package/dist/camera/__tests__/camera.spec.d.ts +0 -1
- package/dist/camera/__tests__/landmark.spec.d.ts +0 -1
- package/dist/camera/index.d.ts +0 -2
- package/dist/canvas-module.d.ts +0 -3
- package/dist/components/Cullable.d.ts +0 -15
- package/dist/components/Geometry.d.ts +0 -13
- package/dist/components/Renderable.d.ts +0 -25
- package/dist/components/Sortable.d.ts +0 -17
- package/dist/components/Transform.d.ts +0 -28
- package/dist/components/index.d.ts +0 -5
- package/dist/display-objects/Circle.d.ts +0 -12
- package/dist/display-objects/CustomElement.d.ts +0 -25
- package/dist/display-objects/DisplayObject.d.ts +0 -258
- package/dist/display-objects/Ellipse.d.ts +0 -14
- package/dist/display-objects/Group.d.ts +0 -6
- package/dist/display-objects/HTML.d.ts +0 -36
- package/dist/display-objects/Image.d.ts +0 -16
- package/dist/display-objects/Line.d.ts +0 -23
- package/dist/display-objects/Path.d.ts +0 -47
- package/dist/display-objects/Polygon.d.ts +0 -12
- package/dist/display-objects/Polyline.d.ts +0 -21
- package/dist/display-objects/Rect.d.ts +0 -16
- package/dist/display-objects/Text.d.ts +0 -65
- package/dist/display-objects/__tests__/circle.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.bounds.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.node.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.transformable.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/display-object.visible.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/ellipse.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/line.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/path.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/polygon.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/polyline.spec.d.ts +0 -1
- package/dist/display-objects/__tests__/text.spec.d.ts +0 -1
- package/dist/display-objects/index.d.ts +0 -13
- package/dist/dom/Animation.d.ts +0 -132
- package/dist/dom/AnimationEffectTiming.d.ts +0 -59
- package/dist/dom/AnimationEvent.d.ts +0 -11
- package/dist/dom/AnimationTimeline.d.ts +0 -37
- package/dist/dom/CustomElementRegistry.d.ts +0 -15
- package/dist/dom/CustomEvent.d.ts +0 -16
- package/dist/dom/Document.d.ts +0 -59
- package/dist/dom/Element.d.ts +0 -143
- package/dist/dom/EventTarget.d.ts +0 -47
- package/dist/dom/FederatedEvent.d.ts +0 -146
- package/dist/dom/FederatedMouseEvent.d.ts +0 -52
- package/dist/dom/FederatedPointerEvent.d.ts +0 -69
- package/dist/dom/FederatedWheelEvent.d.ts +0 -20
- package/dist/dom/KeyframeEffect.d.ts +0 -48
- package/dist/dom/KeyframeList.d.ts +0 -2
- package/dist/dom/Node.d.ts +0 -106
- package/dist/dom/__tests__/animation.computed-timing.spec.d.ts +0 -1
- package/dist/dom/__tests__/animation.keyframe-effect.spec.d.ts +0 -1
- package/dist/dom/__tests__/animation.timeline.spec.d.ts +0 -1
- package/dist/dom/__tests__/document.spec.d.ts +0 -1
- package/dist/dom/__tests__/element.spec.d.ts +0 -1
- package/dist/dom/__tests__/event.spec.d.ts +0 -1
- package/dist/dom/__tests__/utils/easing.d.ts +0 -14
- package/dist/dom/__tests__/utils/keyframe.d.ts +0 -38
- package/dist/dom/index.d.ts +0 -17
- package/dist/dom/interfaces.d.ts +0 -327
- package/dist/global-module.d.ts +0 -1
- package/dist/index.d.ts +0 -15
- package/dist/index.esm.js +0 -13165
- package/dist/index.js +0 -13659
- package/dist/plugins/CullingPlugin.d.ts +0 -19
- package/dist/plugins/DirtyCheckPlugin.d.ts +0 -10
- package/dist/plugins/EventPlugin.d.ts +0 -26
- package/dist/plugins/FrustumCullingStrategy.d.ts +0 -21
- package/dist/plugins/PrepareRendererPlugin.d.ts +0 -6
- package/dist/property-handlers/__tests__/color.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/dimension.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/filter.spec.d.ts +0 -1
- package/dist/property-handlers/__tests__/transform.spec.d.ts +0 -1
- package/dist/property-handlers/aabb.d.ts +0 -2
- package/dist/property-handlers/anchor.d.ts +0 -3
- package/dist/property-handlers/clipPath.d.ts +0 -19
- package/dist/property-handlers/color.d.ts +0 -32
- package/dist/property-handlers/dimension.d.ts +0 -18
- package/dist/property-handlers/filter.d.ts +0 -9
- package/dist/property-handlers/index.d.ts +0 -17
- package/dist/property-handlers/interfaces.d.ts +0 -20
- package/dist/property-handlers/localPosition.d.ts +0 -2
- package/dist/property-handlers/numeric.d.ts +0 -5
- package/dist/property-handlers/offsetDistance.d.ts +0 -5
- package/dist/property-handlers/offsetPath.d.ts +0 -5
- package/dist/property-handlers/origin.d.ts +0 -11
- package/dist/property-handlers/path.d.ts +0 -5
- package/dist/property-handlers/points.d.ts +0 -6
- package/dist/property-handlers/transform.d.ts +0 -45
- package/dist/property-handlers/zIndex.d.ts +0 -2
- package/dist/services/ContextService.d.ts +0 -12
- package/dist/services/EventService.d.ts +0 -64
- package/dist/services/RenderingContext.d.ts +0 -28
- package/dist/services/RenderingService.d.ts +0 -51
- package/dist/services/SceneGraphSelector.d.ts +0 -20
- package/dist/services/SceneGraphService.d.ts +0 -146
- package/dist/services/aabb/CircleUpdater.d.ts +0 -10
- package/dist/services/aabb/EllipseUpdater.d.ts +0 -10
- package/dist/services/aabb/LineUpdater.d.ts +0 -10
- package/dist/services/aabb/PathUpdater.d.ts +0 -11
- package/dist/services/aabb/PolylineUpdater.d.ts +0 -10
- package/dist/services/aabb/RectUpdater.d.ts +0 -10
- package/dist/services/aabb/TextUpdater.d.ts +0 -13
- package/dist/services/aabb/index.d.ts +0 -8
- package/dist/services/aabb/interfaces.d.ts +0 -16
- package/dist/services/index.d.ts +0 -10
- package/dist/services/text/OffscreenCanvasCreator.d.ts +0 -6
- package/dist/services/text/index.d.ts +0 -35
- package/dist/shapes/AABB.d.ts +0 -33
- package/dist/shapes/BoundingSphere.d.ts +0 -8
- package/dist/shapes/Frustum.d.ts +0 -16
- package/dist/shapes/Plane.d.ts +0 -14
- package/dist/shapes/Point.d.ts +0 -11
- package/dist/shapes/Polygon.d.ts +0 -9
- package/dist/shapes/Ray.d.ts +0 -24
- package/dist/shapes/Rect.d.ts +0 -12
- package/dist/shapes/Rectangle.d.ts +0 -12
- package/dist/shapes/__tests__/aabb.spec.d.ts +0 -1
- package/dist/shapes/__tests__/boundingSphere.spec.d.ts +0 -1
- package/dist/shapes/__tests__/frustum.spec.d.ts +0 -1
- package/dist/shapes/__tests__/plane.spec.d.ts +0 -1
- package/dist/shapes/__tests__/ray.spec.d.ts +0 -1
- package/dist/shapes/index.d.ts +0 -8
- package/dist/types.d.ts +0 -219
- package/dist/utils/__tests__/event.spec.d.ts +0 -1
- package/dist/utils/__tests__/path.spec.d.ts +0 -1
- package/dist/utils/__tests__/raf.spec.d.ts +0 -1
- package/dist/utils/__tests__/text.spec.d.ts +0 -1
- package/dist/utils/animation.d.ts +0 -15
- package/dist/utils/bezier-easing.d.ts +0 -20
- package/dist/utils/canvas.d.ts +0 -5
- package/dist/utils/custom-easing.d.ts +0 -75
- package/dist/utils/event.d.ts +0 -11
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/interpolation.d.ts +0 -3
- package/dist/utils/math.d.ts +0 -22
- package/dist/utils/path.d.ts +0 -15
- package/dist/utils/raf.d.ts +0 -3
- package/dist/utils/text.d.ts +0 -2
package/dist/types.d.ts
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import type { vec2, vec3 } from 'gl-matrix';
|
|
2
|
-
import { ParsedPathStyleProps, ParsedPolylineStyleProps } from './display-objects';
|
|
3
|
-
import type { DisplayObject } from './display-objects';
|
|
4
|
-
import type { ParsedColorStyleProperty } from './property-handlers';
|
|
5
|
-
import type { IRenderer } from './AbstractRenderer';
|
|
6
|
-
export declare enum SHAPE {
|
|
7
|
-
Group = "group",
|
|
8
|
-
Circle = "circle",
|
|
9
|
-
Ellipse = "ellipse",
|
|
10
|
-
Image = "image",
|
|
11
|
-
Rect = "rect",
|
|
12
|
-
Line = "line",
|
|
13
|
-
Polyline = "polyline",
|
|
14
|
-
Polygon = "polygon",
|
|
15
|
-
Text = "text",
|
|
16
|
-
Path = "path",
|
|
17
|
-
HTML = "html"
|
|
18
|
-
}
|
|
19
|
-
declare type ColorType = string | null;
|
|
20
|
-
export interface EventPosition {
|
|
21
|
-
clientX: number;
|
|
22
|
-
clientY: number;
|
|
23
|
-
viewportX: number;
|
|
24
|
-
viewportY: number;
|
|
25
|
-
x: number;
|
|
26
|
-
y: number;
|
|
27
|
-
}
|
|
28
|
-
export declare const enum LINE_CAP {
|
|
29
|
-
Butt = "butt",
|
|
30
|
-
Round = "round",
|
|
31
|
-
Square = "square"
|
|
32
|
-
}
|
|
33
|
-
export declare const enum LINE_JOIN {
|
|
34
|
-
Bevel = "bevel",
|
|
35
|
-
Round = "round",
|
|
36
|
-
Miter = "miter"
|
|
37
|
-
}
|
|
38
|
-
export interface BaseStyleProps {
|
|
39
|
-
/**
|
|
40
|
-
* x in local space
|
|
41
|
-
*/
|
|
42
|
-
x?: number;
|
|
43
|
-
/**
|
|
44
|
-
* y in local space
|
|
45
|
-
*/
|
|
46
|
-
y?: number;
|
|
47
|
-
/**
|
|
48
|
-
* the origin of rotation and scaling, default to (0, 0)
|
|
49
|
-
*/
|
|
50
|
-
origin?: vec2 | vec3;
|
|
51
|
-
/**
|
|
52
|
-
* how do we define the 'position' of a shape?
|
|
53
|
-
* eg. the default anchor of a Rect is top-left, we can change it to its' center [0.5, 0.5].
|
|
54
|
-
*/
|
|
55
|
-
anchor?: vec2 | vec3;
|
|
56
|
-
/**
|
|
57
|
-
* visibility in CSS
|
|
58
|
-
*/
|
|
59
|
-
visibility?: 'visible' | 'hidden';
|
|
60
|
-
/**
|
|
61
|
-
* z-index in CSS
|
|
62
|
-
*/
|
|
63
|
-
zIndex?: number;
|
|
64
|
-
/**
|
|
65
|
-
* the cursor style when the target is active
|
|
66
|
-
*/
|
|
67
|
-
cursor?: Cursor;
|
|
68
|
-
/**
|
|
69
|
-
* clip path
|
|
70
|
-
* @see https://developer.mozilla.org/zh-CN/docs/Web/CSS/clip-path
|
|
71
|
-
*/
|
|
72
|
-
clipPath?: DisplayObject | null;
|
|
73
|
-
clipPathTargets?: DisplayObject[];
|
|
74
|
-
/**
|
|
75
|
-
* offset path
|
|
76
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Motion_Path
|
|
77
|
-
*/
|
|
78
|
-
offsetPath?: DisplayObject | null;
|
|
79
|
-
offsetPathTargets?: DisplayObject[];
|
|
80
|
-
/**
|
|
81
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform
|
|
82
|
-
*/
|
|
83
|
-
transform?: string;
|
|
84
|
-
/**
|
|
85
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin
|
|
86
|
-
*/
|
|
87
|
-
transformOrigin?: string;
|
|
88
|
-
stroke?: ColorType;
|
|
89
|
-
/** 描边透明度 */
|
|
90
|
-
strokeOpacity?: number;
|
|
91
|
-
/** 填充颜色 */
|
|
92
|
-
fill?: ColorType;
|
|
93
|
-
/** 填充透明度 */
|
|
94
|
-
fillOpacity?: number;
|
|
95
|
-
/** 整体透明度 */
|
|
96
|
-
opacity?: number;
|
|
97
|
-
/** 线宽 */
|
|
98
|
-
lineWidth?: number;
|
|
99
|
-
/** 指定如何绘制每一条线段末端 */
|
|
100
|
-
lineCap?: LINE_CAP;
|
|
101
|
-
/** 用来设置2个长度不为0的相连部分(线段,圆弧,曲线)如何连接在一起的属性(长度为0的变形部分,其指定的末端和控制点在同一位置,会被忽略) */
|
|
102
|
-
lineJoin?: LINE_JOIN;
|
|
103
|
-
/**
|
|
104
|
-
* 设置线的虚线样式,可以指定一个数组。一组描述交替绘制线段和间距(坐标空间单位)长度的数字。 如果数组元素的数量是奇数, 数组的元素会被复制并重复。例如, [5, 15, 25] 会变成 [5, 15, 25, 5, 15, 25]。这个属性取决于浏览器是否支持 setLineDash() 函数。
|
|
105
|
-
*/
|
|
106
|
-
lineDash?: number[] | null;
|
|
107
|
-
padding?: number[] | number;
|
|
108
|
-
/**
|
|
109
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowBlur
|
|
110
|
-
*/
|
|
111
|
-
shadowBlur?: number;
|
|
112
|
-
/**
|
|
113
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/shadowColor
|
|
114
|
-
*/
|
|
115
|
-
shadowColor?: ColorType;
|
|
116
|
-
/** 阴影 x 方向偏移量 */
|
|
117
|
-
shadowOffsetX?: number;
|
|
118
|
-
/** 阴影 y 方向偏移量 */
|
|
119
|
-
shadowOffsetY?: number;
|
|
120
|
-
/**
|
|
121
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/filter
|
|
122
|
-
*/
|
|
123
|
-
filter?: string;
|
|
124
|
-
}
|
|
125
|
-
export interface ParsedBaseStyleProps extends Omit<BaseStyleProps, 'fill' | 'stroke' | 'path' | 'points'> {
|
|
126
|
-
fill?: ParsedColorStyleProperty;
|
|
127
|
-
stroke?: ParsedColorStyleProperty;
|
|
128
|
-
path?: ParsedPathStyleProps;
|
|
129
|
-
points?: ParsedPolylineStyleProps;
|
|
130
|
-
x?: number;
|
|
131
|
-
y?: number;
|
|
132
|
-
width?: number;
|
|
133
|
-
height?: number;
|
|
134
|
-
/**
|
|
135
|
-
* x according to definition, eg. Line's x1/x2, Polyline's points
|
|
136
|
-
*/
|
|
137
|
-
defX?: number;
|
|
138
|
-
defY?: number;
|
|
139
|
-
/**
|
|
140
|
-
* offset relative to initial definition
|
|
141
|
-
*/
|
|
142
|
-
offsetX?: number;
|
|
143
|
-
offsetY?: number;
|
|
144
|
-
}
|
|
145
|
-
export declare type Cursor = 'auto' | 'default' | 'none' | 'context-menu' | 'help' | 'pointer' | 'progress' | 'wait' | 'cell' | 'crosshair' | 'text' | 'vertical-text' | 'alias' | 'copy' | 'move' | 'no-drop' | 'not-allowed' | 'grab' | 'grabbing' | 'all-scroll' | 'col-resize' | 'row-resize' | 'n-resize' | 'e-resize' | 's-resize' | 'w-resize' | 'ne-resize' | 'nw-resize' | 'se-resize' | 'sw-resize' | 'ew-resize' | 'ns-resize' | 'nesw-resize' | 'nwse-resize' | 'zoom-in' | 'zoom-out';
|
|
146
|
-
export interface RendererConfig {
|
|
147
|
-
/**
|
|
148
|
-
* enable dirty rectangle rendering
|
|
149
|
-
*/
|
|
150
|
-
enableDirtyRectangleRendering: boolean;
|
|
151
|
-
enableDirtyRectangleRenderingDebug: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* enable auto rendering
|
|
154
|
-
*/
|
|
155
|
-
enableAutoRendering: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* enable TAA in WebGL
|
|
158
|
-
*/
|
|
159
|
-
enableTAA: boolean;
|
|
160
|
-
}
|
|
161
|
-
export declare const CanvasConfig = "CanvasConfig";
|
|
162
|
-
export interface CanvasConfig {
|
|
163
|
-
/**
|
|
164
|
-
* Renderer
|
|
165
|
-
*/
|
|
166
|
-
renderer: IRenderer;
|
|
167
|
-
/**
|
|
168
|
-
* 容器
|
|
169
|
-
* @type {string|HTMLElement}
|
|
170
|
-
*/
|
|
171
|
-
container: string | HTMLElement;
|
|
172
|
-
/**
|
|
173
|
-
* 画布宽度
|
|
174
|
-
* @type {number}
|
|
175
|
-
*/
|
|
176
|
-
width: number;
|
|
177
|
-
/**
|
|
178
|
-
* 画布高度
|
|
179
|
-
* @type {number}
|
|
180
|
-
*/
|
|
181
|
-
height: number;
|
|
182
|
-
/**
|
|
183
|
-
* 是否可监听
|
|
184
|
-
* @type {boolean}
|
|
185
|
-
*/
|
|
186
|
-
capture?: boolean;
|
|
187
|
-
/**
|
|
188
|
-
* 画布的 cursor 样式
|
|
189
|
-
* @type {Cursor}
|
|
190
|
-
*/
|
|
191
|
-
cursor?: Cursor;
|
|
192
|
-
[key: string]: any;
|
|
193
|
-
}
|
|
194
|
-
export declare type ChangeType = 'changeSize' | 'add' | 'sort' | 'clear' | 'attr' | 'show' | 'hide' | 'zIndex' | 'remove' | 'matrix' | 'clip';
|
|
195
|
-
declare type A = ['a' | 'A', number, number, number, number, number, number, number];
|
|
196
|
-
declare type C = ['c' | 'C', number, number, number, number, number, number];
|
|
197
|
-
declare type O = ['o' | 'O', number, number];
|
|
198
|
-
declare type H = ['h' | 'H', number];
|
|
199
|
-
declare type L = ['l' | 'L', number, number];
|
|
200
|
-
declare type M = ['m' | 'M', number, number];
|
|
201
|
-
declare type R = ['r' | 'R', number, number, number, number];
|
|
202
|
-
declare type Q = ['q' | 'Q', number, number, number, number];
|
|
203
|
-
declare type S = ['s' | 'S', number, number, number, number, number, number, number];
|
|
204
|
-
declare type T = ['t' | 'T', number, number];
|
|
205
|
-
declare type V = ['v' | 'V', number];
|
|
206
|
-
declare type U = ['u' | 'U', number, number, number];
|
|
207
|
-
declare type Z = ['z' | 'Z'];
|
|
208
|
-
export declare type PathCommand = A | C | O | H | L | M | R | Q | S | T | V | U | Z;
|
|
209
|
-
export declare type InteractivePointerEvent = PointerEvent | TouchEvent | MouseEvent | WheelEvent;
|
|
210
|
-
export declare type Tuple4<T> = [T, T, T, T];
|
|
211
|
-
export declare type Tuple4Number = Tuple4<number>;
|
|
212
|
-
export declare type ComninedValue<T> = T | [T] | [T, T] | [T, T, T] | Tuple4<T>;
|
|
213
|
-
export declare type CombinedNumber = ComninedValue<number>;
|
|
214
|
-
export declare type Length = number;
|
|
215
|
-
declare type Digit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
|
|
216
|
-
export declare type Percentage = `${Digit}%` | `${Digit}${Digit}%`;
|
|
217
|
-
export declare type LengthOrPercentage = Length | Percentage;
|
|
218
|
-
export declare type LengthOrPercentageOrAuto = Length | Percentage | 'auto';
|
|
219
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { AnimationEffectTiming } from '../dom/AnimationEffectTiming';
|
|
2
|
-
export declare const linear: (x: number) => number;
|
|
3
|
-
export declare function parseEasingFunction(normalizedEasing: string): import("./custom-easing").TypeEasingFunction;
|
|
4
|
-
export declare function calculateActiveDuration(timing: EffectTiming): number;
|
|
5
|
-
export declare function calculateIterationProgress(activeDuration: number, localTime: number, timing: AnimationEffectTiming): number;
|
|
6
|
-
/**
|
|
7
|
-
* From: [https://easings.net]
|
|
8
|
-
* Read More about easings on [MDN](https://developer.mozilla.org/en-US/docs/Web/API/EffectTiming/easing)
|
|
9
|
-
*/
|
|
10
|
-
export declare const EASINGS: Record<string, string>;
|
|
11
|
-
export declare const EasingKeys: string[];
|
|
12
|
-
/**
|
|
13
|
-
* Converts users input into a usable easing function string
|
|
14
|
-
*/
|
|
15
|
-
export declare const getEase: (ease?: keyof typeof EASINGS | string) => string;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* https://github.com/gre/bezier-easing
|
|
3
|
-
* BezierEasing - use bezier curve for transition easing function
|
|
4
|
-
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
|
|
5
|
-
*/
|
|
6
|
-
export declare const NEWTON_ITERATIONS = 4;
|
|
7
|
-
export declare const NEWTON_MIN_SLOPE = 0.001;
|
|
8
|
-
export declare const SUBDIVISION_PRECISION = 1e-7;
|
|
9
|
-
export declare const SUBDIVISION_MAX_ITERATIONS = 10;
|
|
10
|
-
export declare const kSplineTableSize = 11;
|
|
11
|
-
export declare const kSampleStepSize: number;
|
|
12
|
-
export declare const float32ArraySupported: boolean;
|
|
13
|
-
export declare const A: (aA1: number, aA2: number) => number;
|
|
14
|
-
export declare const B: (aA1: number, aA2: number) => number;
|
|
15
|
-
export declare const C: (aA1: number) => number;
|
|
16
|
-
export declare const calcBezier: (aT: number, aA1: number, aA2: number) => number;
|
|
17
|
-
export declare const getSlope: (aT: number, aA1: number, aA2: number) => number;
|
|
18
|
-
export declare const binarySubdivide: (aX: number, aA: number, aB: number, mX1: number, mX2: number) => number;
|
|
19
|
-
export declare const newtonRaphsonIterate: (aX: number, aGuessT: number, mX1: number, mX2: number) => number;
|
|
20
|
-
export declare const bezier: (mX1: number, mY1: number, mX2: number, mY2: number) => (t: number) => number;
|
package/dist/utils/canvas.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
export declare const convertToDash: (str: string) => string;
|
|
2
|
-
export declare const limit: (value: number, min: number, max: number) => number;
|
|
3
|
-
/**
|
|
4
|
-
* The format to use when defining custom easing functions
|
|
5
|
-
*/
|
|
6
|
-
export declare type TypeEasingFunction = (t: number, params?: (string | number)[], duration?: number) => number;
|
|
7
|
-
export declare type TypeColor = string | number | Array<string | number>;
|
|
8
|
-
export declare type TypeRGBAFunction = (color: TypeColor) => number[];
|
|
9
|
-
/**
|
|
10
|
-
Easing Functions from anime.js, they are tried and true, so, its better to use them instead of other alternatives
|
|
11
|
-
*/
|
|
12
|
-
export declare const Quad: TypeEasingFunction;
|
|
13
|
-
export declare const Cubic: TypeEasingFunction;
|
|
14
|
-
export declare const Quart: TypeEasingFunction;
|
|
15
|
-
export declare const Quint: TypeEasingFunction;
|
|
16
|
-
export declare const Expo: TypeEasingFunction;
|
|
17
|
-
export declare const Sine: TypeEasingFunction;
|
|
18
|
-
export declare const Circ: TypeEasingFunction;
|
|
19
|
-
export declare const Back: TypeEasingFunction;
|
|
20
|
-
export declare const Bounce: TypeEasingFunction;
|
|
21
|
-
export declare const Elastic: TypeEasingFunction;
|
|
22
|
-
export declare const Spring: TypeEasingFunction;
|
|
23
|
-
/**
|
|
24
|
-
* Cache the durations at set easing parameters
|
|
25
|
-
*/
|
|
26
|
-
export declare const EasingDurationCache: Map<string | TypeEasingFunction, number>;
|
|
27
|
-
/**
|
|
28
|
-
* The threshold for an infinite loop
|
|
29
|
-
*/
|
|
30
|
-
export declare const INTINITE_LOOP_LIMIT = 10000;
|
|
31
|
-
/** Convert easing parameters to Array of numbers, e.g. "spring(2, 500)" to [2, 500] */
|
|
32
|
-
export declare const parseEasingParameters: (str: string) => (string | number)[];
|
|
33
|
-
/**
|
|
34
|
-
* The spring easing function will only look smooth at certain durations, with certain parameters.
|
|
35
|
-
* This functions returns the optimal duration to create a smooth springy animation based on physics
|
|
36
|
-
*
|
|
37
|
-
* Note: it can also be used to determine the optimal duration of other types of easing function, but be careful of 'in-'
|
|
38
|
-
* easing functions, because of the nature of the function it can sometimes create an infinite loop, I suggest only using
|
|
39
|
-
* `getEasingDuration` for `spring`, specifically 'out-spring' and 'spring'
|
|
40
|
-
*/
|
|
41
|
-
export declare const getEasingDuration: (easing?: string | TypeEasingFunction) => number;
|
|
42
|
-
/**
|
|
43
|
-
These Easing Functions are based off of the Sozi Project's easing functions
|
|
44
|
-
https://github.com/sozi-projects/Sozi/blob/d72e44ebd580dc7579d1e177406ad41e632f961d/src/js/player/Timing.js
|
|
45
|
-
*/
|
|
46
|
-
export declare const Steps: TypeEasingFunction;
|
|
47
|
-
export declare const Bezier: TypeEasingFunction;
|
|
48
|
-
/** The default `ease-in` easing function */
|
|
49
|
-
export declare const easein: TypeEasingFunction;
|
|
50
|
-
/** Converts easing functions to their `out`counter parts */
|
|
51
|
-
export declare const EaseOut: (ease: TypeEasingFunction) => TypeEasingFunction;
|
|
52
|
-
/** Converts easing functions to their `in-out` counter parts */
|
|
53
|
-
export declare const EaseInOut: (ease: TypeEasingFunction) => TypeEasingFunction;
|
|
54
|
-
/** Converts easing functions to their `out-in` counter parts */
|
|
55
|
-
export declare const EaseOutIn: (ease: TypeEasingFunction) => TypeEasingFunction;
|
|
56
|
-
/**
|
|
57
|
-
* The default list of easing functions, do note this is different from {@link EASING}
|
|
58
|
-
*/
|
|
59
|
-
export declare const EasingFunctions: {
|
|
60
|
-
[key: string]: TypeEasingFunction;
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Convert string easing to their proper form
|
|
64
|
-
*/
|
|
65
|
-
export declare const complexEasingSyntax: (ease: string) => string;
|
|
66
|
-
/** Re-maps a number from one range to another. Numbers outside the range are not clamped to 0 and 1, because out-of-range values are often intentional and useful. */
|
|
67
|
-
export declare const getEasingFunction: (ease: string) => TypeEasingFunction;
|
|
68
|
-
/**
|
|
69
|
-
* Allows you to register new easing functions
|
|
70
|
-
*/
|
|
71
|
-
export declare const registerEasingFunction: (key: string, fn: TypeEasingFunction) => void;
|
|
72
|
-
/**
|
|
73
|
-
* Allows you to register multiple new easing functions
|
|
74
|
-
*/
|
|
75
|
-
export declare const registerEasingFunctions: (...obj: Array<typeof EasingFunctions>) => void;
|
package/dist/utils/event.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { InteractivePointerEvent } from '../types';
|
|
2
|
-
export declare const supportsTouchEvents: boolean;
|
|
3
|
-
export declare const supportsPointerEvents: boolean;
|
|
4
|
-
export declare const MOUSE_POINTER_ID = 1;
|
|
5
|
-
export declare const TOUCH_TO_POINTER: Record<string, string>;
|
|
6
|
-
export declare function isTouchEvent(event: InteractivePointerEvent): event is TouchEvent;
|
|
7
|
-
export declare function isMouseEvent(event: InteractivePointerEvent): event is MouseEvent;
|
|
8
|
-
/**
|
|
9
|
-
* borrow from pixi/events
|
|
10
|
-
*/
|
|
11
|
-
export declare function normalizeToPointerEvent(event: InteractivePointerEvent): PointerEvent[];
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { AnimationEffectTiming } from '../dom';
|
|
2
|
-
import type { IElement } from '../dom/interfaces';
|
|
3
|
-
export declare function convertEffectInput(keyframes: ComputedKeyframe[], timing: AnimationEffectTiming, target: IElement | null): (target: IElement, fraction: number) => void;
|
package/dist/utils/math.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { mat3, mat4, quat, vec2, vec3, vec4 } from 'gl-matrix';
|
|
2
|
-
export declare function getAngle(angle: number | undefined): number;
|
|
3
|
-
export declare function createVec3(x: number | vec2 | vec3 | vec4, y?: number, z?: number): vec3;
|
|
4
|
-
export declare function deg2rad(deg: number): number;
|
|
5
|
-
export declare function rad2deg(rad: number): number;
|
|
6
|
-
/**
|
|
7
|
-
* decompose mat3
|
|
8
|
-
* extract translation/scaling/rotation(in radians)
|
|
9
|
-
*
|
|
10
|
-
* gl-matrix didn't provide them for mat3, but we can
|
|
11
|
-
* @see https://math.stackexchange.com/a/1463487
|
|
12
|
-
* @see https://math.stackexchange.com/a/417813
|
|
13
|
-
*/
|
|
14
|
-
export declare function getScaling(out: vec2, mat: mat3): vec2;
|
|
15
|
-
export declare function getTranslation(out: vec2, mat: mat3): vec2;
|
|
16
|
-
export declare function getRotationInRadians(mat: mat3): number;
|
|
17
|
-
/**
|
|
18
|
-
* @see https://github.com/toji/gl-matrix/issues/329
|
|
19
|
-
* @see https://doc.babylonjs.com/divingDeeper/mesh/transforms/center_origin/rotation_conventions
|
|
20
|
-
*/
|
|
21
|
-
export declare function getEuler(out: vec3, quat: quat | mat4): vec3;
|
|
22
|
-
export declare function fromRotationTranslationScale(rotation: number, x: number, y: number, scaleX: number, scaleY: number): mat3;
|
package/dist/utils/path.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { DisplayObject } from '../display-objects/DisplayObject';
|
|
2
|
-
import { PathCommand } from '../types';
|
|
3
|
-
export declare function equalizeSegments(path1: PathCommand[], path2: PathCommand[], TL?: number): PathCommand[][];
|
|
4
|
-
export declare function getDrawDirection(pathArray: PathCommand[]): boolean;
|
|
5
|
-
export declare function getPathArea(pathArray: PathCommand[]): number;
|
|
6
|
-
export declare function reverseCurve(pathArray: PathCommand[]): PathCommand[];
|
|
7
|
-
export declare function clonePath(pathArray: PathCommand[]): PathCommand[];
|
|
8
|
-
export declare function getRotatedCurve(a: PathCommand[], b: PathCommand[]): (["a" | "A", number, number, number, number, number, number, number] | ["C" | "c", number, number, number, number, number, number] | ["o" | "O", number, number] | ["h" | "H", number] | ["l" | "L", number, number] | ["m" | "M", number, number] | ["r" | "R", number, number, number, number] | ["q" | "Q", number, number, number, number] | ["s" | "S", number, number, number, number, number, number, number] | ["t" | "T", number, number] | ["v" | "V", number] | ["u" | "U", number, number, number] | string[])[];
|
|
9
|
-
/**
|
|
10
|
-
* convert object to path, should account for:
|
|
11
|
-
* * transform & origin
|
|
12
|
-
* * anchor
|
|
13
|
-
* * lineWidth
|
|
14
|
-
*/
|
|
15
|
-
export declare function convertToPath(object: DisplayObject): string;
|
package/dist/utils/raf.d.ts
DELETED
package/dist/utils/text.d.ts
DELETED