@dao42/d42paas-front 0.9.3 → 0.9.7

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/DaoPaaS.d.ts CHANGED
@@ -1,14 +1,3 @@
1
- /*!-----------------------------------------------------------
2
- * Copyright (c) dao42. All rights reserved.
3
- * Type definitions for @dao42/d42paas-front
4
- * Released under the MIT license
5
- *-----------------------------------------------------------*/
6
-
7
- /*---------------------------------------------------------------------------------------------
8
- * Copyright (c) Microsoft Corporation. All rights reserved.
9
- * Licensed under the MIT License. See License.txt in the project root for license information.
10
- *--------------------------------------------------------------------------------------------*/
11
-
12
1
  export interface DiffPatternInfo {
13
2
  value: string;
14
3
  type: string;
@@ -27,91 +16,8 @@ export type Components = Record<ComponentType, any>;
27
16
  export type Mode = 'tsdoc' | 'singleFile' | 'IDE';
28
17
 
29
18
  export type PlaygroundStatus = 'EMPTY' | 'ACTIVE' | 'INACTIVE';
30
-
31
19
  export type DockerStatus = 'RUNNING' | 'STOP';
32
20
 
33
- // export type Replay = 'stop' | 'disabled' | 'pause';
34
- interface MessageType {
35
- /**
36
- * The message type is use to show up the playground status.
37
- */
38
- playgroundStatus?: PlaygroundStatus;
39
-
40
- /**
41
- * The message type is used to show up the docker status.
42
- */
43
- dockerStatus?: DockerStatus;
44
-
45
- /**
46
- * The message type is used to list the users in the room
47
- */
48
- userList?: UserInfo[];
49
-
50
- /**
51
- * The message type is used to identify the user you following.
52
- */
53
- followingUser?: UserInfo;
54
-
55
- /**
56
- * The message type is used to indicate the users who following you.
57
- */
58
- usersFollowYou?: UserInfo[];
59
- }
60
-
61
- interface ErrorType {
62
- /**
63
- * The error message block
64
- */
65
- message: {
66
- /**
67
- * The error message content
68
- */
69
- content: string;
70
-
71
- /**
72
- * The error playground you started
73
- */
74
- playgroundId: string;
75
-
76
- /**
77
- * The error timestamp
78
- */
79
- timestamp: number;
80
- };
81
- }
82
-
83
- /**
84
- * Userinfo type
85
- */
86
- interface UserInfo {
87
- /**
88
- * The playground id show up in the user info
89
- */
90
- playgroundId?: string;
91
-
92
- operation?: any;
93
- uuid?: string;
94
- color?: string;
95
- name?: string;
96
- username?: string;
97
- agentUserId?: string;
98
- role?: string;
99
- avatar?: string;
100
- onlineCount?: number;
101
- }
102
-
103
- // interface ReplayType {
104
- // /**
105
- // * The agentUserId of the user who started the replay
106
- // */
107
- // agentUserId?: UserInfo['agentUserId'];
108
-
109
- // /**
110
- // * The timestamp of the replay
111
- // */
112
- // timestamp: number;
113
- // }
114
-
115
21
  export interface TreeProps {
116
22
  /**
117
23
  * The tree Item height
@@ -347,87 +253,38 @@ export type ComponentPropsType =
347
253
  | ConsoleOrShellProps;
348
254
 
349
255
  /**
350
- * Passing the values to init the playground.
351
- * @category PaaS Options [Required]
256
+ *
257
+ * @interface Component
258
+ * @desc The props of the component.
259
+ *
352
260
  */
353
- export interface Options {
354
- /**
355
- * @ignore
356
- *
357
- */
358
- debug?: boolean;
359
-
360
- /**
361
- *
362
- * Error listener to the application.
363
- * @param The error message block
364
- * @event
365
- */
366
- onError?: (error: ErrorType) => void;
367
-
368
- /**
369
- *
370
- * Message listener to the application.
371
- * @param MessageType
372
- * @event
373
- */
374
- onMessage?: (message: MessageType) => void;
375
-
376
- /**
377
- * The service worker origin
378
- */
379
- // serviceWorkerOrigin?: string;
380
-
261
+ export interface Component<T> {
381
262
  /**
382
263
  *
383
- * init the playground with the mode.
264
+ * The DOM for the component.
265
+ * @type {(string | HTMLElement | Element)}
384
266
  *
385
267
  */
386
- // mode?: Mode;
268
+ container: string | HTMLElement | Element;
387
269
 
270
+ item: ComponentType;
388
271
  /**
389
- *
390
- * init the playground with the paasDomain.
391
- * @param The paas domain
392
- * @optional
272
+ * The component props
273
+ * todo: fix the type of any
393
274
  */
394
- paasDomain?: string;
275
+ props?: any;
276
+ }
395
277
 
396
- /**
397
- *
398
- * init the playground ticket needed.
399
- *
400
- */
278
+ /**
279
+ * Passing the values to init the playground.
280
+ * @category PaaS Options [Required]
281
+ */
282
+ export interface PaaSOptions {
401
283
  ticket: string;
402
-
403
- /**
404
- *
405
- * agentUserId for the playground.
406
- *
407
- */
408
- // agentUserId: string;
409
-
410
- /**
411
- *
412
- * tenantId for the playground.
413
- *
414
- */
415
284
  tenantId: string;
416
-
417
- /**
418
- * userInfo for the playground.
419
- */
420
- userInfo: {
421
- username: string;
422
- avatarUrl?: string;
423
- };
424
-
425
- /**
426
- *
427
- * this argument is to ingnore replaying patterns.
428
- *
429
- */
430
- ignoreReplayers?: string[];
285
+ userInfo: UserInfo;
286
+ // 可选, 默认连接到 www.1024paas.com
287
+ paasDomain?: string;
431
288
 
432
289
  /**
433
290
  *
@@ -439,33 +296,20 @@ export interface Options {
439
296
  components?: Component<ComponentPropsType>[];
440
297
 
441
298
  /**
442
- * @deprecated to fix the issue of the playground.
443
299
  *
444
- * render?: () => TComponent[]; keyof Dao_FrontType.CRDT[]
300
+ * Message listener to the application.
301
+ * @param Message
302
+ * @event
445
303
  */
446
- }
304
+ onMessage?: (message: Message) => void;
447
305
 
448
- /**
449
- *
450
- * @interface Component
451
- * @desc The props of the component.
452
- *
453
- */
454
- export interface Component<T> {
455
306
  /**
456
307
  *
457
- * The DOM for the component.
458
- * @type {(string | HTMLElement | Element)}
459
- *
460
- */
461
- container: string | HTMLElement | Element;
462
-
463
- item: ComponentType;
464
- /**
465
- * The component props
466
- * todo: fix the type of any
308
+ * Error listener to the application.
309
+ * @param The error message block
310
+ * @event
467
311
  */
468
- props?: any;
312
+ onError?: (error: Message) => void;
469
313
  }
470
314
 
471
315
  /**
@@ -481,15 +325,7 @@ export interface Component<T> {
481
325
  *
482
326
  * See {@link Options} for more details.
483
327
  */
484
- export class DaoPaaS {
485
- constructor(options: Options);
486
-
487
- get playgroundStatus(): PlaygroundStatus;
488
-
489
- get dockerStatus(): DockerStatus;
490
-
491
- get userList(): UserInfo[];
492
-
328
+ export interface IDaoPaaS {
493
329
  /**
494
330
  *
495
331
  * Error listener to the application.
@@ -512,7 +348,7 @@ export class DaoPaaS {
512
348
  * @param {unFollowUser} args
513
349
  *
514
350
  */
515
- dispose(): Promise<string>;
351
+ dispose(): void;
516
352
 
517
353
  /**
518
354
  *
@@ -537,7 +373,7 @@ export class DaoPaaS {
537
373
  * @param {DiffPatternInfo} args
538
374
  *
539
375
  */
540
- setDiff(current: DiffPatternInfo, next: DiffPatternInfo): void;
376
+ // setDiff(current: DiffPatternInfo, next: DiffPatternInfo): void;
541
377
 
542
378
  /**
543
379
  *
@@ -545,14 +381,14 @@ export class DaoPaaS {
545
381
  *
546
382
  */
547
383
 
548
- replayAll(): void;
384
+ // replayAll(): void;
549
385
  /**
550
386
  *
551
387
  * Replaying method for global calling.
552
388
  * @param {ReplayType} args
553
389
  *
554
390
  */
555
- replay(agentUserId: Pick<UserInfo, 'agentUserId'>): void;
391
+ // replay(agentUserId: Pick<UserInfo, 'agentUserId'>): void;
556
392
 
557
393
  /**
558
394
  *
@@ -560,23 +396,7 @@ export class DaoPaaS {
560
396
  * @param {boolean} arg
561
397
  *
562
398
  */
563
- record(arg?: boolean): void;
564
-
565
- /**
566
- *
567
- * async method to set Replayers.
568
- * @param {keyof Dao_FrontType.CRDT[]} arg
569
- *
570
- */
571
- setReplayers(arg: string[]): void;
572
-
573
- /**
574
- *
575
- * Here you can switch language services by calling this method.
576
- * @param {boolean} arg
577
- *
578
- */
579
- switchLspServer(arg: boolean): void;
399
+ // record(arg?: boolean): void;
580
400
 
581
401
  /**
582
402
  *
@@ -614,7 +434,7 @@ export class DaoPaaS {
614
434
  *
615
435
  *
616
436
  */
617
- Editor(args: Omit<Component<EditorProps>, 'item'>): void;
437
+ // Editor(args: Omit<Component<EditorProps>, 'item'>): void;
618
438
 
619
439
  /**
620
440
  *
@@ -624,7 +444,7 @@ export class DaoPaaS {
624
444
  * @param Component
625
445
  *
626
446
  */
627
- Page(args: Omit<Component<TreeProps>, 'item'>): void;
447
+ // Page(args: Omit<Component<TreeProps>, 'item'>): void;
628
448
 
629
449
  /**
630
450
  *
@@ -643,7 +463,7 @@ export class DaoPaaS {
643
463
  * @param Component
644
464
  *
645
465
  */
646
- Tree(args: Omit<Component<TreeProps>, 'item'>): void;
466
+ // Tree(args: Omit<Component<TreeProps>, 'item'>): void;
647
467
 
648
468
  /**
649
469
  *
@@ -663,7 +483,7 @@ export class DaoPaaS {
663
483
  * @param Component
664
484
  *
665
485
  */
666
- Shell(args: Omit<Component<ConsoleOrShellProps>, 'item'>): void;
486
+ // Shell(args: Omit<Component<ConsoleOrShellProps>, 'item'>): void;
667
487
 
668
488
  /**
669
489
  *
@@ -682,7 +502,7 @@ export class DaoPaaS {
682
502
  * @param Component
683
503
  *
684
504
  */
685
- Browser(args: Omit<Component<BrowserProps>, 'item'>): void;
505
+ // Browser(args: Omit<Component<BrowserProps>, 'item'>): void;
686
506
 
687
507
  /**
688
508
  *
@@ -702,7 +522,7 @@ export class DaoPaaS {
702
522
  * @param Component
703
523
  *
704
524
  */
705
- Console(args: Omit<Component<ConsoleOrShellProps>, 'item'>): void;
525
+ // Console(args: Omit<Component<ConsoleOrShellProps>, 'item'>): void;
706
526
 
707
527
  mapRender(components: Component<ComponentType>[]): void;
708
528
  }