diff --git a/src/registry.ts b/src/registry.ts new file mode 100644 index 0000000..26ee2d8 --- /dev/null +++ b/src/registry.ts @@ -0,0 +1,12 @@ +export class SerializedRegistry { + private _registeredIds: string[] + constructor() {} + get registeredIds() { + return this._registeredIds; + } + public register(id: string) { + if (this._registeredIds.includes(id)) + throw Error(`${id} is already used`) + this._registeredIds.push(id); + } +} \ No newline at end of file