API reference
@searsuite/sear-plugin-export
Versioned export envelopes, document-state codec registries, and durable persistence boundaries.
16 exportsderived from source
- classDocumentStateCodecRegistrysource ↗
-
class DocumentStateCodecRegistry<TState>Registry that composes document-state modules without central field enumeration.
constructorconstructor DocumentStateCodecRegistry<TState>(): DocumentStateCodecRegistry<TState>methoddeserialize deserialize(modules: readonly SearDocumentStateModuleFile[], path: string): Partial<TState>Deserializes registered modules into one partial document state.
modules: readonly SearDocumentStateModuleFile[]path: string
methodregister register(codec: DocumentStateCodec<TState>): thisRegisters a module codec. Duplicate keys are rejected.
codec: DocumentStateCodec<TState>
methodregisterContribution registerContribution(contribution: DocumentStateModuleContribution<unknown, object>): thisRegisters the codec from a plugin-owned document-state contribution.
contribution: DocumentStateModuleContribution<unknown, object>
methodserialize serialize(state: TState): SearDocumentStateModuleFile[]Serializes every registered module whose codec returns a payload.
state: TState
- classExportErrorsource ↗
-
class ExportError extends SearErrorError thrown when a persisted workbook payload cannot be encoded or decoded.
constructorconstructor ExportError(code: ExportErrorCode, message: string, details?: SearErrorDetails): ExportErrorCreates an ExportError instance.
code: ExportErrorCodemessage: stringdetails: SearErrorDetails
propertycode readonly code: ExportErrorCodeStable machine-readable error code.
Inherited members 9
Inherited from SearError.
- interfaceDocumentStateCodecsource ↗
-
interface DocumentStateCodec<TState>Codec contributed by the owner of one document-state module.
propertykey readonly key: stringStable module key written to persisted files.
methoddeserialize deserialize(payload: JsonValue, path: string): Partial<TState>Restores the module-owned part of a document state.
payload: JsonValuepath: string
methodserialize serialize(state: TState): unknownSerializes the module-owned part of a document state.
state: TState
- interfaceDocumentStateModuleContributionsource ↗
-
interface DocumentStateModuleContribution<TOwnerState, TDocumentState>Export contribution owned by one document-state owner.
propertycodec readonly codec: DocumentStateCodec<TDocumentState>JSON codec used for this module in stable export files.
propertykey readonly key: stringStable module key written to persisted files.
methodcapture capture(ownerState: TOwnerState): Partial<TDocumentState> | undefinedCaptures this owner state into the aggregate document-state snapshot.
ownerState: TOwnerState
- interfaceSearDocumentStateModuleFilesource ↗
-
interface SearDocumentStateModuleFileOne registered document-state module in a stable export file.
- interfaceSearFormulaBindingFilesource ↗
-
interface SearFormulaBindingFileOne formula cell's workbook-qualified reference targets.
propertycol readonly col: numberpropertyformula readonly formula: stringpropertyreferences readonly references: readonly { sheetId: string; sheetName: string }[]propertyrow readonly row: numberpropertysheetId readonly sheetId: string - interfaceSearSheetDocumentFilesource ↗
-
interface SearSheetDocumentFileStable persisted representation of one Sheet document state.
- interfaceSearWorkbookFilesource ↗
-
interface SearWorkbookFile<TSheetDescriptor>Stable persisted representation of a Workbook document state.
propertyformat readonly format: "searsuite.workbook"Stable file-format identifier.
propertyworkbook readonly workbook: { formulaBindings?: readonly SearFormulaBindingFile[]; id: string; metadata?: Readonly<Record<string, JsonValue>>; sheets: readonly TSheetDescriptor[]; sheetStates: Readonly<Record<string, SearSheetDocumentFile>> }Persisted workbook document state.
- typeExportErrorCodesource ↗
-
type ExportErrorCode = typeof ExportErrorCode[keyof typeof ExportErrorCode]Machine-readable export error code type.
- typeJsonValuesource ↗
-
type JsonValue = null | boolean | number | string | readonly JsonValue[] | { }JSON-compatible scalar or object value.
- variableExportErrorCodesource ↗
-
ExportErrorCode: { codecNotFound: "SEAR_EXPORT_CODEC_NOT_FOUND"; duplicateCodec: "SEAR_EXPORT_DUPLICATE_CODEC"; invalidFormat: "SEAR_EXPORT_INVALID_FORMAT" }Stable machine-readable error codes owned by the export plugin.
- variableSearWorkbookFileFormatsource ↗
-
SearWorkbookFileFormat: "searsuite.workbook"Current stable workbook JSON format identifier.
- functioncloneJsonRecordsource ↗
-
cloneJsonRecord(value: Readonly<Record<string, unknown>> | undefined, path: string): Readonly<Record<string, JsonValue>> | undefinedNarrows a runtime value to a JSON-compatible metadata record.
value: Readonly<Record<string, unknown>> | undefinedpath: string
- functioncloneJsonValuesource ↗
-
cloneJsonValue<TValue>(value: TValue, path?: string): TValueClones a JSON-compatible value and rejects values that cannot be persisted as JSON.
value: TValuepath: string
- functionreadRecordsource ↗
-
readRecord(value: unknown, path: string): Record<string, unknown>Narrows a runtime value to a plain object.
value: unknownpath: string
- variableExportErrorCodeValuesource ↗
-
ExportErrorCodeValue: { codecNotFound: "SEAR_EXPORT_CODEC_NOT_FOUND"; duplicateCodec: "SEAR_EXPORT_DUPLICATE_CODEC"; invalidFormat: "SEAR_EXPORT_INVALID_FORMAT" }Stable machine-readable error codes owned by the export plugin.
No public exports match that search.