model-action 2.0.0 → 2.0.2

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.
Files changed (45) hide show
  1. package/dist/index.d.ts +7 -2
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +6 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/Action.d.ts.map +1 -1
  6. package/dist/modules/Action.js +1 -0
  7. package/dist/modules/Action.js.map +1 -1
  8. package/dist/modules/Animation.d.ts +59 -0
  9. package/dist/modules/Animation.d.ts.map +1 -0
  10. package/dist/modules/Animation.js +117 -0
  11. package/dist/modules/Animation.js.map +1 -0
  12. package/dist/modules/CameraView.d.ts +37 -0
  13. package/dist/modules/CameraView.d.ts.map +1 -0
  14. package/dist/modules/CameraView.js +110 -0
  15. package/dist/modules/CameraView.js.map +1 -0
  16. package/dist/modules/Effect.d.ts +37 -0
  17. package/dist/modules/Effect.d.ts.map +1 -0
  18. package/dist/modules/Effect.js +72 -0
  19. package/dist/modules/Effect.js.map +1 -0
  20. package/dist/modules/GameMode.d.ts +17 -0
  21. package/dist/modules/GameMode.d.ts.map +1 -0
  22. package/dist/modules/GameMode.js +36 -0
  23. package/dist/modules/GameMode.js.map +1 -0
  24. package/dist/modules/Init.d.ts +28 -0
  25. package/dist/modules/Init.d.ts.map +1 -0
  26. package/dist/modules/Init.js +81 -0
  27. package/dist/modules/Init.js.map +1 -0
  28. package/dist/modules/Path.d.ts +76 -0
  29. package/dist/modules/Path.d.ts.map +1 -0
  30. package/dist/modules/Path.js +155 -0
  31. package/dist/modules/Path.js.map +1 -0
  32. package/dist/peer-stream.d.ts +123 -0
  33. package/dist/peer-stream.d.ts.map +1 -0
  34. package/dist/peer-stream.js +852 -0
  35. package/dist/peer-stream.js.map +1 -0
  36. package/package.json +1 -1
  37. package/src/index.ts +7 -2
  38. package/src/modules/Action.ts +1 -0
  39. package/src/modules/Animation.ts +171 -0
  40. package/src/modules/{Camera.ts → CameraView.ts} +2 -2
  41. package/src/modules/Effect.ts +127 -0
  42. package/src/modules/GameMode.ts +60 -0
  43. package/src/modules/Init.ts +104 -0
  44. package/src/modules/{Track.ts → Path.ts} +21 -21
  45. package/src/peer-stream.js +938 -0
@@ -2,12 +2,12 @@
2
2
 
3
3
 
4
4
  /**
5
- * 轨迹方法
5
+ * 路径方法
6
6
  */
7
7
  import { Action, SendParam } from "./Action";
8
8
 
9
9
 
10
- type TrackActionType = 'getRoadNet' | 'remove' | 'add' | 'show' | 'hide' | 'updateMovingParam' | 'start' | 'stop' | 'restart' | 'beginEdit' | 'endEdit'
10
+ type PathActionType = 'getRoadNet' | 'remove' | 'add' | 'show' | 'hide' | 'updateMovingParam' | 'start' | 'stop' | 'restart' | 'beginEdit' | 'endEdit'
11
11
 
12
12
  // 路径模块类型
13
13
  export type PathModuleType = 'Edit' | 'PathTracer'
@@ -49,7 +49,7 @@ export interface PathEditParam {
49
49
  }
50
50
 
51
51
  // 轨迹添加的 data 结构
