Skip to main content

ClipboardControls

How the clipboard contract scripts a port. A real adapter implements these by mocking navigator.clipboard and, for the fallback path, execCommand.

This is an interface exported by @mapcairn/core/contracts, checked against version 0.2.0.

Signature​

import type { ClipboardControls } from "@mapcairn/core/contracts";

interface ClipboardControls

Methods​

willFail​

willFail(reason: ClipboardContractFailure): void;

Makes every later copy fail the way reason describes.

  • reason (ClipboardContractFailure)

willSucceed​

willSucceed(): void;

Makes every later copy succeed.

written​

written(): readonly string[];

The text of every copy that succeeded, oldest first.

See also​

Source: packages/core/src/contracts/clipboard.contract.ts:16