UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

20 lines (19 loc) 965 B
import type { DictionaryItem, ImmutableDictionary } from "../util/dictionary.js"; import type { Updates } from "../util/update.js"; import { Store } from "./Store.js"; /** Store a dictionary object. */ export declare class DictionaryStore<T> extends Store<ImmutableDictionary<T>> implements Iterable<DictionaryItem<T>> { constructor(value?: ImmutableDictionary<T>, time?: number); /** Get the length of the current value of this store. */ get count(): number; /** Set a named entry in this object with a different value. */ update(updates: Updates<ImmutableDictionary<T>>): void; /** Remove a named entry from this object. */ delete(...keys: string[]): void; /** Get an item in this dictionary. */ getItem(name: string): T | undefined; /** Set an item in this dictionary. */ setItem(name: string, value: T): void; /** Iterate over the entries of the object. */ [Symbol.iterator](): Iterator<DictionaryItem<T>>; }