Skip to content

wb.cellStyles

WorkbookCellStyles

7 methods

get

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

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

getStyle

Promise<CellStyle | null>
getStyle(styleId: string): Promise<CellStyle | null>;
ParameterTypeRequired
styleIdstringrequired

Get a full cell style by ID. Returns null if not found.

list

Promise<CellStyle[]>
list(options?: CellStyleListOptions): Promise<CellStyle[]>;
ParameterTypeRequired
optionsCellStyleListOptionsoptional

List cell styles. Defaults to built-in + custom styles.

getCatalog

Promise<CellStyleCatalog>
getCatalog(options?: Pick<CellStyleListOptions, 'source'>): Promise<CellStyleCatalog>;
ParameterTypeRequired
optionsPick<CellStyleListOptions, 'source'>optional

Get ordered style catalog data for gallery-style consumers.

add

Promise<CellStyle>
add(name: string, format: CellFormat): Promise<CellStyle>;
ParameterTypeRequired
namestringrequired
formatCellFormatrequired

Create a new custom cell style.

update

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

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

remove

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

Delete a custom cell style. Returns true if deleted.