← All packages

@searsuite/sear-plugin-clipboard

Copy, cut, and paste

Range commands move Sheet content through the clipboard. A cut session tracks content until the paste commits.

enumSheetPasteMode

Selects which structured clipboard channels are applied by a paste command.

enum memberAll: "all"
enum memberFormats: "formats"
enum memberValues: "values"
classInMemorySheetClipboard
class InMemorySheetClipboard extends SheetClipboard

Node-safe clipboard used when a host does not expose system clipboard I/O.

Inherited members 1

Inherited from SheetClipboard.

classSheetClipboard

Platform-neutral clipboard abstraction. Implementations own system I/O.

classSheetClipboardPlugin
class SheetClipboardPlugin extends Plugin<unknown, CellProperties, Record<string, never>>, PluginExtension<SheetCommandBus>

Default sheet clipboard plugin. System clipboard I/O remains a host-owned SheetClipboardPort.

constructorSheetClipboardPlugin(source: SheetClipboardDataSource, codec: SheetClipboardCodec): SheetClipboardPlugin
propertyreadonly pluginKey: PluginKeystatic
propertyreadonly symbol: typeof symbolstatic
methodapply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

Applies a transaction to plugin-owned state and returns the next state.

methodgetPluginConfig(): null

Returns this plugin's runtime configuration view for the current core.

methodregisterCommands(commands: SheetCommandBus): void

Registers the three semantic clipboard commands on this editor's bus.

methodregisterState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: Record<string, never> }

Registers one or more plugin-owned state records with the host manager.

methodrender(): []

Produces scene nodes owned by this plugin for the current core state.

Inherited members 29

Inherited from Plugin.

interfaceSheetCopyRangeInput

Optional explicit range; omitted means the current editor selection.

interfaceSheetPasteRangeInput

Input for pasting a previously decoded or host-read clipboard payload.

propertyreadonly mode?: SheetPasteMode

Structured channel selection. Plain-text payloads contain values only.

propertyreadonly payload: SheetClipboardPayload
propertyreadonly target?: SheetClipboardCellPoint

Top-left target; omitted means the current selection's top-left cell.

interfaceSheetPasteRangeResult
interface SheetPasteRangeResult extends SheetCommandResult

Committed target range, used by hosts to select the pasted cells.

Inherited members 4

Inherited from SheetCommandResult.

typeSheetClipboardPort
type SheetClipboardPort = Pick<SheetClipboard, "read" | "write">

Structural port retained as a lightweight host-adapter contract.

variableCancelCutRangeCommand
CancelCutRangeCommand: SheetCommandDefinition<void, SheetCommandResult>

Cancels a pending cut without changing any cell content.

variableCopyCommand
CopyCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCopyRangeCommand
CopyRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

Typed command that snapshots a range without mutating sheet state.

variableCutCommand
CutCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCutRangeCommand
CutRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

Typed command that snapshots and clears a range in one sheet transaction.

variablePasteCommand
PasteCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetPasteRangeResult>
variablePasteRangeCommand
PasteRangeCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetPasteRangeResult>

Typed command that decodes and writes a payload through the normal sheet transaction boundary.

Clipboard data and codecs

The codec represents cell values and merged ranges in a portable payload before a paste command reads them.

classSheetClipboardError
class SheetClipboardError extends SearError

Public error raised when a clipboard command cannot satisfy its contract.

Inherited members 9

Inherited from SearError.

classSheetClipboardSheetIdentity

Identity of the mounted sheet, stable across workbook sheet remounts.

interfaceSheetClipboardCommandResult
interface SheetClipboardCommandResult extends SheetCommandResult

Result shared by copy and cut commands.

Inherited members 4

Inherited from SheetCommandResult.

interfaceSheetClipboardDataSource

Data source required by the clipboard plugin; selection and storage stay replaceable.

propertyreadonly cutSession?: SheetClipboardCutSession
propertyreadonly cutSourceId?: string
propertyreadonly formatTarget: PluginKey
propertyreadonly target: PluginKey
methodcaptureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]
methodcaptureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]
methodclearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]
methodcreateClipboardCutId(): string
methodgetColumnCount(): number
methodgetMergedRange(row: number, column: number): SheetRangeBounds | null

Optional host projection for rejecting writes hidden by merged cells.

methodgetRowCount(): number
methodgetSelection(): SheetRangeBounds | null
methodisRowVisible(row: number): boolean
methodplanClearMergedRanges(range: SheetRangeBounds): SheetClipboardMergePlan
methodplanOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]
methodplanPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): SheetClipboardMergePlan
methodplanRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]
methodprepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): void
methodreadCell(row: number, column: number): CellMatrixElement | null
methodreadCellFormat(row: number, column: number): CellFormat | null
methodscheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>
methodvalidatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResult

Optional editor-local validation applied before any pasted value is written.

interfaceSheetClipboardDecodeContext

