import type { AnyCaller } from "./function.js"; /** Readonly dictionary object. */ export type ImmutableDictionary = { readonly [K in string]: T; }; /** Writable dictionary object. */ export type MutableDictionary = { [K in string]: T; }; /** Single item for a dictionary object in entry format. */ export type DictionaryItem = readonly [string, T]; /** Get the type of the _values_ of the items of a dictionary object. */ export type DictionaryValue = T[string]; /** Value that can be converted to a dictionary object. */ export type PossibleDictionary = ImmutableDictionary | Iterable>; /** Is an unknown value a dictionary object? */ export declare function isDictionary(value: unknown): value is ImmutableDictionary; /** Assert that an unknown value is a dictionary object */ export declare function assertDictionary(value: unknown, caller?: AnyCaller): asserts value is ImmutableDictionary; /** Convert a possible dictionary into a dictionary. */ export declare function getDictionary(dict: PossibleDictionary): ImmutableDictionary; /** Turn a dictionary object into a set of props. */ export declare function getDictionaryItems(input: ImmutableDictionary): readonly DictionaryItem[]; export declare function getDictionaryItems(input: PossibleDictionary): Iterable>; /** Is an unknown value the key for an own prop of a dictionary. */ export declare function isDictionaryItem(dict: ImmutableDictionary, key: unknown): key is string; /** Assert that an unknown value is the key for an own prop of a dictionary. */ export declare function assertDictionaryItem(dict: ImmutableDictionary, key: string, caller?: AnyCaller): asserts key is string; /** Get an item in a map or throw `RequiredError` if it doesn't exist. */ export declare function requireDictionaryItem(dict: ImmutableDictionary, key: string, caller?: AnyCaller): T; /** Get an item in a map or `undefined` if it doesn't exist. */ export declare function getDictionaryItem(dict: ImmutableDictionary, key: string): T | undefined; /** Set a prop on a dictionary object (immutably) and return a new object including that prop. */ export declare const withDictionaryItem: (dict: ImmutableDictionary, key: string, value: T) => ImmutableDictionary; /** Set several props on a dictionary object (immutably) and return a new object including those props. */ export declare const withDictionaryItems: (dict: ImmutableDictionary, props: PossibleDictionary) => ImmutableDictionary; /** Remove several key/value entries from a dictionary object (immutably) and return a new object without those props. */ export declare const omitDictionaryItems: (dict: ImmutableDictionary, ...keys: string[]) => ImmutableDictionary; /** Remove a key/value entry from a dictionary object (immutably) and return a new object without that prop. */ export declare const omitDictionaryItem: (dict: ImmutableDictionary, key: string) => ImmutableDictionary; /** Pick several props from a dictionary object and return a new object with only thos props. */ export declare const pickDictionaryItems: (dict: ImmutableDictionary, ...keys: string[]) => ImmutableDictionary; /** Set a single named prop on a dictionary object (by reference) and return its value. */ export declare const setDictionaryItem: (dict: MutableDictionary, key: string, value: T) => T; /** Set several named props on a dictionary object (by reference). */ export declare const setDictionaryItems: (dict: MutableDictionary, entries: PossibleDictionary) => void; /** Remove several key/value entries from a dictionary object (by reference). */ export declare const deleteDictionaryItems: (dict: T, ...keys: string[]) => void; /** Remove a key/value entry from a dictionary object (by reference). */ export declare const deleteDictionaryItem: (dict: T, key: string) => void; /** Type that represents an empty dictionary object. */ export type EmptyDictionary = { readonly [K in never]: never; }; /** An empty dictionary object. */ export declare const EMPTY_DICTIONARY: EmptyDictionary;