model-action 1.0.5 → 1.0.6

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.
@@ -1,4 +1,57 @@
1
- import { SendParam } from "../../index";
1
+ export type RequiredSome<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
2
+ export interface SendParam {
3
+ cmd: string;
4
+ action: string;
5
+ }
6
+ export interface IdItem {
7
+ id: string;
8
+ }
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
+ 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
+ export type LocationList = Array<{
29
+ location: LocationItem;
30
+ }>;
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;
2
55
  export declare class Action {
3
56
  /**
4
57
  * 视角初始化
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * POI点方法
3
3
  */
4
- import { PoiType, RequiredSome } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, PoiType, RequiredSome } from "./Action";
6
5
  export declare class PoiAction extends Action {
7
6
  /**
8
7
  * 添加poi
@@ -1,3 +1,6 @@
1
+ /**
2
+ * POI点方法
3
+ */
1
4
  import { Action } from "./Action";
2
5
  export class PoiAction extends Action {
3
6
  /**
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * 轨迹方法
3
3
  */
4
- import { TrackType } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, TrackType } from "./Action";
6
5
  export declare class TrackAction extends Action {
7
6
  /**
8
7
  * 清除轨迹
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 轨迹方法
3
+ */
1
4
  import { Action } from "./Action";
2
5
  export class TrackAction extends Action {
3
6
  /**
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * 视频融合方法
3
3
  */
4
- import { VideoFusionType } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, VideoFusionType } from "./Action";
6
5
  export declare class VideoFusionAction extends Action {
7
6
  /**
8
7
  * 视频融合初始化
@@ -1,3 +1,6 @@
1
+ /**
2
+ * 视频融合方法
3
+ */
1
4
  import { Action } from "./Action";
2
5
  export class VideoFusionAction extends Action {
3
6
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "model-action",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "与三维交互api",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,4 +1,70 @@
1
- import { SendParam } from "../../index";
1
+ export type RequiredSome<T, K extends keyof T> = Required<Pick<T, K>> & Omit<T, K>;
2
+
3
+ export interface SendParam {
4
+ cmd: string,
5
+ action: string,
6
+ }
7
+
8
+ export interface IdItem {
9
+ id: string;
10
+ }
11
+
12
+ export type IdList = IdItem[];
13
+
14
+
15
+ export type PathList = Array<{
16
+ location: string
17
+ }>
18
+
19
+
20
+ export type PoiAction = 'show' | 'hide' | 'add' | 'delete' | 'update' | 'getInfo'
21
+ 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
+
38
+ export type LocationList = Array<{
39
+ location: LocationItem
40
+ }>
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
2
68
 
3
69
  export class Action {
4
70
  /**
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * POI点方法
3
3
  */
4
- import { PoiType, RequiredSome } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, PoiType, RequiredSome } from "./Action";
6
5
 
7
6
  export class PoiAction extends Action {
8
7
  /**
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * 轨迹方法
3
3
  */
4
- import { TrackType } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, TrackType } from "./Action";
6
5
 
7
6
  export class TrackAction extends Action {
8
7
  /**
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * 视频融合方法
3
3
  */
4
- import { VideoFusionType } from "../../index";
5
- import { Action } from "./Action";
4
+ import { Action, VideoFusionType } from "./Action";
6
5
 
7
6
  export class VideoFusionAction extends Action {
8
7
  /**