import { Tuple } from './Tuple.js'; import { Maybe } from './Maybe.js'; import { Order } from './Function.js'; /** Returns the first element which satisfies a predicate. A more typesafe version of the already existing List.prototype.find */ declare function find(f: (x: T, index: number, arr: T[]) => boolean, list: T[]): Maybe; declare function find(f: (x: T, index: number, arr: T[]) => boolean): (list: T[]) => Maybe; /** Returns the index of the first element which satisfies a predicate. A more typesafe version of the already existing List.prototype.findIndex */ declare function findIndex(f: (x: T, index: number, arr: T[]) => boolean, list: T[]): Maybe; declare function findIndex(f: (x: T, index: number, arr: T[]) => boolean): (list: T[]) => Maybe; /** Returns the element at a given index of a list */ declare function at(index: number, list: readonly T[]): Maybe; declare function at(index: number): (list: readonly T[]) => Maybe; /** Sorts an array with the given comparison function */ declare function sort(compare: (a: T, b: T) => Order, list: readonly T[]): T[]; declare function sort(compare: (a: T, b: T) => Order): (list: readonly T[]) => T[]; export declare const List: { init: (list: readonly T[]) => Maybe; uncons: (list: readonly T[]) => Maybe>; at: typeof at; head: (list: readonly T[]) => Maybe; last: (list: readonly T[]) => Maybe; tail: (list: readonly T[]) => Maybe; find: typeof find; findIndex: typeof findIndex; sum: (list: readonly number[]) => number; sort: typeof sort; }; export {};