gis-common 5.1.15 → 5.1.17
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/gis-common.es.js +1637 -1717
- package/dist/gis-common.umd.js +1 -1
- package/dist/index.d.ts +1639 -4
- package/package.json +4 -4
- package/dist/constant/CaseType.d.ts +0 -8
- package/dist/constant/ErrorType.d.ts +0 -31
- package/dist/constant/EventType.d.ts +0 -24
- package/dist/constant/FormType.d.ts +0 -6
- package/dist/constant/GraphicTypes.d.ts +0 -26
- package/dist/constant/LayerType.d.ts +0 -10
- package/dist/constant/index.d.ts +0 -6
- package/dist/core/AudioPlayer.d.ts +0 -20
- package/dist/core/CanvasDrawer.d.ts +0 -37
- package/dist/core/Color.d.ts +0 -65
- package/dist/core/Cookie.d.ts +0 -5
- package/dist/core/DateTime.d.ts +0 -43
- package/dist/core/EventDispatcher.d.ts +0 -13
- package/dist/core/FullScreen.d.ts +0 -16
- package/dist/core/HashMap.d.ts +0 -20
- package/dist/core/MqttClient.d.ts +0 -32
- package/dist/core/Storage.d.ts +0 -51
- package/dist/core/WebGL.d.ts +0 -31
- package/dist/core/WebSocketClient.d.ts +0 -15
- package/dist/core/index.d.ts +0 -12
- package/dist/types.d.ts +0 -101
- package/dist/utils/AjaxUtil.d.ts +0 -109
- package/dist/utils/ArrayUtil.d.ts +0 -45
- package/dist/utils/AssertUtil.d.ts +0 -15
- package/dist/utils/BrowserUtil.d.ts +0 -85
- package/dist/utils/CommUtil.d.ts +0 -105
- package/dist/utils/CoordsUtil.d.ts +0 -43
- package/dist/utils/DomUtil.d.ts +0 -90
- package/dist/utils/ExceptionUtil.d.ts +0 -15
- package/dist/utils/FileUtil.d.ts +0 -33
- package/dist/utils/GeoJsonUtil.d.ts +0 -76
- package/dist/utils/GeoUtil.d.ts +0 -151
- package/dist/utils/ImageUtil.d.ts +0 -43
- package/dist/utils/MathUtil.d.ts +0 -37
- package/dist/utils/MessageUtil.d.ts +0 -35
- package/dist/utils/ObjectUtil.d.ts +0 -30
- package/dist/utils/OptimizeUtil.d.ts +0 -43
- package/dist/utils/StringUtil.d.ts +0 -34
- package/dist/utils/TreeUtil.d.ts +0 -25
- package/dist/utils/UrlUtil.d.ts +0 -18
- package/dist/utils/ValidateUtil.d.ts +0 -26
- package/dist/utils/index.d.ts +0 -20
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gis-common",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.17",
|
|
4
4
|
"author": "Guo.Yan <luv02@vip.qq.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
|
-
"module": "dist/gis-common.
|
|
7
|
+
"module": "dist/gis-common.umd.js",
|
|
8
8
|
"main": "dist/gis-common.umd.js",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"files": [
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"import": "./dist/gis-common.
|
|
16
|
+
"import": "./dist/gis-common.umd.js",
|
|
17
17
|
"require": "./dist/gis-common.umd.js"
|
|
18
18
|
}
|
|
19
19
|
},
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"terser": "^5.32.0",
|
|
37
37
|
"typescript": "^5.5.4",
|
|
38
38
|
"vite": "^5.4.0",
|
|
39
|
-
"vite-plugin-dts": "^4.
|
|
39
|
+
"vite-plugin-dts": "^4.5.4"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
declare enum ErrorType {
|
|
2
|
-
LOGIN_EXPIRED = "\u767B\u5F55\u4FE1\u606F\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55",
|
|
3
|
-
INTERNAL_ERROR = "\u5185\u90E8\u9519\u8BEF",
|
|
4
|
-
NETWORK_ERROR = "\u8BF7\u6C42\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC\u662F\u5426\u5DF2\u8FDE\u63A5",
|
|
5
|
-
PROCESS_FAIL = "\u4EFB\u52A1\u5904\u7406\u5931\u8D25",
|
|
6
|
-
PROCESS_TIMEOUT = "\u4EFB\u52A1\u5904\u7406\u8D85\u65F6",
|
|
7
|
-
AUTH_VERIFY_ERROR = "\u6743\u9650\u9A8C\u8BC1\u5931\u8D25",
|
|
8
|
-
INSTANCE_DUPLICATE = "\u5B9E\u4F8B\u4E3A\u5355\u4F8B\u6A21\u5F0F\uFF0C\u4E0D\u5141\u8BB8\u91CD\u590D\u6784\u5EFA",
|
|
9
|
-
STRING_CHECK_LOSS = "\u5B57\u7B26\u4E32\u7F3A\u5C11\u5173\u952E\u5B57",
|
|
10
|
-
PARAMETER_ERROR = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25",
|
|
11
|
-
PARAMETER_ERROR_ARRAY = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u6570\u7EC4",
|
|
12
|
-
PARAMETER_ERROR_STRING = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u5B57\u7B26",
|
|
13
|
-
PARAMETER_ERROR_FUNCTION = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u51FD\u6570",
|
|
14
|
-
PARAMETER_ERROR_OBJECT = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u5BF9\u8C61",
|
|
15
|
-
PARAMETER_ERROR_INTEGER = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u6574\u578B",
|
|
16
|
-
PARAMETER_ERROR_NUMBER = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u6570\u503C",
|
|
17
|
-
PARAMETER_ERROR_LACK = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u975E\u7A7A",
|
|
18
|
-
PARAMETER_ERROR_ENUM = "\u9A8C\u8BC1\u53C2\u6570\u7C7B\u578B\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u6307\u5B9A\u7684\u503C",
|
|
19
|
-
DATA_ERROR = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25",
|
|
20
|
-
DATA_ERROR_COORDINATE = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u5750\u6807",
|
|
21
|
-
DATA_ERROR_COLOR = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662F\u989C\u8272\u4EE3\u7801",
|
|
22
|
-
DATA_ERROR_JSON = "JSON\u89E3\u6790\u5931\u8D25\uFF0C\u683C\u5F0F\u6709\u8BEF",
|
|
23
|
-
DATA_ERROR_GEOJSON = "\u683C\u5F0F\u7C7B\u578B\u9A8C\u8BC1\u5931\u8D25\uFF0C\u5FC5\u987B\u662FGeoJSON",
|
|
24
|
-
REQUEST_ERROR = "\u8BF7\u6C42\u8D44\u6E90\u5931\u8D25",
|
|
25
|
-
REQUEST_ERROR_CROSS = "\u4E0D\u5141\u8BB8\u8DE8\u7AD9\u70B9\u8BBF\u95EE\u8D44\u6E90",
|
|
26
|
-
REQUEST_ERROR_TIMEOUT = "\u8BF7\u6C42\u8D85\u65F6\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC",
|
|
27
|
-
REQUEST_ERROR_NOT_FOUND = "\u8BF7\u6C42\u8D44\u6E90\u4E0D\u5B58\u5728",
|
|
28
|
-
REQUEST_ERROR_FORBIDDEN = "\u8BF7\u6C42\u8D44\u6E90\u7981\u6B62\u8BBF\u95EE",
|
|
29
|
-
REQUEST_ERROR_EMPTY = "\u8BF7\u6C42\u6570\u636E\u8BB0\u5F55\u4E3A\u7A7A"
|
|
30
|
-
}
|
|
31
|
-
export default ErrorType;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare enum EventType {
|
|
2
|
-
MAP_RENDER = "mapRender",
|
|
3
|
-
MAP_READY = "mapReady",
|
|
4
|
-
MOUSE_CLICK = "click",
|
|
5
|
-
MOUSE_DOUBLE_CLICK = "dblclick",
|
|
6
|
-
MOUSE_MOVE = "mousemove",
|
|
7
|
-
MOUSE_IN = "mousein",
|
|
8
|
-
MOUSE_OUT = "mouseout",
|
|
9
|
-
MOUSE_RIGHT_CLICK = "mouseRightClick",
|
|
10
|
-
KEY_DOWN = "keyDown",
|
|
11
|
-
KEY_UP = "keyUp",
|
|
12
|
-
DRAW_ACTIVE = "drawActive",
|
|
13
|
-
DRAW_MOVE = "drawMove",
|
|
14
|
-
DRAW_COMPLETE = "drawComplete",
|
|
15
|
-
MQTT_CONNECT = "mqttConnect",
|
|
16
|
-
MQTT_ERROR = "mqttError",
|
|
17
|
-
MQTT_MESSAGE = "mqttMessage",
|
|
18
|
-
MQTT_CLOSE = "mqttClose",
|
|
19
|
-
WEB_SOCKET_CONNECT = "webSocketConnect",
|
|
20
|
-
WEB_SOCKET_ERROR = "webSocketError",
|
|
21
|
-
WEB_SOCKET_MESSAGE = "webSocketMessage",
|
|
22
|
-
WEB_SOCKET_CLOSE = "webSocketClose"
|
|
23
|
-
}
|
|
24
|
-
export default EventType;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export declare enum GraphicType {
|
|
2
|
-
POINT = "Point",
|
|
3
|
-
POLYLINE = "Polyline",
|
|
4
|
-
POLYGON = "Polygon",
|
|
5
|
-
RECTANGLE = "Rectangle",
|
|
6
|
-
BILLBOARD = "Billboard",
|
|
7
|
-
CYLINDER = "Cylinder",
|
|
8
|
-
ELLIPSOID = "Ellipsoid",
|
|
9
|
-
LABEL = "Label",
|
|
10
|
-
MODEL = "Model",
|
|
11
|
-
WALL = "Wall",
|
|
12
|
-
CIRCLE = "Circle"
|
|
13
|
-
}
|
|
14
|
-
export declare enum LineSymbol {
|
|
15
|
-
SOLID = 0,
|
|
16
|
-
DASH = "10,5",
|
|
17
|
-
DOT = "3",
|
|
18
|
-
DASHDOT = "10,3,3,3",
|
|
19
|
-
DASHDOTDOT = "10,3,3,3,3,3"
|
|
20
|
-
}
|
|
21
|
-
export declare enum MeasureMode {
|
|
22
|
-
DISTANCE = 0,
|
|
23
|
-
AREA = 1,
|
|
24
|
-
HEIGHT = 2,
|
|
25
|
-
ANGLE = 3
|
|
26
|
-
}
|
package/dist/constant/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as EventType } from './EventType';
|
|
2
|
-
export { default as ErrorType } from './ErrorType';
|
|
3
|
-
export { default as LayerType } from './LayerType';
|
|
4
|
-
export { default as FormType } from './FormType';
|
|
5
|
-
export { default as CaseType } from './CaseType';
|
|
6
|
-
export * from './GraphicTypes';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 声音播放类
|
|
3
|
-
* @export
|
|
4
|
-
* @class AudioPlayer
|
|
5
|
-
*/
|
|
6
|
-
export default class AudioPlayer {
|
|
7
|
-
/**
|
|
8
|
-
* Creates an instance of AudioPlayer.
|
|
9
|
-
* @param {*} url
|
|
10
|
-
*/
|
|
11
|
-
private audio;
|
|
12
|
-
constructor(url: string);
|
|
13
|
-
play(): void;
|
|
14
|
-
pause(): void;
|
|
15
|
-
get muted(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* @description 设置静音状态,如果静音,autoplay属性将失效
|
|
18
|
-
*/
|
|
19
|
-
set muted(val: boolean);
|
|
20
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Coordinate } from '../types';
|
|
2
|
-
export default class CanvasDrawer {
|
|
3
|
-
private ctx;
|
|
4
|
-
constructor(el: HTMLElement | string);
|
|
5
|
-
/**
|
|
6
|
-
* 绘制线条
|
|
7
|
-
*
|
|
8
|
-
* @param start 起始坐标点
|
|
9
|
-
* @param end 终止坐标点
|
|
10
|
-
* @param options 绘制选项,包括线条宽度和颜色
|
|
11
|
-
* @throws 当画布上下文不存在时抛出错误
|
|
12
|
-
*/
|
|
13
|
-
drawLine({ x: startX, y: startY }: Coordinate, { x: endX, y: endY }: Coordinate, options?: {
|
|
14
|
-
width?: number;
|
|
15
|
-
color?: string;
|
|
16
|
-
}): void;
|
|
17
|
-
/**
|
|
18
|
-
* 绘制圆弧
|
|
19
|
-
*
|
|
20
|
-
* @param x 圆心x坐标
|
|
21
|
-
* @param y 圆心y坐标
|
|
22
|
-
* @param radius 半径
|
|
23
|
-
* @param startAngle 起始角度(度)
|
|
24
|
-
* @param endAngle 结束角度(度)
|
|
25
|
-
* @param anticlockwise 是否逆时针绘制
|
|
26
|
-
* @param isFill 是否填充
|
|
27
|
-
* @param bgColor 背景颜色
|
|
28
|
-
* @throws 当Canvas context为null或undefined时抛出错误
|
|
29
|
-
*/
|
|
30
|
-
drawArc({ x, y }: Coordinate, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean, isFill: boolean, bgColor: string): void;
|
|
31
|
-
drawImage({ x, y }: Coordinate, src: string): void;
|
|
32
|
-
drawText({ x, y }: Coordinate, text: string, options: {
|
|
33
|
-
font: string;
|
|
34
|
-
color: string;
|
|
35
|
-
}): void;
|
|
36
|
-
static createCanvas(width?: number, height?: number): HTMLCanvasElement;
|
|
37
|
-
}
|
package/dist/core/Color.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { ColorRGBA } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
* 基本的颜色类,支持RGB颜色
|
|
4
|
-
*/
|
|
5
|
-
export default class Color {
|
|
6
|
-
_r: number;
|
|
7
|
-
_g: number;
|
|
8
|
-
_b: number;
|
|
9
|
-
_alpha: number;
|
|
10
|
-
constructor(r: number, g: number, b: number, a?: number);
|
|
11
|
-
private _validateColorChannel;
|
|
12
|
-
toArray(): number[];
|
|
13
|
-
toString(): string;
|
|
14
|
-
toJson(): ColorRGBA;
|
|
15
|
-
get rgba(): string;
|
|
16
|
-
get hex(): string;
|
|
17
|
-
setAlpha(a: number): Color;
|
|
18
|
-
setRgb(r: number, g: number, b: number): Color;
|
|
19
|
-
/**
|
|
20
|
-
* 从RGBA字符串创建Color对象
|
|
21
|
-
*
|
|
22
|
-
* @param rgbaValue RGBA颜色值字符串,格式为"rgba(r,g,b,a)"或"rgb(r,g,b)"
|
|
23
|
-
* @returns 返回Color对象
|
|
24
|
-
* @throws 如果rgbaValue不是有效的RGBA颜色值,则抛出错误
|
|
25
|
-
*/
|
|
26
|
-
static fromRgba(rgbaValue: string): Color;
|
|
27
|
-
/**
|
|
28
|
-
* 将十六进制颜色值转换为颜色对象
|
|
29
|
-
*
|
|
30
|
-
* @param hexValue 十六进制颜色值,可带或不带#前缀,支持3位和6位表示
|
|
31
|
-
* @returns 返回颜色对象
|
|
32
|
-
*/
|
|
33
|
-
static fromHex(hexValue: string, a?: number): Color;
|
|
34
|
-
/**
|
|
35
|
-
* 从 HSL 字符串创建颜色对象
|
|
36
|
-
*
|
|
37
|
-
* @param hsl HSL 字符串,格式为 hsl(h, s%, l%) 或 hsla(h, s%, l%, a)
|
|
38
|
-
* @returns 返回颜色对象,如果 hsl 字符串无效则返回 null
|
|
39
|
-
*/
|
|
40
|
-
static fromHsl(hslValue: string): Color;
|
|
41
|
-
static fromName(str: string): Color;
|
|
42
|
-
/**
|
|
43
|
-
* 从字符串中创建颜色对象
|
|
44
|
-
*
|
|
45
|
-
* @param str 字符串类型的颜色值,支持rgba、hex、hsl格式
|
|
46
|
-
* @returns 返回创建的颜色对象
|
|
47
|
-
* @throws 当颜色值无效时,抛出错误
|
|
48
|
-
*/
|
|
49
|
-
static from(str: string): Color;
|
|
50
|
-
/**
|
|
51
|
-
* 将RGB颜色值转换为十六进制颜色值
|
|
52
|
-
*
|
|
53
|
-
* @param r 红色分量值,取值范围0-255
|
|
54
|
-
* @param g 绿色分量值,取值范围0-255
|
|
55
|
-
* @param b 蓝色分量值,取值范围0-255
|
|
56
|
-
* @param a 可选参数,透明度分量值,取值范围0-1
|
|
57
|
-
* @returns 十六进制颜色值,格式为#RRGGBB或#RRGGBBAA
|
|
58
|
-
*/
|
|
59
|
-
static rgb2hex(r: number, g: number, b: number, a?: number): string;
|
|
60
|
-
static isHex(a: string): boolean;
|
|
61
|
-
static isRgb(a: string): boolean;
|
|
62
|
-
static isHsl(a: string): boolean;
|
|
63
|
-
static isColor(a: string): boolean;
|
|
64
|
-
static random(): Color;
|
|
65
|
-
}
|
package/dist/core/Cookie.d.ts
DELETED
package/dist/core/DateTime.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export default class DateTime extends Date {
|
|
2
|
-
constructor(...val: any);
|
|
3
|
-
format(fmt?: string): string;
|
|
4
|
-
addDate(interval: string, number: number): Date;
|
|
5
|
-
static lastMonth(): DateTime;
|
|
6
|
-
static thisMonth(): DateTime;
|
|
7
|
-
static nextMonth(): DateTime;
|
|
8
|
-
static lastWeek(): DateTime;
|
|
9
|
-
static thisWeek(): DateTime;
|
|
10
|
-
static nextWeek(): DateTime;
|
|
11
|
-
static lastDay(): DateTime;
|
|
12
|
-
static thisDay(): DateTime;
|
|
13
|
-
static nextDay(): DateTime;
|
|
14
|
-
/**
|
|
15
|
-
* 解析日期字符串,并返回对应的Date对象。
|
|
16
|
-
*
|
|
17
|
-
* @param str 日期字符串,格式为"yyyy-MM-dd"、"yyyy-MM-dd HH:mm:ss"或"yyyy-MM-dd HH:mm:ss.SSS"。
|
|
18
|
-
* @returns 返回解析后的Date对象,如果解析失败则返回null。
|
|
19
|
-
*/
|
|
20
|
-
static parseDate(str: string): Date;
|
|
21
|
-
/**
|
|
22
|
-
* 格式化时间间隔
|
|
23
|
-
*
|
|
24
|
-
* @param startTime 开始时间,可以是字符串、数字或日期类型
|
|
25
|
-
* @param endTime 结束时间,可以是字符串、数字或日期类型
|
|
26
|
-
* @returns 返回格式化后的时间间隔字符串,格式为"天数 天 小时 时 分钟 分 秒 秒"或"少于1秒"
|
|
27
|
-
*/
|
|
28
|
-
static formatDateInterval(startTime: string | number | Date, endTime: string | number | Date): string;
|
|
29
|
-
/**
|
|
30
|
-
* 将给定的时间(秒)格式化为时:分:秒格式的字符串
|
|
31
|
-
*
|
|
32
|
-
* @param times 时间(秒)
|
|
33
|
-
* @returns 返回格式化后的字符串
|
|
34
|
-
*/
|
|
35
|
-
static formatterCounter(times: number): string;
|
|
36
|
-
/**
|
|
37
|
-
* 静态方法:使当前线程暂停执行指定的毫秒数
|
|
38
|
-
*
|
|
39
|
-
* @param d 需要暂停的毫秒数
|
|
40
|
-
* @returns 无返回值
|
|
41
|
-
*/
|
|
42
|
-
static sleep(d: number): void;
|
|
43
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DispatcherEvent, EventDispatcherHandler } from '../types';
|
|
2
|
-
export default class EventDispatcher {
|
|
3
|
-
private _listeners;
|
|
4
|
-
private _mutex;
|
|
5
|
-
private _context;
|
|
6
|
-
addEventListener(type: string, listener: EventDispatcherHandler, context?: any, mutexStatus?: boolean): EventDispatcher;
|
|
7
|
-
hasEventListener(type: string, listener: EventDispatcherHandler): boolean;
|
|
8
|
-
removeEventListener(type: string, listener: EventDispatcherHandler): void;
|
|
9
|
-
dispatchEvent(event: DispatcherEvent): void;
|
|
10
|
-
removeAllListener(): void;
|
|
11
|
-
on(type: string, listener: EventDispatcherHandler, context?: any, mutexStatus?: boolean): any;
|
|
12
|
-
off(type: string, listener: EventDispatcherHandler): any;
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
type EventName = 'change' | 'error';
|
|
2
|
-
interface FullScreenAPI {
|
|
3
|
-
request(element: HTMLElement | undefined, options?: FullscreenOptions): Promise<void>;
|
|
4
|
-
exit(): Promise<void>;
|
|
5
|
-
toggle(element: HTMLElement, options?: FullscreenOptions): Promise<void>;
|
|
6
|
-
onchange(callback: (event: Event) => void): void;
|
|
7
|
-
onerror(callback: (event: Event) => void): void;
|
|
8
|
-
on(event: EventName, callback: (event: Event) => void): void;
|
|
9
|
-
off(event: EventName, callback: (event: Event) => void): void;
|
|
10
|
-
readonly isFullscreen: boolean;
|
|
11
|
-
readonly element: HTMLElement | undefined;
|
|
12
|
-
readonly isEnabled: boolean;
|
|
13
|
-
raw: any;
|
|
14
|
-
}
|
|
15
|
-
declare let FullScreen: FullScreenAPI;
|
|
16
|
-
export default FullScreen;
|
package/dist/core/HashMap.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export default class HashMap<K, V> extends Map<K, V> {
|
|
2
|
-
isEmpty(): boolean;
|
|
3
|
-
_values(): V[];
|
|
4
|
-
_keys(): K[];
|
|
5
|
-
_entries(): [K, V][];
|
|
6
|
-
/**
|
|
7
|
-
* 从键值对数组创建一个HashMap对象
|
|
8
|
-
*
|
|
9
|
-
* @param array 键值对数组,默认为空数组
|
|
10
|
-
* @returns 返回一个新的HashMap对象
|
|
11
|
-
*/
|
|
12
|
-
static fromEntries<K extends string | number | symbol, V>(array?: Array<[K, V]>): HashMap<K, V>;
|
|
13
|
-
/**
|
|
14
|
-
* 从JSON字符串创建HashMap实例
|
|
15
|
-
*
|
|
16
|
-
* @param str JSON字符串
|
|
17
|
-
* @returns HashMap实例
|
|
18
|
-
*/
|
|
19
|
-
static fromJson<K extends string | number | symbol, V>(str: string): HashMap<K, V>;
|
|
20
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { MqttClientContext } from '../types';
|
|
2
|
-
import { default as EventDispatcher } from './EventDispatcher';
|
|
3
|
-
declare enum State {
|
|
4
|
-
ERROR = 0,
|
|
5
|
-
READY = 1,
|
|
6
|
-
CONNECT = 2,
|
|
7
|
-
TIMEOUT = 3
|
|
8
|
-
}
|
|
9
|
-
export default class MqttClient extends EventDispatcher {
|
|
10
|
-
/**
|
|
11
|
-
* Creates an instance of MqttClient.
|
|
12
|
-
* @param {*} config mqtt实例参数
|
|
13
|
-
*/
|
|
14
|
-
private static defaultContext;
|
|
15
|
-
state: State;
|
|
16
|
-
url: string;
|
|
17
|
-
context: any;
|
|
18
|
-
options: any;
|
|
19
|
-
client: any;
|
|
20
|
-
topics: string[];
|
|
21
|
-
private _timer;
|
|
22
|
-
constructor(url?: string, config?: Partial<MqttClientContext>);
|
|
23
|
-
_onConnect(): void;
|
|
24
|
-
_onError(): void;
|
|
25
|
-
_onMessage(): void;
|
|
26
|
-
sendMsg(topic: string, msg: string): this;
|
|
27
|
-
subscribe(topic: any | string[]): this;
|
|
28
|
-
unsubscribe(topic: string | string[]): this;
|
|
29
|
-
unsubscribeAll(): this;
|
|
30
|
-
unconnect(): void;
|
|
31
|
-
}
|
|
32
|
-
export {};
|
package/dist/core/Storage.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export default class Storage {
|
|
2
|
-
static prefix: string;
|
|
3
|
-
private static _getPrefixedKey;
|
|
4
|
-
/**
|
|
5
|
-
* 将键值对存储到localStorage中
|
|
6
|
-
*
|
|
7
|
-
* @param key 键名
|
|
8
|
-
* @param value 值,默认为null
|
|
9
|
-
* @param options 存储选项,可选参数
|
|
10
|
-
* @param options.expires 过期时间,单位为毫秒,默认为null
|
|
11
|
-
*/
|
|
12
|
-
static setLocal(key: string, value?: any, options?: {
|
|
13
|
-
expires?: number;
|
|
14
|
-
}): void;
|
|
15
|
-
/**
|
|
16
|
-
* 将键值对存储到sessionStorage中
|
|
17
|
-
*
|
|
18
|
-
* @param key 键名
|
|
19
|
-
* @param value 值,默认为null
|
|
20
|
-
* @param options 存储选项,可选参数
|
|
21
|
-
* @param options.expires 过期时间,单位为毫秒,默认为null
|
|
22
|
-
*/
|
|
23
|
-
static setSession(key: string, value?: any, options?: {
|
|
24
|
-
expires?: number;
|
|
25
|
-
}): void;
|
|
26
|
-
/**
|
|
27
|
-
* 从Storage中获取指定key的存储值
|
|
28
|
-
*
|
|
29
|
-
* @param key 存储键名
|
|
30
|
-
* @param missing 当获取不到指定key的存储值时返回的默认值
|
|
31
|
-
* @param options 其他配置选项
|
|
32
|
-
* @returns 返回指定key的存储值,若获取不到则返回missing参数指定的默认值
|
|
33
|
-
*/
|
|
34
|
-
static getLocal(key: string, missing?: any, options?: any): any;
|
|
35
|
-
/**
|
|
36
|
-
* 从Storage中获取指定key的存储值
|
|
37
|
-
*
|
|
38
|
-
* @param key 存储键名
|
|
39
|
-
* @param missing 当获取不到指定key的存储值时返回的默认值
|
|
40
|
-
* @param options 其他配置选项
|
|
41
|
-
* @returns 返回指定key的存储值,若获取不到则返回missing参数指定的默认值
|
|
42
|
-
*/
|
|
43
|
-
static getSession(key: string, missing?: any, options?: any): any;
|
|
44
|
-
static localkeys(): string[];
|
|
45
|
-
static sessionkeys(): string[];
|
|
46
|
-
static getAllLocal(includeKeys: string[] | undefined): any[];
|
|
47
|
-
static getAllSession(includeKeys: string[] | undefined): any[];
|
|
48
|
-
static remove(key: string, options?: any): void;
|
|
49
|
-
static clearLocal(options?: any): void;
|
|
50
|
-
static clearSession(options?: any): void;
|
|
51
|
-
}
|
package/dist/core/WebGL.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export default class WebGL {
|
|
2
|
-
ctx: WebGLRenderingContext;
|
|
3
|
-
constructor(el: HTMLElement | string);
|
|
4
|
-
/**
|
|
5
|
-
* 初始化着色器
|
|
6
|
-
*
|
|
7
|
-
* @param gl WebGL渲染上下文
|
|
8
|
-
* @param vshader 顶点着色器源代码
|
|
9
|
-
* @param fshader 片段着色器源代码
|
|
10
|
-
* @returns 如果着色器初始化成功返回true,否则返回false
|
|
11
|
-
*/
|
|
12
|
-
initShaders(gl: WebGLRenderingContext, vshader: string, fshader: string): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* 创建并返回一个 WebGL 程序对象。
|
|
15
|
-
*
|
|
16
|
-
* @param gl WebGLRenderingContext 对象,表示 WebGL 渲染上下文。
|
|
17
|
-
* @param vshader 顶点着色器代码,以字符串形式传入。
|
|
18
|
-
* @param fshader 片段着色器代码,以字符串形式传入。
|
|
19
|
-
* @returns 返回创建的 WebGL 程序对象,如果创建失败则返回 null。
|
|
20
|
-
*/
|
|
21
|
-
createProgram(gl: WebGLRenderingContext, vshader: string, fshader: string): WebGLProgram;
|
|
22
|
-
/**
|
|
23
|
-
* 加载着色器
|
|
24
|
-
*
|
|
25
|
-
* @param gl WebGL渲染上下文对象
|
|
26
|
-
* @param type 着色器类型(顶点着色器或片段着色器)
|
|
27
|
-
* @param source 着色器源代码
|
|
28
|
-
* @returns 加载的着色器对象,如果加载失败则返回null
|
|
29
|
-
*/
|
|
30
|
-
loadShader(gl: WebGLRenderingContext, type: number, source: string): WebGLShader;
|
|
31
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as EventDispatcher } from './EventDispatcher';
|
|
2
|
-
export default class WebSocketClient extends EventDispatcher {
|
|
3
|
-
private maxCheckTimes;
|
|
4
|
-
private url;
|
|
5
|
-
private checkTimes;
|
|
6
|
-
connectStatus: boolean;
|
|
7
|
-
private client;
|
|
8
|
-
constructor(url?: string);
|
|
9
|
-
connect(): void;
|
|
10
|
-
disconnect(): void;
|
|
11
|
-
connCheckStatus(times: number): void;
|
|
12
|
-
send(message: string): true | this;
|
|
13
|
-
heartbeat(): void;
|
|
14
|
-
get state(): number;
|
|
15
|
-
}
|
package/dist/core/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as AudioPlayer } from './AudioPlayer';
|
|
2
|
-
export { default as Cookie } from './Cookie';
|
|
3
|
-
export { default as Color } from './Color';
|
|
4
|
-
export { default as CanvasDrawer } from './CanvasDrawer';
|
|
5
|
-
export { default as DateTime } from './DateTime';
|
|
6
|
-
export { default as EventDispatcher } from './EventDispatcher';
|
|
7
|
-
export { default as FullScreen } from './FullScreen';
|
|
8
|
-
export { default as HashMap } from './HashMap';
|
|
9
|
-
export { default as WebSocketClient } from './WebSocketClient';
|
|
10
|
-
export { default as MqttClient } from './MqttClient';
|
|
11
|
-
export { default as Storage } from './Storage';
|
|
12
|
-
export { default as WebGL } from './WebGL';
|
package/dist/types.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export interface Coordinate {
|
|
2
|
-
x: number;
|
|
3
|
-
y: number;
|
|
4
|
-
z?: number;
|
|
5
|
-
}
|
|
6
|
-
export interface LngLat {
|
|
7
|
-
lng: number;
|
|
8
|
-
lat: number;
|
|
9
|
-
alt?: number;
|
|
10
|
-
}
|
|
11
|
-
export type GeometryType = 'Point' | 'MultiPoint' | 'LineString' | 'MultiLineString' | 'Polygon' | 'MultiPolygon';
|
|
12
|
-
export interface GeoJSONPoint {
|
|
13
|
-
type: 'Point';
|
|
14
|
-
coordinates: Array<number>;
|
|
15
|
-
}
|
|
16
|
-
export interface GeoJSONMultiPoint {
|
|
17
|
-
type: 'MultiPoint';
|
|
18
|
-
coordinates: Array<Array<number>>;
|
|
19
|
-
}
|
|
20
|
-
export interface GeoJSONLineString {
|
|
21
|
-
type: 'LineString';
|
|
22
|
-
coordinates: Array<Array<number>>;
|
|
23
|
-
}
|
|
24
|
-
export interface GeoJSONMultiLineString {
|
|
25
|
-
type: 'MultiLineString';
|
|
26
|
-
coordinates: Array<Array<Array<number>>>;
|
|
27
|
-
}
|
|
28
|
-
export interface GeoJSONPolygon {
|
|
29
|
-
type: 'Polygon';
|
|
30
|
-
coordinates: Array<Array<Array<number>>>;
|
|
31
|
-
}
|
|
32
|
-
export interface GeoJSONMultiPolygon {
|
|
33
|
-
type: 'MultiPolygon';
|
|
34
|
-
coordinates: Array<Array<Array<Array<number>>>>;
|
|
35
|
-
}
|
|
36
|
-
export interface GeoJSONLineStringFeature {
|
|
37
|
-
type: 'Feature';
|
|
38
|
-
geometry: GeoJSONLineString;
|
|
39
|
-
properties: Record<string, any>;
|
|
40
|
-
}
|
|
41
|
-
export interface GeoJSONMultiStringLineFeature {
|
|
42
|
-
type: 'Feature';
|
|
43
|
-
geometry: GeoJSONMultiLineString;
|
|
44
|
-
properties: Record<string, any>;
|
|
45
|
-
}
|
|
46
|
-
export interface GeoJSONPolygonFeature {
|
|
47
|
-
type: 'Feature';
|
|
48
|
-
geometry: GeoJSONPolygon;
|
|
49
|
-
properties: Record<string, any>;
|
|
50
|
-
}
|
|
51
|
-
export interface GeoJSONMultiPolygonFeature {
|
|
52
|
-
type: 'Feature';
|
|
53
|
-
geometry: GeoJSONMultiPolygon;
|
|
54
|
-
properties: Record<string, any>;
|
|
55
|
-
}
|
|
56
|
-
export interface GeoJSONFeature {
|
|
57
|
-
type: 'Feature';
|
|
58
|
-
geometry: GeoJSONPoint | GeoJSONMultiPoint | GeoJSONLineString | GeoJSONMultiLineString | GeoJSONPolygon | GeoJSONMultiPolygon;
|
|
59
|
-
properties: Record<string, any>;
|
|
60
|
-
}
|
|
61
|
-
export interface GeoJSONCollection {
|
|
62
|
-
type: 'FeatureCollection';
|
|
63
|
-
features: GeoJSONFeature[];
|
|
64
|
-
bbox: number[];
|
|
65
|
-
}
|
|
66
|
-
export interface DispatcherEvent {
|
|
67
|
-
type: string;
|
|
68
|
-
message: Record<string, any>;
|
|
69
|
-
target?: any;
|
|
70
|
-
}
|
|
71
|
-
export type EventDispatcherHandler = (event: DispatcherEvent) => void;
|
|
72
|
-
export interface ColorRGBA {
|
|
73
|
-
r: number;
|
|
74
|
-
g: number;
|
|
75
|
-
b: number;
|
|
76
|
-
a?: number;
|
|
77
|
-
}
|
|
78
|
-
export interface MqttClientContext {
|
|
79
|
-
MQTT_USERNAME: string;
|
|
80
|
-
MQTT_PASSWORD: string;
|
|
81
|
-
MQTT_TIMEOUTM: number;
|
|
82
|
-
MQTT_MAX_RETRY: number;
|
|
83
|
-
REJECT_UNAUTHORIZED: boolean;
|
|
84
|
-
}
|
|
85
|
-
export interface CanvasStyle {
|
|
86
|
-
color: string;
|
|
87
|
-
fillColor: string;
|
|
88
|
-
lineWidth: number;
|
|
89
|
-
}
|
|
90
|
-
export interface SuperArray<T = any> extends Array<T> {
|
|
91
|
-
desc(f?: (d: T) => any): SuperArray<T>;
|
|
92
|
-
asc(f?: (d: T) => any): SuperArray<T>;
|
|
93
|
-
groupBy(f: (d: T) => any): SuperArray<T>;
|
|
94
|
-
distinct(f?: (d: T) => any): SuperArray<T>;
|
|
95
|
-
max(f?: (d: T) => any): T;
|
|
96
|
-
min(f?: (d: T) => any): T;
|
|
97
|
-
sum(f?: (d: T) => any): number;
|
|
98
|
-
avg(f?: (d: T) => any): number;
|
|
99
|
-
random(): SuperArray<T>;
|
|
100
|
-
remove(f: (d: T) => any): SuperArray<T>;
|
|
101
|
-
}
|