UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

22 lines (21 loc) 1.08 kB
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. */ deleteItems(...keys: string[]): void; /** Get an item in this dictionary. */ get(name: string): T | undefined; /** Set an item in this dictionary. */ set(name: string, value: T): void; /** Delete an item (or several items) in this dictionary. */ delete(name: string, ...names: string[]): void; /** Iterate over the entries of the object. */ [Symbol.iterator](): Iterator<DictionaryItem<T>>; }