← All packages

API reference

@searsuite/sear-plugin-clipboard

Type-neutral Sheet clipboard traversal, serialization, and paste commands.

41 exportsderived from source

enumSheetPasteModesource ↗
enum SheetPasteMode

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

enum memberAll
All: "all"
enum memberFormats
Formats: "formats"
enum memberValues
Values: "values"
classDefaultSheetClipboardCodecsource ↗
class DefaultSheetClipboardCodec extends SheetClipboardCodec

Default codec that delegates cell serialization to the cell-type registry.

constructorconstructor
DefaultSheetClipboardCodec(cellCodecs: CellClipboardCodecRegistry): DefaultSheetClipboardCodec
cellCodecs: CellClipboardCodecRegistry
methoddecode
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRange
payload: SheetClipboardPayload
context: SheetClipboardDecodeContext
methodencode
encode(range: SheetRangeBounds, source: SheetClipboardDataSource, visibleRowsOnly?: boolean): SheetClipboardPayload
range: SheetRangeBounds
source: SheetClipboardDataSource
visibleRowsOnly: boolean
classInMemorySheetClipboardsource ↗
class InMemorySheetClipboard extends SheetClipboard

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

constructorconstructor
InMemorySheetClipboard(): InMemorySheetClipboard
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
Inherited members 1

Inherited from SheetClipboard.

classSheetClipboardsource ↗
class SheetClipboard

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

constructorconstructor
SheetClipboard(): SheetClipboard
propertysymbolstatic
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
classSheetClipboardCutSessionsource ↗
class SheetClipboardCutSession

Transient cut intent shared by the sheets mounted in one workbook.

constructorconstructor
SheetClipboardCutSession(): SheetClipboardCutSession
propertysymbolstatic
readonly symbol: typeof symbol
methodbegin
begin(pending: PendingSheetCut): void
pending: PendingSheetCut
methodcancel
cancel(): void
methodgetPending
getPending(): PendingSheetCut | null
classSheetClipboardErrorsource ↗
class SheetClipboardError extends SearError

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

constructorconstructor
SheetClipboardError(code: SheetClipboardErrorCode, message: string, details?: SearErrorDetails): SheetClipboardError
code: SheetClipboardErrorCode
message: string
details: SearErrorDetails
propertycode
readonly code: SheetClipboardErrorCode

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

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

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

constructorconstructor
SheetClipboardPlugin(source: SheetClipboardDataSource, codec: SheetClipboardCodec): SheetClipboardPlugin
source: SheetClipboardDataSource
codec: SheetClipboardCodec
propertypluginKeystatic
readonly pluginKey: PluginKey
propertysymbolstatic
readonly symbol: typeof symbol
methodapply
apply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

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

state: Record<string, never>
_transaction: Transaction
methodgetPluginConfig
getPluginConfig(): null

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

methodregisterCommands
registerCommands(commands: SheetCommandBus): void

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

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

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

methodrender
render(): []

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

Inherited members 30

Inherited from Plugin.

classSheetClipboardSheetIdentitysource ↗
class SheetClipboardSheetIdentity

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

constructorconstructor
SheetClipboardSheetIdentity(id: string): SheetClipboardSheetIdentity
id: string
propertyid
readonly id: string
propertysymbolstatic
readonly symbol: typeof symbol
interfacePendingSheetCutsource ↗
interface PendingSheetCut
propertyid
readonly id: string
propertyrange
readonly range: SheetClipboardRangeInput
propertysourceId
readonly sourceId: string
interfaceSheetClipboardCodecsource ↗
interface SheetClipboardCodec

Codec extension point for clipboard envelope and external formats. Cell types register their own handlers separately.

methoddecode
decode(payload: SheetClipboardPayload, context: SheetClipboardDecodeContext): SheetClipboardDecodedRange
payload: SheetClipboardPayload
context: SheetClipboardDecodeContext
methodencode
encode(range: SheetRangeBounds, source: SheetClipboardDataSource, visibleRowsOnly?: boolean): SheetClipboardPayload
range: SheetRangeBounds
source: SheetClipboardDataSource
visibleRowsOnly: boolean
interfaceSheetClipboardCommandResultsource ↗
interface SheetClipboardCommandResult extends SheetCommandResult

Result shared by copy and cut commands.

propertypayload
readonly payload: SheetClipboardPayload
propertyrange
readonly range: SheetClipboardRangeInput
Inherited members 4

