Cache.d.ts 437 B

1234567891011
  1. export type KeyType = string | number;
  2. type ValueType = [number, any];
  3. declare class Entity {
  4. instanceId: string;
  5. constructor(instanceId: string);
  6. /** @private Internal cache map. Do not access this directly */
  7. cache: Map<string, ValueType>;
  8. get(keys: KeyType[] | string): ValueType | null;
  9. update(keys: KeyType[] | string, valueFn: (origin: ValueType | null) => ValueType | null): void;
  10. }
  11. export default Entity;