// Type definitions for yallist 4.0 // Project: https://github.com/isaacs/yallist#readme // Definitions by: BendingBender // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 export = Yallist; declare class Yallist implements Iterable { static create(): Yallist; static create(list: Yallist.ForEachIterable): Yallist; static create(...items: T[]): Yallist; static Node: Yallist.NodeConstructor; head: Yallist.Node | null; tail: Yallist.Node | null; length: number; constructor(); constructor(list: Yallist.ForEachIterable); constructor(...items: T[]); forEach(callbackFn: (this: U, value: T, index: number, list: this) => void, thisArg?: U): void; forEachReverse(callbackFn: (this: U, value: T, index: number, list: this) => void, thisArg?: U): void; get(n: number): T | undefined; getReverse(n: number): T | undefined; map(callbackFn: (this: U, value: T, list: this) => R, thisArg?: U): Yallist; mapReverse(callbackFn: (this: U, value: T, list: this) => R, thisArg?: U): Yallist; pop(): T | undefined; push(...items: T[]): number; pushNode(node: Yallist.Node): void; reduce(fn: (previousValue: U, currentValue: T, index: number) => U, initialValue?: U): U; reduceReverse(fn: (previousValue: U, currentValue: T, index: number) => U, initialValue?: U): U; removeNode(node: Yallist.Node): void; reverse(): this; shift(): T | undefined; slice(from?: number, to?: number): Yallist; sliceReverse(from?: number, to?: number): Yallist; splice(start: number, deleteCount: number, ...nodes: T[]): T[]; toArray(): T[]; toArrayReverse(): T[]; unshift(...items: T[]): number; unshiftNode(node: Yallist.Node): void; [Symbol.iterator](): Iterator; } declare namespace Yallist { interface ForEachIterable { forEach(callbackFn: (item: T) => void): void; } interface NodeConstructor { (value: T, prev?: Node, next?: Node, list?: Yallist): Node; new (value: T, prev?: Node, next?: Node, list?: Yallist): Node; } interface Node { prev: Node | null; next: Node | null; value: T; list?: Yallist | undefined; } }