← All packages

API reference

@searsuite/sear-plugin-format-painter

Sheet format painting through state-owner contributions.

17 exportsderived from source

classSheetFormatPainterPluginsource ↗
class SheetFormatPainterPlugin extends Plugin<unknown, CellProperties, null>

Owns only a local captured-format session; document formats remain with their owners.

constructorconstructor
SheetFormatPainterPlugin(options: SheetFormatPainterOptions): SheetFormatPainterPlugin
options: SheetFormatPainterOptions
propertywarnOnDuplicateDepth
readonly warnOnDuplicateDepth: false

Whether PluginManager should warn when another ordered plugin shares this depth.

propertysymbolstatic
readonly symbol: typeof symbol
methodapply
apply(_state: null, _transaction: Transaction): null

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

_state: null
_transaction: Transaction
methoddestroy
destroy(): void
methodgetPluginConfig
getPluginConfig(): null

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

methodregisterCommands
registerCommands(commands: SheetCommandBus): void
commands: SheetCommandBus
methodregisterObservations
registerObservations(observations: ObservationRegistry): void
observations: ObservationRegistry
methodregisterState
registerState(): { dataEngine: { enabled: boolean }; key: PluginKey; state: null }

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

methodrender
render(): null

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

Inherited members 29

Inherited from Plugin.

classSheetFormatPainterSessionsource ↗
class SheetFormatPainterSession

Local brush state borrowed by Sheet editors mounted within one Workbook.

constructorconstructor
SheetFormatPainterSession(): SheetFormatPainterSession
propertysymbolstatic
readonly symbol: typeof symbol
membersnapshot
snapshot: unknown
memberstate
state: unknown
methodclear
clear(): void
methodstart
start(formats: SheetFormatTransferRegistry, snapshot: SheetFormatTransferSnapshot, state: FormatPainterState): void
formats: SheetFormatTransferRegistry
snapshot: SheetFormatTransferSnapshot
state: FormatPainterState
methodvisibleState
visibleState(formats: SheetFormatTransferRegistry): FormatPainterState
formats: SheetFormatTransferRegistry
interfaceFormatPainterStatesource ↗
interface FormatPainterState
propertymode
readonly mode: FormatPainterMode | null
propertysource
readonly source: SheetMoveRange | null
interfaceSheetFormatPainterOptionssource ↗
interface SheetFormatPainterOptions

Dependencies supplied by the owning composition root, with no global state.

propertyformats
readonly formats: SheetFormatTransferRegistry
propertyplatform
readonly platform: Platform
propertyreadShape
readonly readShape: (): readonly [number, number]
propertysession
readonly session?: SheetFormatPainterSession
interfaceStartFormatPainterInputsource ↗
interface StartFormatPainterInput
propertymode
readonly mode?: FormatPainterMode
propertysource
readonly source: SheetMoveRange
typeFormatPainterModesource ↗
type FormatPainterMode = typeof FormatPainterMode[keyof typeof FormatPainterMode]

Canonical activation modes shared by commands and hosts.

variableApplyFormatPainterCommandsource ↗
ApplyFormatPainterCommand: SheetCommandDefinition<{ destination: SheetMoveRange }, SheetCommandResult>
variableCancelFormatPainterCommandsource ↗
CancelFormatPainterCommand: SheetCommandDefinition<void, SheetCommandResult>
variableFormatPainterModesource ↗
FormatPainterMode: { Once: "once"; Persistent: "persistent" }

Canonical activation modes shared by commands and hosts.

variableFormatPainterObservationsource ↗
FormatPainterObservation: StateObservationDefinition<FormatPainterState>
variableStartFormatPainterCommandsource ↗
StartFormatPainterCommand: SheetCommandDefinition<StartFormatPainterInput, SheetCommandResult>
functioncreateMatrixFormatTransfersource ↗
createMatrixFormatTransfer<Value>(id: string, target: PluginKey, readMatrix: (): SheetFormatMatrix<Value>): Required<SheetFormatTransferContribution>

Captures sparse persisted formats and tiles them over an inclusive target.

id: string
target: PluginKey
readMatrix: (): SheetFormatMatrix<Value>
typeSheetFormatRangesource ↗
type SheetFormatRange = SheetMoveRange

Inclusive range shared by format-transfer owners and hosts.

interfaceSheetFormatTransferContributionsource ↗
interface SheetFormatTransferContribution

Optional state-owner contribution to format painting.

propertyid
readonly id: string
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans removal of this owner's explicit formats without changing cell content.

range: SheetMoveRange
methodplanCaptured
planCaptured(portable: unknown, destination: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans a captured source pattern using this owner's current target state.

portable: unknown
destination: SheetMoveRange
interfaceSheetFormatTransferPlansource ↗
interface SheetFormatTransferPlan

One owner's isolated plan; only the owner interprets its operations.

propertyoperations
readonly operations: readonly Operation[]
propertytarget
readonly target: PluginKey
classSheetFormatTransferRegistrysource ↗
class SheetFormatTransferRegistry

Editor-local composition of state-owner format transfers.

constructorconstructor
SheetFormatTransferRegistry(): SheetFormatTransferRegistry
propertysymbolstatic
readonly symbol: typeof symbol
methodcapture
capture(source: SheetMoveRange): SheetFormatTransferSnapshot
source: SheetMoveRange
methodcapturePortable
capturePortable(source: SheetMoveRange): readonly SheetPortableFormatTransfer[]
source: SheetMoveRange
methodclear
clear(range: SheetMoveRange): readonly SheetFormatTransferPlan[]

Plans all format owners against the same unchanged pre-clear state.

range: SheetMoveRange
methoddestroy
destroy(): void
methodplanPortable
planPortable(captured: readonly SheetPortableFormatTransfer[], destination: SheetMoveRange): readonly SheetFormatTransferPlan[]
captured: readonly SheetPortableFormatTransfer[]
destination: SheetMoveRange
methodregister
register(owner: SheetFormatTransferContribution): (): void
owner: SheetFormatTransferContribution
interfaceSheetFormatTransferSnapshotsource ↗
interface SheetFormatTransferSnapshot

Captured format data, independent of subsequent source changes.

propertyportable
readonly portable?: unknown

Captured owner data that can be planned against another Sheet instance.

methodplan
plan(destination: SheetMoveRange, targetRegistry?: SheetFormatTransferRegistry): readonly SheetFormatTransferPlan[]
destination: SheetMoveRange
targetRegistry: SheetFormatTransferRegistry