interface ReadOnlyValueInterface { readonly value: V; subscribe: (callback: (value: V) => void) => string; unsubscribe: (subId: string) => boolean; } interface ValueInterface extends ReadOnlyValueInterface { value: V; } type AnyFunction = (...args: any[]) => any; type MaybePromisify = T | Promise; type PromisifyMethods = { [K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters) => MaybePromisify> : T[K]; }; export type SupportedStorage = PromisifyMethods>; export type ValueOptions = { storage: SupportedStorage; }; declare class Value implements ValueInterface { private _value; private subscribers; private persistKey?; private storage?; constructor(initialValue: V, persistKey?: string, options?: ValueOptions); private hydrate; get value(): V; set value(newValue: V); subscribe(callback: (value: V) => void): string; unsubscribe(subId: string): boolean; } export { ReadOnlyValueInterface, Value, ValueInterface };