← All packages

@searsuite/sear-plugin-sort

Sheet range sorting commands and stable sparse row permutation helpers.

Sort a range

classSheetSortError
class SheetSortError extends SearError

Base class for errors intentionally exposed by SearSuite packages.

Packages may throw this generic form while they do not need a more specific public error type. Domain-specific subclasses override code.

constructorSheetSortError(message: string, details: Record<string, unknown>): SheetSortError
propertyreadonly code: "SHEET_SORT_INVALID_INPUT"

Stable machine-readable identifier for this error category.

Inherited members 9

Inherited from SearError.

classSheetSortPlugin
class SheetSortPlugin extends Plugin<unknown, CellProperties, Record<string, never>>

Stateless command owner for stable range sorting.

constructorSheetSortPlugin(dependencies: SheetSortDependencies): SheetSortPlugin
propertyreadonly warnOnDuplicateDepth: false

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

propertyreadonly pluginKey: PluginKeystatic
propertyreadonly symbol: typeof symbolstatic
methodapply(state: Record<string, never>, _transaction: Transaction): Record<string, never>

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

methodgetPluginConfig(): null

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

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

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

methodrender(): []

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

Inherited members 28

Inherited from Plugin.

variableSortSheetRangeCommand
SortSheetRangeCommand: SheetCommandDefinition<SheetSortRangeInput, SheetCommandResult>

Keys and row order

typeSheetSortValue
type SheetSortValue = number | string | boolean | null
functioncreateSheetSortPermutation
createSheetSortPermutation(input: SheetSortRangeInput, matrix: CSRMatrix<CellMatrixElement>, readValue: (row: number, column: number): SheetSortValue, platform: Pick<Platform, "toLowerCase">, compareText: (left: string, right: string): number): SheetSortPermutation

Sorts occupied key rows; rows with empty keys remain stable at the end without being materialized.