/** * Async clipboard API wrappers. * * Provides simple read/write access to the system clipboard * via the Async Clipboard API, plus image read/write and a reactive * `clipboardText()` signal for opt-in monitoring (1.14+). * * @module bquery/media */ import { type AbortableOptions } from './internal'; import type { ClipboardAPI, MediaSignalHandle } from './types'; /** * Clipboard API wrapper providing async read/write access for text and * (where supported) images. * * Both string methods are `Promise`-based and will reject if the API is * unavailable or permission is denied. * * @example * ```ts * import { clipboard } from '@bquery/bquery/media'; * * await clipboard.write('Hello, world!'); * const text = await clipboard.read(); * * if (clipboard.isSupported) { * const blob = await clipboard.readImage(); * await clipboard.writeImage(blob); * } * ``` */ export declare const clipboard: ClipboardAPI & { /** Whether the basic text Clipboard API is available. */ readonly isSupported: boolean; /** Whether image read/write is available (ClipboardItem support). */ readonly isImageSupported: boolean; /** Read the first image entry from the clipboard as a `Blob`. */ readImage(): Promise; /** Write a `Blob` (typically `image/png`) to the clipboard. */ writeImage(blob: Blob): Promise; }; /** * Options for {@link clipboardText}. */ export interface ClipboardTextOptions extends AbortableOptions { /** Re-read on `focus` events. @default true */ onFocus?: boolean; /** Re-read on `copy` / `cut` events. @default true */ onCopy?: boolean; /** Polling interval in ms. Disabled by default. */ pollMs?: number; } /** * Reactive signal that mirrors the system clipboard text. * * Re-reads on `focus`, `copy`, `cut`, and (optionally) a configurable polling * interval. Returns an empty string when the Clipboard API is unavailable or * permission has not been granted. * * @example * ```ts * const text = clipboardText({ onFocus: true }); * effect(() => console.log('clipboard:', text.value)); * ``` */ export declare const clipboardText: (options?: ClipboardTextOptions) => MediaSignalHandle; //# sourceMappingURL=clipboard.d.ts.map