File size: 733 Bytes
b39afbe
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
 * Copyright (c) 2023 MERCENARIES.AI PTE. LTD.
 * All rights reserved.
 */

class WorkflowClientControlManager {
  controls: Map<string, any>;
  static instance: WorkflowClientControlManager;
  constructor() {
    this.controls = new Map();
  }

  add(key: string, clientControlType: any) {
    this.controls.set(key, clientControlType);
  }

  get(id: string) {
    return this.controls.get(id);
  }

  has(id: string) {
    return this.controls.has(id);
  }

  static getInstance() {
    if (WorkflowClientControlManager.instance == null) {
      WorkflowClientControlManager.instance = new WorkflowClientControlManager();
    }
    return WorkflowClientControlManager.instance;
  }
}

export { WorkflowClientControlManager };