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.

26 lines
625 B

4 years ago
  1. declare class Denque<T = any> {
  2. constructor();
  3. constructor(array: T[]);
  4. push(item: T): number;
  5. unshift(item: T): number;
  6. pop(): T | undefined;
  7. removeBack(): T | undefined;
  8. shift(): T | undefined;
  9. peekBack(): T | undefined;
  10. peekFront(): T | undefined;
  11. peekAt(index: number): T | undefined;
  12. get(index: number): T | undefined;
  13. remove(index: number, count: number): T[];
  14. removeOne(index: number): T | undefined;
  15. splice(index: number, count: number, ...item: T[]): T[] | undefined;
  16. isEmpty(): boolean;
  17. clear(): void;
  18. toString(): string;
  19. toArray(): T[];
  20. length: number;
  21. }
  22. export = Denque;