import { Predicate } from 'fp-ts/lib/Predicate'; export declare function collectFirst(arr: T[], selector: (x: T) => U | null | undefined): U | undefined; export declare function collect(arr: ReadonlyArray, selector: (x: T) => U | null | undefined): U[]; export declare const shuffle: (a: readonly T[]) => T[]; export declare const permute: (array: readonly T[]) => T[][]; /** * Split an array into "runs" by a condition for consecutive elements. * Elements will be split when the condition returns true. * * For an empty array, this will return an empty array of runs. Each run is therefore at least one element long. */ export declare const split: (a: readonly T[], cond: (x0: T, x1: T) => boolean) => readonly (readonly T[])[]; /** * Apply a filter predicate on an array in place. The matching elements will be retained, * non-matching elements will be returned as a new array. */ export declare const retainInPlaceAndGetRemoved: (a: T[], pred: Predicate) => T[]; /** * And-combine an array of predicates. * The empty array yields a predicate that is always true. */ export declare const andCombine: (predicates: readonly Predicate[]) => Predicate; /** * Randomly interleaves several arrays so that the order within each array is preserved. */ export declare const interleaveRandom: (arrays: readonly (readonly T[])[]) => T[];