提交学习笔记专用
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.

14 lines
212 B

  1. interface Node {
  2. next: Node | null;
  3. }
  4. interface Constructor<T> {
  5. new(): T;
  6. }
  7. declare function reusify<T extends Node>(constructor: Constructor<T>): {
  8. get(): T;
  9. release(node: T): void;
  10. };
  11. export = reusify;