import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event"; import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle"; import { IStorageValueChangeEvent, StorageScope, StorageTarget } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage"; import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service"; export interface IStoredValueSerialization { deserialize(data: string): T; serialize(data: T): string; } interface IStoredValueOptions { key: string; scope: StorageScope; target: StorageTarget; serialization?: IStoredValueSerialization; } /** * todo@connor4312: is this worthy to be in common? */ export declare class StoredValue extends Disposable { private readonly storage; private readonly serialization; private readonly key; private readonly scope; private readonly target; private value?; /** * Emitted whenever the value is updated or deleted. */ readonly onDidChange: Event; constructor(options: IStoredValueOptions, storage: IStorageService); /** * Reads the value, returning the undefined if it's not set. */ get(): T | undefined; /** * Reads the value, returning the default value if it's not set. */ get(defaultValue: T): T; /** * Persists changes to the value. * @param value */ store(value: T): void; /** * Delete an element stored under the provided key from storage. */ delete(): void; } export {};