UNPKG

@types/fast-list

Version:
51 lines (41 loc) 1.66 kB
# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fast-list/index.d.ts) ````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](https://github.com/BendingBender).