@rimbu/bimap
Version:
A bidirectional immutable Map of keys and values for TypeScript
21 lines (20 loc) • 1.36 kB
text/typescript
import { BiMapBuilder, BiMapNonEmptyImpl } from '@rimbu/bimap/custom';
import type { BiMap } from '@rimbu/bimap';
import type { RMap } from '@rimbu/collection-types/map';
import type { ArrayNonEmpty } from '@rimbu/common';
import { Reducer, type StreamSource } from '@rimbu/stream';
export declare class BiMapContext<UK, UV, Tp extends BiMap.Types = BiMap.Types> implements BiMap.Context<UK, UV> {
readonly keyValueContext: RMap.Context<UK>;
readonly valueKeyContext: RMap.Context<UV>;
constructor(keyValueContext: RMap.Context<UK>, valueKeyContext: RMap.Context<UV>);
get typeTag(): 'BiMap';
get _types(): Tp;
readonly _empty: BiMap<any, any>;
readonly empty: <K extends UK, V extends UV>() => BiMap<K, V>;
readonly of: any;
readonly from: <K, V>(...sources: ArrayNonEmpty<StreamSource<readonly [K, V]>>) => [K, V] extends [UK, UV] ? BiMap<K, V> | any : never;
readonly builder: <K extends UK, V extends UV>() => BiMap.Builder<K, V>;
readonly reducer: <K extends UK, V extends UV>(source?: StreamSource<readonly [K, V]>) => Reducer<readonly [K, V], BiMap<K, V>>;
createNonEmptyImpl<K extends UK, V extends UV>(keyValueMap: RMap.NonEmpty<K, V>, valueKeyMap: RMap.NonEmpty<V, K>): BiMapNonEmptyImpl<K, V>;
createBuilder<K extends UK, V extends UV>(source?: BiMapNonEmptyImpl<K, V>): BiMapBuilder<K, V>;
}