@types/yallist
TypeScript definitions for yallist
Last updated 5 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install @types/yallist 
SYNC missed versions from official npm registry.

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

// Type definitions for yallist 4.0
// Project: https://github.com/isaacs/yallist#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

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: Fri, 02 Jul 2021 16:32:03 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by BendingBender.

Current Tags

  • 4.0.1                                ...           latest (5 years ago)
  • 3.0.1                                ...           ts2.3 (8 years ago)
  • 3.0.1                                ...           ts2.4 (8 years ago)
  • 3.0.1                                ...           ts2.5 (8 years ago)
  • 3.0.1                                ...           ts2.6 (8 years ago)
  • 3.0.1                                ...           ts2.7 (8 years ago)
  • 3.0.1                                ...           ts2.8 (8 years ago)
  • 3.0.1                                ...           ts2.9 (8 years ago)
  • 3.0.1                                ...           ts3.0 (8 years ago)
  • 3.0.1                                ...           ts3.1 (8 years ago)
  • 3.0.1                                ...           ts3.2 (8 years ago)
  • 3.0.1                                ...           ts3.3 (8 years ago)
  • 3.0.1                                ...           ts3.4 (8 years ago)
  • 4.0.0                                ...           ts3.5 (5 years ago)
  • 4.0.1                                ...           ts3.6 (5 years ago)
  • 4.0.1                                ...           ts3.7 (5 years ago)
  • 4.0.1                                ...           ts3.8 (5 years ago)
  • 4.0.1                                ...           ts3.9 (5 years ago)
  • 4.0.1                                ...           ts4.0 (5 years ago)
  • 4.0.1                                ...           ts4.1 (5 years ago)
  • 4.0.1                                ...           ts4.2 (5 years ago)
  • 4.0.1                                ...           ts4.3 (5 years ago)
  • 4.0.1                                ...           ts4.4 (5 years ago)
  • 4.0.1                                ...           ts4.5 (5 years ago)
  • 4.0.1                                ...           ts4.6 (5 years ago)
  • 4.0.1                                ...           ts4.7 (5 years ago)
  • 4.0.1                                ...           ts4.8 (5 years ago)
  • 4.0.1                                ...           ts4.9 (5 years ago)

4 Versions

  • 4.0.1                                ...           5 years ago
  • 4.0.0                                ...           5 years ago
  • 3.0.1                                ...           8 years ago
  • 3.0.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org | Home |