@types/for-each
Version:
TypeScript definitions for for-each
42 lines (35 loc) • 1.36 kB
Markdown
# Installation
> `npm install --save @types/for-each`
# Summary
This package contains type definitions for for-each (https://github.com/Raynos/for-each).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/for-each.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/for-each/index.d.ts)
````ts
declare function forEach<T = unknown, This = undefined>(
arr: T[],
callback: (this: This, value: T, index: number, array: T[]) => void,
thisArg?: This,
): void;
declare function forEach<T = unknown, This = undefined>(
arr: ArrayLike<T>,
callback: (this: This, value: T, index: number, array: ArrayLike<T>) => void,
thisArg?: This,
): void;
declare function forEach<V = unknown, K extends PropertyKey = PropertyKey, This = undefined>(
obj: Record<K, V>,
callback: (this: This, value: V, key: K, obj: Record<K, V>) => void,
thisArg?: This,
): void;
declare function forEach<This = undefined>(
str: string,
callback: (this: This, value: string, index: number, str: string) => void,
thisArg: This,
): void;
export = forEach;
````
### Additional Details
* Last updated: Tue, 07 Nov 2023 03:09:37 GMT
* Dependencies: none
# Credits
These definitions were written by [Jordan Harband](https://github.com/ljharb).