signal-desktop/ts/shims/storage.ts

17 lines
458 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2019 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import type { StorageAccessType } from '../types/Storage.d';
2020-09-16 19:31:05 +00:00
// Matching window.storage.put API
export async function put<K extends keyof StorageAccessType>(
key: K,
value: StorageAccessType[K]
): Promise<void> {
await window.storage.put(key, value);
}
export async function remove(key: keyof StorageAccessType): Promise<void> {
await window.storage.remove(key);
}