@dao42/d42paas-front 0.7.26 → 0.7.31

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/editor.d.ts CHANGED
@@ -8,19 +8,30 @@
8
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
9
9
  * Licensed under the MIT License. See License.txt in the project root for license information.
10
10
  *--------------------------------------------------------------------------------------------*/
11
+ export type Mode = 'tsdoc' | 'singleFile' | 'IDE';
11
12
 
12
- export type TMode = 'tsdoc' | 'singleFile' | 'IDE';
13
+ export type PlaygroundStatus = 'EMPTY' | 'ACTIVE' | 'INACTIVE';
13
14
 
14
- export type T_PlaygroundStatus = 'EMPTY' | 'ACTIVE' | 'INACTIVE';
15
+ export type Replay = 'stop' | 'disabled' | 'pause';
15
16
 
16
- export type TReplay = 'stop' | 'disabled' | 'pause';
17
+ export type DockerStatus = 'RUNNING' | 'STOP';
17
18
 
18
- export type T_DockerStatus = 'RUNNING' | 'STOP';
19
+ type MessageType = {
20
+ PlaygroundStatus?: PlaygroundStatus;
21
+ dockerStatus?: DockerStatus;
22
+ userList?: UserInfo[];
23
+ };
24
+
25
+ type ErrorType = {
26
+ PlaygroundStatus?: any;
27
+ dockerStatus?: DockerStatus;
28
+ userList?: UserInfo[];
29
+ };
19
30
 
20
31
  /**
21
- * JS API
32
+ * Userinfo type
22
33
  */
