import * as Y from "yjs"; export interface missionStoreModel { missionId: string; doc: Y.Doc; } /** * @description store credentials to socket to prevent auth data change while connected */ export abstract class MissionMap { private static store = new Map(); public static write(identifier: string, data: missionStoreModel, overwrite: boolean = false): void { if (!this.exists(identifier) || overwrite) this.store.set(identifier, data); } public static read(identifier: string): missionStoreModel { return this.store.get(identifier); } public static exists(identifier: string): boolean { return this.store.has(identifier); } public static delete(identifier: string): void { this.store.delete(identifier); } }