// Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 export class NodeRefMap { private map: Map> = new Map(); generation: number = 0; set(id: string, ref: React.RefObject) { this.map.set(id, ref); this.generation++; } delete(id: string) { if (this.map.has(id)) { this.map.delete(id); this.generation++; } } get(id: string): React.RefObject { if (this.map.has(id)) { return this.map.get(id); } } }