23
- interface TUserInfo {
34
+ interface UserInfo {
24
35
  playgroundId?: string;
25
36
  operation?: any;
26
37
  uuid?: string;
@@ -33,15 +44,30 @@ interface TUserInfo {
33
44
  onlineCount?: number;
34
45
  }
35
46
 
47
+ type ReplayType = {
48
+ userId?: UserInfo['userId'];
49
+ timestamp: number;
50
+ };
51
+
36
52
  /**
37
- * the arguments of the Playground.
53
+ * Passing the values to init the playground.
38
54
  */
39
- interface TConstructor {
55
+ export interface Options {
40
56
  debug?: boolean;
41
57
 
58
+ /**
59
+ *
60
+ * Error listener to the aplication.
61
+ * @param error
62
+ */
42
63
  onError?: (error: any) => void;
43
64
 
44
- onMessage?: (message: any) => void;
65
+ /**
66
+ *
67
+ * Message listener to the aplication.
68
+ * @param MessageType
69
+ */
70
+ onMessage?: (message: MessageType) => void;
45
71
 
46
72
  serviceWorkerOrigin?: string;
47
73
 
@@ -50,12 +76,11 @@ interface TConstructor {
50
76
  * init the playground with the mode.
51
77
  *
52
78
  */
53
-
54
- mode?: TMode;
79
+ mode?: Mode;
55
80
 
56
81
  /**
57
82
  *
58
- * init the playground with the env.
83
+ * init the playground with the paasDomain.
59
84
  *
60
85
  */
61
86
  paasDomain: string;
@@ -118,22 +143,21 @@ interface TConstructor {
118
143
  */
119
144
  }
120
145
 
121
- export interface UserComponent extends TComponentArgs {
146
+ export interface UserComponent extends ComponentArgs {
122
147
  item: string;
123
148
  }
124
149
 
125
150
  /**
126
151
  *
127
- * @interface TComponentArgs
152
+ * @interface ComponentArgs
128
153
  * @desc
129
154
  *
130
155
  */
131
- export interface TComponentArgs {
156
+ export interface ComponentArgs {
132
157
  /**
133
158
  *
134
159
  * the DOM for the component.
135
160
  * @type {(string | HTMLElement | Element)}
136
- * @memberof TComponentArgs
137
161
  *
138
162
  */
139
163
  container: string | HTMLElement | Element;
@@ -141,14 +165,17 @@ export interface TComponentArgs {
141
165
  props?: any;
142
166
  }
143
167
 
168
+ /**
169
+ * This is the entry point for the application.
170
+ */
144
171
  export class DaoPaaS {
145
- constructor(args: TConstructor);
172
+ constructor(options: Options);
146
173
 
147
- get playgroundStatus(): T_PlaygroundStatus;
174
+ get playgroundStatus(): PlaygroundStatus;
148
175
 
149
- get dockerStatus(): T_DockerStatus;
176
+ get dockerStatus(): DockerStatus;
150
177
 
151
- get userList(): TUserInfo[];
178
+ get userList(): UserInfo[];
152
179
 
153
180
  /**
154
181
  *
@@ -157,7 +184,7 @@ export class DaoPaaS {
157
184
  *
158
185
  */
159
186
 
160
- unFollowUser(user: any, callback: () => void): void;
187
+ unFollowUser(user: UserInfo, callback: () => void): void;
161
188
 
162
189
  /**
163
190
  *
@@ -165,16 +192,15 @@ export class DaoPaaS {
165
192
  * @param {followUser} args
166
193
  *
167
194
  */
168
-
169
- followUser(user: any, callback: () => void): void;
195
+ followUser(user: UserInfo, callback: () => void): void;
170
196
 
171
197
  /**
172
198
  *
173
199
  * Replaying method for global calling.
174
- * @param {TReplay} args
200
+ * @param {ReplayType} args
175
201
  *
176
202
  */
177
- replay(args: { userId: TUserInfo['userId']; timestamp: string }): void;
203
+ replay(param: ReplayType): void;
178
204
 
179
205
  /**
180
206
  *
@@ -182,7 +208,7 @@ export class DaoPaaS {
182
208
  * @param {boolean} arg
183
209
  *
184
210
  */
185
- record(arg: boolean): void;
211
+ record(arg?: boolean): void;
186
212
 
187
213
  /**
188
214
  *
@@ -203,7 +229,6 @@ export class DaoPaaS {
203
229
  /**
204
230
  *
205
231
  * Active the playground handler.
206
- * @memberof DaoPaaS
207
232
  *
208
233
  */
209
234
  activePlayground(): void;
@@ -211,7 +236,6 @@ export class DaoPaaS {
211
236
  /**
212
237
  *
213
238
  * Run the playground handler.
214
- * @memberof DaoPaaS
215
239
  *
216
240
  */
217
241
  runPlayground(): void;
@@ -219,7 +243,6 @@ export class DaoPaaS {
219
243
  /**
220
244
  *
221
245
  * Stop the playground.
222
- * @memberof DaoPaaS
223
246
  *
224
247
  */
225
248
  stopPlayground(): void;
@@ -227,12 +250,12 @@ export class DaoPaaS {
227
250
  /**
228
251
  *
229
252
  * Editor component.
230
- * @memberof DaoPaaS
253
+ * @param ComponentArgs
231
254
  * CSS.Properties<string | number>
232
255
  */
233
256
  Editor(
234
257
  args:
235
- | TComponentArgs
258
+ | ComponentArgs
236
259
  | {
237
260
  containerStyle: any;
238
261
  editorStyle: any;
@@ -243,40 +266,40 @@ export class DaoPaaS {
243
266
  /**
244
267
  *
245
268
  * Page component.
246
- * @memberof DaoPaaS
269
+ * @param ComponentArgs
247
270
  *
248
271
  */
249
- Page(args: TComponentArgs): void;
272
+ Page(args: ComponentArgs): void;
250
273
 
251
274
  /**
252
275
  *
253
276
  * Tree component.
254
- * @memberof DaoPaaS
277
+ * @param ComponentArgs
255
278
  *
256
279
  */
257
- Tree(args: TComponentArgs): void;
280
+ Tree(args: ComponentArgs): void;
258
281
 
259
282
  /**
260
283
  *
261
284
  * Shell component.
262
- * @memberof DaoPaaS
285
+ * @param ComponentArgs
263
286
  *
264
287
  */
265
- Shell(args: TComponentArgs): void;
288
+ Shell(args: ComponentArgs): void;
266
289
 
267
290
  /**
268
291
  *
269
292
  * Browser component.
270
- * @memberof DaoPaaS
293
+ * @param ComponentArgs
271
294
  *
272
295
  */
273
- Browser(args: TComponentArgs): void;
296
+ Browser(args: ComponentArgs): void;
274
297
 
275
298
  /**
276
299
  *
277
300
  * Console component.
278
- * @memberof DaoPaaS
301
+ * @param ComponentArgs
279
302
  *
280
303
  */
281
- Console(args: TComponentArgs): void;
304
+ Console(args: ComponentArgs): void;
282
305
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dao42/d42paas-front",
3
- "version": "0.7.26",
3
+ "version": "0.7.31",
4
4
  "description": "> TODO: description",
5
5
  "author": "eric183 <kk297466058@gmail.com>",
6
6
  "homepage": "https://github.com/dao42/d42paas_frontend#readme",
@@ -26,7 +26,7 @@
26
26
  "scripts": {
27
27
  "prebuild": "rimraf dist",
28
28
  "webpack": "cross-env TS_NODE_PROJECT=\"tsconfig.dev.json\" webpack --config ./config/webpack.prod.config.ts",
29
- "start:web": "yarn vite && yarn workNameSpaceToFix",
29
+ "start:web": "yarn vite && yarn workNameSpaceToFix && yarn typedoc",
30
30
  "storybook": "start-storybook -p 6006",
31
31
  "build-storybook": "build-storybook -o .storybook/dist",
32
32
  "dev:disble": "cross-env TS_NODE_PROJECT=\"tsconfig.dev.json\" webpack serve --open --config ./config/webpack.dev.config.ts",
@@ -34,8 +34,10 @@
34
34
  "dev": "vite serve --host --config ./config/vite.config.ts",
35
35
  "dev:patch": "vite serve --host --config ./config/vite.dev.config.ts",
36
36
  "vite": "cross-env NODE_ENV=production vite build --config ./config/vite.config.ts && yarn run copyTS",
37
+ "typedoc": "npx typedoc --tsconfig ./doc.tsconfig.json",
37
38
  "fix": "eslint --fix --ext .jsx src/**",
38
39
  "copyTS": "shx cp ./src/types/editor.d.ts ./dist",
40
+ "copyMD": "shx cp ../../README.md ./dist",
39
41
  "np": "npm publish --access-public",
40
42
  "patch": "yarn vite && npm version patch && yarn clean",
41
43
  "test": "jest --verbose",
@@ -83,7 +85,6 @@
83
85
  "@types/react-dom": "^17.0.9",
84
86
  "@types/tailwindcss": "^2.2.4",
85
87
  "@types/uuid": "^8.3.1",
86
- "@types/webpack": "^5.28.0",
87
88
  "@vitejs/plugin-react": "^1.0.7",
88
89
  "autoprefixer": "^10.0.2",
89
90
  "babel-core": "^6.26.3",