GoScrobble/web/node_modules/fork-ts-checker-webpack-plugin/lib/LinkedList.d.ts

28 lines
861 B
TypeScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
export declare class HeadNode<T> {
next: LinkedListNode<T> | TailNode<T>;
constructor();
}
export declare class TailNode<T> {
previous: LinkedListNode<T> | HeadNode<T>;
constructor(head: HeadNode<T>);
}
export declare class LinkedListNode<T> {
next: LinkedListNode<T> | TailNode<T> | null;
previous: LinkedListNode<T> | HeadNode<T> | null;
readonly item: T;
constructor(item: T);
detachSelf(): void;
attachAfter(node: LinkedListNode<T> | HeadNode<T>): void;
attachBefore(node: LinkedListNode<T> | TailNode<T>): void;
}
export declare class LinkedList<T> {
head: HeadNode<T>;
tail: TailNode<T>;
constructor();
add(item: T): LinkedListNode<T>;
getItems(): T[];
forEach(callback: (item: T, node: LinkedListNode<T>) => void): void;
hasItems(): boolean;
getLastItem(): LinkedListNode<T>;
}