提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 lines
317 B

  1. export declare class Registry<T> {
  2. private readonly generateIdentifier;
  3. private kv;
  4. constructor(generateIdentifier: (v: T) => string);
  5. register(value: T, identifier?: string): void;
  6. clear(): void;
  7. getIdentifier(value: T): string | undefined;
  8. getValue(identifier: string): T | undefined;
  9. }