Inherited from SheetCommandResult.

interfaceSheetClipboardDataSourcesource ↗
interface SheetClipboardDataSource

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

propertycutSession
readonly cutSession?: SheetClipboardCutSession
propertycutSourceId
readonly cutSourceId?: string
propertyformatTarget
readonly formatTarget: PluginKey
propertytarget
readonly target: PluginKey
methodcaptureMergedRanges
captureMergedRanges(range: SheetRangeBounds): readonly SheetClipboardMergedRange[]
range: SheetRangeBounds
methodcaptureOwnerFormats
captureOwnerFormats(range: SheetRangeBounds): readonly SheetPortableFormatTransfer[]
range: SheetRangeBounds
methodclearOwnerFormats
clearOwnerFormats(range: SheetRangeBounds): readonly SheetFormatTransferPlan[]
range: SheetRangeBounds
methodcreateClipboardCutId
createClipboardCutId(): string
methodgetColumnCount
getColumnCount(): number
methodgetMergedRange
getMergedRange(row: number, column: number): SheetRangeBounds | null

Optional host projection for rejecting writes hidden by merged cells.

row: number
column: number
methodgetRowCount
getRowCount(): number
methodgetSelection
getSelection(): SheetRangeBounds | null
methodisRowVisible
isRowVisible(row: number): boolean
row: number
methodplanClearMergedRanges
planClearMergedRanges(range: SheetRangeBounds): SheetClipboardMergePlan
range: SheetRangeBounds
methodplanOwnerFormats
planOwnerFormats(captured: readonly SheetPortableFormatTransfer[], target: SheetRangeBounds): readonly SheetFormatTransferPlan[]
captured: readonly SheetPortableFormatTransfer[]
target: SheetRangeBounds
methodplanPasteMergedRanges
planPasteMergedRanges(merges: readonly SheetClipboardMergedRange[], target: SheetClipboardCellPoint): SheetClipboardMergePlan
merges: readonly SheetClipboardMergedRange[]
target: SheetClipboardCellPoint
methodplanRangeMove
planRangeMove(source: SheetClipboardRangeInput, destination: SheetClipboardRangeInput): readonly SheetRangeMovePlan[]
source: SheetClipboardRangeInput
destination: SheetClipboardRangeInput
methodprepareCrossSheetCut
prepareCrossSheetCut(cutId: string, clearPipeline: Pipeline): void
cutId: string
clearPipeline: Pipeline
methodreadCell
readCell(row: number, column: number): CellMatrixElement | null
row: number
column: number
methodreadCellFormat
readCellFormat(row: number, column: number): CellFormat | null
row: number
column: number
methodscheduleCrossSheetMove
scheduleCrossSheetMove(cutId: string, sourceId: string, pastePipeline: Pipeline): Promise<void>
cutId: string
sourceId: string
pastePipeline: Pipeline
interfaceSheetClipboardDecodeContextsource ↗
interface SheetClipboardDecodeContext

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

propertytarget
readonly target: SheetClipboardCellPoint
interfaceSheetClipboardDecodedRangesource ↗
interface SheetClipboardDecodedRange

Decoded value and format matrices ready for parallel paste transactions.

propertyformats
readonly formats?: readonly readonly CellFormat | null[][]

Present only when the source supplied editor-native format metadata.

propertymerges
readonly merges?: readonly SheetClipboardMergedRange[]
propertyownerFormats
readonly ownerFormats?: readonly SheetPortableFormatTransfer[]
propertyownerFormatsByRow
readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]
propertyrows
readonly rows: readonly SheetClipboardDecodedRow[]
interfaceSheetClipboardMergedRangesource ↗
interface SheetClipboardMergedRange

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

propertyend
readonly end: SheetClipboardCellPoint
propertystart
readonly start: SheetClipboardCellPoint
interfaceSheetClipboardMergePlansource ↗
interface SheetClipboardMergePlan

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

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
interfaceSheetClipboardPayloadsource ↗
interface SheetClipboardPayload

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

propertyplainText
readonly plainText: string

Plain text representation suitable for external applications.

propertystructured
readonly structured?: SheetClipboardStructuredPayload

Optional editor-native representation preserving cell type and metadata.

interfaceSheetClipboardRangeInputsource ↗
interface SheetClipboardRangeInput

Inclusive range accepted by clipboard commands.

