import * as O from "../../../Option/index.js"; import * as A from "../Array/index.js"; import type { Chunk } from "./definition.js"; export * from "./definition.js"; /** * Builds a chunk of a single value */ export declare function single(a: A): Chunk; /** * Builds an empty chunk */ export declare function empty(): Chunk; /** * Appends a value to a chunk * * @ets_data_first append_ */ export declare function append(a: A1): (self: Chunk) => Chunk; /** * Appends a value to a chunk */ export declare function append_(self: Chunk, a: A1): Chunk; /** * Prepends a value to a chunk * * @ets_data_first prepend_ */ export declare function prepend(a: A1): (self: Chunk) => Chunk; /** * Prepends a value to a chunk */ export declare function prepend_(self: Chunk, a: A1): Chunk; /** * Concats chunks * * @ets_data_first concat_ */ export declare function concat(that: Chunk): (self: Chunk) => Chunk; /** * Concats chunks */ export declare function concat_(self: Chunk, that: Chunk): Chunk; /** * Converts a chunk to an ArrayLike (either Array or Buffer) */ export declare function toArrayLike(self: Chunk): ArrayLike; /** * Converts a chunk to an Array */ export declare function toArray(self: Chunk): A.Array; /** * Safely get a value */ export declare function get_(self: Chunk, n: number): O.Option; /** * Safely get a value * * @ets_data_first get_ */ export declare function get(n: number): (self: Chunk) => O.Option; /** * Unsafely get a value */ export declare function unsafeGet_(self: Chunk, n: number): A; /** * Safely get a value * * @ets_data_first unsafeGet_ */ export declare function unsafeGet(n: number): (self: Chunk) => A; /** * Referential equality check */ export declare function equals_(self: Chunk, that: Chunk): boolean; /** * Referential equality check * * @ets_data_first equals_ */ export declare function equals(that: Chunk): (self: Chunk) => boolean; /** * Takes the first n elements */ export declare function take_(self: Chunk, n: number): Chunk; /** * Takes the first n elements * * @ets_data_first take_ */ export declare function take(n: number): (self: Chunk) => Chunk; /** * Takes the last n elements */ export declare function takeRight_(self: Chunk, n: number): Chunk; /** * Takes the last n elements * * @ets_data_first takeRight_ */ export declare function takeRight(n: number): (self: Chunk) => Chunk; /** * Drops the first n elements */ export declare function drop_(self: Chunk, n: number): Chunk; /** * Drops the first n elements * * @ets_data_first drop_ */ export declare function drop(n: number): (self: Chunk) => Chunk; /** * Drops the first n elements */ export declare function dropRight_(self: Chunk, n: number): Chunk; /** * Drops the first n elements * * @ets_data_first dropRight_ */ export declare function dropRight(n: number): (self: Chunk) => Chunk; /** * Returns the number of elements in the chunk */ export declare function size(self: Chunk): number; /** * Returns a chunk with the elements mapped by the specified function. */ export declare function map_(self: Chunk, f: (a: A) => B): Chunk; /** * Returns a chunk with the elements mapped by the specified function. * * @ets_data_first map_ */ export declare function map(f: (a: A) => B): (self: Chunk) => Chunk; /** * Returns a chunk with the elements mapped by the specified function. */ export declare function mapWithIndex_(self: Chunk, f: (index: number, a: A) => B): Chunk; /** * Returns a chunk with the elements mapped by the specified function. * * @ets_data_first mapWithIndex_ */ export declare function mapWithIndex(f: (index: number, a: A) => B): (self: Chunk) => Chunk; /** * Returns a chunk with the elements mapped by the specified function. */ export declare function chain_(self: Chunk, f: (a: A) => Chunk): Chunk; /** * Returns a chunk with the elements mapped by the specified function. * * @ets_data_first chain_ */ export declare function chain(f: (a: A) => Chunk): (self: Chunk) => Chunk; /** * Flattens a chunk of chunks into a single chunk by concatenating all chunks. */ export declare function flatten(self: Chunk>): Chunk; /** * Returns the first element of this chunk if it exists. */ export declare function head(self: Chunk): O.Option; /** * Returns every elements after the first */ export declare function tail(self: Chunk): O.Option>; /** * Returns the last element of this chunk if it exists. */ export declare function last(self: Chunk): O.Option; /** * Returns the first element of this chunk. Note that this method is partial * in that it will throw an exception if the chunk is empty. Consider using * `head` to explicitly handle the possibility that the chunk is empty * or iterating over the elements of the chunk in lower level, performance * sensitive code unless you really only need the first element of the chunk. */ export declare function unsafeHead(self: Chunk): A; /** * Returns every elements after the first. Note that this method is partial * in that it will throw an exception if the chunk is empty. Consider using * `head` to explicitly handle the possibility that the chunk is empty * or iterating over the elements of the chunk in lower level, performance * sensitive code unless you really only need the first element of the chunk. */ export declare function unsafeTail(self: Chunk): Chunk; /** * Returns the last element of this chunk. Note that this method is partial * in that it will throw an exception if the chunk is empty. Consider using * `last` to explicitly handle the possibility that the chunk is empty * or iterating over the elements of the chunk in lower level, performance * sensitive code unless you really only need the last element of the chunk. */ export declare function unsafeLast(self: Chunk): A; /** * Determines if the chunk is empty. */ export declare function isEmpty(self: Chunk): boolean; /** * Determines if the chunk is empty. */ export declare function isNonEmpty(self: Chunk): boolean; /** * Buckets iterator */ export declare function buckets(self: Chunk): Iterable>; /** * Reverse buckets iterator */ export declare function reverseBuckets(self: Chunk): Iterable>; /** * Reverse buckets iterator */ export declare function reverse(self: Chunk): Iterable; /** * Materializes a chunk into a chunk backed by an array. This method can * improve the performance of bulk operations. */ export declare function materialize(self: Chunk): Chunk; /** * The unit chunk */ export declare const unit: Chunk; /** * Build a chunk from a sequence of values * * NOTE: different from Chunk#from this copies the elements 1 by 1 * allowing for binary to be correctly stored in typed arrays */ export declare function make(...iter: Elem): Chunk; /** * Return a chunk of length `n` with element `i` initialized with `f(i)` */ export declare function makeBy_(n: number, f: (i: number) => A): Chunk; /** * Builder */ export declare function builder(): ChunkBuilder; export declare class ChunkBuilder { private chunk; constructor(chunk: Chunk); append(a: A): ChunkBuilder; build(): Chunk; } //# sourceMappingURL=core.d.ts.map