model-action 1.0.6 → 1.0.8

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.
@@ -3,55 +3,14 @@ export interface SendParam {
3
3
  cmd: string;
4
4
  action: string;
5
5
  }
6
- export interface IdItem {
6
+ interface IdItem {
7
7
  id: string;
8
8
  }
9
9
  export type IdList = IdItem[];
10
- export type PathList = Array<{
11
- location: string;
12
- }>;
13
- export type PoiAction = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo';
14
10
  export type LocationItem = `X=${number},Y=${number},Z=${number}`;
15
- export type PoiType = {
16
- action: PoiAction;
17
- id?: string;
18
- type?: string;
19
- typeChild?: string;
20
- text?: string;
21
- location?: LocationItem;
22
- place?: string;
23
- description?: string;
24
- linkId?: string;
25
- floorNum?: string;
26
- lowestFloor?: string;
27
- } & SendParam;
28
11
  export type LocationList = Array<{
29
12
  location: LocationItem;
30
13
  }>;
31
- export type TrackAction = 'getRoadNet' | 'remove' | 'add';
32
- export type TrackType = {
33
- action: TrackAction;
34
- pathId?: string;
35
- rnId?: string;
36
- roadNet?: string;
37
- type?: string;
38
- data?: LocationList | IdList;
39
- } & SendParam;
40
- export type VideoFusionAction = 'init' | 'flyTo' | 'start' | 'stop' | 'pause' | 'resume' | 'refresh';
41
- export type VideoFusionType = {
42
- action: VideoFusionAction;
43
- token?: string;
44
- ip?: string;
45
- port?: string;
46
- isHttps?: boolean;
47
- id?: string;
48
- fov?: number;
49
- backPlay?: boolean;
50
- ids?: IdList;
51
- isLocation?: boolean;
52
- videoType?: 'Video' | 'Record';
53
- recordType?: 'Cloud' | 'Device';
54
- } & SendParam;
55
14
  export declare class Action {
56
15
  /**
57
16
  * 视角初始化
@@ -64,3 +23,4 @@ export declare class Action {
64
23
  */
65
24
  static sendParam<T extends SendParam>(param: T, msg?: string): void;
66
25
  }
26
+ export {};
@@ -1,26 +1,55 @@
1
1
  /**
2
2
  * POI点方法
3
3
  */
4
- import { Action, PoiType, RequiredSome } from "./Action";
4
+ import { Action, LocationItem, SendParam } from "./Action";
5
+ type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo';
6
+ type PoiType = {
7
+ action: PoiActionType;
8
+ id?: string;
9
+ type?: string;
10
+ typeChild?: string;
11
+ text?: string;
12
+ location?: LocationItem;
13
+ place?: string;
14
+ description?: string;
15
+ linkId?: string;
16
+ floorNum?: string;
17
+ lowestFloor?: string;
18
+ } & SendParam;
5
19
  export declare class PoiAction extends Action {
6
20
  /**
7
21
  * 添加poi
22
+ * @param {*} type 相机type
23
+ * @param {*} location poi点位置
24
+ * @param {*} text POI标题
25
+ * @param {*} place POI所在位置
26
+ * @param {*} description POI描述
27
+ * @param {*} linkId POI关联的设备ID
8
28
  */
9
- static poiAdd({ type, location, text, place, description, linkId }: RequiredSome<PoiType, 'action' | 'type' | 'location'>): void;
29
+ static poiAdd(type: PoiType['type'], location: LocationItem, text?: PoiType['text'], place?: PoiType['place'], description?: PoiType['description'], linkId?: PoiType['linkId']): void;
10
30
  /**
11
31
  * 删除poi
32
+ * @param {*} id 点ID
12
33
  */
13
- static poiDel({ id }: PoiType): void;
34
+ static poiDel(id: string): void;
14
35
  /**
15
36
  * 显示poi
37
+ * @param {*} id POI的ID
38
+ * @param {*} type 相机type
39
+ * @param {*} place POI所在位置
16
40
  */
17
- static poiShow({ id, type, place }: PoiType): void;
41
+ static poiShow(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']): void;
18
42
  /**
19
43
  * 隐藏poi
44
+ * @param {*} id POI的ID
45
+ * @param {*} type 相机type
46
+ * @param {*} place POI所在位置
20
47
  */
21
- static poiHide({ id, type, place }: PoiType): void;
48
+ static poiHide(id: PoiType['id'], type: PoiType['type'], place: PoiType['place']): void;
22
49
  /**
23
50
  * 获取指定POI
51
+ * @param {*} type 相机type
24
52
  */
25
- static poiGetInfo({ type }: PoiType): void;
53
+ static poiGetInfo(type?: PoiType['type']): void;
26
54
  }
55
+ export {};
@@ -5,8 +5,14 @@ import { Action } from "./Action";
5
5
  export class PoiAction extends Action {
6
6
  /**
7
7
  * 添加poi
8
+ * @param {*} type 相机type
9
+ * @param {*} location poi点位置
10
+ * @param {*} text POI标题
11
+ * @param {*} place POI所在位置
12
+ * @param {*} description POI描述
13
+ * @param {*} linkId POI关联的设备ID
8
14
  */
9
- static poiAdd({ type = 'Camera', location, text = '', place = '', description = '', linkId = '' }) {
15
+ static poiAdd(type = 'Camera', location, text = '', place = '', description = '', linkId = '') {
10
16
  const param = {
11
17
  cmd: "POI",
12
18
  action: "add",
@@ -21,8 +27,9 @@ export class PoiAction extends Action {
21
27
  }
22
28
  /**
23
29
  * 删除poi
30
+ * @param {*} id 点ID
24
31
  */
25
- static poiDel({ id }) {
32
+ static poiDel(id) {
26
33
  const param = {
27
34
  cmd: "POI",
28
35
  action: "delete",
@@ -32,8 +39,11 @@ export class PoiAction extends Action {
32
39
  }
33
40
  /**
34
41
  * 显示poi
42
+ * @param {*} id POI的ID
43
+ * @param {*} type 相机type
44
+ * @param {*} place POI所在位置
35
45
  */
36
- static poiShow({ id, type = "Camera", place }) {
46
+ static poiShow(id, type = "Camera", place) {
37
47
  const param = {
38
48
  cmd: "POI",
39
49
  action: "show",
@@ -47,8 +57,11 @@ export class PoiAction extends Action {
47
57
  }
48
58
  /**
49
59
  * 隐藏poi
60
+ * @param {*} id POI的ID
61
+ * @param {*} type 相机type
62
+ * @param {*} place POI所在位置
50
63
  */
51
- static poiHide({ id, type = "Camera", place }) {
64
+ static poiHide(id, type = "Camera", place) {
52
65
  const param = {
53
66
  cmd: "POI",
54
67
  action: "hide",
@@ -62,8 +75,9 @@ export class PoiAction extends Action {
62
75
  }
63
76
  /**
64
77
  * 获取指定POI
78
+ * @param {*} type 相机type
65
79
  */
66
- static poiGetInfo({ type = 'Camera' }) {
80
+ static poiGetInfo(type = 'Camera') {
67
81
  const param = {
68
82
  cmd: "POI",
69
83
  action: "getInfo",
@@ -1,18 +1,33 @@
1
1
  /**
2
2
  * 轨迹方法
3
3
  */
4
- import { Action, TrackType } from "./Action";
4
+ import { Action, IdList, LocationList, SendParam } from "./Action";
5
+ type TrackActionType = 'getRoadNet' | 'remove' | 'add';
6
+ type TrackType = {
7
+ action: TrackActionType;
8
+ pathId?: string;
9
+ rnId?: string;
10
+ roadNet?: string;
11
+ type?: string;
12
+ data?: LocationList | IdList;
13
+ } & SendParam;
5
14
  export declare class TrackAction extends Action {
6
15
  /**
7
16
  * 清除轨迹
17
+ * @param {*} pathId 自定义轨迹ID
8
18
  */
9
- static trackRemove({ pathId }: TrackType): void;
19
+ static trackRemove(pathId?: TrackType['pathId']): void;
10
20
  /**
11
21
  * 获取三维路网坐标
22
+ * @param {*} data
23
+ * @param {*} rnId 路网ID
12
24
  */
13
- static trackGetRoadNet({ data, rnId }: TrackType): void;
25
+ static trackGetRoadNet(data: TrackType['data'], rnId?: TrackType['rnId']): void;
14
26
  /**
15
27
  * 请求三维绘制路网
28
+ * @param {*} data
29
+ * @param {*} pathId 自定义轨迹ID
16
30
  */
17
- static trackPath({ data, pathId }: TrackType): void;
31
+ static trackPath(data: TrackType['data'], pathId?: TrackType['pathId']): void;
18
32
  }
33
+ export {};
@@ -5,8 +5,9 @@ import { Action } from "./Action";
5
5
  export class TrackAction extends Action {
6
6
  /**
7
7
  * 清除轨迹
8
+ * @param {*} pathId 自定义轨迹ID
8
9
  */
9
- static trackRemove({ pathId = "CameraTrack" }) {
10
+ static trackRemove(pathId = "CameraTrack") {
10
11
  const param = {
11
12
  cmd: "path",
12
13
  action: "remove",
@@ -16,8 +17,10 @@ export class TrackAction extends Action {
16
17
  }
17
18
  /**
18
19
  * 获取三维路网坐标
20
+ * @param {*} data
21
+ * @param {*} rnId 路网ID
19
22
  */
20
- static trackGetRoadNet({ data, rnId = 'RN-1' }) {
23
+ static trackGetRoadNet(data, rnId = 'RN-1') {
21
24
  const param = {
22
25
  cmd: "path",
23
26
  action: "getRoadNet",
@@ -28,8 +31,10 @@ export class TrackAction extends Action {
28
31
  }
29
32
  /**
30
33
  * 请求三维绘制路网
34
+ * @param {*} data
35
+ * @param {*} pathId 自定义轨迹ID
31
36
  */
32
- static trackPath({ data, pathId = "CameraTrack" }) {
37
+ static trackPath(data, pathId = "CameraTrack") {
33
38
  const param = {
34
39
  cmd: "path",
35
40
  action: "add",
@@ -1,26 +1,52 @@
1
1
  /**
2
2
  * 视频融合方法
3
3
  */
4
- import { Action, VideoFusionType } from "./Action";
4
+ import { Action, IdList, SendParam } from "./Action";
5
+ type VideoFusionActionType = 'init' | 'flyTo' | 'start' | 'stop' | 'pause' | 'resume' | 'refresh';
6
+ type VideoFusionType = {
7
+ action: VideoFusionActionType;
8
+ token?: string;
9
+ ip?: string;
10
+ port?: string;
11
+ isHttps?: boolean;
12
+ id?: string;
13
+ fov?: number;
14
+ backPlay?: boolean;
15
+ ids?: IdList;
16
+ isLocation?: boolean;
17
+ videoType?: 'Video' | 'Record';
18
+ recordType?: 'Cloud' | 'Device';
19
+ } & SendParam;
5
20
  export declare class VideoFusionAction extends Action {
6
21
  /**
7
22
  * 视频融合初始化
23
+ * @param {*} token TOKEN
24
+ * @param {*} ip IP
25
+ * @param {*} port 端口
26
+ * @param {*} token TOKEN
27
+ * @param {*} isHttps 是否https
8
28
  */
9
- static videoFusionInit({ token, ip, port, isHttps }: VideoFusionType): void;
29
+ static videoFusionInit(token: VideoFusionType['token'], ip: VideoFusionType['ip'], port?: VideoFusionType['port'], isHttps?: VideoFusionType['isHttps']): void;
10
30
  /**
11
31
  * 飞行到视频融合点位
32
+ * @param {*} id 点ID
33
+ * @param {*} fov 视场角
12
34
  */
13
- static videoFusionFlyTo({ id, fov }: VideoFusionType): void;
35
+ static videoFusionFlyTo(id: VideoFusionType['id'], fov: VideoFusionType['fov']): void;
14
36
  /**
15
37
  * 开启视频融合
38
+ * @param {*} ids id列表
16
39
  */
17
- static videoFusionStart({ ids }: VideoFusionType): void;
40
+ static videoFusionStart(ids: VideoFusionType['ids']): void;
18
41
  /**
19
42
  * 关闭视频融合
43
+ * @param {*} ids id列表
20
44
  */
21
- static videoFusionStop({ ids }: VideoFusionType): void;
45
+ static videoFusionStop(ids: VideoFusionType['ids']): void;
22
46
  /**
23
47
  * 刷新视频融合
48
+ * @param {*} token TOKEN
24
49
  */
25
- static videoFusionRefresh({ token }: VideoFusionType): void;
50
+ static videoFusionRefresh(token: VideoFusionType['token']): void;
26
51
  }
52
+ export {};
@@ -5,8 +5,13 @@ import { Action } from "./Action";
5
5
  export class VideoFusionAction extends Action {
6
6
  /**
7
7
  * 视频融合初始化
8
+ * @param {*} token TOKEN
9
+ * @param {*} ip IP
10
+ * @param {*} port 端口
11
+ * @param {*} token TOKEN
12
+ * @param {*} isHttps 是否https
8
13
  */
9
- static videoFusionInit({ token, ip, port = '1998', isHttps = false }) {
14
+ static videoFusionInit(token, ip, port = '1998', isHttps = false) {
10
15
  const param = {
11
16
  cmd: "videoFusion",
12
17
  action: "init",
@@ -19,8 +24,10 @@ export class VideoFusionAction extends Action {
19
24
  }
20
25
  /**
21
26
  * 飞行到视频融合点位
27
+ * @param {*} id 点ID
28
+ * @param {*} fov 视场角
22
29
  */
23
- static videoFusionFlyTo({ id, fov }) {
30
+ static videoFusionFlyTo(id, fov) {
24
31
  const param = {
25
32
  cmd: "videoFusion",
26
33
  action: "flyTo",
@@ -31,8 +38,9 @@ export class VideoFusionAction extends Action {
31
38
  }
32
39
  /**
33
40
  * 开启视频融合
41
+ * @param {*} ids id列表
34
42
  */
35
- static videoFusionStart({ ids }) {
43
+ static videoFusionStart(ids) {
36
44
  const param = {
37
45
  cmd: "videoFusion",
38
46
  action: "start",
@@ -45,8 +53,9 @@ export class VideoFusionAction extends Action {
45
53
  }
46
54
  /**
47
55
  * 关闭视频融合
56
+ * @param {*} ids id列表
48
57
  */
49
- static videoFusionStop({ ids }) {
58
+ static videoFusionStop(ids) {
50
59
  const param = {
51
60
  cmd: "videoFusion",
52
61
  action: "stop",
@@ -59,8 +68,9 @@ export class VideoFusionAction extends Action {
59
68
  }
60
69
  /**
61
70
  * 刷新视频融合
71
+ * @param {*} token TOKEN
62
72
  */
63
- static videoFusionRefresh({ token }) {
73
+ static videoFusionRefresh(token) {
64
74
  const param = {
65
75
  cmd: "videoFusion",
66
76
  action: "refresh",
package/package.json CHANGED
@@ -1,18 +1,23 @@
1
1
  {
2
2
  "name": "model-action",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "与三维交互api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
8
- "build":"tsc",
8
+ "dev": "tsc --watch",
9
+ "build": "tsc",
9
10
  "test": "echo \"Error: no test specified\" && exit 1"
10
11
  },
11
- "files": ["dist","src"],
12
+ "files": [
13
+ "dist",
14
+ "src",
15
+ "index.d.js"
16
+ ],
12
17
  "author": "andm31",
13
18
  "license": "ISC",
14
19
  "devDependencies": {
15
20
  "typescript": "^5.8.3"
16
21
  },
17
22
  "type": "module"
18
- }
23
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { Action } from './modules/Action'
2
2
  export { VideoFusionAction } from "./modules/VideoFusion";
3
3
  export { PoiAction } from './modules/Poi'
4
- export { TrackAction } from './modules/Track'
4
+ export { TrackAction } from './modules/Track'
@@ -5,66 +5,18 @@ export interface SendParam {
5
5
  action: string,
6
6
  }
7
7
 
8
- export interface IdItem {
8
+
9
+ interface IdItem {
9
10
  id: string;
10
11
  }
11
12
 
12
13
  export type IdList = IdItem[];
13
14
 
14
-
15
- export type PathList = Array<{
16
- location: string
17
- }>
18
-
19
-
20
- export type PoiAction = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo'
21
15
  export type LocationItem = `X=${number},Y=${number},Z=${number}`
22
- export type PoiType = {
23
- action: PoiAction, //方法
24
- id?: string, //POI点UE中的ID
25
- type?: string, //POI类型
26
- typeChild?: string, //POI子类型
27
- text?: string, //POI标题
28
- location?: LocationItem, //POI在场景中的坐标格式
29
- place?: string, //POI所在位置
30
- description?: string, //POI描述
31
- linkId?: string, //POI关联设备ID
32
- floorNum?: string, //总楼层
33
- lowestFloor?: string //最低楼层
34
- } & SendParam
35
-
36
-
37
16
 
38
17
  export type LocationList = Array<{
39
18
  location: LocationItem
40
19
  }>
41
- export type TrackAction = 'getRoadNet' | 'remove' | 'add'
42
- export type TrackType = {
43
- action: TrackAction,
44
- pathId?: string, //自定义轨迹ID
45
- rnId?: string, //路网ID
46
- roadNet?: string, //路网信息
47
- type?: string,
48
- data?: LocationList | IdList
49
- } & SendParam
50
-
51
-
52
- export type VideoFusionAction = 'init' | 'flyTo' | 'start' | 'stop' | 'pause' | 'resume' | 'refresh'
53
- export type VideoFusionType = {
54
- action: VideoFusionAction,
55
- token?: string,
56
- ip?: string,
57
- port?: string,
58
- isHttps?: boolean,
59
- id?: string,
60
- fov?: number, //视场角
61
- backPlay?:boolean,
62
- ids?: IdList,
63
- isLocation?: boolean, //是否定位到第一个点,true=定位到第一个,false=不定位
64
- videoType?: 'Video' | 'Record', //Video:实时流,Record:录像,默认实时流 Video
65
- recordType?: 'Cloud' | 'Device',// Cloud:中心录像,Device:设备录像,默认中心录像 Cloud,videoType为 Record 时有效
66
-
67
- } & SendParam
68
20
 
69
21
  export class Action {
70
22
  /**
@@ -1,13 +1,35 @@
1
+
1
2
  /**
2
3
  * POI点方法
3
4
  */
4
- import { Action, PoiType, RequiredSome } from "./Action";
5
+ import { Action, LocationItem, RequiredSome, SendParam } from "./Action";
6
+
7
+ type PoiActionType = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo'
8
+ type PoiType = {
9
+ action: PoiActionType, //方法
10
+ id?: string, //POI点UE中的ID
11
+ type?: string, //POI类型
12
+ typeChild?: string, //POI子类型
13
+ text?: string, //POI标题
14
+ location?: LocationItem, //POI在场景中的坐标格式
15
+ place?: string, //POI所在位置
16
+ description?: string, //POI描述
17
+ linkId?: string, //POI关联设备ID
18
+ floorNum?: string, //总楼层
19
+ lowestFloor?: string //最低楼层
20
+ } & SendParam
5
21
 
6
22
  export class PoiAction extends Action {
7
23
  /**
8
24
  * 添加poi
25
+ * @param {*} type 相机type
26
+ * @param {*} location poi点位置
27
+ * @param {*} text POI标题
28
+ * @param {*} place POI所在位置
29
+ * @param {*} description POI描述
30
+ * @param {*} linkId POI关联的设备ID
9
31
  */
10
- static poiAdd({ type = 'Camera', location, text = '', place = '', description = '', linkId = '' }: RequiredSome<PoiType, 'action' | 'type' | 'location'>) {
32
+ static poiAdd(type: PoiType['type'] = 'Camera', location: LocationItem, text: PoiType['text'] = '', place: PoiType['place'] = '', description: PoiType['description'] = '', linkId: PoiType['linkId'] = '') {
11
33
  const param: RequiredSome<PoiType, 'action' | 'type' | 'location'> = {
12
34
  cmd: "POI",
13
35
  action: "add",
@@ -23,8 +45,9 @@ export class PoiAction extends Action {
23
45
 
24
46
  /**
25
47
  * 删除poi
48
+ * @param {*} id 点ID
26
49
  */
27
- static poiDel({ id }: PoiType) {
50
+ static poiDel(id: string) {
28
51
  const param: PoiType = {
29
52
  cmd: "POI",
30
53
  action: "delete",
@@ -35,8 +58,11 @@ export class PoiAction extends Action {
35
58
 
36
59
  /**
37
60
  * 显示poi
61
+ * @param {*} id POI的ID
62
+ * @param {*} type 相机type
63
+ * @param {*} place POI所在位置
38
64
  */
39
- static poiShow({ id, type = "Camera", place }: PoiType) {
65
+ static poiShow(id: PoiType['id'], type: PoiType['type'] = "Camera", place: PoiType['place']) {
40
66
  const param: PoiType = {
41
67
  cmd: "POI",
42
68
  action: "show",
@@ -52,8 +78,11 @@ export class PoiAction extends Action {
52
78
 
53
79
  /**
54
80
  * 隐藏poi
81
+ * @param {*} id POI的ID
82
+ * @param {*} type 相机type
83
+ * @param {*} place POI所在位置
55
84
  */
56
- static poiHide({ id, type = "Camera", place }: PoiType) {
85
+ static poiHide(id: PoiType['id'], type: PoiType['type'] = "Camera", place: PoiType['place']) {
57
86
  const param: PoiType = {
58
87
  cmd: "POI",
59
88
  action: "hide",
@@ -69,8 +98,9 @@ export class PoiAction extends Action {
69
98
 
70
99
  /**
71
100
  * 获取指定POI
101
+ * @param {*} type 相机type
72
102
  */
73
- static poiGetInfo({type='Camera'}:PoiType) {
103
+ static poiGetInfo(type: PoiType['type'] = 'Camera') {
74
104
  const param: PoiType = {
75
105
  cmd: "POI",
76
106
  action: "getInfo",
@@ -1,13 +1,28 @@
1
+
2
+
3
+
1
4
  /**
2
5
  * 轨迹方法
3
6
  */
4
- import { Action, TrackType } from "./Action";
7
+ import { Action, IdList, LocationList, SendParam } from "./Action";
8
+
9
+
10
+ type TrackActionType = 'getRoadNet' | 'remove' | 'add'
11
+ type TrackType = {
12
+ action: TrackActionType,
13
+ pathId?: string, //自定义轨迹ID
14
+ rnId?: string, //路网ID
15
+ roadNet?: string, //路网信息
16
+ type?: string,
17
+ data?: LocationList | IdList
18
+ } & SendParam
5
19
 
6
20
  export class TrackAction extends Action {
7
21
  /**
8
22
  * 清除轨迹
23
+ * @param {*} pathId 自定义轨迹ID
9
24
  */
10
- static trackRemove({ pathId = "CameraTrack" }: TrackType) {
25
+ static trackRemove(pathId: TrackType['pathId'] = "CameraTrack") {
11
26
  const param: TrackType = {
12
27
  cmd: "path",
13
28
  action: "remove",
@@ -18,8 +33,10 @@ export class TrackAction extends Action {
18
33
 
19
34
  /**
20
35
  * 获取三维路网坐标
36
+ * @param {*} data
37
+ * @param {*} rnId 路网ID
21
38
  */
22
- static trackGetRoadNet({ data, rnId = 'RN-1' }: TrackType) {
39
+ static trackGetRoadNet(data: TrackType['data'], rnId: TrackType['rnId'] = 'RN-1') {
23
40
  const param: TrackType = {
24
41
  cmd: "path",
25
42
  action: "getRoadNet",
@@ -31,8 +48,10 @@ export class TrackAction extends Action {
31
48
 
32
49
  /**
33
50
  * 请求三维绘制路网
51
+ * @param {*} data
52
+ * @param {*} pathId 自定义轨迹ID
34
53
  */
35
- static trackPath({ data, pathId = "CameraTrack" }: TrackType) {
54
+ static trackPath(data: TrackType['data'], pathId: TrackType['pathId'] = "CameraTrack") {
36
55
  const param: TrackType = {
37
56
  cmd: "path",
38
57
  action: "add",
@@ -1,13 +1,37 @@
1
+
2
+
1
3
  /**
2
4
  * 视频融合方法
3
5
  */
4
- import { Action, VideoFusionType } from "./Action";
6
+ import { Action, IdList, LocationList, SendParam } from "./Action";
7
+
8
+ type VideoFusionActionType = 'init' | 'flyTo' | 'start' | 'stop' | 'pause' | 'resume' | 'refresh'
9
+ type VideoFusionType = {
10
+ action: VideoFusionActionType,
11
+ token?: string,
12
+ ip?: string,
13
+ port?: string,
14
+ isHttps?: boolean,
15
+ id?: string,
16
+ fov?: number, //视场角
17
+ backPlay?: boolean,
18
+ ids?: IdList,
19
+ isLocation?: boolean, //是否定位到第一个点,true=定位到第一个,false=不定位
20
+ videoType?: 'Video' | 'Record', //Video:实时流,Record:录像,默认实时流 Video
21
+ recordType?: 'Cloud' | 'Device',// Cloud:中心录像,Device:设备录像,默认中心录像 Cloud,videoType为 Record 时有效
22
+ } & SendParam
23
+
5
24
 
6
25
  export class VideoFusionAction extends Action {
7
26
  /**
8
27
  * 视频融合初始化
28
+ * @param {*} token TOKEN
29
+ * @param {*} ip IP
30
+ * @param {*} port 端口
31
+ * @param {*} token TOKEN
32
+ * @param {*} isHttps 是否https
9
33
  */
10
- static videoFusionInit({ token, ip, port = '1998', isHttps = false }: VideoFusionType) {
34
+ static videoFusionInit(token: VideoFusionType['token'], ip: VideoFusionType['ip'], port: VideoFusionType['port'] = '1998', isHttps: VideoFusionType['isHttps'] = false) {
11
35
  const param: VideoFusionType = {
12
36
  cmd: "videoFusion",
13
37
  action: "init",
@@ -21,8 +45,10 @@ export class VideoFusionAction extends Action {
21
45
 
22
46
  /**
23
47
  * 飞行到视频融合点位
48
+ * @param {*} id 点ID
49
+ * @param {*} fov 视场角
24
50
  */
25
- static videoFusionFlyTo({id, fov}:VideoFusionType) {
51
+ static videoFusionFlyTo(id: VideoFusionType['id'], fov: VideoFusionType['fov']) {
26
52
  const param: VideoFusionType = {
27
53
  cmd: "videoFusion",
28
54
  action: "flyTo",
@@ -34,8 +60,9 @@ export class VideoFusionAction extends Action {
34
60
 
35
61
  /**
36
62
  * 开启视频融合
63
+ * @param {*} ids id列表
37
64
  */
38
- static videoFusionStart({ids}:VideoFusionType) {
65
+ static videoFusionStart(ids: VideoFusionType['ids']) {
39
66
  const param: VideoFusionType = {
40
67
  cmd: "videoFusion",
41
68
  action: "start",
@@ -49,8 +76,9 @@ export class VideoFusionAction extends Action {
49
76
 
50
77
  /**
51
78
  * 关闭视频融合
79
+ * @param {*} ids id列表
52
80
  */
53
- static videoFusionStop({ids}:VideoFusionType) {
81
+ static videoFusionStop(ids: VideoFusionType['ids']) {
54
82
  const param: VideoFusionType = {
55
83
  cmd: "videoFusion",
56
84
  action: "stop",
@@ -64,8 +92,9 @@ export class VideoFusionAction extends Action {
64
92
 
65
93
  /**
66
94
  * 刷新视频融合
95
+ * @param {*} token TOKEN
67
96
  */
68
- static videoFusionRefresh({token}:VideoFusionType) {
97
+ static videoFusionRefresh(token: VideoFusionType['token']) {
69
98
  const param: VideoFusionType = {
70
99
  cmd: "videoFusion",
71
100
  action: "refresh",