Skip to content
SumOfficeSumOfficeSumOffice

Formatting

Column width and row height, merging cells, themes and fonts, conditional formatting. Operations on this page: 10.

Column width and row height, merging cells, themes and fonts, conditional formatting. Terms are in the glossary.

Applies column width.

Request

Field TypeScript type Req.
operation "apply_column_width" yes
subsetId string yes
sheetKey string yes
col number | null no
width number | null no
columns ContractColumnWidth[] no
defaultWidth number | null no
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_column_width

Field TypeScript type Req.
operation "apply_column_width" yes
subsetId string yes
session ContractSubsetSessionInfo yes
supportedSubset string yes
delta DeltaSummary yes
changedColumns number[] yes
dirtyCellCount number yes
currentSourceSaveReadiness ContractCurrentSourceSaveReadiness | null no
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes
layoutMetrics ContractLayoutMetricsSubset yes

Minimal JSON template

{
"operation": "apply_column_width",
"subsetId": "<subsetId>",
"sheetKey": "<sheetPath>",
"requestedBackend": "native-desktop"
}

Applies conditional formatting rules.

Request

Field TypeScript type Req.
operation "apply_conditional_formatting_rules" yes
subsetId string yes
sheetKey string yes
rules ContractConditionalRule[] yes
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_conditional_formatting_rules

Field TypeScript type Req.
operation "apply_conditional_formatting_rules" yes
subsetId string yes
session ContractSubsetSessionInfo yes
supportedSubset string yes
delta DeltaSummary yes
rules ContractConditionalRule[] yes
preservedUnsupportedRuleBlockCount number yes
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes

Minimal JSON template

{
"operation": "apply_conditional_formatting_rules",
"subsetId": "<subsetId>",
"sheetKey": "<sheetPath>",
"rules": [],
"requestedBackend": "native-desktop"
}

Applies cell merging.

Request

Field TypeScript type Req.
operation "apply_merge_cells" yes
subsetId string yes
sheetKey string yes
range CellRange yes
merge boolean yes
mode ContractMergeCellsMode | null no
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_merge_cells

Field TypeScript type Req.
operation "apply_merge_cells" yes
subsetId string yes
session ContractSubsetSessionInfo yes
supportedSubset string yes
delta DeltaSummary yes
merge boolean yes
mode ContractMergeCellsMode yes
mergeRef string | null no
mergeRefs string[] yes
changedMerges string[] yes
removedMerges string[] yes
dirtyCellCount number yes
currentSourceSaveReadiness ContractCurrentSourceSaveReadiness | null no
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes
layoutMetrics ContractLayoutMetricsSubset yes

Minimal JSON template

{
"operation": "apply_merge_cells",
"subsetId": "<subsetId>",
"sheetKey": "<sheetPath>",
"range": "<CellRange>",
"merge": false,
"requestedBackend": "native-desktop"
}

Applies row height.

Request

Field TypeScript type Req.
operation "apply_row_height" yes
subsetId string yes
sheetKey string yes
row number | null no
height number | null no
rows ContractRowHeight[] no
defaultHeight number | null no
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_row_height

Field TypeScript type Req.
operation "apply_row_height" yes
subsetId string yes
session ContractSubsetSessionInfo yes
supportedSubset string yes
delta DeltaSummary yes
changedRows number[] yes
dirtyCellCount number yes
currentSourceSaveReadiness ContractCurrentSourceSaveReadiness | null no
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes
layoutMetrics ContractLayoutMetricsSubset yes

Minimal JSON template

{
"operation": "apply_row_height",
"subsetId": "<subsetId>",
"sheetKey": "<sheetPath>",
"requestedBackend": "native-desktop"
}

Applies an edit to the theme fonts.

Request

Field TypeScript type Req.
operation "apply_theme_fonts_patch" yes
subsetId string yes
patch ContractApplyThemeFontsPatch yes
requestedBackend ComputeBackendKind | null no

Response on success · apply_theme_fonts_patch

Field TypeScript type Req.
operation "apply_theme_fonts_patch" yes
subsetId string yes
major string yes
minor string yes
applied boolean yes

Minimal JSON template

{
"operation": "apply_theme_fonts_patch",
"subsetId": "<subsetId>",
"patch": "<ContractApplyThemeFontsPatch>",
"requestedBackend": "native-desktop"
}

Applies the workbook theme.

Request

Field TypeScript type Req. Note from the contract
operation "apply_workbook_theme" yes
subsetId string yes
presetId string yes A theme identifier from the theme catalog — colors together with fonts. If colorsOnly is set, the identifier is taken from the color-set catalog instead, the same list as “Page Layout → Colors”.
colorsOnly boolean no Apply only the theme’s color set, without touching the fonts. Without this field, or with false, the theme is applied in full — both colors and fonts.
customColors ContractWorkbookThemeColorScheme | null no
previewOnly boolean no Re-parse the workbook and show the result in a separate session, without changing anything.
expectedRevision number | null no Required when saving; ignored when just viewing without changes.
readOnly boolean no
protected boolean no
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_workbook_theme

