import type { ImmutableArray } from "./array.js"; import type { DictionaryItem, ImmutableDictionary } from "./dictionary.js"; import type { Entry } from "./entry.js"; import type { Arguments } from "./function.js"; import type { ImmutableObject, Prop, Value } from "./object.js"; /** Set of named transforms for a data object (or `undefined` to skip the transform). */ export type Transforms = { readonly [K in keyof I]?: (input: I[K], ...args: A) => O[K]; }; /** Modify a set of items using a transform. */ export declare function mapItems(items: Iterable, transform: (v: I, ...args: A) => O, ...args: A): Iterable; /** Modify the items of an array using a transform. */ export declare function mapArray(arr: Iterable, transform: (v: I, ...args: A) => O, ...args: A): ImmutableArray; /** Modify the _values_ of the props of an object using a transform. */ export declare function mapProps(obj: I, transform: (prop: Prop, ...args: A) => Value, ...args: A): O; /** Modify the _values_ of a dictionary using a transform. */ export declare function mapDictionary(dictionary: ImmutableDictionary, transform: (item: DictionaryItem, ...args: A) => O, ...args: A): ImmutableDictionary; /** Modify the _values_ of a set of entries using a transform. */ export declare function mapEntries(entries: Iterable>, transform: (entry: Entry, ...args: A) => O, ...args: A): Iterable>; /** * Transform an object using a set of named transforms. * * @returns Transformed object (or same object if no changes were made). */ export declare function transformObject(obj: T, transforms: Transforms, A>, ...args: A): T; export declare function transformObject(obj: T | Partial, transforms: Transforms, A>, ...args: A): Partial; export declare function transformObject(obj: I, transforms: Transforms, A>, ...args: A): O; export declare function transformObject(obj: I | Partial, transforms: Transforms, A>, ...args: A): Partial; /** Transform items in a sequence as they are yielded using a (potentially async) transform. */ export declare function mapSequence(sequence: AsyncIterable, transform: (input: I, ...args: A) => O | PromiseLike, ...args: A): AsyncIterable;