Context supplied to codecs so formula-aware implementations can rebase references on paste.

interfaceSheetClipboardMergedRange

Inclusive merged range relative to the copied range's top-left cell.

interfaceSheetClipboardMergePlan

Merge-owner operation plan produced by the active sheet adapter.

interfaceSheetClipboardPayload

Platform-neutral clipboard data. It is transient and is not a persistence envelope.

propertyreadonly plainText: string

Plain text representation suitable for external applications.

propertyreadonly structured?: SheetClipboardStructuredPayload

Optional editor-native representation preserving cell type and metadata.

interfaceSheetClipboardRangeInput

Inclusive range accepted by clipboard commands.

interfaceSheetClipboardStructuredPayload

Editor-owned structured range data carried inside a clipboard payload.

propertyreadonly cutId?: string

Transient identifier linking a cut and a subsequent paste in Sheet history.

propertyreadonly formats: readonly readonly CellFormat | null[][]

Parallel explicit-format rows. Null means General/no explicit format.

propertyreadonly isCut?: true

A cut move keeps formula references anchored to their original targets.

propertyreadonly kind: "searsuite.sheet-range"
propertyreadonly merges?: readonly SheetClipboardMergedRange[]

Merge geometry relative to this payload's top-left cell.

propertyreadonly ownerFormats?: readonly SheetPortableFormatTransfer[]

Optional persisted-format snapshots supplied by their state owners.

propertyreadonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]

Per-row format snapshots for a compacted visible-row selection.

propertyreadonly rows: readonly SheetClipboardRow[]
propertyreadonly source: SheetClipboardCellPoint

Original top-left coordinate, supplied to cell-type paste codecs.

propertyreadonly sourceRows?: readonly number[]

Original row coordinates when a filtered selection is compacted on copy.

propertyreadonly version: 3
typeSheetClipboardCellPoint
type SheetClipboardCellPoint = readonly [number, number]

A zero-based cell coordinate expressed as [row, column].

typeSheetClipboardDecodedRow
type SheetClipboardDecodedRow = readonly CellMatrixElement | null[]

Decoded cells ready for a paste transaction.

typeSheetClipboardErrorCode
type SheetClipboardErrorCode = typeof SheetClipboardErrorCode[keyof typeof SheetClipboardErrorCode] SheetClipboardErrorCode: { InputRejected: "SEAR_SHEET_CLIPBOARD_INPUT_REJECTED"; InvalidPayload: "SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD"; NoSelection: "SEAR_SHEET_CLIPBOARD_NO_SELECTION"; NoVisibleRows: "SEAR_SHEET_CLIPBOARD_NO_VISIBLE_ROWS"; SourceIntersectsMergedCells: "SEAR_SHEET_CLIPBOARD_SOURCE_INTERSECTS_MERGED_CELLS"; TargetIntersectsMergedCells: "SEAR_SHEET_CLIPBOARD_TARGET_INTERSECTS_MERGED_CELLS"; TargetOutOfBounds: "SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS" }

Supported sheet clipboard error code values.

typeSheetClipboardRow
type SheetClipboardRow = readonly CellClipboardCellPayload | null[]

One row in a structured clipboard range, including empty cells.

variableSHEET_CLIPBOARD_MIME_TYPE
SHEET_CLIPBOARD_MIME_TYPE: "application/x-searsuite-sheet-range"

MIME type that a browser adapter may use for the structured payload.

variableSHEET_CLIPBOARD_PAYLOAD_VERSION
SHEET_CLIPBOARD_PAYLOAD_VERSION: 3

Current version of the transient structured sheet clipboard payload.

variableSheetClipboardCodecSymbol
SheetClipboardCodecSymbol: typeof SheetClipboardCodecSymbol

DI token for the editor-local clipboard codec.

variableSheetClipboardDataSourceSymbol
SheetClipboardDataSourceSymbol: typeof SheetClipboardDataSourceSymbol

DI token for the editor-local clipboard data source.

variableSheetClipboardErrorCodeType
SheetClipboardErrorCodeType: { InputRejected: "SEAR_SHEET_CLIPBOARD_INPUT_REJECTED"; InvalidPayload: "SEAR_SHEET_CLIPBOARD_INVALID_PAYLOAD"; NoSelection: "SEAR_SHEET_CLIPBOARD_NO_SELECTION"; NoVisibleRows: "SEAR_SHEET_CLIPBOARD_NO_VISIBLE_ROWS"; SourceIntersectsMergedCells: "SEAR_SHEET_CLIPBOARD_SOURCE_INTERSECTS_MERGED_CELLS"; TargetIntersectsMergedCells: "SEAR_SHEET_CLIPBOARD_TARGET_INTERSECTS_MERGED_CELLS"; TargetOutOfBounds: "SEAR_SHEET_CLIPBOARD_TARGET_OUT_OF_BOUNDS" }

Stable public errors raised by the sheet clipboard contract.