wb.cellStyles
WorkbookCellStyles
7 methods
get
→ Promise<CellFormat | null>get(styleId: string): Promise<CellFormat | null>;| Parameter | Type | Required |
|---|---|---|
| styleId | string | required |
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>;| Parameter | Type | Required |
|---|---|---|
| styleId | string | required |
Get a full cell style by ID. Returns null if not found.
list
→ Promise<CellStyle[]>list(options?: CellStyleListOptions): Promise<CellStyle[]>;| Parameter | Type | Required |
|---|---|---|
| options | CellStyleListOptions | optional |
List cell styles. Defaults to built-in + custom styles.
getCatalog
→ Promise<CellStyleCatalog>getCatalog(options?: Pick<CellStyleListOptions, 'source'>): Promise<CellStyleCatalog>;| Parameter | Type | Required |
|---|---|---|
| options | Pick<CellStyleListOptions, 'source'> | optional |
Get ordered style catalog data for gallery-style consumers.
add
→ Promise<CellStyle>add(name: string, format: CellFormat): Promise<CellStyle>;| Parameter | Type | Required |
|---|---|---|
| name | string | required |
| format | CellFormat | required |
Create a new custom cell style.
update
→ Promise<CellStyle | null>update(
styleId: string,
updates: Partial<Omit<CellStyle, 'id' | 'builtIn'>>,
): Promise<CellStyle | null>;| Parameter | Type | Required |
|---|---|---|
| styleId | string | required |
| updates | Partial<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>;| Parameter | Type | Required |
|---|---|---|
| styleId | string | required |
Delete a custom cell style. Returns true if deleted.