supported
Supported public entry point. Import this entry point as @sheetwrite/core.
Source entry: packages/core/src/index.ts
Exported symbols
Classes 15
CommentCoordinatorTransport/auth-neutral comment state with server-owned author and timestamp fields.
DelimitedTextOptionsErrorStable invalid-option failure for a delimited-text resource ceiling.
DelimitedTextResourceErrorStable resource-limit failure raised before the next oversized parse or encode allocation.
IncompleteDataErrorError thrown when an operation requires datasource cells that are not loaded.
MemoryPersistenceAdapterExecutable database-neutral reference adapter for tests, demos, and local workflows.
PersistenceErrorTyped failure raised by persistence and synchronization flows.
PresenceCoordinatorEphemeral presence lifecycle; it never calls a document mutation API.
RevisionCoordinatorCoordinates listing and restoring host-owned workbook revisions.
SheetwriteStoreStable public facade and the sole transaction, epoch, policy, and event barrier.
SnapshotResourceErrorStable resource failure raised by direct workbook construction paths.
SnapshotValidationErrorPath-qualified schema failure found while validating an untrusted snapshot.
SyncCoordinatorDeterministic, transport-neutral optimistic sync.
SyncPendingCapacityErrorTyped local transaction rejection produced when the durable queue cannot reserve capacity.
SyncProtocolErrorTyped rejection of malformed or resource-exhausting synchronization input.
XlsxResourceErrorStable resource-limit failure surfaced before an XLSX codec allocates unsafe data.
Functions 35
cellA10-based (row, col) → A1 cell reference (0, 0 → "A1").
cellScalarToTextSpreadsheet display text for a resolved scalar.
colToA1Column index (0-based) → A1 column label (0 → "A", 26 → "AA").
createGridCreates and mounts an imperative Grid in the supplied host element.
createGridFromSnapshotMount a grid over a validated, non-dirty snapshot.
dateToSerialConvert a real UTC Date to the Excel 1900-system serial.
documentOpTargetExhaustive stable target identity used by persistence/logging layers.
downloadBytesTrigger a browser download from in-memory bytes.
formatNumberDeterministic Excel-style number/date formatter.
fromCsvParse CSV into ColumnarData.
fromXlsxTableParse the first sheet of .xlsx bytes into ColumnarData.
fromXlsxWorkbookFormula-preserving, multi-sheet workbook import through the optional XLSX backend.
initSheetwriteLoad the WASM data engine once.
isSheetwriteReadyWhether initSheetwrite has completed — the single readiness source.
labelToColA1 column label → 0-based column index (inverse of colToA1).
parseCellInputCoerce raw text input into a CellValue, following spreadsheet input-bar conventions: - blank (after trimming) clears the cell to a null literal; - text longer than one character beginning with = becomes a formula; -…
parseCellLiteralInputParse imported text as a literal using the same boolean, number, date, and currency rules as parseCellInput.
parseCsvParse the fixed comma dialect: quoted delimiters/newlines, doubled quotes, bare CR, LF, or CRLF records, Unicode, trailing empty fields, and one optional leading UTF-8 BOM.
parseCurrencyInputParse a currency-formatted string into a plain number, or null when the remaining text is not numeric.
parseDateInputParse a user-typed date string into a serial, or null when it is not a date.
rangeA1Two cell corners → A1 range ("A1:B3"), collapsing to a single ref when equal.
rebaseDocumentOperationsConservative server-ordered rebase for pending offline work.
resolveThemeFromCssRead --sheetwrite- CSS custom properties into a partial theme.
resolveTransactionResourceLimitsValidate and merge transaction ceiling overrides without retaining the caller-owned object.
serialToDateConvert a date serial back to a Date.
setXlsxTableExportBackendRegisters the optional table XLSX export implementation used by core.
setXlsxTableImportBackendRegisters the optional table XLSX import implementation used by core.
setXlsxWorkbookBackendRegisters the optional workbook XLSX implementation used by core.
shiftA1RefsShift relative A1 references in a formula by (dRow, dCol) — used when a formula is filled into other cells.
toCsvExport the current visible CSV view (UTF-8 BOM, CRLF): visible columns and view-ordered rows surviving sort, filter, hidden-row, and group state.
toTsvExport a canonical data-space range as clipboard-compatible TSV (CRLF, no BOM).
toXlsxTableExports a table model through the registered optional XLSX backend.
toXlsxWorkbookFormula-preserving, multi-sheet workbook export through the optional XLSX backend.
validateTransactionResourcesIncrementally validate the operation count and exact encoded payload size without constructing a JSON string.
validateWorkbookSnapshotValidate and canonically order a schema-1 snapshot without hydrating runtime state.
Interfaces 99
CellAddressZero-based address of one cell on a stable sheet ID.
CellBlockSparse row-major cells bounded by one rectangular block.
CellBorderVisual border applied to one or more sides of a cell.
CellBordersPer-side borders; all applies to any side not given its own border.
CellChangeOne committed cell edit, carrying enough to roll back.
CellInputSnapshotView-aware editable snapshot of one cell, for hosts building a detached formula bar or cell inspector.
CellNoteSerializable plain-text note anchored to a cell.
CellPaintContextRead-only cell and canvas geometry supplied to a custom renderer.
CellRendererCustom cell renderer hooks for the main-thread canvas or DOM overlay.
CellStyleSerializable formatting applied to a cell or used as a column default.
ChangeEventPayload of the change event; flows OUT for API submission/reconcile.
ColumnSchema and default presentation for one workbook column.
ColumnarDataEager column-oriented values used to initialize a sheet.
CommentAdapterHost persistence contract for versioned comment threads.
CommentAuthorRefStable host-provided identity displayed on a comment message.
CommentCoordinatorOptionsDocument identity and initial version for comment coordination.
CommentListResultVersioned comment-thread listing returned by a host adapter.
CommentMessageOne immutable author message in a comment thread.
CommentMutationRequestVersioned comment mutation submitted to a host adapter.
CommentThreadVersioned discussion anchored to a document location.
ConditionalFormatRuleOrdered condition and style applied to a cell range.
ContextMenuContextCell and viewport coordinates resolved for one bundled context-menu opening.
ContextMenuItemBuilt-in, separator, or custom callback row in the right-click menu.
DataSourceHost callback that asynchronously loads cancellable row pages.
DataSourcePageOne resolved row page returned by a DataSource.
DataSourceRequestCancellable sheet and row interval requested from a DataSource.
DataSourceStorageOptionsDense or allocation-lazy paged storage policy for datasource cells.
DataValidationRuleOne stable, range-scoped data-entry rule.
DelimitedTextOptionsOptional resource ceilings for an in-memory delimited-text operation.
DelimitedTextResourceLimitsResource ceilings shared by synchronous CSV and TSV parsing and encoding.
DocumentValidationErrorPath-qualified validation failure for a document operation.
GridImperative grid handle for document commands, events, rendering, and teardown.
GridActionsImperative operations the toolbar and context menu bind to; also exposed as Grid.actions.
GridConfigToolbar / feature configuration.
GridEventsPayload map for events emitted by a Grid.
GridOptionsWorkbook, data, rendering, policy, and built-in UI options used to create a Grid.
GridTransactionAn undoable transaction submitted through a Grid.
HighlightRangeA highlight target: a range plus an optional per-range color override.
MergeRangeInclusive merged-cell rectangle in data-row/column coordinates.
NamedRangeSnapshotWorkbook-global or sheet-scoped named range used by formulas and persistence.
PackedCellBlockDense row-major mutation payload.
PagedStoreStatsAllocation and load statistics for one paged datasource sheet.
PendingCommitImmutable local operation batch awaiting a host acknowledgement.
PendingCommitLoadOptionsMandatory bounds for one durable pending-commit restore.
PendingCommitStorageHost-owned durable queue.
PersistenceAdapterHost load and commit contract for versioned workbook persistence.
PersistenceCommitRequestCancellable pending commit submitted to a persistence adapter.
PresenceActorPublic collaborator identity attached to presence updates.
PresenceCoordinatorOptionsIdentity, privacy, and timing options for presence coordination.
PresenceMessageEphemeral collaborator selection and activity update.
PresenceOverlayEphemeral collaborator selection rendered above the grid.
PresencePrivacyOptionsControls which ephemeral collaborator details may be transmitted.
PresenceTransportHost transport contract for ephemeral presence messages.
ProtectedRangeSerializable client UX policy.
ProtectionRequestLocal operation and protected-range context supplied to the host policy.
RangeInclusive rectangular cell range on a stable sheet ID.
RebaseConflictReason and affected operations for an unsafe document rebase.
RemoteOperationOptionsClassification metadata for host-supplied remote operations.
RemoteOperationSourceHost subscription contract for ordered versioned operations.
ReplaceResultReplacement count and refreshed search state returned by replace-all.
ResolvedCellAuthoritative source value, evaluated value, style, and load state for a cell.
RevisionAdapterHost persistence contract for revision history and restore.
RevisionCoordinatorOptionsDocument identity and version options for revision coordination.
RevisionRestoreRequestVersioned restore request submitted to a revision adapter.
RevisionSummaryHost-provided metadata describing a saved workbook revision.
RowGroupA collapsible row group (data-row range, end-inclusive), Sheets-style.
RowMetadataPersistent display and grouping metadata for one document row.
SearchOptionsCase, whole-cell, sheet, and column constraints for grid search.
SearchResultOrdered matches and active index produced by a grid search.
SheetWorkbook sheet schema used when creating a live grid.
SheetSnapshotSerializable complete state for one workbook sheet.
SheetwriteStoreOptionsStorage layout plus snapshot and transaction resource ceilings for one store.
SnapshotCellSerializable cell value and optional style inside a snapshot block.
SnapshotResourceLimitsResource ceilings applied before snapshot normalization or store allocation.
SnapshotValidationOptionsValidation and allocation policy for an untrusted workbook snapshot.
SortKeyOne key of a multi-column sort, applied in array order (first = primary).
StoreColumnar workbook storage, query, transaction, and subscription contract.
SyncCoordinatorLimitsResource ceilings applied independently to remote collaboration input and local durability.
SyncCoordinatorOptionsDocument, version, durability, and online options for synchronization.
SyncMutationRecordPending commit paired with its current synchronization status.
SyncPendingQueueLimitsAggregate ceilings for local commits retained until durable acknowledgement.
SyncStateSnapshotImmutable observable synchronization state.
SyncVersionGapRequestContiguous-version recovery request produced when remote input skips ahead.
ThemeResolved canvas colors, typography, and geometry used for painting.
ToolbarItemBuilt-in, separator, or custom callback item in the grid toolbar.
TransactionLow-level Store transaction.
TransactionApplicationOptionsSource and commit classification used when applying a transaction.
TransactionResourceLimitsPublic ceilings shared by transaction producers, persistence, transport, and replay.
VersionedCommentEventComment mutation paired with its assigned server version.
VersionedOperationRemote document operations paired with a contiguous server version.
VisibleWindowViewOne rectangular window of resolved cells, returned by Store.getVisibleWindow in a single call.
WorkbookLive workbook schema containing ordered sheets and the active sheet ID.
WorkbookSnapshotSchema-versioned serializable workbook document.
XlsxResourceLimitsResource dimensions bounded by every XLSX import and export path.
XlsxTableExportBackendPluggable first-row-header, first-sheet table export backend.
XlsxTableImportBackendPluggable table import backend.
XlsxWorkbookBackendOptional backend contract for complete workbook XLSX interchange.
XlsxWorkbookOptionsShared options passed to every registered table and workbook XLSX backend.
XlsxWorkbookWarningStructured fidelity warning emitted during XLSX conversion.
Types 49
AggregateOpColumn aggregate operation for Grid.aggregate / Store data ops.
ApplyTransactionResultOutcome of applying a document transaction, including conflict, rejection, and no-op states.
CellAlignHorizontal text alignment supported by cell styles.
CellFormatHow a column's cells are typed, parsed, and rendered: text verbatim, number via its numberFormat, date as an Excel-style serial (see date-serial.ts) rendered by a date numberFormat, and currency as a plain number…
CellLoadStateDatasource loading state for a resolved cell.
CellScalarA scalar that can be displayed directly.
CellValueA cell's persisted input: a literal, a cross-reference, or a formula.
ColumnFilterOne column's filter predicate.
CommentAnchorDocument location to which a comment thread is attached.
CommentCoordinatorEventState transition emitted by the comment coordinator.
CommentMutationSerializable operation that creates or updates comment state.
CommentMutationResponseApplied, duplicate, or conflict acknowledgement for a comment mutation.
ConditionalFormatPredicatePredicate used to decide whether a conditional format applies.
ContextMenuActionNameBuilt-in action names accepted by custom context-menu rows.
ContextMenuItemsStatic rows or a context-aware factory evaluated each time the menu opens.
DataCellDatasource cell value with optional cell-specific styling.
DataValidationComparisonNative comparison semantics for numeric, date-serial, and text-length validation.
DataValidationConditionSerializable condition enforced by a data-validation rule.
DelimitedTextOperationPhase reported by a typed delimited-text resource failure.
DocumentOpExhaustive serializable operation union for workbook mutations.
DocumentRebaseResultSuccessful rebased operations or a conservative rebase conflict.
DocumentValidationResultSuccess or structured errors returned by document validation.
MutationIssueStructured warning or rejection produced while applying an operation.
MutationPolicyModeAtomic or partial handling for locally denied operations.
OperationSourceWhether a committed change originated locally or from remote host input.
PersistenceCommitResponseApplied, duplicate, or conflict acknowledgement from persistence.
PersistenceErrorCodeStable category for a persistence failure.
PresenceCoordinatorEventConnection or actor transition emitted by presence coordination.
ProtectionResolverHost-owned client UX permission callback for protected mutations.
QueryCapabilityWhether a query is complete for the currently loaded datasource pages.
RebaseConflictCodeStable conservative-rebase conflict category.
RevisionCoordinatorEventState or restore transition emitted by revision coordination.
RevisionRestoreResponseApplied or conflict acknowledgement for a revision restore.
RowDataObject-shaped datasource row keyed by workbook column keys.
SelectionCurrent cell, range, row, column, or multi-range selection.
SheetIdStable identifier used to address a workbook sheet.
SheetVisibilityNative worksheet visibility preserved across workbook snapshots and tab rendering.
SnapshotGridOptionsGrid creation options accepted when hydrating a validated snapshot.
SnapshotStorageModeAllocation mode used when enforcing snapshot construction capacity.
SyncActivityStateCurrent persistence activity reported by a sync coordinator.
SyncConnectionStateHost-controlled online state reported by synchronization.
SyncCoordinatorEventQueue, version, connection, or error transition emitted by synchronization.
SyncMutationStatusLifecycle state of one local mutation in the synchronization queue.
SyncPendingCapacityStateWhether the durable local queue can currently admit another transaction.
SyncProtocolErrorCodeStable category identifying which synchronization protocol bound was violated.
ToolbarActionNameBuilt-in action names accepted by custom toolbar items.
ToolbarIconText, DOM node, or node factory used as toolbar icon content.
TransactionResourceValidationResultSuccessful byte/count inspection or one structured transaction rejection.
ValidationPolicyReject-or-warn policy attached to a data-validation rule.
Variables 9
DEFAULT_DELIMITED_TEXT_RESOURCE_LIMITSConservative defaults for synchronous, in-memory CSV and TSV operations.
DEFAULT_SNAPSHOT_RESOURCE_LIMITSConservative defaults that retain the million-row paged-sheet contract.
DEFAULT_SYNC_COORDINATOR_LIMITSConservative synchronization limits suitable for untrusted collaboration input and offline work.
DEFAULT_THEMEDefault canvas theme used before CSS and explicit theme overrides.
DEFAULT_TRANSACTION_RESOURCE_LIMITSInclusive defaults for every atomic document transaction accepted by a Store or Grid.
DEFAULT_XLSX_RESOURCE_LIMITSConservative defaults used by the optional XLSX codec.
REF_CYCLESentinel shown for a reference that participates in a cycle.
SHEETWRITE_CLIPBOARD_MIMEPrivate-format MIME type used for rich Sheetwrite clipboard payloads.
WORKBOOK_SCHEMA_VERSIONCurrent workbook snapshot schema version accepted by Sheetwrite.