Skip to content
Mog is in active development. The GitHub repo, SDK packages, and community channels are not yet available. Follow for launch updates

wb.styles

WorkbookStyles

12 methods

getTableStyles

Promise<TableStyleInfoWithReadOnly[]>
getTableStyles(): Promise<TableStyleInfoWithReadOnly[]>;

Get all table styles (built-in + custom) with a `readOnly` flag.

createTableStyle

Promise<string>
createTableStyle(config: TableStyleConfig): Promise<string>;
ParameterTypeRequired
configTableStyleConfigrequired

Create a custom table style. Returns the style name/ID.

updateTableStyle

Promise<void>
updateTableStyle(name: string, updates: Partial<TableStyleConfig>): Promise<void>;
ParameterTypeRequired
namestringrequired
updatesPartial<TableStyleConfig>required

Update a custom table style.

removeTableStyle

Promise<void>
removeTableStyle(name: string): Promise<void>;
ParameterTypeRequired
namestringrequired

Remove a custom table style.

getDefaultTableStyle

Promise<string | undefined>
getDefaultTableStyle(): Promise<string | undefined>;

Get the default table style ID applied to new tables.

setDefaultTableStyle

Promise<void>
setDefaultTableStyle(styleId: string | undefined): Promise<void>;
ParameterTypeRequired
styleIdstring | undefinedrequired

Set the default table style ID for new tables. Pass undefined to reset.

duplicateTableStyle

Promise<string>
duplicateTableStyle(name: string): Promise<string>;
ParameterTypeRequired
namestringrequired

Duplicate an existing table style. Returns the new style name.

getById

Promise<CellFormat | null>
getById(styleId: string): Promise<CellFormat | null>;
ParameterTypeRequired
styleIdstringrequired

Get a cell format (style) by its style ID. Returns the format, or null if not found.

getCellStyles

Promise<CellStyle[]>
getCellStyles(): Promise<CellStyle[]>;

Get all custom cell styles (excludes built-in).

createCellStyle

Promise<CellStyle>
createCellStyle(style: Omit<CellStyle, 'builtIn'>): Promise<CellStyle>;
ParameterTypeRequired
styleOmit<CellStyle, 'builtIn'>required

Create a new custom cell style.

updateCellStyle

Promise<CellStyle | undefined>
updateCellStyle(
    styleId: string,
    updates: Partial<Omit<CellStyle, 'id' | 'builtIn'>>,
  ): Promise<CellStyle | undefined>;
ParameterTypeRequired
styleIdstringrequired
updatesPartial<Omit<CellStyle, 'id' | 'builtIn'>>required

Update a custom cell style. Returns the updated style, or undefined if not found.

deleteCellStyle

Promise<boolean>
deleteCellStyle(styleId: string): Promise<boolean>;
ParameterTypeRequired
styleIdstringrequired

Delete a custom cell style. Returns true if deleted.