import { MapFunction as MapFunction$1 } from 'extra-iterable'; /** * Entries is a list of key-value pairs, with unique keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/Entries) */ type Entries = Iterable<[K, V]>; /** * Lists is a pair of key list and value list, with unique keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/Lists) */ type Lists = [Iterable, Iterable]; /** * Handle reading of a single value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/ReadFunction) * @returns value */ type ReadFunction = () => V; /** * Handle combining of two values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/CombineFunction) * @param a a value * @param b another value * @returns combined value */ type CombineFunction = (a: V, b: V) => V; /** * Handle comparison of two values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/CompareFunction) * @param a a value * @param b another value * @returns ab: +ve */ type CompareFunction = (a: V, b: V) => number; /** * Handle processing of values in a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/ProcessFunction) * @param v value in map * @param k key of value in map * @param x map containing the value */ type ProcessFunction = (v: V, k: K, x: Map) => void; /** * Handle selection of values in a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/TestFunction) * @param v value in map * @param k key of value in map * @param x map containing the value * @returns selected? */ type TestFunction = (v: V, k: K, x: Map) => boolean; /** * Handle transformation of a value to another. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/MapFunction) * @param v value in map * @param k key of value in map * @param x map containing the value * @returns transformed value */ type MapFunction = (v: V, k: K, x: Map) => W; /** * Handle reduction of multiple values into a single value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/ReduceFunction) * @param acc accumulator (temporary result) * @param v value in map * @param k key of value in map * @param x map containing the value * @returns reduced value */ type ReduceFunction = (acc: W, v: V, k: K, x: Map) => W; /** * Handle ending of a combined map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/EndFunction) * @param dones iįµ—Ź° map done? * @returns combined map done? */ type EndFunction = (dones: boolean[]) => boolean; /** * Check if value is a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/is) * @param v value * @returns v is a map? */ declare function is(v: any): v is Map; /** * List all keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/keys) * @param x a map * @returns kā‚€, kā‚, ... | [kįµ¢, vįµ¢] āˆˆ x */ declare function keys(x: Map): IterableIterator; /** * List all values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/values) * @param x a map * @returns vā‚€, vā‚, ... | [kįµ¢, vįµ¢] āˆˆ x */ declare function values(x: Map): IterableIterator; /** * List all key-value pairs. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/entries) * @param x a map * @returns [kā‚€, vā‚€], [kā‚, vā‚], ... | [kįµ¢, vįµ¢] āˆˆ x */ declare function entries(x: Map): IterableIterator<[K, V]>; /** * Convert entries to map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/from) * @param x entries * @returns x as map */ declare function from(x: Entries): Map; /** * Convert entries to map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/from$) * @param x entries (updateable is map!) * @returns x as map */ declare function from$(x: Entries): Map; /** * Convert lists to map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/fromLists) * @param x lists, i.e. [keys, values] * @returns x as map */ declare function fromLists(x: Lists): Map; /** * Create a map from keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/fromKeys) * @param x keys * @param fm map function for values (v, i, x) * @returns x as map */ declare function fromKeys(x: Iterable, fm?: MapFunction$1 | null): Map; /** * Create a map from values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/fromValues) * @param x values * @param fm map function for keys (v, i, x) * @returns x as map */ declare function fromValues(x: Iterable, fm?: MapFunction$1 | null): Map; /** * Compare two maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/compare) * @param x a map * @param y another map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns x=y: 0, otherwise: -ve/+ve */ declare function compare(x: Map, y: Map, fc?: CompareFunction | null, fm?: MapFunction | null): number; /** * Check if two maps are equal. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/isEqual) * @param x a map * @param y another map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns x = y? */ declare function isEqual(x: Map, y: Map, fc?: CompareFunction | null, fm?: MapFunction | null): boolean; /** * Find the size of a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/size) * @param x a map * @returns |x| */ declare function size(x: Map): number; /** * Check if a map is empty. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/isEmpty) * @param x a map * @returns |x| = 0? */ declare function isEmpty(x: Map): boolean; /** * Get value at key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/get) * @param x a map * @param k key * @returns x[k] */ declare function get(x: Map, k: K): V; /** * Get values at keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/getAll) * @param x a map * @param ks keys * @returns [x[kā‚€], x[kā‚], ...] | [kā‚€, kā‚, ...] = ks */ declare function getAll(x: Map, ks: K[]): V[]; /** * Get value at path in a nested map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/getPath) * @param x a nested map * @param p path * @returns x[kā‚€][kā‚][...] | [kā‚€, kā‚, ...] = p */ declare function getPath(x: Map, p: K[]): any; /** * Check if nested map has a path. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/hasPath) * @param x a nested map * @param p path * @returns x[kā‚€][kā‚][...] exists? | [kā‚€, kā‚, ...] = p */ declare function hasPath(x: Map, p: K[]): boolean; /** * Set value at key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/set) * @param x a map * @param k key * @param v value * @returns x' | x' = x; x'[k] = v */ declare function set(x: Entries, k: K, v: V): Map; /** * Set value at key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/set$) * @param x a map (updated) * @param k key * @param v value * @returns x | x[k] = v */ declare function set$(x: Map, k: K, v: V): Map; /** * Set value at path in a nested map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/setPath$) * @param x a nested map (updated) * @param p path * @param v value * @returns x | x[kā‚€][kā‚][...] = v; [kā‚€, kā‚, ...] = p */ declare function setPath$(x: Map, p: K[], v: any): Map; /** * Exchange two values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/swap) * @param x a map * @param k a key * @param l another key * @returns x' | x' = x; x'[k] = x[l]; x'[l] = x[k] */ declare function swap(x: Entries, k: K, l: K): Map; /** * Exchange two values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/swap$) * @param x a map (updated) * @param k a key * @param l another key * @returns x | x[i] ā†” x[j] */ declare function swap$(x: Map, k: K, l: K): Map; /** * Remove value at key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/remove) * @param x a map * @param k key * @returns x \\: [k] */ declare function remove(x: Entries, k: K): Map; /** * Remove value at key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/remove$) * @param x a map (updated) * @param k key * @returns x = x \\: [k] */ declare function remove$(x: Map, k: K): Map; /** * Remove value at path in a nested map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/removePath$) * @param x a nested map (updated) * @param p path * @returns x = x \\: [kā‚€][kā‚][...] | [kā‚€, kā‚, ...] = p */ declare function removePath$(x: Map, p: K[]): Map; /** * Count values which satisfy a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/count) * @param x a map * @param ft test function (v, k, x) * @returns Ī£tįµ¢ | tįµ¢ = 1 if ft(vįµ¢) else 0; [kįµ¢, vįµ¢] āˆˆ x */ declare function count(x: Map, ft: TestFunction): number; /** * Count occurrences of values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/countAs) * @param x a map * @param fm map function (v, k, x) * @returns Map \{value ā‡’ count\} */ declare function countAs(x: Map, fm?: MapFunction | null): Map; /** * Find smallest value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/min) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns v | v ā‰¤ vįµ¢; [kįµ¢, vįµ¢] āˆˆ x */ declare function min(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): V; /** * Find smallest entry. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/minEntry) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [min_key, min_value] */ declare function minEntry(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): [K, V]; /** * Find largest value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/max) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns v | v ā‰„ vįµ¢; [kįµ¢, vįµ¢] āˆˆ x */ declare function max(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): V; /** * Find largest entry. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/maxEntry) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [max_key, max_value] */ declare function maxEntry(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): [K, V]; /** * Find smallest and largest values. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/range) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [min_value, max_value] */ declare function range(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): [V, V]; /** * Find smallest and largest entries. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/rangeEntries) * @param x a map * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [min_entry, max_entry] */ declare function rangeEntries(x: Map, fc?: CompareFunction | null, fm?: MapFunction | null): [[K, V], [K, V]]; /** * Get first entry from map (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/head) * @param x a map * @param ed default entry * @returns [kā‚€, vā‚€] if x ā‰  Ī¦ else ed | [kā‚€, vā‚€] āˆˆ x */ declare function head(x: Entries, ed?: [K, V]): [K, V]; /** * Get a map without its first entry (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/tail) * @param x a map * @returns x \\ \{[kā‚€, vā‚€]\} if x ā‰  Ī¦ else x | [kā‚€, vā‚€] āˆˆ x */ declare function tail(x: Map): Map; /** * Keep first n entries only (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/take) * @param x a map * @param n number of entries [1] * @returns \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | [kįµ¢, vįµ¢] āˆˆ x and |\{[kā‚€, vā‚€], [kā‚, vā‚], ...\}| ā‰¤ n */ declare function take(x: Map, n?: number): Map; /** * Keep first n entries only (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/take$) * @param x a map (updated) * @param n number of entries [1] * @returns x = \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | [kįµ¢, vįµ¢] āˆˆ x and |\{[kā‚€, vā‚€], [kā‚, vā‚], ...\}| ā‰¤ n */ declare function take$(x: Map, n?: number): Map; /** * Remove first n entries (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/drop) * @param x a map * @param n number of entries [1] * @returns \{[kā‚™, vā‚™], [kā‚™ā‚Šā‚, vā‚™ā‚Šā‚], ...\} | [kįµ¢, vįµ¢] āˆˆ x and |\{[kā‚™, vā‚™], [kā‚™ā‚Šā‚, vā‚™ā‚Šā‚], ...\}| ā‰¤ max(|x| - n, 0) */ declare function drop(x: Map, n?: number): Map; /** * Remove first n entries (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/drop$) * @param x a map (updated) * @param n number of entries [1] * @returns x = \{[kā‚™, vā‚™], [kā‚™ā‚Šā‚, vā‚™ā‚Šā‚], ...\} | [kįµ¢, vįµ¢] āˆˆ x and |\{[kā‚™, vā‚™], [kā‚™ā‚Šā‚, vā‚™ā‚Šā‚], ...\}| ā‰¤ max(|x| - n, 0) */ declare function drop$(x: Map, n?: number): Map; /** * List all possible subsets. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/subsets) * @param x a map * @param n number of entries [-1 ā‡’ any] * @returns entries selected by bit from 0..2^|x| if n<0; only of length n otherwise */ declare function subsets(x: Map, n?: number): IterableIterator>; /** * Pick an arbitrary key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/randomKey) * @param x a map * @param fr random number generator ([0, 1)) * @returns kįµ¢ | [kįµ¢, vįµ¢] āˆˆ x */ declare function randomKey(x: Map, fr?: ReadFunction): K; /** * Pick an arbitrary entry. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/randomEntry) * @param x a map * @param fr random number generator ([0, 1)) * @returns [kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x */ declare function randomEntry(x: Entries, fr?: ReadFunction): [K, V]; /** * Pick an arbitrary subset. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/randomSubset) * @param x a map * @param n number of entries [-1 ā‡’ any] * @param fr random number generator ([0, 1)) * @returns \{[kįµ¢, vįµ¢], [kā±¼, vā±¼], ...\} | [kįµ¢, vįµ¢], [kā±¼, vā±¼], ... āˆˆ x; |\{[kįµ¢, vįµ¢], [kā±¼, vā±¼], ...\}| = |x| if n<0 else n */ declare function randomSubset(x: Map, n?: number, fr?: ReadFunction | null): Map; /** * Check if map has a key. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/has) * @param x a map * @param k search key * @returns [k, *] āˆˆ x? */ declare function has(x: Map, k: K): boolean; /** * Check if map has a value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/hasValue) * @param x a map * @param v search value * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [*, v] āˆˆ x? */ declare function hasValue(x: Map, v: V, fc?: CompareFunction | null, fm?: MapFunction | null): boolean; /** * Check if map has an entry. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/hasEntry) * @param x a map * @param e search entry ([k, v]) * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns [k, v] āˆˆ x? | [k, v] = e */ declare function hasEntry(x: Map, e: [K, V], fc?: CompareFunction | null, fm?: MapFunction | null): boolean; /** * Check if map has a subset. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/hasSubset) * @param x a map * @param y search subset * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns y āŠ† x? */ declare function hasSubset(x: Map, y: Map, fc?: CompareFunction | null, fm?: MapFunction | null): boolean; /** * Find first value passing a test (default order). * [šŸ“˜](https://github.com/nodef/extra-map/wiki/find) * @param x a map * @param ft test function (v, k, x) * @returns first v | ft(v) = true; [k, v] āˆˆ x */ declare function find(x: Map, ft: TestFunction): V; /** * Find values passing a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/findAll) * @param x a map * @param ft test function (v, k, x) * @returns [vā‚€, vā‚, ...] | ft(vįµ¢) = true; [kįµ¢, vįµ¢] āˆˆ x */ declare function findAll(x: Map, ft: TestFunction): V[]; /** * Find key of an entry passing a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/search) * @param x a map * @param ft test function (v, k, x) * @returns key of entry */ declare function search(x: Map, ft: TestFunction): K; /** * Find keys of entries passing a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/searchAll) * @param x a map * @param ft test function (v, k, x) * @returns keys of entries */ declare function searchAll(x: Map, ft: TestFunction): K[]; /** * Find a key with given value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/searchValue) * @param x a map * @param v search value * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns key of value */ declare function searchValue(x: Map, v: V, fc?: CompareFunction | null, fm?: MapFunction | null): K; /** * Find keys with given value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/searchValueAll) * @param x a map * @param v search value * @param fc compare function (a, b) * @param fm map function (v, k, x) * @returns keys of value */ declare function searchValueAll(x: Map, v: V, fc?: CompareFunction | null, fm?: MapFunction | null): K[]; /** * Call a function for each value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/forEach) * @param x a map * @param fp process function (v, k, x) */ declare function forEach(x: Map, fp: ProcessFunction): void; /** * Check if any value satisfies a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/some) * @param x a map * @param ft test function (v, k, x) * @returns true if ft(vįµ¢) = true for some [kįµ¢, vįµ¢] āˆˆ x */ declare function some(x: Map, ft: TestFunction): boolean; /** * Check if all values satisfy a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/every) * @param x a map * @param ft test function (v, k, x) * @returns true if ft(vįµ¢) = true for all [kįµ¢, vįµ¢] āˆˆ x */ declare function every(x: Map, ft: TestFunction): boolean; /** * Transform values of a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/map) * @param x a map * @param fm map function (v, k, x) * @returns \{[kā‚€, fm(vā‚€)], [kā‚, fm(vā‚)], ...\} | [kįµ¢, vįµ¢] āˆˆ x */ declare function map(x: Map, fm: MapFunction): Map; /** * Transform values of a map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/map$) * @param x a map (updated) * @param fm map function (v, k, x) * @returns x = \{[kā‚€, fm(vā‚€)], [kā‚, fm(vā‚)], ...\} | [kįµ¢, vįµ¢] āˆˆ x */ declare function map$(x: Map, fm: MapFunction): Map; /** * Reduce values of set to a single value. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/reduce) * @param x a map * @param fr reduce function (acc, v, k, x) * @param acc initial value * @returns fr(fr(acc, vā‚€), vā‚)... | fr(acc, vā‚€) = vā‚€ if acc not given */ declare function reduce(x: Map, fr: ReduceFunction, acc?: V | W): V | W; /** * Keep entries which pass a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/filter) * @param x a map * @param ft test function (v, k, x) * @returns \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | ft(vįµ¢) = true; [kįµ¢, vįµ¢] āˆˆ x */ declare function filter(x: Map, ft: TestFunction): Map; /** * Keep entries which pass a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/filter$) * @param x an map (updated) * @param ft test function (v, k, x) * @returns x = \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | ft(vįµ¢) = true; [kįµ¢, vįµ¢] āˆˆ x */ declare function filter$(x: Map, ft: TestFunction): Map; /** * Keep values at given keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/filterAt) * @param x a map * @param ks keys * @returns \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | kįµ¢ āˆˆ ks; [kįµ¢, vįµ¢] āˆˆ x */ declare function filterAt(x: Map, ks: K[]): Map; /** * Keep values at given keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/filterAt$) * @param x a map (updated) * @param ks keys * @returns x = \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | kįµ¢ āˆˆ ks; [kįµ¢, vįµ¢] āˆˆ x */ declare function filterAt$(x: Map, ks: K[]): Map; /** * Discard entries which pass a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/reject) * @param x a map * @param ft test function (v, k, x) * @returns \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | ft(vįµ¢) = false; [kįµ¢, vįµ¢] āˆˆ x */ declare function reject(x: Map, ft: TestFunction): Map; /** * Discard entries which pass a test. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/reject$) * @param x a map (updated) * @param ft test function (v, k, x) * @returns x = \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | ft(vįµ¢) = false; [kįµ¢, vįµ¢] āˆˆ x */ declare function reject$(x: Map, ft: TestFunction): Map; /** * Discard values at given keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/rejectAt) * @param x a map * @param ks keys * @returns \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | kįµ¢ āˆ‰ ks; [kįµ¢, vįµ¢] āˆˆ x */ declare function rejectAt(x: Map, ks: K[]): Map; /** * Discard values at given keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/rejectAt$) * @param x a map (updated) * @param ks keys * @returns x = \{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | kįµ¢ āˆ‰ ks; [kįµ¢, vįµ¢] āˆˆ x */ declare function rejectAt$(x: Map, ks: K[]): Map; /** * Flatten nested map to given depth. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/flat) * @param x a nested map * @param n maximum depth [-1 ā‡’ all] * @param fm map function (v, k, x) * @param ft test function for flatten (v, k, x) [is] * @returns flat map */ declare function flat(x: Map, n?: number, fm?: MapFunction | null, ft?: TestFunction | null): Map; /** * Flatten nested map, based on map function. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/flatMap) * @param x a nested map * @param fm map function (v, k, x) * @param ft test function for flatten (v, k, x) [is] * @returns flat map */ declare function flatMap(x: Map, fm?: MapFunction | null, ft?: TestFunction | null): Map; /** * Combine matching entries from maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/zip) * @param xs maps * @param fm map function (vs, k) * @param fe end function (dones) [array.some] * @param vd default value * @returns [fm([xā‚€[kā‚€], xā‚[kā‚€], ...]), fm([xā‚€[kā‚], xā‚[kā‚], ...]), ...] */ declare function zip(xs: Map[], fm?: MapFunction | null, fe?: EndFunction, vd?: V): Map; /** * Segregate entries by test result. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/partition) * @param x a map * @param ft test function (v, k, x) * @returns [satisfies, doesnt] */ declare function partition(x: Map, ft: TestFunction): [Map, Map]; /** * Segregate entries by similarity. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/partitionAs) * @param x a map * @param fm map function (v, k, x) * @returns Map \{key ā‡’ values\} */ declare function partitionAs(x: Map, fm: MapFunction): Map>; /** * Break map into chunks of given size. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/chunk) * @param x a map * @param n chunk size [1] * @param s chunk step [n] * @returns [x[0..n], x[s..s+n], x[2s..2s+n], ...] */ declare function chunk(x: Map, n?: number, s?: number): Map[]; /** * Append entries from maps, preferring last. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/concat) * @param xs maps * @returns xā‚€ āˆŖ xā‚ āˆŖ ... | [xā‚€, xā‚, ...] = xs */ declare function concat(...xs: Entries[]): Map; /** * Append entries from maps, preferring last. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/concat$) * @param x a map (updated) * @param ys other maps * @returns x = x āˆŖ yā‚€ āˆŖ yā‚ āˆŖ ... | [yā‚€, yā‚, ...] = ys */ declare function concat$(x: Map, ...ys: Entries[]): Map; /** * Join entries together into a string. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/join) * @param x a map * @param sep separator [,] * @param asc associator [=] * @returns "$\{kā‚€\}=$\{vā‚€\},$\{kā‚\}=$\{vā‚\}..." | [kįµ¢, vįµ¢] āˆˆ x */ declare function join(x: Entries, sep?: string, asc?: string): string; /** * Check if maps have no common keys. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/isDisjoint) * @param x a map * @param y another map * @returns x āˆ© y = Ī¦? */ declare function isDisjoint(x: Map, y: Entries): boolean; /** * Obtain keys present in any map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/unionKeys) * @param xs maps * @returns [kā‚€, kā‚, ...] | [kįµ¢, vįµ¢] āˆˆ xā‚€ āˆŖ xā‚, ...; [xā‚€, xā‚, ...] = xs */ declare function unionKeys(...xs: Entries[]): Set; /** * Obtain entries present in any map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/union) * @param x a map * @param y another map * @param fc combine function (a, b) * @returns x āˆŖ y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x or [kįµ¢, vįµ¢] āˆˆ y\} */ declare function union(x: Entries, y: Entries, fc?: CombineFunction | null): Map; /** * Obtain entries present in any map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/union$) * @param x a map (updated) * @param y another map * @param fc combine function (a, b) * @returns x = x āˆŖ y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x or [kįµ¢, vįµ¢] āˆˆ y\} */ declare function union$(x: Map, y: Entries, fc?: CombineFunction | null): Map; /** * Obtain keys present in all maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/intersectionKeys) * @param xs maps * @returns [kā‚€, kā‚, ...] | [kįµ¢, vįµ¢] āˆˆ xā‚€ āˆ© xā‚, ...; [xā‚€, xā‚, ...] = xs */ declare function intersectionKeys(...xs: Map[]): Set; /** * Obtain entries present in both maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/intersection) * @param x a map * @param y another map * @param fc combine function (a, b) * @returns x āˆ© y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x and [kįµ¢, vįµ¢] āˆˆ y\} */ declare function intersection(x: Map, y: Entries, fc?: CombineFunction | null): Map; /** * Obtain entries present in both maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/intersection$) * @param x a map (updated) * @param y another map * @param fc combine function (a, b) * @returns x = x āˆ© y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x and [kįµ¢, vįµ¢] āˆˆ y\} */ declare function intersection$(x: Map, y: Map, fc?: CombineFunction | null): Map; /** * Obtain entries not present in another map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/difference) * @param x a map * @param y another map * @returns x - y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x, [kįµ¢, *] āˆ‰ y\} */ declare function difference(x: Entries, y: Entries): Map; /** * Obtain entries not present in another map. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/difference$) * @param x a map (updated) * @param y another map * @returns x = x - y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] āˆˆ x, [kįµ¢, *] āˆ‰ y\} */ declare function difference$(x: Map, y: Entries): Map; /** * Obtain entries not present in both maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/symmetricDifference) * @param x a map * @param y another map * @returns x-y āˆŖ y-x */ declare function symmetricDifference(x: Entries, y: Entries): Map; /** * Obtain entries not present in both maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/symmetricDifference$) * @param x a map (updated) * @param y another map * @returns x = x-y āˆŖ y-x */ declare function symmetricDifference$(x: Map, y: Entries): Map; /** * List cartesian product of maps. * [šŸ“˜](https://github.com/nodef/extra-map/wiki/cartesianProduct) * @param xs maps * @param fm map function (vs, i) * @returns xā‚€ Ɨ xā‚ Ɨ ... = \{\{[kā‚€, vā‚€], [kā‚, vā‚], ...\} | [kā‚€, vā‚€] āˆˆ xā‚€, [kā‚, vā‚] āˆˆ xā‚, ...]\} */ declare function cartesianProduct>(xs: Map[], fm?: MapFunction, Map | W> | null): IterableIterator | W>; export { type CombineFunction, type CompareFunction, type EndFunction, type Entries, type Lists, type MapFunction, type ProcessFunction, type ReadFunction, type ReduceFunction, type TestFunction, cartesianProduct, chunk, compare, concat, concat$, count, countAs, difference, difference$, drop, drop$, entries, randomEntry as entry, every, filter, filter$, filterAt, filterAt$, find, findAll, flat, flatMap, forEach, from, from$, from as fromEntries, from$ as fromEntries$, fromKeys, fromLists, fromValues, get, getAll, getPath, has, hasEntry, has as hasKey, hasPath, hasSubset, hasValue, head, intersection, intersection$, intersectionKeys, is, isDisjoint, isEmpty, isEqual, join, randomKey as key, keys, size as length, map, map$, max, maxEntry, min, minEntry, partition, partitionAs, randomEntry, randomKey, randomSubset, range, rangeEntries, reduce, reject, reject$, rejectAt, rejectAt$, remove, remove$, removePath$, search, searchAll, searchValue, searchValueAll, set, set$, setPath$, size, some, randomSubset as subset, subsets, swap, swap$, symmetricDifference, symmetricDifference$, tail, take, take$, union, union$, unionKeys, values, zip };