Field TypeScript type Req. Note from the contract
operation "apply_workbook_theme" yes The response repeats the main fields of open_workbook_subset and apply_cell_edits, so the shell redraws the workbook the same way it does after an ordinary edit — no separate handling is needed.
subsetId string yes
session ContractSubsetSessionInfo yes
appliedPresetId string yes
createdThemePart boolean yes
previewOnly boolean no
activeSheet ContractActiveSheetMeta yes
workbookSheets ContractWorkbookSheetMeta[] yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes
layoutMetrics ContractLayoutMetricsSubset no
themeColorPalette string[] no The workbook’s twelve-color theme palette — the same in composition and meaning as in open_workbook_subset, but after the theme has been applied. Elements that follow the theme (table styles, for example) are recolored from it immediately, with no save and reopen needed.
workbookHistory ContractWorkbookHistoryProjection | null no

Minimal JSON template

{
"operation": "apply_workbook_theme",
"subsetId": "<subsetId>",
"presetId": "<string>",
"requestedBackend": "native-desktop"
}

Request

Field TypeScript type Req.
operation “manage_cell_styles” yes
subsetId string yes
action ContractCellStylesManagerAction yes
expectedRevision number | null no
readOnly boolean no
protected boolean no
viewport ViewportWindow | null no

Response on success · manage_cell_styles

Field TypeScript type Req.
operation “manage_cell_styles” yes
subsetId string yes
session ContractSubsetSessionInfo yes
action “inspect” | “commit” | “applyStyle” | “mergeFromWorkbook” yes
styles ContractCellStyleDefinition[] yes
authority ContractCellStylesManagerAuthority yes
didChange boolean yes
changedCellCount number yes
workbookHistory ContractWorkbookHistoryProjection yes
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes

Minimal JSON template

{
"operation": "manage_cell_styles",
"subsetId": "<subsetId>",
"action": "<ContractCellStylesManagerAction>"
}

Manages conditional formatting rules.

Request

Field TypeScript type Req.
operation "manage_conditional_formatting_rules" yes
subsetId string yes
sheetKey string yes
action ContractConditionalFormattingManagerAction yes
expectedRevision number | null no
readOnly boolean no
protected boolean no
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · manage_conditional_formatting_rules

Field TypeScript type Req.
operation "manage_conditional_formatting_rules" yes
subsetId string yes
session ContractSubsetSessionInfo yes
action "inspect" | “apply” yes
rules ContractConditionalRule[] yes
opaqueRules ContractConditionalFormattingOpaqueRule[] yes
authority ContractConditionalFormattingManagerAuthority yes
didChange boolean yes
workbookHistory ContractWorkbookHistoryProjection yes
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes

Minimal JSON template

{
"operation": "manage_conditional_formatting_rules",
"subsetId": "<subsetId>",
"sheetKey": "<sheetPath>",
"action": "<ContractConditionalFormattingManagerAction>",
"requestedBackend": "native-desktop"
}

Request

Field TypeScript type Req.
operation “manage_table_styles” yes
subsetId string yes
action ContractTableStylesManagerAction yes
expectedRevision number | null no
readOnly boolean no
protected boolean no
viewport ViewportWindow | null no

Response on success · manage_table_styles

Field TypeScript type Req.
operation “manage_table_styles” yes
subsetId string yes
session ContractSubsetSessionInfo yes
action “inspect” | “commit” | “applyStyle” yes
styles ContractTableStyleDefinition[] yes
tables ContractTableMetadataProjection yes
authority ContractTableStylesManagerAuthority yes
didChange boolean yes
changedTableCount number yes
workbookHistory ContractWorkbookHistoryProjection yes
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes

Minimal JSON template

{
"operation": "manage_table_styles",
"subsetId": "<subsetId>",
"action": "<ContractTableStylesManagerAction>"
}

Pastes conditional formatting rules.

Request

Field TypeScript type Req.
operation "paste_conditional_formatting_rules" yes
subsetId string yes
clipboardId string yes
target CellRange yes
viewport ViewportWindow | null no
requestedBackend ComputeBackendKind | null no

Response on success · apply_conditional_formatting_rules

Field TypeScript type Req.
operation "apply_conditional_formatting_rules" yes
subsetId string yes
session ContractSubsetSessionInfo yes
supportedSubset string yes
delta DeltaSummary yes
rules ContractConditionalRule[] yes
preservedUnsupportedRuleBlockCount number yes
activeSheet ContractActiveSheetMeta yes
geometry ContractGeometrySubset yes
recalcNeeded boolean yes
viewport ViewportWindow yes
previewCells ContractPreviewCell[] yes

Minimal JSON template

{
"operation": "paste_conditional_formatting_rules",
"subsetId": "<subsetId>",
"clipboardId": "<string>",
"target": "<CellRange>",
"requestedBackend": "native-desktop"
}

Documentation assistant

Answers are assembled from the documentation and may be inaccurate — check the sources.