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

1.0.3 • Public • Published

Installation

npm install --save @types/fast-list

Summary

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

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fast-list.

index.d.ts

export as namespace FastList;
export = FastList;

declare const FastList: FastListFactory;

interface FastListFactory {
    <T>(): FastList.List<T>;
    new<T>(): FastList.List<T>;
}

declare namespace FastList {
    interface List<T> {
        readonly length: number;

        push(item: T): void;
        pop(): T | undefined;
        unshift(item: T): void;
        shift(): T | undefined;
        drop(): void;
        item(index: number): T | undefined;
        map<U = T, V = this>(callbackfn: (this: V, value: T, index: number, list: this) => U, thisArg?: V): List<U>;
        reduce<U = T, V = this>(
            callbackfn: (this: V, acc: U, value: T, index: number, list: this) => U,
            initialValue?: U,
            thisArg?: V,
        ): U;
        forEach<U = this>(callbackfn: (this: U, value: T, index: number, list: this) => void, thisArg?: U): void;
        filter<U = this>(callbackfn: (this: U, value: T, index: number, list: this) => boolean, thisArg?: U): List<T>;
        slice(start?: number, end?: number): T[];
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: none

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/fast-list

Weekly Downloads

23

Version

1.0.3

License

MIT

Unpacked Size

4.67 kB

Total Files

5

Last publish

Collaborators

  • types