vislite 0.5.2-alpha.1 → 0.5.2
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/.editorconfig +18 -18
- package/AUTHORS.txt +6 -6
- package/CHANGELOG +143 -137
- package/LICENSE +20 -20
- package/README.md +69 -69
- package/lib/Buffer/index.umd.js +36 -36
- package/lib/Buffer/index.umd.min.js +2 -2
- package/lib/Canvas/index.umd.js +650 -650
- package/lib/Canvas/index.umd.min.js +2 -2
- package/lib/Cardinal/index.umd.js +91 -91
- package/lib/Cardinal/index.umd.min.js +2 -2
- package/lib/Eoap/index.umd.js +34 -34
- package/lib/Eoap/index.umd.min.js +2 -2
- package/lib/Geometry/index.umd.js +142 -142
- package/lib/Geometry/index.umd.min.js +2 -2
- package/lib/Hermite/index.umd.js +36 -36
- package/lib/Hermite/index.umd.min.js +2 -2
- package/lib/Matrix4/index.umd.js +119 -119
- package/lib/Matrix4/index.umd.min.js +2 -2
- package/lib/Mercator/index.umd.js +20 -20
- package/lib/Mercator/index.umd.min.js +2 -2
- package/lib/OralCanvas/index.es.js +598 -598
- package/lib/OralCanvas/index.es.min.js +2 -2
- package/lib/OralWebGL/index.es.js +532 -532
- package/lib/OralWebGL/index.es.min.js +3 -3
- package/lib/SVG/index.umd.js +470 -405
- package/lib/SVG/index.umd.min.js +3 -3
- package/lib/Shader/index.umd.js +69 -69
- package/lib/Shader/index.umd.min.js +3 -3
- package/lib/Texture/index.umd.js +53 -53
- package/lib/Texture/index.umd.min.js +2 -2
- package/lib/TreeLayout/index.umd.js +363 -363
- package/lib/TreeLayout/index.umd.min.js +2 -2
- package/lib/WebGL/index.umd.js +579 -579
- package/lib/WebGL/index.umd.min.js +3 -3
- package/lib/animation/index.umd.js +72 -72
- package/lib/animation/index.umd.min.js +2 -2
- package/lib/formatColor/index.umd.js +40 -40
- package/lib/formatColor/index.umd.min.js +2 -2
- package/lib/getLoopColors/index.umd.js +36 -36
- package/lib/getLoopColors/index.umd.min.js +2 -2
- package/lib/getWebGLContext/index.umd.js +44 -44
- package/lib/getWebGLContext/index.umd.min.js +2 -2
- package/lib/index.umd.js +2744 -2662
- package/lib/index.umd.min.js +3 -3
- package/lib/move/index.umd.js +27 -0
- package/lib/move/index.umd.min.js +11 -0
- package/lib/resizeObserver/index.umd.js +29 -29
- package/lib/resizeObserver/index.umd.min.js +2 -2
- package/lib/rotate/index.umd.js +8 -8
- package/lib/rotate/index.umd.min.js +2 -2
- package/lib/ruler/index.umd.js +126 -126
- package/lib/ruler/index.umd.min.js +2 -2
- package/lib/scale/index.umd.js +26 -0
- package/lib/scale/index.umd.min.js +11 -0
- package/lib/throttle/index.umd.js +49 -49
- package/lib/throttle/index.umd.min.js +2 -2
- package/lib/viewHandler/index.umd.js +120 -120
- package/lib/viewHandler/index.umd.min.js +2 -2
- package/miniprogram/ui-canvas/index.js +107 -107
- package/miniprogram/ui-canvas/index.json +4 -4
- package/miniprogram/ui-canvas/index.wxml +4 -4
- package/miniprogram/ui-canvas/index.wxss +5 -5
- package/package/Buffer/index.ts +2 -2
- package/package/Canvas/index.ts +2 -2
- package/package/Cardinal/index.ts +2 -2
- package/package/Eoap/index.ts +2 -2
- package/package/Geometry/index.ts +2 -2
- package/package/Hermite/index.ts +2 -2
- package/package/Matrix4/index.ts +2 -2
- package/package/Mercator/index.ts +2 -2
- package/package/OralCanvas/index.ts +2 -2
- package/package/OralWebGL/index.ts +2 -2
- package/package/SVG/index.ts +2 -2
- package/package/Shader/index.ts +39 -39
- package/package/Texture/index.ts +2 -2
- package/package/TreeLayout/index.ts +2 -2
- package/package/WebGL/index.ts +2 -2
- package/package/animation/index.ts +2 -2
- package/package/formatColor/index.ts +2 -2
- package/package/getLoopColors/index.ts +2 -2
- package/package/getWebGLContext/index.ts +39 -39
- package/package/index.ts +76 -72
- package/package/move/index.ts +3 -0
- package/package/resizeObserver/index.ts +2 -2
- package/package/rotate/index.ts +2 -2
- package/package/ruler/index.ts +2 -2
- package/package/scale/index.ts +3 -0
- package/package/throttle/index.ts +2 -2
- package/package/viewHandler/index.ts +2 -2
- package/package.json +66 -66
- package/src/Canvas.ts +67 -67
- package/src/Eoap.ts +66 -66
- package/src/Geometry.ts +82 -82
- package/src/Matrix4/index.ts +76 -76
- package/src/Matrix4/move.ts +12 -12
- package/src/Matrix4/rotate.ts +15 -15
- package/src/Matrix4/scale.ts +11 -11
- package/src/Matrix4/transform.ts +64 -64
- package/src/Mercator.ts +27 -27
- package/src/SVG.ts +24 -24
- package/src/TreeLayout/index.ts +186 -186
- package/src/WebGL.ts +66 -66
- package/src/animation.ts +98 -98
- package/src/common/assemble.ts +22 -22
- package/src/common/canvas/arc.ts +50 -50
- package/src/common/canvas/config.ts +158 -158
- package/src/common/canvas/gradient.ts +29 -29
- package/src/common/canvas/index.ts +168 -168
- package/src/common/canvas/painter.ts +426 -426
- package/src/common/canvas/texts.ts +18 -18
- package/src/common/geometry/prism-horizontal.ts +33 -33
- package/src/common/geometry/prism-vertical.ts +40 -40
- package/src/common/geometry/sphere-fragment.ts +39 -39
- package/src/common/geometry/tool/circle.ts +11 -11
- package/src/common/mergeOption.ts +6 -6
- package/src/common/setStyle.ts +5 -5
- package/src/common/svg/config.ts +186 -174
- package/src/common/svg/gradient.ts +63 -0
- package/src/common/svg/index.ts +356 -344
- package/src/common/svg/tool.ts +44 -44
- package/src/common/tree/index.ts +25 -25
- package/src/common/tree/toInnerTree.ts +56 -56
- package/src/common/tree/toPlainTree.ts +131 -131
- package/src/common/webgl/buffer.ts +79 -79
- package/src/common/webgl/doDraw.ts +108 -108
- package/src/common/webgl/getColorFactory.ts +26 -26
- package/src/common/webgl/getShader.ts +48 -48
- package/src/common/webgl/getTexture.ts +11 -11
- package/src/common/webgl/getWebGLContext.ts +27 -27
- package/src/common/webgl/index.ts +223 -223
- package/src/common/webgl/shader.ts +75 -75
- package/src/common/webgl/texture.ts +96 -96
- package/src/formatColor.ts +44 -44
- package/src/getLoopColors.ts +42 -42
- package/src/interpolation/Cardinal.ts +110 -110
- package/src/interpolation/Hermite.ts +65 -65
- package/src/move.ts +8 -0
- package/src/resizeObserver.ts +36 -36
- package/src/rotate.ts +7 -7
- package/src/ruler.ts +188 -188
- package/src/scale.ts +7 -0
- package/src/shader/fsColor.c +7 -7
- package/src/shader/fsColors.c +7 -7
- package/src/shader/fsCube.c +8 -8
- package/src/shader/fsImage.c +8 -8
- package/src/shader/vsColor.c +17 -17
- package/src/shader/vsColors.c +13 -13
- package/src/shader/vsCube.c +13 -13
- package/src/shader/vsImage.c +13 -13
- package/src/throttle.ts +51 -51
- package/src/viewHandler.ts +158 -158
- package/types/Buffer.d.ts +23 -23
- package/types/Canvas.d.ts +300 -300
- package/types/CanvasConfig.d.ts +106 -106
- package/types/CanvasOption.d.ts +7 -7
- package/types/Cardinal.d.ts +13 -13
- package/types/Geometry.d.ts +40 -40
- package/types/GeometryOption.d.ts +11 -11
- package/types/GeometryResult.d.ts +18 -18
- package/types/Gradient.d.ts +14 -14
- package/types/Hermite.d.ts +18 -18
- package/types/Map.d.ts +9 -9
- package/types/Matrix4.d.ts +42 -42
- package/types/Object3D.d.ts +114 -114
- package/types/SVG.d.ts +238 -215
- package/types/SVGConfig.d.ts +76 -76
- package/types/Scene3D.d.ts +6 -6
- package/types/Shader.d.ts +21 -21
- package/types/Texture.d.ts +16 -16
- package/types/Tree.d.ts +69 -69
- package/types/TreeConfig.d.ts +24 -24
- package/types/TreeLayout.d.ts +54 -54
- package/types/TreeOption.d.ts +48 -48
- package/types/WebGL.d.ts +38 -38
- package/types/WebGLOption.d.ts +7 -7
- package/types/animation.d.ts +6 -6
- package/types/formatColor.d.ts +2 -2
- package/types/getLoopColors.d.ts +2 -2
- package/types/getWebGLContext.d.ts +2 -2
- package/types/index.d.ts +175 -169
- package/types/move.d.ts +3 -0
- package/types/painterConfig.d.ts +2 -2
- package/types/resizeObserver.d.ts +2 -2
- package/types/rotate.d.ts +2 -2
- package/types/ruler.d.ts +7 -7
- package/types/scale.d.ts +3 -0
- package/types/throttle.d.ts +4 -4
- package/types/throttleOption.d.ts +21 -21
- package/types/viewHandler.d.ts +13 -13
- package/uni-app/ui-canvas.vue +226 -226
package/types/index.d.ts
CHANGED
|
@@ -1,170 +1,176 @@
|
|
|
1
|
-
import CardinalType from './Cardinal'
|
|
2
|
-
import HermiteType from './Hermite'
|
|
3
|
-
|
|
4
|
-
import Matrix4Type from './Matrix4'
|
|
5
|
-
import rotateType from './rotate'
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
import
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
import
|
|
27
|
-
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
import
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
import
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
static
|
|
101
|
-
static
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
static
|
|
107
|
-
static
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
static
|
|
112
|
-
static
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
static
|
|
118
|
-
static
|
|
119
|
-
|
|
120
|
-
//
|
|
121
|
-
static
|
|
122
|
-
static
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
static
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
//
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
//
|
|
137
|
-
export let
|
|
138
|
-
export let
|
|
139
|
-
|
|
140
|
-
//
|
|
141
|
-
export let
|
|
142
|
-
export let
|
|
143
|
-
export let
|
|
144
|
-
export let
|
|
145
|
-
|
|
146
|
-
//
|
|
147
|
-
export let
|
|
148
|
-
export let
|
|
149
|
-
export let
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
export let
|
|
154
|
-
export let
|
|
155
|
-
export let
|
|
156
|
-
|
|
157
|
-
//
|
|
158
|
-
export let
|
|
159
|
-
export let
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
export let
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
1
|
+
import CardinalType from './Cardinal'
|
|
2
|
+
import HermiteType from './Hermite'
|
|
3
|
+
|
|
4
|
+
import Matrix4Type from './Matrix4'
|
|
5
|
+
import rotateType from './rotate'
|
|
6
|
+
import moveType from './move'
|
|
7
|
+
import scaleType from './scale'
|
|
8
|
+
|
|
9
|
+
import getLoopColorsType from './getLoopColors'
|
|
10
|
+
import formatColorType from './formatColor'
|
|
11
|
+
import animationType from './animation'
|
|
12
|
+
import rulerType from './ruler'
|
|
13
|
+
|
|
14
|
+
import SVGType from './SVG'
|
|
15
|
+
import CanvasType from './Canvas'
|
|
16
|
+
import WebGLType from './WebGL'
|
|
17
|
+
|
|
18
|
+
import CanvasOptionType from './CanvasOption'
|
|
19
|
+
import WebGLOptionType from './WebGLOption'
|
|
20
|
+
|
|
21
|
+
import getWebGLContextType from './getWebGLContext'
|
|
22
|
+
import ShaderType from './Shader'
|
|
23
|
+
import BufferType from './Buffer'
|
|
24
|
+
import TextureType from './Texture'
|
|
25
|
+
|
|
26
|
+
import MapType from './Map'
|
|
27
|
+
|
|
28
|
+
import viewHandlerType from './viewHandler'
|
|
29
|
+
import throttleType from './throttle'
|
|
30
|
+
import resizeObserverType from './resizeObserver'
|
|
31
|
+
|
|
32
|
+
import TreeLayoutType from './TreeLayout'
|
|
33
|
+
import TreeConfigType from './TreeConfig'
|
|
34
|
+
|
|
35
|
+
import GeometryType from './Geometry'
|
|
36
|
+
import GeometryOptionType from './GeometryOption'
|
|
37
|
+
|
|
38
|
+
// 插值
|
|
39
|
+
interface NewCardinalType extends CardinalType {
|
|
40
|
+
new(t?: number): this
|
|
41
|
+
}
|
|
42
|
+
interface NewHermiteType extends HermiteType {
|
|
43
|
+
new(u?: number): this
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// 变换
|
|
47
|
+
interface NewMatrix4Type extends Matrix4Type {
|
|
48
|
+
new(initMatrix4?: number[]): this
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// 画笔
|
|
52
|
+
interface NewSVGType extends SVGType {
|
|
53
|
+
new(el: HTMLElement | null): this
|
|
54
|
+
}
|
|
55
|
+
interface NewCanvasType extends CanvasType {
|
|
56
|
+
new(el: HTMLElement | null, option?: CanvasOptionType): this
|
|
57
|
+
}
|
|
58
|
+
interface NewWebGLType extends WebGLType {
|
|
59
|
+
new(el: HTMLElement | null, option?: WebGLOptionType): this
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// WebGL
|
|
63
|
+
interface NewShaderType extends ShaderType {
|
|
64
|
+
new(painter: WebGLRenderingContext): this
|
|
65
|
+
}
|
|
66
|
+
interface NewBufferType extends BufferType {
|
|
67
|
+
new(painter: WebGLRenderingContext, isElement?: boolean): this
|
|
68
|
+
}
|
|
69
|
+
interface NewTextureType extends TextureType {
|
|
70
|
+
new(painter: WebGLRenderingContext, type: string, unit?: number): this
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// 投影
|
|
74
|
+
interface NewEoapType extends MapType {
|
|
75
|
+
new(scale?: number, center?: number[]): this
|
|
76
|
+
}
|
|
77
|
+
interface NewMercatorType extends MapType {
|
|
78
|
+
new(scale?: number, center?: number[]): this
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 布局
|
|
82
|
+
interface NewTreeLayoutType extends TreeLayoutType {
|
|
83
|
+
new(config?: TreeConfigType): this
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 几何&模型数据
|
|
87
|
+
interface NewGeometryType extends GeometryType {
|
|
88
|
+
new(option?: GeometryOptionType): this
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export default class VISLite {
|
|
92
|
+
|
|
93
|
+
// 插值
|
|
94
|
+
static Cardinal: NewCardinalType
|
|
95
|
+
static Hermite: NewHermiteType
|
|
96
|
+
|
|
97
|
+
// 变换
|
|
98
|
+
static Matrix4: NewMatrix4Type
|
|
99
|
+
static rotate: rotateType
|
|
100
|
+
static move: moveType
|
|
101
|
+
static scale: scaleType
|
|
102
|
+
|
|
103
|
+
// 工具
|
|
104
|
+
static getLoopColors: getLoopColorsType
|
|
105
|
+
static formatColor: formatColorType
|
|
106
|
+
static animation: animationType
|
|
107
|
+
static ruler: rulerType
|
|
108
|
+
|
|
109
|
+
// 画笔
|
|
110
|
+
static SVG: NewSVGType
|
|
111
|
+
static Canvas: NewCanvasType
|
|
112
|
+
static WebGL: NewWebGLType
|
|
113
|
+
|
|
114
|
+
// WebGL
|
|
115
|
+
static getWebGLContext: getWebGLContextType
|
|
116
|
+
static Shader: NewShaderType
|
|
117
|
+
static Buffer: NewBufferType
|
|
118
|
+
static Texture: NewTextureType
|
|
119
|
+
|
|
120
|
+
// 投影
|
|
121
|
+
static Eoap: NewEoapType
|
|
122
|
+
static Mercator: NewMercatorType
|
|
123
|
+
|
|
124
|
+
// 辅助
|
|
125
|
+
static viewHandler: viewHandlerType
|
|
126
|
+
static throttle: throttleType
|
|
127
|
+
static resizeObserver: resizeObserverType
|
|
128
|
+
|
|
129
|
+
// 布局
|
|
130
|
+
static TreeLayout: NewTreeLayoutType
|
|
131
|
+
|
|
132
|
+
// 几何&模型数据
|
|
133
|
+
static Geometry: NewGeometryType
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// 插值
|
|
137
|
+
export let Cardinal: NewCardinalType
|
|
138
|
+
export let Hermite: NewHermiteType
|
|
139
|
+
|
|
140
|
+
// 变换
|
|
141
|
+
export let Matrix4: NewMatrix4Type
|
|
142
|
+
export let rotate: rotateType
|
|
143
|
+
export let move: moveType
|
|
144
|
+
export let scale: scaleType
|
|
145
|
+
|
|
146
|
+
// 工具
|
|
147
|
+
export let getLoopColors: getLoopColorsType
|
|
148
|
+
export let formatColor: formatColorType
|
|
149
|
+
export let animation: animationType
|
|
150
|
+
export let ruler: rulerType
|
|
151
|
+
|
|
152
|
+
// 画笔
|
|
153
|
+
export let SVG: NewSVGType
|
|
154
|
+
export let Canvas: NewCanvasType
|
|
155
|
+
export let WebGL: NewWebGLType
|
|
156
|
+
|
|
157
|
+
// WebGL
|
|
158
|
+
export let getWebGLContext: getWebGLContextType
|
|
159
|
+
export let Shader: NewShaderType
|
|
160
|
+
export let Buffer: NewBufferType
|
|
161
|
+
export let Texture: NewTextureType
|
|
162
|
+
|
|
163
|
+
// 投影
|
|
164
|
+
export let Eoap: NewEoapType
|
|
165
|
+
export let Mercator: NewMercatorType
|
|
166
|
+
|
|
167
|
+
// 辅助
|
|
168
|
+
export let viewHandler: viewHandlerType
|
|
169
|
+
export let throttle: throttleType
|
|
170
|
+
export let resizeObserver: resizeObserverType
|
|
171
|
+
|
|
172
|
+
// 布局
|
|
173
|
+
export let TreeLayout: NewTreeLayoutType
|
|
174
|
+
|
|
175
|
+
// 几何&模型数据
|
|
170
176
|
export let Geometry: NewGeometryType
|
package/types/move.d.ts
ADDED
package/types/painterConfig.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type arcCapType = "butt" | "round" | "-round"
|
|
2
|
-
export type textAlignType = "left" | "center" | "right"
|
|
1
|
+
export type arcCapType = "butt" | "round" | "-round"
|
|
2
|
+
export type textAlignType = "left" | "center" | "right"
|
|
3
3
|
export type textBaselineType = "top" | "middle" | "bottom"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface resizeObserver {
|
|
2
|
-
(el: HTMLElement | null, callback: Function): Function
|
|
1
|
+
export default interface resizeObserver {
|
|
2
|
+
(el: HTMLElement | null, callback: Function): Function
|
|
3
3
|
}
|
package/types/rotate.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export default interface rotateType {
|
|
2
|
-
(cx: number, cy: number, deg: number, x: number, y: number): [number, number]
|
|
1
|
+
export default interface rotateType {
|
|
2
|
+
(cx: number, cy: number, deg: number, x: number, y: number): [number, number]
|
|
3
3
|
}
|
package/types/ruler.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export interface rulerOptionType {
|
|
2
|
-
max?: number
|
|
3
|
-
min?: number
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
export default interface rulerType {
|
|
7
|
-
(maxValue: number, minValue: number, num: number, option?: rulerOptionType): number[]
|
|
1
|
+
export interface rulerOptionType {
|
|
2
|
+
max?: number
|
|
3
|
+
min?: number
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export default interface rulerType {
|
|
7
|
+
(maxValue: number, minValue: number, num: number, option?: rulerOptionType): number[]
|
|
8
8
|
}
|
package/types/scale.d.ts
ADDED
package/types/throttle.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import throttleOptionType from './throttleOption'
|
|
2
|
-
|
|
3
|
-
export default interface throttle {
|
|
4
|
-
(callback: Function, option?: throttleOptionType): Function
|
|
1
|
+
import throttleOptionType from './throttleOption'
|
|
2
|
+
|
|
3
|
+
export default interface throttle {
|
|
4
|
+
(callback: Function, option?: throttleOptionType): Function
|
|
5
5
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
export type throttleOpportunityType = "begin" | "end" | "wide"
|
|
2
|
-
|
|
3
|
-
export default interface throttleOptionType {
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 节流时长
|
|
7
|
-
*/
|
|
8
|
-
time?: number
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 是否持续节流
|
|
12
|
-
*/
|
|
13
|
-
keep?: boolean
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 执行时机
|
|
17
|
-
*
|
|
18
|
-
* begin(开始触发)、end(结束触发)、wide(第一次开始触发,其余结束触发)
|
|
19
|
-
*/
|
|
20
|
-
opportunity?: throttleOpportunityType
|
|
21
|
-
|
|
1
|
+
export type throttleOpportunityType = "begin" | "end" | "wide"
|
|
2
|
+
|
|
3
|
+
export default interface throttleOptionType {
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 节流时长
|
|
7
|
+
*/
|
|
8
|
+
time?: number
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 是否持续节流
|
|
12
|
+
*/
|
|
13
|
+
keep?: boolean
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 执行时机
|
|
17
|
+
*
|
|
18
|
+
* begin(开始触发)、end(结束触发)、wide(第一次开始触发,其余结束触发)
|
|
19
|
+
*/
|
|
20
|
+
opportunity?: throttleOpportunityType
|
|
21
|
+
|
|
22
22
|
}
|
package/types/viewHandler.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export interface paramsType {
|
|
2
|
-
type: string
|
|
3
|
-
value: number,
|
|
4
|
-
normal: number[],
|
|
5
|
-
event: Event
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface callbackFun {
|
|
9
|
-
(params: paramsType): void
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default interface viewHandlerType {
|
|
13
|
-
(callback: callbackFun): void
|
|
1
|
+
export interface paramsType {
|
|
2
|
+
type: string
|
|
3
|
+
value: number,
|
|
4
|
+
normal: number[],
|
|
5
|
+
event: Event
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface callbackFun {
|
|
9
|
+
(params: paramsType): void
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default interface viewHandlerType {
|
|
13
|
+
(callback: callbackFun): void
|
|
14
14
|
}
|