/** * Shared clipboard write and transient feedback primitives for React controls. * * @module react/components/clipboard */ interface ClipboardFeedbackOutcome { status: "copied" | "failed"; text: string; } /** State returned by {@link useClipboardFeedback}. */ export interface ClipboardFeedback { /** The most recent settled copy outcome, or `undefined` before/while copying. */ outcome: ClipboardFeedbackOutcome | undefined; /** Copy text and update `outcome` only if this remains the latest request. */ copy: (text: string, ownerDocument?: Document) => Promise; } /** * Copy text without leaking the fallback textarea or reporting false success. * * Returns `false` when neither the asynchronous Clipboard API nor the legacy * `execCommand("copy")` fallback completes successfully. An aborted request * never starts the fallback or reports success; the Clipboard API itself does * not expose cancellation for a write already in progress. */ export declare function copyTextToClipboard(text: string, ownerDocument?: Document, signal?: AbortSignal): Promise; /** * Coordinate clipboard writes and a bounded success/failure feedback window. * * Later requests supersede earlier ones, and pending writes cannot update an * unmounted component. */ export declare function useClipboardFeedback(timeout?: number): ClipboardFeedback; export {}; //# sourceMappingURL=clipboard.d.ts.map