import { Compactable2 } from './Compactable.js'; import { Either } from './Either.js'; import { Eq } from './Eq.js'; import { Filterable2 } from './Filterable.js'; import { FilterableWithIndex2C } from './FilterableWithIndex.js'; import { Foldable, Foldable1, Foldable2, Foldable2C, Foldable3 } from './Foldable.js'; import { FoldableWithIndex2C } from './FoldableWithIndex.js'; import { Functor2 } from './Functor.js'; import { HKT, Kind, Kind2, Kind3, URIS, URIS2, URIS3 } from './HKT.js'; import { Magma } from './Magma.js'; import { Monoid } from './Monoid.js'; import * as O from './Option.js'; import { Ord } from './Ord.js'; import { Predicate } from './Predicate.js'; import { Refinement } from './Refinement.js'; import { Semigroup } from './Semigroup.js'; import { Separated } from './Separated.js'; import { Show } from './Show.js'; import { TraversableWithIndex2C } from './TraversableWithIndex.js'; import { Unfoldable, Unfoldable1 } from './Unfoldable.js'; import { Witherable2C } from './Witherable.js'; type Option = O.Option; /** * @category instances * @since 2.0.0 */ export declare const getShow: (SK: Show, SA: Show) => Show>; /** * Calculate the number of key/value pairs in a map * * @since 2.0.0 */ export declare const size: (m: Map) => number; /** * Test whether or not a map is empty * * @since 2.0.0 */ export declare const isEmpty: (m: Map) => boolean; /** * Test whether or not a key exists in a map * * @since 2.0.0 */ export declare const member: (E: Eq) => { (k: K): (m: Map) => boolean; (k: K, m: Map): boolean; }; /** * Test whether or not a value is a member of a map * * @since 2.0.0 */ export declare const elem: (E: Eq) => { (a: A): (m: Map) => boolean; (a: A, m: Map): boolean; }; /** * Get a sorted `Array` of the keys contained in a `Map`. * * @since 2.0.0 */ export declare const keys: (O: Ord) => (m: Map) => Array; /** * Get a sorted `Array` of the values contained in a `Map`. * * @since 2.0.0 */ export declare const values: (O: Ord) => (m: Map) => Array; /** * @since 2.0.0 */ export declare function collect(O: Ord): (f: (k: K, a: A) => B) => (m: Map) => Array; /** * Get a sorted `Array` of the key/value pairs contained in a `Map`. * * @since 2.0.0 */ export declare function toArray(O: Ord): (m: Map) => Array<[K, A]>; /** * Unfolds a map into a list of key/value pairs * * @since 2.0.0 */ export declare function toUnfoldable(ord: Ord, U: Unfoldable1): (d: Map) => Kind; export declare function toUnfoldable(ord: Ord, U: Unfoldable): (d: Map) => HKT; /** * Insert or replace a key/value pair in a `Map`. * * @since 2.0.0 */ export declare const upsertAt: (E: Eq) => ((k: K, a: A) => (m: Map) => Map); /** * Delete a key and value from a map * * @since 2.0.0 */ export declare const deleteAt: (E: Eq) => ((k: K) => (m: Map) => Map); /** * @since 2.0.0 */ export declare const updateAt: (E: Eq) => ((k: K, a: A) => (m: Map) => Option>); /** * @since 2.0.0 */ export declare const modifyAt: (E: Eq) => ((k: K, f: (a: A) => A) => (m: Map) => Option>); /** * Delete a key and value from a map, returning the value as well as the subsequent map * * @since 2.0.0 */ export declare function pop(E: Eq): (k: K) => (m: Map) => Option<[A, Map]>; /** * Lookup the value for a key in a `Map`. * If the result is a `Some`, the existing key is also returned. * * @since 2.0.0 */ export declare function lookupWithKey(E: Eq): { (k: K): (m: Map) => Option<[K, A]>; (k: K, m: Map): Option<[K, A]>; }; /** * Lookup the value for a key in a `Map`. * * @since 2.0.0 */ export declare const lookup: (E: Eq) => { (k: K): (m: Map) => Option; (k: K, m: Map): Option; }; /** * Test whether or not one `Map` contains all of the keys and values contained in another `Map` * * @since 2.0.0 */ export declare const isSubmap: (SK: Eq, SA: Eq) => { (that: Map): (me: Map) => boolean; (me: Map, that: Map): boolean; }; /** * @category instances * @since 2.0.0 */ export declare const getEq: (SK: Eq, SA: Eq) => Eq>; /** * Gets `Monoid` instance for Maps given `Semigroup` instance for their values * * @category instances * @since 2.0.0 */ export declare function getMonoid(SK: Eq, SA: Semigroup): Monoid>; /** * Create a map with one key/value pair * * @since 2.0.0 */ export declare const singleton: (k: K, a: A) => Map; /** * Create a map from a foldable collection of key/value pairs, using the * specified `Magma` to combine values for duplicate keys. * * @category constructors * @since 2.0.0 */ export declare function fromFoldable(E: Eq, M: Magma, F: Foldable3): (fka: Kind3) => Map; export declare function fromFoldable(E: Eq, M: Magma, F: Foldable2): (fka: Kind2) => Map; export declare function fromFoldable(E: Eq, M: Magma, F: Foldable1): (fka: Kind) => Map; export declare function fromFoldable(E: Eq, M: Magma, F: Foldable): (fka: HKT) => Map; /** * @since 2.10.0 */ export declare const partitionMapWithIndex: (f: (k: K, a: A) => Either) => (fa: Map) => Separated, Map>; /** * @since 2.10.0 */ export declare function partitionWithIndex(predicateWithIndex: (k: K, a: A) => a is B): (fa: Map) => Separated, Map>; export declare function partitionWithIndex(predicateWithIndex: (k: K, a: A) => boolean): (fb: Map) => Separated, Map>; export declare function partitionWithIndex(predicateWithIndex: (k: K, a: A) => boolean): (fa: Map) => Separated, Map>; /** * @since 2.10.0 */ export declare const filterMapWithIndex: (f: (k: K, a: A) => Option) => (fa: Map) => Map; /** * @since 2.10.0 */ export declare function filterWithIndex(p: (k: K, a: A) => a is B): (m: Map) => Map; export declare function filterWithIndex(p: (k: K, a: A) => boolean): (m: Map) => Map; export declare function filterWithIndex(p: (k: K, a: A) => boolean): (m: Map) => Map; /** * @category filtering * @since 2.0.0 */ export declare const compact: (fa: Map>) => Map; /** * @category filtering * @since 2.0.0 */ export declare const filter: { (refinement: Refinement): (fa: Map) => Map; (predicate: Predicate): (fb: Map) => Map; (predicate: Predicate): (fa: Map) => Map; }; /** * @category filtering * @since 2.0.0 */ export declare const filterMap: (f: (a: A) => Option) => (fa: Map) => Map; /** * `map` can be used to turn functions `(a: A) => B` into functions `(fa: F) => F` whose argument and return types * use the type constructor `F` to represent some computational context. * * @category mapping * @since 2.0.0 */ export declare const map: (f: (a: A) => B) => (fa: Map) => Map; /** * @category mapping * @since 2.7.1 */ export declare const mapWithIndex: (f: (k: K, a: A) => B) => (fa: Map) => Map; /** * @category filtering * @since 2.0.0 */ export declare const partition: { (refinement: Refinement): (fa: Map) => Separated, Map>; (predicate: Predicate): (fb: Map) => Separated, Map>; (predicate: Predicate): (fa: Map) => Separated, Map>; }; /** * @category filtering * @since 2.0.0 */ export declare const partitionMap: (f: (a: A) => Either) => (fa: Map) => Separated, Map>; /** * @category filtering * @since 2.0.0 */ export declare const separate: (fa: Map>) => Separated, Map>; /** * @category type lambdas * @since 2.0.0 */ export declare const URI = "Map"; /** * @category type lambdas * @since 2.0.0 */ export type URI = typeof URI; declare module './HKT.js' { interface URItoKind2 { readonly [URI]: Map; } } /** * @category instances * @since 2.11.0 */ export declare const getUnionSemigroup: (E: Eq, S: Semigroup) => Semigroup>; /** * @category instances * @since 2.11.0 */ export declare const getUnionMonoid: (E: Eq, S: Semigroup) => Monoid>; /** * @category instances * @since 2.11.0 */ export declare const getIntersectionSemigroup: (E: Eq, S: Semigroup) => Semigroup>; /** * @category instances * @since 2.11.0 */ export declare const getDifferenceMagma: (E: Eq) => () => Magma>; /** * @category filtering * @since 2.0.0 */ export declare function getFilterableWithIndex(): FilterableWithIndex2C; /** * @category filtering * @since 2.0.0 */ export declare function getWitherable(O: Ord): Witherable2C & TraversableWithIndex2C; /** * @category folding * @since 2.11.0 */ export declare const reduce: (O: Ord) => (b: B, f: (b: B, a: A) => B) => (m: Map) => B; /** * @category folding * @since 2.11.0 */ export declare const foldMap: (O: Ord) => (M: Monoid) => (f: (a: A) => M) => (m: Map) => M; /** * @category folding * @since 2.11.0 */ export declare const reduceRight: (O: Ord) => (b: B, f: (a: A, b: B) => B) => (m: Map) => B; /** * @category folding * @since 2.11.0 */ export declare const getFoldable: (O: Ord) => Foldable2C; /** * @category folding * @since 2.11.0 */ export declare const reduceWithIndex: (O: Ord) => (b: B, f: (k: K, b: B, a: A) => B) => (m: Map) => B; /** * @category folding * @since 2.11.0 */ export declare const foldMapWithIndex: (O: Ord) => (M: Monoid) => (f: (k: K, a: A) => M) => (m: Map) => M; /** * @category folding * @since 2.11.0 */ export declare const reduceRightWithIndex: (O: Ord) => (b: B, f: (k: K, a: A, b: B) => B) => (m: Map) => B; /** * @category folding * @since 2.10.0 */ export declare const getFoldableWithIndex: (O: Ord) => FoldableWithIndex2C; /** * @category traversing * @since 2.10.0 */ export declare const getTraversableWithIndex: (O: Ord) => TraversableWithIndex2C; /** * @category instances * @since 2.7.0 */ export declare const Functor: Functor2; /** * @category mapping * @since 2.10.0 */ export declare const flap: (a: A) => (fab: Kind2<"Map", E, (a: A) => B>) => Kind2<"Map", E, B>; /** * @category instances * @since 2.7.0 */ export declare const Compactable: Compactable2; /** * @category instances * @since 2.7.0 */ export declare const Filterable: Filterable2; /** * @since 2.11.0 */ export declare const union: (E: Eq, M: Magma) => ((second: Map) => (first: Map) => Map); /** * @since 2.11.0 */ export declare const intersection: (E: Eq, M: Magma) => ((second: Map) => (first: Map) => Map); /** * @since 2.11.0 */ export declare const difference: (E: Eq) => ((_second: Map) => (first: Map) => Map); /** * Use a `new Map()` instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const empty: Map; /** * Use [`upsertAt`](#upsertat) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const insertAt: (E: Eq) => (k: K, a: A) => (m: Map) => Map; /** * Use [`Filterable`](#filterable) instead. * * @category zone of death * @since 2.0.0 * @deprecated */ export declare const map_: Filterable2; export {};