mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-19 19:16:29 +08:00
18 lines
358 B
TypeScript
18 lines
358 B
TypeScript
import { del, get, set } from 'idb-keyval';
|
|
|
|
// Used for clipboard
|
|
|
|
const ID = 'tldraw_clipboard';
|
|
|
|
export async function getClipboard(): Promise<string | undefined> {
|
|
return get(ID);
|
|
}
|
|
|
|
export async function setClipboard(item: string): Promise<void> {
|
|
return set(ID, item);
|
|
}
|
|
|
|
export function clearClipboard(): Promise<void> {
|
|
return del(ID);
|
|
}
|