UNPKG

extra-entries

Version:

A collection of functions for operating upon Entries.

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