mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-02-15 07:28:59 +00:00
18 lines
512 B
TypeScript
18 lines
512 B
TypeScript
// Copyright 2019 Signal Messenger, LLC
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
import type { StorageAccessType } from '../types/Storage.d.ts';
|
|
import { itemStorage } from '../textsecure/Storage.preload.js';
|
|
|
|
// Matching storage.put API
|
|
export async function put<K extends keyof StorageAccessType>(
|
|
key: K,
|
|
value: StorageAccessType[K]
|
|
): Promise<void> {
|
|
await itemStorage.put(key, value);
|
|
}
|
|
|
|
export async function remove(key: keyof StorageAccessType): Promise<void> {
|
|
await itemStorage.remove(key);
|
|
}
|