52
- interface TrackAddData {
52
+ interface PathAddData {
53
53
  action: 'add';
54
54
  pathId: string; // 自定义轨迹ID
55
55
  pathDrawBaseType: PathDrawBaseType; // 绘制方式
@@ -59,15 +59,15 @@ interface TrackAddData {
59
59
  points: PathPoint[]; // 路径点数组
60
60
  }
61
61
 
62
- type TrackType = SendParam & {
62
+ type PathType = SendParam & {
63
63
  cmd: "path";
64
64
  data: {
65
- action: TrackActionType;
65
+ action: PathActionType;
66
66
  [key: string]: any;
67
67
  };
68
68
  }
69
69
 
70
- export class TrackAction extends Action {
70
+ export class PathAction extends Action {
71
71
  /**
72
72
  * 请求三维绘制路径
73
73
  * @param pathId 自定义轨迹ID,后面删除的时候用,如果之前有编辑路径,这里就使用编辑路径的时候传入的路径 pathId
@@ -77,7 +77,7 @@ export class TrackAction extends Action {
77
77
  * @param rolerMoveParam 沿路径移动的信息
78
78
  * @param pathStyle 路径样式
79
79
  */
80
- static trackAdd(
80
+ static pathAdd(
81
81
  pathId: string,
82
82
  pathDrawBaseType: PathDrawBaseType,
83
83
  points: PathPoint[],
@@ -85,7 +85,7 @@ export class TrackAction extends Action {
85
85
  rolerMoveParam?: RolerMoveParam,
86
86
  pathStyle?: PathStyle
87
87
  ) {
88
- const data: TrackAddData = {
88
+ const data: PathAddData = {
89
89
  action: "add",
90
90
  pathId,
91
91
  pathDrawBaseType,
@@ -107,7 +107,7 @@ export class TrackAction extends Action {
107
107
  data.pathStyle = pathStyle;
108
108
  }
109
109
 
110
- const param: TrackType = {
110
+ const param: PathType = {
111
111
  cmd: "path",
112
112
  data
113
113
  };
@@ -120,7 +120,7 @@ export class TrackAction extends Action {
120
120
  * @param pathId 自定义轨迹ID,同前面,自定义的ID
121
121
  * @param module 显隐、删除哪一部分:Edit 编辑的部分 | PathTracer 根据设备点动态生成的路径部分,如果不传,则整个显隐或者删除
122
122
  */
123
- static trackShowHideRemove(
123
+ static pathShowHideRemove(
124
124
  action: 'show' | 'hide' | 'remove',
125
125
  pathId: string,
126
126
  module?: PathModuleType
@@ -139,7 +139,7 @@ export class TrackAction extends Action {
139
139
  data.module = module;
140
140
  }
141
141
 
142
- const param: TrackType = {
142
+ const param: PathType = {
143
143
  cmd: "path",
144
144
  data
145
145
  };
@@ -157,7 +157,7 @@ export class TrackAction extends Action {
157
157
  * @param pathId 自定义轨迹ID
158
158
  * @param rolerMoveParam 沿路径移动的参数
159
159
  */
160
- static trackUpdateMovingParam(
160
+ static pathUpdateMovingParam(
161
161
  pathId: string,
162
162
  rolerMoveParam: RolerMoveParam
163
163
  ) {
@@ -171,7 +171,7 @@ export class TrackAction extends Action {
171
171
  rolerMoveParam
172
172
  };
173
173
 
174
- const param: TrackType = {
174
+ const param: PathType = {
175
175
  cmd: "path",
176
176
  data
177
177
  };
@@ -184,19 +184,19 @@ export class TrackAction extends Action {
184
184
  * @param pathId 自定义轨迹ID
185
185
  * @param rolerMoveParam 沿路径移动的参数
186
186
  */
187
- static trackMove(action: 'start', pathId: string, rolerMoveParam: RolerMoveParam): void;
187
+ static pathMove(action: 'start', pathId: string, rolerMoveParam: RolerMoveParam): void;
188
188
  /**
189
189
  * 在生成的路径上面移动 - 停止或重启
190
190
  * @param action 操作类型:stop 停止移动 | restart 重启移动
191
191
  */
192
- static trackMove(action: 'stop' | 'restart'): void;
192
+ static pathMove(action: 'stop' | 'restart'): void;
193
193
  /**
194
194
  * 在生成的路径上面移动
195
195
  * @param action 操作类型:start 开始移动 | stop 停止移动 | restart 重启移动
196
196
  * @param pathId 自定义轨迹ID(仅 start 时需要)
197
197
  * @param rolerMoveParam 沿路径移动的参数(仅 start 时需要)
198
198
  */
199
- static trackMove(
199
+ static pathMove(
200
200
  action: 'start' | 'stop' | 'restart',
201
201
  pathId?: string,
202
202
  rolerMoveParam?: RolerMoveParam
@@ -219,7 +219,7 @@ export class TrackAction extends Action {
219
219
  }
220
220
  // stop 和 restart 不需要 pathId 和 rolerMoveParam
221
221
 
222
- const param: TrackType = {
222
+ const param: PathType = {
223
223
  cmd: "path",
224
224
  data
225
225
  };
@@ -238,7 +238,7 @@ export class TrackAction extends Action {
238
238
  * @param pathName 路径名称,前端配置界面提供数据,非必须
239
239
  * @param pathEditParam 路径编辑参数,前端配置界面提供数据
240
240
  */
241
- static trackBeginEdit(
241
+ static pathBeginEdit(
242
242
  pathId?: string,
243
243
  pathName?: string,
244
244
  pathEditParam?: PathEditParam
@@ -267,7 +267,7 @@ export class TrackAction extends Action {
267
267
  data.pathEditParam = pathEditParam;
268
268
  }
269
269
 
270
- const param: TrackType = {
270
+ const param: PathType = {
271
271
  cmd: "path",
272
272
  data
273
273
  };
@@ -277,14 +277,14 @@ export class TrackAction extends Action {
277
277
  /**
278
278
  * 停止路径编辑
279
279
  */
280
- static trackEndEdit() {
280
+ static pathEndEdit() {
281
281
  const data: {
282
282
  action: 'endEdit';
283
283
  } = {
284
284
  action: 'endEdit'
285
285
  };
286
286
 
287
- const param: TrackType = {
287
+ const param: PathType = {
288
288
  cmd: "path",
289
289
  data
290
290
  };