ae0b85ec92c45ea2b758d6a87d4699251ec9aac691519caf38199fa603b77a63a849c771597ee352b2d245abcc291b795a3da4beed7bbe8ae53ba0f4838a9e 1.1 KB

1234567891011121314151617181920212223242526272829
  1. import { Container, ContainerIterator } from "../../ContainerBase";
  2. export declare type HashLinkNode<K, V> = {
  3. _key: K;
  4. _value: V;
  5. _pre: HashLinkNode<K, V>;
  6. _next: HashLinkNode<K, V>;
  7. };
  8. export declare abstract class HashContainerIterator<K, V> extends ContainerIterator<K | [K, V]> {
  9. abstract readonly container: HashContainer<K, V>;
  10. pre(): this;
  11. next(): this;
  12. }
  13. export declare abstract class HashContainer<K, V> extends Container<K | [K, V]> {
  14. /**
  15. * @description Unique symbol used to tag object.
  16. */
  17. readonly HASH_TAG: symbol;
  18. clear(): void;
  19. /**
  20. * @description Remove the element of the specified key.
  21. * @param key - The key you want to remove.
  22. * @param isObject - Tell us if the type of inserted key is `object` to improve efficiency.<br/>
  23. * If a `undefined` value is passed in, the type will be automatically judged.
  24. * @returns Whether erase successfully.
  25. */
  26. eraseElementByKey(key: K, isObject?: boolean): boolean;
  27. eraseElementByIterator(iter: HashContainerIterator<K, V>): HashContainerIterator<K, V>;
  28. eraseElementByPos(pos: number): number;
  29. }