/** * Collection Write Interface * @desczh * 可写入集合接口 * @file * @since 0.2.0 */ import { Kind, URIS } from 'fp-ts/HKT'; import { ReaderCollection } from './ReaderCollection'; import { Predicate } from 'macoolka-predicate'; /** * Collection Write Input Interface * @desczh * 可写入集合输入接口 * @since 0.2.0 */ export interface WriteCollectionInput { updateWith: (predicate: Predicate, updater: (a: A) => A) => (as: Kind) => Kind; /** * delete the element wtih the specified condition, * creating a new collection. * @desczh * 删除一些满足条件的元素,返回删除后的集合 * @example * import { deleteWith,from } from 'macoolka-array' * import { pipe } from 'fp-ts/pipeable' * * pipe( * from([1, 2, 3]), * deleteWith(a => a === 2 || a===1), * a => expect(a).toEqual(from([3])) * ) * * @since 2.0.0 */ deleteWith: (predicate: Predicate) => (as: Kind) => Kind; /** * Attaches an element to the front of an `Collection`, creating a new non empty `Collection` * @desczh * 插入一个元素到集合头,返回新集合. * @example * import { cons } from 'fp-ts/Array' * * assert.deepStrictEqual(cons(0)([1, 2, 3]), [0, 1, 2, 3]) * * @since 2.0.0 */ add: (head: A) => (tail: Kind) => Kind; } export interface WriterCollection extends WriteCollectionInput, ReaderCollection { } export declare function initWriterCollection(option: WriteCollectionInput & ReaderCollection): WriterCollection;