@types/yallist
TypeScript icon, indicating that this package has built-in type declarations

4.0.4 • Public • Published

Installation

npm install --save @types/yallist

Summary

This package contains type definitions for yallist (https://github.com/isaacs/yallist#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yallist.

index.d.ts

export = Yallist;

declare class Yallist<T> implements Iterable<T> {
    static create<T>(): Yallist<T>;
    static create<T>(list: Yallist.ForEachIterable<T>): Yallist<T>;
    static create<T>(...items: T[]): Yallist<T>;

    static Node: Yallist.NodeConstructor;

    head: Yallist.Node<T> | null;
    tail: Yallist.Node<T> | null;
    length: number;

    constructor();
    constructor(list: Yallist.ForEachIterable<T>);
    constructor(...items: T[]);

    forEach<U = this>(callbackFn: (this: U, value: T, index: number, list: this) => void, thisArg?: U): void;
    forEachReverse<U = this>(callbackFn: (this: U, value: T, index: number, list: this) => void, thisArg?: U): void;
    get(n: number): T | undefined;
    getReverse(n: number): T | undefined;
    map<U = this, R = T>(callbackFn: (this: U, value: T, list: this) => R, thisArg?: U): Yallist<R>;
    mapReverse<U = this, R = T>(callbackFn: (this: U, value: T, list: this) => R, thisArg?: U): Yallist<R>;
    pop(): T | undefined;
    push(...items: T[]): number;
    pushNode(node: Yallist.Node<T>): void;
    reduce<U = T>(fn: (previousValue: U, currentValue: T, index: number) => U, initialValue?: U): U;
    reduceReverse<U = T>(fn: (previousValue: U, currentValue: T, index: number) => U, initialValue?: U): U;
    removeNode(node: Yallist.Node<T>): void;
    reverse(): this;
    shift(): T | undefined;
    slice(from?: number, to?: number): Yallist<T>;
    sliceReverse(from?: number, to?: number): Yallist<T>;
    splice(start: number, deleteCount: number, ...nodes: T[]): T[];
    toArray(): T[];
    toArrayReverse(): T[];
    unshift(...items: T[]): number;
    unshiftNode(node: Yallist.Node<T>): void;

    [Symbol.iterator](): Iterator<T>;
}

declare namespace Yallist {
    interface ForEachIterable<T> {
        forEach(callbackFn: (item: T) => void): void;
    }

    interface NodeConstructor {
        <T>(value: T, prev?: Node<T>, next?: Node<T>, list?: Yallist<T>): Node<T>;
        new<T>(value: T, prev?: Node<T>, next?: Node<T>, list?: Yallist<T>): Node<T>;
    }

    interface Node<T> {
        prev: Node<T> | null;
        next: Node<T> | null;
        value: T;
        list?: Yallist<T> | undefined;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
4.0.417,435ts5.7
4.0.417,435ts5.6
4.0.417,435latest
4.0.417,435ts4.5
4.0.417,435ts4.6
4.0.417,435ts4.7
4.0.417,435ts4.8
4.0.417,435ts4.9
4.0.417,435ts5.0
4.0.417,435ts5.1
4.0.417,435ts5.2
4.0.417,435ts5.3
4.0.417,435ts5.4
4.0.417,435ts5.5
4.0.417,435ts5.8
4.0.11,666ts3.6
4.0.11,666ts3.7
4.0.11,666ts3.8
4.0.11,666ts3.9
4.0.11,666ts4.0
4.0.11,666ts4.1
4.0.11,666ts4.2
4.0.11,666ts4.3
4.0.11,666ts4.4
3.0.163ts2.3
3.0.163ts2.4
3.0.163ts2.5
3.0.163ts2.6
3.0.163ts2.7
3.0.163ts2.8
3.0.163ts2.9
3.0.163ts3.0
3.0.163ts3.1
3.0.163ts3.2
3.0.163ts3.3
3.0.163ts3.4
4.0.02ts3.5

Version History

VersionDownloads (Last 7 Days)Published
4.0.417,435
4.0.318
4.0.257
4.0.11,666
4.0.02
3.0.163
3.0.00

Package Sidebar

Install

npm i @types/yallist

Weekly Downloads

19,241

Version

4.0.4

License

MIT

Unpacked Size

6.95 kB

Total Files

5

Last publish

Collaborators

  • types