/** * Collection Constructor Interface * @desczh * 构造集合接口 * @file * @since 0.2.0 */ import { Kind, URIS } from 'fp-ts/HKT'; /** * Collection Constructor Input Interface * @desczh * 构造集合输入接口 * @since 0.2.0 */ export interface ConstructorCollectionInput { readonly URI: F; /** * Create a new `Collection` containing the values of the provided Iterable. * @desczh * 从迭代器中构建集合 * @since 0.2.0 */ from: (collection: Iterable) => Kind; } /** * Collection Constructor Interface * @desczh * 构造集合接口 * @since 0.2.0 */ export interface ConstructorCollection extends ConstructorCollectionInput { /** * Return An empty `Collection` * @desczh * 空集合 * @since 0.2.0 */ empty(): Kind; /** * Return a `Collection` of length `n` with element `i` initialized with `f(i)` * @desczh * 通过一个数字和函数构建集合 * @example * import { makeBy } from 'fp-ts/List' * * const double = (n: number): number => n * 2 * assert.deepStrictEqual(makeBy(5, double), [0, 2, 4, 6, 8]) * * @since 0.2.0 */ makeBy(n: number, f: (i: number) => A): Kind; /** * Create an `Collection` containing a range of integers, including both endpoints * @desczh * 通过一个范围和函数构建集合 * @example * import { range } from 'fp-ts/List' * * assert.deepStrictEqual(range(1, 5), [1, 2, 3, 4, 5]) * * @since 0.2.0 */ makeByRange(start: number, end: number): Kind; /** * Create an `Collection` containing a value repeated the specified number of times * @desczh * 通过重复的元素构建集合 * @example * import { makeByRepeat } from 'fp-ts/List' * * assert.deepStrictEqual(makeByRepeat(3, 'a'), ['a', 'a', 'a']) * * @since 0.2.0 */ makeByRepeat(n: number, a: A): Kind; } export declare function initConstructor({ from, URI }: ConstructorCollectionInput): ConstructorCollection;