UNPKG

2.81 kBTypeScriptView Raw
1import { image2D_Object } from "./image2D.d";
2import { point , ruler} from './type.d';
3import { dot } from './dot.d';
4import { matrix4 } from './matrix4.d';
5import { cardinal } from './interpolation.d';
6import { treeLayout_options, treeLayout, pieLayout_options, pieLayout } from './layout.d';
7import { map_options, map } from './map.d';
8
9/**
10 * 返回image2D对象
11 * @param selector 选择器
12 * @param context 可选,查找上下文
13 */
14declare function image2D(selector: Function | Element | string | image2D_Object | Array<Element | image2D_Object>, context?: Element): image2D_Object;
15
16export default image2D;
17
18/**
19 * image2D静态方法
20 */
21
22// 事件
23
24/**
25 * 阻止冒泡
26 */
27image2D.stopPropagation = (event: Event): image2D => { };
28
29/**
30 * 阻止默认事件
31 */
32image2D.preventDefault = (event: Event): image2D => { };
33
34// 二维坐标变换
35
36/**
37 * 点(x,y)围绕中心(cx,cy)旋转deg度
38 */
39image2D.rotate = (cx: number, cy: number, deg: number, x: number, y: number): point => { };
40
41/**
42 * 点(x,y)沿着向量(ax,ay)方向移动距离d
43 */
44image2D.move = (ax: number, ay: number, d: number, x: number, y: number): point => { };
45
46/**
47 * 点(x,y)围绕中心(cx,cy)缩放times倍
48 */
49image2D.scale = (cx: number, cy: number, times: number, x: number, y: number): point => { };
50
51/**
52 * 获取一个dot实例
53 */
54image2D.dot = (init: {
55 d: [dx: number, dy: number],
56 c: [cx: number, cy: number],
57 p: [x: number, y: number]
58}): dot => { };
59
60/**
61 * 返回一个矩阵对象
62 * @param initMatrix4 一个初始化矩阵或默认采用单位矩阵E初始化
63 */
64image2D.Matrix4 = (initMatrix4?:any): matrix4 => { };
65
66// 曲线插值
67
68/**
69 * 获取Cardinal插值对象实例
70 */
71image2D.cardinal = (): cardinal => { };
72
73// 布局
74
75/**
76 * 树布局
77 */
78image2D.treeLayout = (config?: treeLayout_options): treeLayout => { };
79
80/**
81 * 饼布局
82 */
83image2D.pieLayout = (config?: pieLayout_options): pieLayout => { };
84
85// 地图坐标映射
86
87/**
88 * 获取地图投影对象
89 */
90image2D.map = (config?: map_options): map => { };
91
92// 一些补充
93
94/**
95 * 动画方法
96 */
97image2D.animation = (doit: Function, speeds?: number, endBack?: Function, timing): Function => { };
98
99/**
100 * 定任意一个合法的css颜色字符串,把颜色统一转变成rgba格式,返回一个数组[r,g,b,a]
101 */
102image2D.formatColor = (colorString: string): Array<number> => { };
103
104/**
105 * 传递需要的颜色个数,返回一组随机色彩
106 */
107image2D.getRandomColors = (num: number, alpha?: number): Array<string> => { };
108
109/**
110 * 传递需要的颜色个数,返回一组循环色彩
111 */
112image2D.getLoopColors = (num: number, alpha?: number): Array<string> => { };
113
114/**
115 * 刻度尺辅助计算
116 */
117image2D.ruler = (maxValue: number, minValue: number, number?: number): ruler => { };