propertyend
readonly end: SheetClipboardCellPoint
propertystart
readonly start: SheetClipboardCellPoint
interfaceSheetClipboardStructuredPayloadsource ↗
interface SheetClipboardStructuredPayload

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

propertycutId
readonly cutId?: string

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

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

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

propertyisCut
readonly isCut?: true

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

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

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

propertyownerFormats
readonly ownerFormats?: readonly SheetPortableFormatTransfer[]

Optional persisted-format snapshots supplied by their state owners.

propertyownerFormatsByRow
readonly ownerFormatsByRow?: readonly readonly SheetPortableFormatTransfer[][]

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

propertyrows
readonly rows: readonly SheetClipboardRow[]
propertysource
readonly source: SheetClipboardCellPoint

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

propertysourceRows
readonly sourceRows?: readonly number[]

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

propertyversion
readonly version: 3
interfaceSheetCopyRangeInputsource ↗
interface SheetCopyRangeInput

Optional explicit range; omitted means the current editor selection.

propertyrange
readonly range?: SheetClipboardRangeInput
interfaceSheetPasteRangeInputsource ↗
interface SheetPasteRangeInput

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

propertymode
readonly mode?: SheetPasteMode

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

propertypayload
readonly payload: SheetClipboardPayload
propertytarget
readonly target?: SheetClipboardCellPoint

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

interfaceSheetPasteRangeResultsource ↗
interface SheetPasteRangeResult extends SheetCommandResult

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

propertyrange
readonly range: SheetClipboardRangeInput
propertyworkbookMove
readonly workbookMove?: true
Inherited members 4

Inherited from SheetCommandResult.

typeSheetClipboardCellPointsource ↗
type SheetClipboardCellPoint = readonly [number, number]

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

typeSheetClipboardDecodedRowsource ↗
type SheetClipboardDecodedRow = readonly CellMatrixElement | null[]

Decoded cells ready for a paste transaction.

typeSheetClipboardErrorCodesource ↗
type SheetClipboardErrorCode = typeof SheetClipboardErrorCode[keyof typeof SheetClipboardErrorCode]

Supported sheet clipboard error code values.

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

Structural port retained as a lightweight host-adapter contract.

typeSheetClipboardRowsource ↗
type SheetClipboardRow = readonly CellClipboardCellPayload | null[]

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

variableCancelCutRangeCommandsource ↗
CancelCutRangeCommand: SheetCommandDefinition<void, SheetCommandResult>

Cancels a pending cut without changing any cell content.

variableCopyCommandsource ↗
CopyCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCopyRangeCommandsource ↗
CopyRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

Typed command that snapshots a range without mutating sheet state.

variableCutCommandsource ↗
CutCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>
variableCutRangeCommandsource ↗
CutRangeCommand: SheetCommandDefinition<void | SheetCopyRangeInput, SheetClipboardCommandResult>

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

variablePasteCommandsource ↗
PasteCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetPasteRangeResult>
variablePasteRangeCommandsource ↗
PasteRangeCommand: SheetCommandDefinition<SheetPasteRangeInput, SheetPasteRangeResult>

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

variableSHEET_CLIPBOARD_MIME_TYPEsource ↗
SHEET_CLIPBOARD_MIME_TYPE: "application/x-searsuite-sheet-range"

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

variableSHEET_CLIPBOARD_PAYLOAD_VERSIONsource ↗
SHEET_CLIPBOARD_PAYLOAD_VERSION: 3

Current version of the transient structured sheet clipboard payload.

variableSheetClipboardCodecSymbolsource ↗
SheetClipboardCodecSymbol: typeof SheetClipboardCodecSymbol

DI token for the editor-local clipboard codec.

variableSheetClipboardDataSourceSymbolsource ↗
SheetClipboardDataSourceSymbol: typeof SheetClipboardDataSourceSymbol

DI token for the editor-local clipboard data source.

variableSheetClipboardErrorCodesource ↗
SheetClipboardErrorCode: { 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.

classAbstractSheetClipboardsource ↗
class AbstractSheetClipboard

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

constructorconstructor
SheetClipboard(): SheetClipboard
propertysymbolstatic
readonly symbol: typeof symbol
methodread
read(): Promise<SheetClipboardPayload | null>
methodwrite
write(payload: SheetClipboardPayload): Promise<void>
payload: SheetClipboardPayload
variableSheetClipboardErrorCodeTypesource ↗
SheetClipboardErrorCodeType: { 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.