export type CopyStatus = 'idle' | 'copied' | 'error'; export interface UseCopyToClipboardOptions { /** * Auto-reset to `'idle'` this many ms after a successful copy. Pass * `0` to disable auto-reset (caller drives the lifecycle). @default 2000 */ resetAfterMs?: number; /** * Override the underlying clipboard writer. When omitted the hook * uses `navigator.clipboard.writeText`. Pass your own writer to add * a legacy `document.execCommand('copy')` fallback for non-HTTPS * contexts, or to instrument the call for telemetry. Must resolve * `true` on success, `false` on failure (do not throw). */ writer?: (value: string) => Promise; } export interface UseCopyToClipboardReturn { /** Current status. `'idle'` until the first `copy()` call. */ status: CopyStatus; /** Last value successfully copied, or `null`. */ copiedValue: string | null; /** Copy `value` to the clipboard. Returns `true` on success. */ copy: (value: string) => Promise; /** Reset to `'idle'` immediately. */ reset: () => void; } /** * Copy a string to the system clipboard with status tracking. * * Uses `navigator.clipboard.writeText` (https-only / focus-required, but * universally available in modern browsers). Falls back gracefully — * `copy()` returns `false` and sets `status: 'error'` when the Clipboard * API is unavailable or the call rejects. * * Status auto-resets to `'idle'` after `resetAfterMs` ms by default so * the common "show ✓ for 2s after click" UX has zero glue code. * * @example * const { status, copy } = useCopyToClipboard(); * */ export declare function useCopyToClipboard(options?: UseCopyToClipboardOptions): UseCopyToClipboardReturn; //# sourceMappingURL=use-copy-to-clipboard.d.ts.map