export = FIFO declare class Node { next: Node prev: Node list: FIFO value: T constructor(list: FIFO, val: T) link(next: Node): Node } /** Create a new instance */ declare function FIFO(): FIFO declare class FIFO { /** Contains the first node on the list */ node: null|Node /** Number of nodes in the list */ length: number /** Sets the value of a node */ set(node: null|Node, value: T): null|Node /** * Returns the next node relative to the node you pass. If the node was the * last node in the list `null` is returned */ next(node?: null|Node): null|Node /** * Returns the previous node relative to the node you pass. If the node was * the first node in the list null is returned */ prev(node?: null|Node): null|Node /** Returns the value of the node */ get(node?: null|Node): null|T /** Removes the node and returns the value */ remove(node?: null|Node): null|T /** Inserts a value at the beginning of the list */ unshift(value: T): Node /** * Push a new value to the end of the list. Returns a node that contains this * value. The value can be accessed by accessing `node.value` */ push(value: T): Node /** Moves a node to the end of the list */ bump(node: Node): boolean /** Readds a node. Should only be done with a node that has been removed */ add(node: Node): Node /** Peek at the first value */ first(): null|T /** Peek at the last value */ last(): null|T /** Removes the first node and returns the value */ shift(): null|Node /** Removes the last node and returns the value */ pop(): null|Node /** Returns whether the list is empty */ isEmpty(): boolean /** Alias for `clear` */ removeAll: () => void /** Clears the list */ clear(): void /** * Iterate over all values in the list. Calls the function with `value, node` */ forEach(fn: (value: T, node: Node) => void): void /** Converts the list to an array and returns it */ toArray(): T[] }