UNPKG

jsmodern

Version:

An extension to existing JavaScript, influenced by other great languages such as Rust, Dart, Java, Golang, etc.

13 lines 466 B
import type { PrototypeStruct } from '../index.js'; declare type FoldPredicate<T, U> = (previousValue: U, currentValue: T, index: number) => T extends U ? T : U; interface Fold<T> { fold(initialValue: T, predicate: FoldPredicate<T, T>): T; fold<U>(initialValue: U, predicate: FoldPredicate<T, U>): U; } export declare const fold: PrototypeStruct; declare global { interface Array<T> extends Fold<T> { } } export {}; //# sourceMappingURL=fold.d.ts.map