@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.
- classInMemorySheetClipboard
-
class InMemorySheetClipboard extends SheetClipboardNode-safe clipboard used when a host does not expose system clipboard I/O.
- classSheetClipboard
-
Platform-neutral clipboard abstraction. Implementations own system I/O.
constructor SheetClipboard(): SheetClipboardproperty readonly symbol: typeof symbolstaticmethod read(): Promise<SheetClipboardPayload | null>method write(payload: SheetClipboardPayload): Promise<void> - classSheetClipboardCutSession
-
Transient cut intent shared by the sheets mounted in one workbook.
constructor SheetClipboardCutSession(): SheetClipboardCutSessionproperty readonly symbol: typeof symbolstaticmethod begin(pending: PendingSheetCut): voidmethod cancel(): voidmethod getPending(): PendingSheetCut | null - 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.
constructor SheetClipboardPlugin(source: SheetClipboardDataSource, codec: SheetClipboardCodec): SheetClipboardPluginproperty readonly pluginKey: PluginKeystaticproperty readonly symbol: typeof symbolstaticmethod apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>Applies a transaction to plugin-owned state and returns the next state.
method getPluginConfig(): nullReturns this plugin's runtime configuration view for the current core.
method registerCommands(commands: SheetCommandBus): voidRegisters the three semantic clipboard commands on this editor's bus.
method registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: Record<string, never> }Registers one or more plugin-owned state records with the host manager.
method render(): []Produces scene nodes owned by this plugin for the current core state.
Inherited members 29
Inherited from Plugin.
- depth
- documentState
- interestedIn
- transactionHistory
- transactionOT
- warnOnDuplicateDepth
- key
- dirtyRect
- enforceRuntimeWriteBoundary
- enforceStateWriteBoundary
- getState
- hasStateWriteBoundary
- lockCommittedState
- onClick
- onDblClick
- onInitialDataCell
- onInitialDataComplete
- onMouseDown
- onMouseMove
- onMouseUp
- onResize
- onScroll
- onTransactionCommitted
- projectTransaction
- registerConfig
- sealRuntimeMetadata
- sealRuntimeMethods
- sealRuntimeWrites
- setState
- interfacePendingSheetCut
-
property readonly id: stringproperty readonly range: SheetClipboardRangeInputproperty readonly sourceId: string - interfaceSheetCopyRangeInput
-
Optional explicit range; omitted means the current editor selection.
- interfaceSheetPasteRangeInput
-
Input for pasting a previously decoded or host-read clipboard payload.
property readonly mode?: SheetPasteModeStructured channel selection. Plain-text payloads contain values only.
property readonly payload: SheetClipboardPayloadproperty readonly target?: SheetClipboardCellPointTop-left target; omitted means the current selection's top-left cell.
- interfaceSheetPasteRangeResult
-
interface SheetPasteRangeResult extends SheetCommandResultCommitted target range, used by hosts to select the pasted cells.
property readonly range: SheetClipboardRangeInputproperty readonly workbookMove?: true - 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.
- classAbstractSheetClipboard
-
Platform-neutral clipboard abstraction. Implementations own system I/O.
constructor SheetClipboard(): SheetClipboardproperty readonly symbol: typeof symbolstaticmethod read(): Promise<SheetClipboardPayload | null>method write(payload: SheetClipboardPayload): Promise<void>
Clipboard data and codecs
The codec represents cell values and merged ranges in a portable payload before a paste command reads them.
- classDefaultSheetClipboardCodec
-
class DefaultSheetClipboardCodec extends SheetClipboardCodecDefault codec that delegates cell serialization to the cell-type registry.
constructor DefaultSheetClipboardCodec(cellCodecs: CellClipboardCodecRegistry): DefaultSheetClipboardCodecmethod decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRangemethod encode(range: SheetRangeBounds, source: SheetClipboardDataSource, visibleRowsOnly?: boolean): SheetClipboardPayload - classSheetClipboardError
-
class SheetClipboardError extends SearErrorPublic error raised when a clipboard command cannot satisfy its contract.
constructor SheetClipboardError(code: SheetClipboardErrorCode, message: string, details?: SearErrorDetails): SheetClipboardErrorproperty readonly code: SheetClipboardErrorCodeStable machine-readable identifier for this error category.
Inherited members 9
Inherited from SearError.
- classSheetClipboardSheetIdentity
-
Identity of the mounted sheet, stable across workbook sheet remounts.
constructor SheetClipboardSheetIdentity(id: string): SheetClipboardSheetIdentityproperty readonly id: stringproperty readonly symbol: typeof symbolstatic - interfaceSheetClipboardCodec
-
Codec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.
- interfaceSheetClipboardCommandResult
-
interface SheetClipboardCommandResult extends SheetCommandResultResult shared by copy and cut commands.
- interfaceSheetClipboardDataSource
-
Data source required by the clipboard plugin; selection and storage stay replaceable.
property readonly cutSession?: SheetClipboardCutSessionproperty readonly cutSourceId?: stringproperty readonly formatTarget: PluginKeyproperty readonly target: PluginKeymethod captureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]method captureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]method clearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]method createClipboardCutId(): stringmethod getColumnCount(): numbermethod getMergedRange(row: number, column: number): SheetRangeBounds | nullOptional host projection for rejecting writes hidden by merged cells.
method getRowCount(): numbermethod getSelection(): SheetRangeBounds | nullmethod isRowVisible(row: number): booleanmethod planClearMergedRanges(range: SheetRangeBounds): SheetClipboardMergePlanmethod planOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]method planPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): SheetClipboardMergePlanmethod planRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]method prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): voidmethod readCell(row: number, column: number): CellMatrixElement | nullmethod readCellFormat(row: number, column: number): CellFormat | nullmethod scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>method validatePasteCell(row: number, column: number, cell: CellMatrixElement | null): SheetCellInputValidationResultOptional editor-local validation applied before any pasted value is written.
- interfaceSheetClipboardDecodeContext
-
Context supplied to codecs so formula-aware implementations can rebase references on paste.
- interfaceSheetClipboardDecodedRange
-
Decoded value and format matrices ready for parallel paste transactions.
property readonly formats?: readonly readonly CellFormat | null[][]Present only when the source supplied editor-native format metadata.
property readonly merges?: readonly SheetClipboardMergedRange[]property readonly ownerFormats?: readonly SheetPortableFormatTransfer[]property readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]property readonly rows: readonly SheetClipboardDecodedRow[] - interfaceSheetClipboardMergedRange
-
Inclusive merged range relative to the copied range's top-left cell.
- interfaceSheetClipboardMergePlan
-
Merge-owner operation plan produced by the active sheet adapter.
property readonly operations: readonly Operation[]property readonly target: PluginKey - interfaceSheetClipboardPayload
-
Platform-neutral clipboard data. It is transient and is not a persistence envelope.
property readonly plainText: stringPlain text representation suitable for external applications.
property readonly structured?: SheetClipboardStructuredPayloadOptional 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.
property readonly cutId?: stringTransient identifier linking a cut and a subsequent paste in Sheet history.
property readonly formats: readonly readonly CellFormat | null[][]Parallel explicit-format rows. Null means General/no explicit format.
property readonly isCut?: trueA cut move keeps formula references anchored to their original targets.
property readonly kind: "searsuite.sheet-range"property readonly merges?: readonly SheetClipboardMergedRange[]Merge geometry relative to this payload's top-left cell.
property readonly ownerFormats?: readonly SheetPortableFormatTransfer[]Optional persisted-format snapshots supplied by their state owners.
property readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]Per-row format snapshots for a compacted visible-row selection.
property readonly rows: readonly SheetClipboardRow[]property readonly source: SheetClipboardCellPointOriginal top-left coordinate, supplied to cell-type paste codecs.
property readonly sourceRows?: readonly number[]Original row coordinates when a filtered selection is compacted on copy.
property readonly 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: 3Current version of the transient structured sheet clipboard payload.
- variableSheetClipboardCodecSymbol
-
SheetClipboardCodecSymbol: typeof SheetClipboardCodecSymbolDI token for the editor-local clipboard codec.
- variableSheetClipboardDataSourceSymbol
-
SheetClipboardDataSourceSymbol: typeof SheetClipboardDataSourceSymbolDI 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.
No matching API entries.