@vsleem-realsee-viewer/shared 1.0.0
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.d.ts +749 -0
- package/dist/index.mjs +1428 -0
- package/dist/index.umd.js +1 -0
- package/package.json +25 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,749 @@
|
|
|
1
|
+
declare namespace api {
|
|
2
|
+
export {
|
|
3
|
+
getCoordinateList,
|
|
4
|
+
bindCoordinate,
|
|
5
|
+
saveCoordinate,
|
|
6
|
+
removeCoordinate,
|
|
7
|
+
mapingCoordinate,
|
|
8
|
+
getMappingRelation,
|
|
9
|
+
getImageInfo
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export { api }
|
|
13
|
+
|
|
14
|
+
export declare type AppObsType = 'huawei' | 'aliyun' | 'huoshan' | 'amazon';
|
|
15
|
+
|
|
16
|
+
export declare type AppSetting = {
|
|
17
|
+
baseUrl?: string;
|
|
18
|
+
authorizeCode?: string;
|
|
19
|
+
obsPrefix?: string;
|
|
20
|
+
obsType?: AppObsType;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
declare abstract class BaseAsyncElement {
|
|
24
|
+
abstract redraw: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
declare abstract class BaseElement {
|
|
28
|
+
abstract type: string;
|
|
29
|
+
abstract x: number;
|
|
30
|
+
abstract y: number;
|
|
31
|
+
abstract draw: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
32
|
+
abstract beforeDraw?: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 坐标系绑定
|
|
37
|
+
*/
|
|
38
|
+
declare function bindCoordinate(data: CoordinateModel[], options?: RequestOptions): Promise<CoordinateModel[]>;
|
|
39
|
+
|
|
40
|
+
export declare type CADModel = {
|
|
41
|
+
bindCsIds?: string;
|
|
42
|
+
createBy?: string;
|
|
43
|
+
createTime?: number;
|
|
44
|
+
updateBy?: string;
|
|
45
|
+
updateTime?: number;
|
|
46
|
+
id?: number;
|
|
47
|
+
no?: string;
|
|
48
|
+
projectId?: number;
|
|
49
|
+
renderType?: number;
|
|
50
|
+
rawType?: string;
|
|
51
|
+
name?: string;
|
|
52
|
+
modelKey?: string;
|
|
53
|
+
rawUrl?: string;
|
|
54
|
+
length?: number;
|
|
55
|
+
mappingRecords?: MappingRecord[];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export declare class CanvasElement {
|
|
59
|
+
canvas: HTMLCanvasElement;
|
|
60
|
+
ctx: CanvasRenderingContext2D;
|
|
61
|
+
options: Record<string, any>;
|
|
62
|
+
offset: {
|
|
63
|
+
x: number;
|
|
64
|
+
y: number;
|
|
65
|
+
};
|
|
66
|
+
curOffset: {
|
|
67
|
+
x: number;
|
|
68
|
+
y: number;
|
|
69
|
+
};
|
|
70
|
+
mousePosition: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
MAX_SCALE: number;
|
|
75
|
+
MIN_SCALE: number;
|
|
76
|
+
STEP_SCALE: number;
|
|
77
|
+
scale: number;
|
|
78
|
+
preScale: number;
|
|
79
|
+
width: number;
|
|
80
|
+
height: number;
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
timeout: any;
|
|
84
|
+
lastTouch: any;
|
|
85
|
+
initialDistance: number;
|
|
86
|
+
touchMode: number;
|
|
87
|
+
isMouseover: boolean;
|
|
88
|
+
isBindEvent: boolean;
|
|
89
|
+
isDrawAssist: boolean;
|
|
90
|
+
customDrawAssist?: () => void;
|
|
91
|
+
isMoveRedrawing: boolean;
|
|
92
|
+
afterDraw?: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
93
|
+
screenPos: {
|
|
94
|
+
screenX: number;
|
|
95
|
+
screenY: number;
|
|
96
|
+
};
|
|
97
|
+
constructor(options: CanvasOptions);
|
|
98
|
+
onClick(e: MouseEvent | Touch): void;
|
|
99
|
+
onMouseout(e: MouseEvent): void;
|
|
100
|
+
onTouchstart(e: TouchEvent): void;
|
|
101
|
+
onMousedown(e: MouseEvent | Touch): void;
|
|
102
|
+
onBothTouchstart(e: TouchEvent): void;
|
|
103
|
+
onTouchmove(e: TouchEvent): void;
|
|
104
|
+
onMousemove(e: MouseEvent | Touch): void;
|
|
105
|
+
onMousemoveTemp(e: MouseEvent | Touch): void;
|
|
106
|
+
onBothTouchmove(e: TouchEvent): void;
|
|
107
|
+
onTouchend(): void;
|
|
108
|
+
onMouseup(): void;
|
|
109
|
+
onMousewheel(e: any): void;
|
|
110
|
+
onTouch(e: Touch): void;
|
|
111
|
+
onDblclick(e: MouseEvent | Touch): void;
|
|
112
|
+
zoom(): void;
|
|
113
|
+
reset(options?: Record<string, any>): void;
|
|
114
|
+
drawAssist(): void;
|
|
115
|
+
draw(): void;
|
|
116
|
+
getPos(event: MouseEvent | Touch): {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
};
|
|
120
|
+
unBindEvent(): void;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export declare class CanvasImageElement implements BaseAsyncElement, BaseElement {
|
|
124
|
+
type: string;
|
|
125
|
+
x: number;
|
|
126
|
+
y: number;
|
|
127
|
+
width: number;
|
|
128
|
+
height: number;
|
|
129
|
+
img: HTMLImageElement;
|
|
130
|
+
src: string;
|
|
131
|
+
redraw: () => void;
|
|
132
|
+
constructor(options: any);
|
|
133
|
+
private loadImage;
|
|
134
|
+
draw(ctx: CanvasRenderingContext2D): void;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare class CanvasIssueElement implements BaseElement {
|
|
138
|
+
id: string;
|
|
139
|
+
type: string;
|
|
140
|
+
x: number;
|
|
141
|
+
y: number;
|
|
142
|
+
width: number;
|
|
143
|
+
height: number;
|
|
144
|
+
src: string;
|
|
145
|
+
img: HTMLImageElement;
|
|
146
|
+
index?: number;
|
|
147
|
+
pIndex?: number;
|
|
148
|
+
parentId?: string;
|
|
149
|
+
count: number;
|
|
150
|
+
badgeR: number;
|
|
151
|
+
redraw: () => void;
|
|
152
|
+
constructor(options: Record<string, any>);
|
|
153
|
+
private loadImage;
|
|
154
|
+
draw(ctx: CanvasRenderingContext2D, core: CanvasElement): void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare class CanvasMarkerElement implements BaseElement {
|
|
158
|
+
readonly type = "marker";
|
|
159
|
+
x: number;
|
|
160
|
+
y: number;
|
|
161
|
+
url: string;
|
|
162
|
+
width: number;
|
|
163
|
+
height: number;
|
|
164
|
+
anchor?: {
|
|
165
|
+
x: number;
|
|
166
|
+
y: number;
|
|
167
|
+
};
|
|
168
|
+
img: HTMLImageElement;
|
|
169
|
+
scale: number;
|
|
170
|
+
redraw?: () => void;
|
|
171
|
+
beforeDraw?: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
172
|
+
constructor(options: Record<string, any>);
|
|
173
|
+
private loadImage;
|
|
174
|
+
private calculateIconPosition;
|
|
175
|
+
draw(ctx: CanvasRenderingContext2D, core: CanvasElement): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
declare interface CanvasOptions {
|
|
179
|
+
container: HTMLCanvasElement;
|
|
180
|
+
width: number;
|
|
181
|
+
height: number;
|
|
182
|
+
isDrawAssist?: boolean;
|
|
183
|
+
customDrawAssist?: () => void;
|
|
184
|
+
isMoveRedrawing?: boolean;
|
|
185
|
+
isBindEvent?: boolean;
|
|
186
|
+
onClick?: (x: number, y: number) => void;
|
|
187
|
+
draw: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
188
|
+
afterDraw?: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export declare class CanvasPointElement implements BaseElement {
|
|
192
|
+
id: string;
|
|
193
|
+
type: string;
|
|
194
|
+
x: number;
|
|
195
|
+
y: number;
|
|
196
|
+
r: number;
|
|
197
|
+
text: string;
|
|
198
|
+
backgroundColor: string;
|
|
199
|
+
index?: number;
|
|
200
|
+
pIndex?: number;
|
|
201
|
+
parentId?: string;
|
|
202
|
+
constructor(options: Record<string, any>);
|
|
203
|
+
draw(ctx: CanvasRenderingContext2D, core: CanvasElement): void;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export declare class CanvasRadarElement implements BaseElement {
|
|
207
|
+
type: string;
|
|
208
|
+
x: number;
|
|
209
|
+
y: number;
|
|
210
|
+
r: number;
|
|
211
|
+
angle: number;
|
|
212
|
+
text: string;
|
|
213
|
+
hFov: number;
|
|
214
|
+
beforeDraw?: (ctx: CanvasRenderingContext2D, core: CanvasElement) => void;
|
|
215
|
+
constructor(options: Record<string, any>);
|
|
216
|
+
draw(ctx: CanvasRenderingContext2D, core: CanvasElement): void;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare class CanvasRegionElement implements BaseElement {
|
|
220
|
+
type: string;
|
|
221
|
+
x: number;
|
|
222
|
+
y: number;
|
|
223
|
+
shape: string;
|
|
224
|
+
areaPoints: any[];
|
|
225
|
+
backgroundColor: string;
|
|
226
|
+
constructor(options: Record<string, any>);
|
|
227
|
+
draw(ctx: CanvasRenderingContext2D, core: CanvasElement): void;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
declare function cloneDeep<T>(value: T): T;
|
|
231
|
+
|
|
232
|
+
export declare class Coordinate {
|
|
233
|
+
id: number;
|
|
234
|
+
type: number;
|
|
235
|
+
level?: number;
|
|
236
|
+
relativeMap?: RelativeMap;
|
|
237
|
+
no?: string;
|
|
238
|
+
name?: string;
|
|
239
|
+
shortName?: string;
|
|
240
|
+
status?: number;
|
|
241
|
+
modelId?: number;
|
|
242
|
+
modelType?: number;
|
|
243
|
+
modelValue?: string;
|
|
244
|
+
projectId?: number;
|
|
245
|
+
parentId?: number;
|
|
246
|
+
parent?: Coordinate;
|
|
247
|
+
groupUuid?: string;
|
|
248
|
+
children: Coordinate[];
|
|
249
|
+
z?: number;
|
|
250
|
+
disabled?: boolean;
|
|
251
|
+
createTime?: number;
|
|
252
|
+
constructor(options?: Partial<Coordinate>);
|
|
253
|
+
get spaceList(): Coordinate[];
|
|
254
|
+
get modelList(): Coordinate[];
|
|
255
|
+
get fullName(): string;
|
|
256
|
+
addChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
257
|
+
removeChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
258
|
+
updateChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
259
|
+
bindChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
260
|
+
mergeChild(result?: Coordinate[]): Promise<void>;
|
|
261
|
+
mappingTo(result: ProjectionModel[]): Promise<void>;
|
|
262
|
+
fromMapping(): Promise<ProjectionModel | undefined>;
|
|
263
|
+
/**
|
|
264
|
+
* 递归寻找到根坐标系
|
|
265
|
+
* @returns
|
|
266
|
+
*/
|
|
267
|
+
findRoot(mapped?: boolean): Coordinate;
|
|
268
|
+
/**
|
|
269
|
+
*寻找到符合要求的子节点模型坐标系
|
|
270
|
+
* @param type 模型类型 默认包含CADModel,SkyMapModel
|
|
271
|
+
* @param mapped 是否被映射
|
|
272
|
+
* @returns
|
|
273
|
+
*/
|
|
274
|
+
findChildModel(type?: number | number[], mapped?: boolean): Coordinate | undefined;
|
|
275
|
+
/**
|
|
276
|
+
* 寻找与当前节点最近的一个模型节点,从当前节点遍历到根节点-广度优先遍历
|
|
277
|
+
* @param type 允许的模型类型
|
|
278
|
+
* @param excludeNodes //排除的坐标系
|
|
279
|
+
* @returns
|
|
280
|
+
*/
|
|
281
|
+
findLatestModel(type?: number | number[], excludeNodes?: Coordinate[]): Coordinate | undefined;
|
|
282
|
+
/**
|
|
283
|
+
*向上寻找到子节点的空间坐标系
|
|
284
|
+
* @returns
|
|
285
|
+
*/
|
|
286
|
+
findParentSpace(): Coordinate | undefined;
|
|
287
|
+
/**
|
|
288
|
+
* 通过当前坐标系,获取父级空间坐标系名称
|
|
289
|
+
* @param level 向上找多少级
|
|
290
|
+
* @returns
|
|
291
|
+
*/
|
|
292
|
+
findParentSpaceNames(level?: number): string[];
|
|
293
|
+
findCsGroup(): Coordinate[];
|
|
294
|
+
/**
|
|
295
|
+
* 递归寻找到相应的层级
|
|
296
|
+
* @param level //坐标系的层级
|
|
297
|
+
* @returns
|
|
298
|
+
*/
|
|
299
|
+
findCsByLevel(level: number): Coordinate | undefined;
|
|
300
|
+
/**
|
|
301
|
+
* 递归寻找到相应的坐标系 - 深度优先
|
|
302
|
+
* @param id 坐标系id
|
|
303
|
+
* @returns
|
|
304
|
+
*/
|
|
305
|
+
findCsById(id?: number): Coordinate | undefined;
|
|
306
|
+
/**
|
|
307
|
+
* 获取路径,递归向上寻找父节点坐标系扁平列表
|
|
308
|
+
* @param mapped 是否被映射
|
|
309
|
+
* @returns
|
|
310
|
+
*/
|
|
311
|
+
getCsRoutes(mapped?: boolean): Coordinate[];
|
|
312
|
+
/**
|
|
313
|
+
* 通过当前坐标系,获取新的映射坐标树
|
|
314
|
+
* @returns
|
|
315
|
+
*/
|
|
316
|
+
getMappedCsTree(): Coordinate;
|
|
317
|
+
/**
|
|
318
|
+
* 获取该坐标系到目标坐标系的映射关系,两个坐标系必须是同一树的坐标系
|
|
319
|
+
* @param dstCoordinate 目标坐标系
|
|
320
|
+
* @returns
|
|
321
|
+
*/
|
|
322
|
+
getDestRelativeMap(dstCoordinate: Coordinate): RelativeMap;
|
|
323
|
+
/**
|
|
324
|
+
* 递归向上寻找父级的映射关系
|
|
325
|
+
* @returns
|
|
326
|
+
*/
|
|
327
|
+
getRelativeMaps(): RelativeMap[];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export declare enum CoordinateLevel {
|
|
331
|
+
Global = 0
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export declare type CoordinateModel = {
|
|
335
|
+
coordinateType?: number;
|
|
336
|
+
renderType?: number;
|
|
337
|
+
createBy?: string;
|
|
338
|
+
createTime?: number;
|
|
339
|
+
groupUuid?: string;
|
|
340
|
+
id?: number;
|
|
341
|
+
modelId?: number;
|
|
342
|
+
modelKey?: string;
|
|
343
|
+
name?: string;
|
|
344
|
+
no?: string;
|
|
345
|
+
parentId?: number;
|
|
346
|
+
projectId?: number;
|
|
347
|
+
relativePosition?: string;
|
|
348
|
+
shortName?: string;
|
|
349
|
+
status?: number;
|
|
350
|
+
thirdId?: string;
|
|
351
|
+
type?: number;
|
|
352
|
+
updateBy?: string;
|
|
353
|
+
updateTime?: number;
|
|
354
|
+
uuid?: string;
|
|
355
|
+
z?: number;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export declare enum CoordinateModelType {
|
|
359
|
+
CADModel = 5,//cad图片模型
|
|
360
|
+
BimfaceModel = 6,//bimface模型
|
|
361
|
+
ForgeModel = 7,//forge模型
|
|
362
|
+
ThreeDModel = 8,//3d模型
|
|
363
|
+
SkyMapModel = 9,//天地图模型
|
|
364
|
+
ScaleModel = 10
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
export declare enum CoordinateStatus {
|
|
368
|
+
Used = 0,//当前使用
|
|
369
|
+
Enabled = 1,//可使用
|
|
370
|
+
Disabled = 2
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export declare enum CoordinateType {
|
|
374
|
+
Space = 0,//空间
|
|
375
|
+
Model = 1,//模型
|
|
376
|
+
Data = 2
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export declare class DataSource {
|
|
380
|
+
/**
|
|
381
|
+
* 获取坐标系树
|
|
382
|
+
* @param projectId 项目id
|
|
383
|
+
* @returns
|
|
384
|
+
*/
|
|
385
|
+
static getCoordinateTree(projectId: number): Promise<Coordinate | undefined>;
|
|
386
|
+
/**
|
|
387
|
+
* 添加坐标系
|
|
388
|
+
* @param parent 添加到的父级
|
|
389
|
+
* @param children 添加的坐标系
|
|
390
|
+
* @returns
|
|
391
|
+
*/
|
|
392
|
+
static addCoordinate(parent: Coordinate, children: Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
393
|
+
/**
|
|
394
|
+
* 删除坐标系
|
|
395
|
+
* @param parent 删除的父级
|
|
396
|
+
* @param child 删除的坐标系
|
|
397
|
+
* @returns
|
|
398
|
+
*/
|
|
399
|
+
static removeCoordinate(parent: Coordinate, children: Partial<Coordinate>[]): Promise<CoordinateModel[]>;
|
|
400
|
+
/**
|
|
401
|
+
* 更新坐标系
|
|
402
|
+
* @param parent 更新的父级
|
|
403
|
+
* @param children 更新的坐标系
|
|
404
|
+
* @returns
|
|
405
|
+
*/
|
|
406
|
+
static updateCoordinate(parent: Coordinate, children: Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
407
|
+
/**
|
|
408
|
+
* 绑定坐标系
|
|
409
|
+
* @param parent 绑定的父级
|
|
410
|
+
* @param children 绑定的坐标系
|
|
411
|
+
* @returns
|
|
412
|
+
*/
|
|
413
|
+
static bindCoordinate(parent: Coordinate, children: Partial<Coordinate>[]): Promise<Coordinate[]>;
|
|
414
|
+
/**
|
|
415
|
+
* 处理坐标系数据
|
|
416
|
+
* @param array 坐标系数据
|
|
417
|
+
* @returns 处理后的坐标系数据
|
|
418
|
+
*/
|
|
419
|
+
static handleCoordinateList(array: CoordinateModel[]): Coordinate[];
|
|
420
|
+
/**
|
|
421
|
+
* 递归函数将扁平列表转化为树形结构
|
|
422
|
+
* @param flatNodes // 扁平列表
|
|
423
|
+
* @param rootId // 根id
|
|
424
|
+
* @returns
|
|
425
|
+
*/
|
|
426
|
+
static buildCoordinateTree(flatNodes: Coordinate[], rootId: number): Coordinate;
|
|
427
|
+
/**
|
|
428
|
+
* 对子节点进行排序,首先按 status=0 升序,然后按 type=0 升序,最后按 createTime 降序
|
|
429
|
+
* @param node // 节点
|
|
430
|
+
* @returns 无返回值
|
|
431
|
+
*/
|
|
432
|
+
static sortCoordinateTree(node: Coordinate): void;
|
|
433
|
+
/**
|
|
434
|
+
* 过滤空间坐标系树
|
|
435
|
+
* @param tree
|
|
436
|
+
*/
|
|
437
|
+
static filterSpaceTree(tree: Coordinate[]): Coordinate[];
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): T & {
|
|
441
|
+
cancel: () => void;
|
|
442
|
+
};
|
|
443
|
+
|
|
444
|
+
export declare class GeoPoint {
|
|
445
|
+
lat: number;
|
|
446
|
+
lon: number;
|
|
447
|
+
alt: number;
|
|
448
|
+
constructor(options?: Partial<GeoPoint>);
|
|
449
|
+
static XYZToLLH(p: Point, refPoint: GeoPoint): GeoPoint;
|
|
450
|
+
static LLHToXYZ(p: Point, refPoint: GeoPoint): Point;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
declare function getCoordinateList(params?: Record<string, any>, options?: RequestOptions): Promise<CoordinateModel[]>;
|
|
454
|
+
|
|
455
|
+
declare function getImageInfo(url: string, options?: RequestOptions): Promise<any>;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* 计算图片在画布中的居中显示变换参数
|
|
459
|
+
* @param cw 画布宽度 (canvasWidth)
|
|
460
|
+
* @param ch 画布高度 (canvasHeight)
|
|
461
|
+
* @param iw 图片原始宽度 (imageWidth)
|
|
462
|
+
* @param ih 图片原始高度 (imageHeight)
|
|
463
|
+
* @returns 包含变换参数的对象 {
|
|
464
|
+
* scale: 缩放比例,
|
|
465
|
+
* x: 左上角X坐标,
|
|
466
|
+
* y: 左上角Y坐标,
|
|
467
|
+
* sw: 缩放后宽度 (scaledWidth),
|
|
468
|
+
* sh: 缩放后高度 (scaledHeight)
|
|
469
|
+
* }
|
|
470
|
+
*/
|
|
471
|
+
declare function getImageTransform(cw: number, ch: number, iw: number, ih: number): {
|
|
472
|
+
scale: number;
|
|
473
|
+
x: number;
|
|
474
|
+
y: number;
|
|
475
|
+
sw: number;
|
|
476
|
+
sh: number;
|
|
477
|
+
};
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* 获取映射关系
|
|
481
|
+
*/
|
|
482
|
+
declare function getMappingRelation(params: Record<string, any>, options?: RequestOptions): Promise<ProjectionModel[]>;
|
|
483
|
+
|
|
484
|
+
declare namespace http {
|
|
485
|
+
export {
|
|
486
|
+
setRequestGlobalConfig,
|
|
487
|
+
request
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
export { http }
|
|
491
|
+
|
|
492
|
+
declare const inBrowser: boolean;
|
|
493
|
+
|
|
494
|
+
declare function is(val: unknown, type: string): boolean;
|
|
495
|
+
|
|
496
|
+
declare function isArray(val: any): val is Array<any>;
|
|
497
|
+
|
|
498
|
+
declare function isBoolean(val: unknown): val is boolean;
|
|
499
|
+
|
|
500
|
+
declare function isDate(val: unknown): val is Date;
|
|
501
|
+
|
|
502
|
+
declare function isDef<T = unknown>(val?: T): val is T;
|
|
503
|
+
|
|
504
|
+
declare function isElement(val: unknown): val is Element;
|
|
505
|
+
|
|
506
|
+
declare function isFunction(val: unknown): val is Function;
|
|
507
|
+
|
|
508
|
+
declare function isNull(val: unknown): val is null;
|
|
509
|
+
|
|
510
|
+
declare function isNullOrUnDef(val: unknown): val is null | undefined;
|
|
511
|
+
|
|
512
|
+
declare function isNumber(val: unknown): val is number;
|
|
513
|
+
|
|
514
|
+
declare function isNumeric(val: number | string): val is string;
|
|
515
|
+
|
|
516
|
+
declare function isObject(val: any): val is Record<any, any>;
|
|
517
|
+
|
|
518
|
+
declare function isPromise<T = any>(val: unknown): val is Promise<T>;
|
|
519
|
+
|
|
520
|
+
declare function isRegExp(val: unknown): val is RegExp;
|
|
521
|
+
|
|
522
|
+
declare function isSameValue(newValue: unknown, oldValue: unknown): boolean;
|
|
523
|
+
|
|
524
|
+
declare function isString(val: unknown): val is string;
|
|
525
|
+
|
|
526
|
+
declare function isUnDef<T = unknown>(val?: T): val is T;
|
|
527
|
+
|
|
528
|
+
declare function isWindow(val: any): val is Window;
|
|
529
|
+
|
|
530
|
+
/**
|
|
531
|
+
* 动态加载 JavaScript 脚本
|
|
532
|
+
* @param src 脚本的 URL 地址
|
|
533
|
+
* @param attributes 可选的脚本属性对象(如 { async: true, defer: true })
|
|
534
|
+
* @returns Promise<boolean> 返回加载结果的 Promise
|
|
535
|
+
*/
|
|
536
|
+
declare function loadScript(src: string, attributes?: Record<string, string | boolean>): Promise<boolean>;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* 坐标系映射
|
|
540
|
+
*/
|
|
541
|
+
declare function mapingCoordinate(data: ProjectionModel[], options?: RequestOptions): Promise<any>;
|
|
542
|
+
|
|
543
|
+
declare type MappingRecord = {
|
|
544
|
+
dstCsGroupUuid: string;
|
|
545
|
+
dstCsId: number;
|
|
546
|
+
dstCsName: string;
|
|
547
|
+
dstCsShortName: string;
|
|
548
|
+
dstParentCsName: string;
|
|
549
|
+
srcCsId: number;
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
export declare class Point {
|
|
553
|
+
x: number;
|
|
554
|
+
y: number;
|
|
555
|
+
z: number;
|
|
556
|
+
lat: number;
|
|
557
|
+
lon: number;
|
|
558
|
+
alt: number;
|
|
559
|
+
yaw: number;
|
|
560
|
+
pitch: number;
|
|
561
|
+
roll: number;
|
|
562
|
+
hasXYZ: boolean;
|
|
563
|
+
hasGeo: boolean;
|
|
564
|
+
hasAngle: boolean;
|
|
565
|
+
plane: string;
|
|
566
|
+
constructor(options?: Partial<Point>);
|
|
567
|
+
static dist(p1: Point, p2: Point): number;
|
|
568
|
+
static distXZ(p1: Point, p2: Point): number;
|
|
569
|
+
static distXY(p1: Point, p2: Point): number;
|
|
570
|
+
static toRadians(degrees: number): number;
|
|
571
|
+
static toDegrees(radians: number): number;
|
|
572
|
+
static angleXZ(pa: Point, pb: Point, pc: Point): number;
|
|
573
|
+
static JSONParse(point?: string): Point | undefined;
|
|
574
|
+
static JSONStringify(point?: Point): string;
|
|
575
|
+
/**
|
|
576
|
+
* 点的投射
|
|
577
|
+
* @param r //
|
|
578
|
+
* @param srcCoordinate 源坐标系
|
|
579
|
+
* @param dstCoordinate 目标坐标系
|
|
580
|
+
*/
|
|
581
|
+
projection(r: RelativeMap, srcCoordinate?: Coordinate, dstCoordinate?: Coordinate): Point | undefined;
|
|
582
|
+
project(r: RelativeMap): Point | undefined;
|
|
583
|
+
projectXZ(r: RelativeMap): Point;
|
|
584
|
+
projectXY(r: RelativeMap): Point;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
export declare type ProjectionModel = {
|
|
588
|
+
mappingType?: number;
|
|
589
|
+
projectId?: number;
|
|
590
|
+
srcCsId?: number;
|
|
591
|
+
srcModelCsId?: number;
|
|
592
|
+
srcModelId?: number;
|
|
593
|
+
srcCsPointA?: string;
|
|
594
|
+
srcCsPointB?: string;
|
|
595
|
+
dstCsId?: number;
|
|
596
|
+
dstModelCsId?: number;
|
|
597
|
+
dstModelId?: number;
|
|
598
|
+
dstPointA?: string;
|
|
599
|
+
dstPointB?: string;
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export declare class RelativeMap {
|
|
603
|
+
scale: number;
|
|
604
|
+
yaw: number;
|
|
605
|
+
x: number;
|
|
606
|
+
y: number;
|
|
607
|
+
z: number;
|
|
608
|
+
start: number;
|
|
609
|
+
end: number;
|
|
610
|
+
plane: string;
|
|
611
|
+
refPoint?: GeoPoint;
|
|
612
|
+
constructor(options?: Partial<RelativeMap>);
|
|
613
|
+
/**
|
|
614
|
+
* 合并两个相对坐标系的映射关系
|
|
615
|
+
* @param r1 先进行的映射关系
|
|
616
|
+
* @param r2 后进行的映射关系
|
|
617
|
+
* @returns 合并后的映射关系
|
|
618
|
+
*/
|
|
619
|
+
static addRelativeMap(r1: RelativeMap, r2: RelativeMap): RelativeMap;
|
|
620
|
+
/**
|
|
621
|
+
* 逆映射
|
|
622
|
+
* @param r 原映射
|
|
623
|
+
* @returns 逆映射
|
|
624
|
+
*/
|
|
625
|
+
static inverseRelativeMap(r: RelativeMap): RelativeMap;
|
|
626
|
+
static JSONParse(r?: string): RelativeMap | undefined;
|
|
627
|
+
static JSONStringify(r?: RelativeMap): string | undefined;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* 删除坐标系
|
|
632
|
+
*/
|
|
633
|
+
declare function removeCoordinate(data: number[], options?: RequestOptions): Promise<CoordinateModel[]>;
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* 发起请求
|
|
637
|
+
* @param config 请求配置
|
|
638
|
+
* @param options 请求选项
|
|
639
|
+
*/
|
|
640
|
+
declare function request<T = any>(config: RequestConfig, options?: Partial<RequestOptions>): Promise<T>;
|
|
641
|
+
|
|
642
|
+
export declare type RequestConfig = {
|
|
643
|
+
url: string;
|
|
644
|
+
method?: string;
|
|
645
|
+
params?: Record<string, any>;
|
|
646
|
+
data?: Record<string, any>;
|
|
647
|
+
body?: any;
|
|
648
|
+
mode?: any;
|
|
649
|
+
headers?: Record<string, string>;
|
|
650
|
+
};
|
|
651
|
+
|
|
652
|
+
/**
|
|
653
|
+
* @description: request method
|
|
654
|
+
*/
|
|
655
|
+
export declare enum RequestEnum {
|
|
656
|
+
GET = "GET",
|
|
657
|
+
POST = "POST"
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
export declare type RequestOptions = {
|
|
661
|
+
isTransformResponse?: boolean;
|
|
662
|
+
joinBaseUrl?: boolean;
|
|
663
|
+
withAuthorize?: boolean;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
export declare type ResponseResult = {
|
|
667
|
+
code: number;
|
|
668
|
+
msg: string;
|
|
669
|
+
data: any;
|
|
670
|
+
};
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* 新增/编辑坐标系
|
|
674
|
+
*/
|
|
675
|
+
declare function saveCoordinate(data: CoordinateModel[], options?: RequestOptions): Promise<CoordinateModel[]>;
|
|
676
|
+
|
|
677
|
+
/**
|
|
678
|
+
* 设置全局请求配置
|
|
679
|
+
* @param config 配置项
|
|
680
|
+
*/
|
|
681
|
+
declare function setRequestGlobalConfig(config: Partial<AppSetting>): void;
|
|
682
|
+
|
|
683
|
+
declare function throttle<T extends (...args: any[]) => void>(func: T, limit: number, immediate?: boolean): T & {
|
|
684
|
+
cancel: () => void;
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* 模型坐标 → 画布坐标转换
|
|
689
|
+
* @param x 模型X坐标
|
|
690
|
+
* @param y 模型Y坐标
|
|
691
|
+
* @param t 变换参数 (transform)
|
|
692
|
+
* @returns 画布坐标系下的坐标 { x, y }
|
|
693
|
+
*/
|
|
694
|
+
declare function toCanvasCoord(x: number, y: number, t: Transform): {
|
|
695
|
+
x: number;
|
|
696
|
+
y: number;
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* 画布坐标 → 模型坐标转换
|
|
701
|
+
* @param x 画布X坐标
|
|
702
|
+
* @param y 画布Y坐标
|
|
703
|
+
* @param t 变换参数 (transform)
|
|
704
|
+
* @returns 模型坐标系下的坐标 { x, y }
|
|
705
|
+
*/
|
|
706
|
+
declare function toModelCoord(x: number, y: number, t: Transform): {
|
|
707
|
+
x: number;
|
|
708
|
+
y: number;
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
declare type Transform = {
|
|
712
|
+
x: number;
|
|
713
|
+
y: number;
|
|
714
|
+
scale: number;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
declare namespace utils {
|
|
718
|
+
export {
|
|
719
|
+
is,
|
|
720
|
+
isDef,
|
|
721
|
+
isUnDef,
|
|
722
|
+
isObject,
|
|
723
|
+
isNull,
|
|
724
|
+
isDate,
|
|
725
|
+
isString,
|
|
726
|
+
isFunction,
|
|
727
|
+
isBoolean,
|
|
728
|
+
isRegExp,
|
|
729
|
+
isArray,
|
|
730
|
+
isWindow,
|
|
731
|
+
isElement,
|
|
732
|
+
isNumeric,
|
|
733
|
+
isNumber,
|
|
734
|
+
isSameValue,
|
|
735
|
+
isNullOrUnDef,
|
|
736
|
+
isPromise,
|
|
737
|
+
inBrowser,
|
|
738
|
+
cloneDeep,
|
|
739
|
+
debounce,
|
|
740
|
+
throttle,
|
|
741
|
+
loadScript,
|
|
742
|
+
getImageTransform,
|
|
743
|
+
toCanvasCoord,
|
|
744
|
+
toModelCoord
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
export { utils }
|
|
748
|
+
|
|
749
|
+
export { }
|