# Worksheet

- Human documentation: [https://docs.univer.ai/reference/facade/worksheet](https://docs.univer.ai/reference/facade/worksheet)

- Agent Markdown: [https://docs.univer.ai/reference/facade/worksheet.md](https://docs.univer.ai/reference/facade/worksheet.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [facade/worksheet.mdx](https://github.com/dream-num/documentation/blob/dev/content/reference/facade/worksheet.mdx)

---

| Packages | `@univerjs/sheets`, `@univerjs/sheets-conditional-formatting`, `@univerjs/sheets-drawing-ui`, `@univerjs-pro/sheets-sparkline`, `@univerjs/sheets-table`, `@univerjs/sheets-ui`, `@univerjs/sheets-thread-comment`, `@univerjs-pro/sheets-shape`, `@univerjs/sheets-drawing`, `@univerjs/sheets-data-validation`, `@univerjs-pro/sheets-chart`, `@univerjs/sheets-filter`, `@univerjs/sheets-note`, `@univerjs-pro/sheets-pivot`, `@univerjs/sheets-hyper-link`, `@univerjs/sheets-sort`, `@univerjs-pro/sheets-outline` |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

A Facade API object bounded to a worksheet. It provides a set of methods to interact with the worksheet.

> This class should not be instantiated directly. Use factory methods on `univerAPI` instead.

## Overview

### @univerjs/sheets

| Method                                                | Description                                                                                     |
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| [`activate`](#activate)                               | Activates this sheet                                                                            |
| [`appendRow`](#appendrow)                             | Appends a row to the bottom of the current data region in the sheet                             |
| [`autoFitRow`](#autofitrow)                           | Make certain row wrap and auto height                                                           |
| [`cancelFreeze`](#cancelfreeze)                       | Cancels the frozen state of the current sheet                                                   |
| [`clear`](#clear)                                     | Clears the sheet of content and formatting information                                          |
| [`clearContents`](#clearcontents)                     | Clears the sheet of contents, while preserving formatting information                           |
| [`clearFormats`](#clearformats)                       | Clears the sheet of formatting, while preserving contents                                       |
| [`deleteColumn`](#deletecolumn)                       | Deletes the column at the given column position                                                 |
| [`deleteColumns`](#deletecolumns)                     | Deletes a number of columns starting at the given column position                               |
| [`deleteColumnsByPoints`](#deletecolumnsbypoints)     | Deletes the columns specified by the given column points                                        |
| [`deleteRow`](#deleterow)                             | Deletes the row at the given row position                                                       |
| [`deleteRows`](#deleterows)                           | Deletes a number of rows starting at the given row position                                     |
| [`deleteRowsByPoints`](#deleterowsbypoints)           | Deletes the rows specified by the given row points                                              |
| [`dispose`](#dispose)                                 | -                                                                                               |
| [`equalTo`](#equalto)                                 | Judge whether provided FWorksheet is equal to current                                           |
| [`getActiveCell`](#getactivecell)                     | Returns the active cell in this sheet                                                           |
| [`getActiveRange`](#getactiverange)                   | Returns the selected range in the active sheet, or null if there is no active range             |
| [`getCellMergeData`](#getcellmergedata)               | Get the merged cell data of the specified row and column                                        |
| [`getColumnCustomMetadata`](#getcolumncustommetadata) | Get custom metadata of column                                                                   |
| [`getColumnDefaultStyle`](#getcolumndefaultstyle)     | Get the default style of the worksheet column                                                   |
| [`getColumnWidth`](#getcolumnwidth)                   | Gets the width in pixels of the given column                                                    |
| [`getCustomMetadata`](#getcustommetadata)             | Get custom metadata of worksheet                                                                |
| [`getDataRange`](#getdatarange)                       | Returns a Range corresponding to the dimensions in which data is present                        |
| [`getDefaultStyle`](#getdefaultstyle)                 | Get the default style of the worksheet                                                          |
| [`getDefinedNames`](#getdefinednames)                 | Get all the defined names in the worksheet                                                      |
| [`getFreeze`](#getfreeze)                             | Get the freeze state of the current sheet                                                       |
| [`getFrozenColumnRange`](#getfrozencolumnrange)       | Get freezed columns                                                                             |
| [`getFrozenColumns`](#getfrozencolumns)               | Get the number of frozen columns                                                                |
| [`getFrozenRowRange`](#getfrozenrowrange)             | Get freezed rows                                                                                |
| [`getFrozenRows`](#getfrozenrows)                     | Get the number of frozen rows                                                                   |
| [`getGridLinesColor`](#getgridlinescolor)             | Get the color of the gridlines in the sheet                                                     |
| [`getIndex`](#getindex)                               | Gets the position of the sheet in its parent spreadsheet                                        |
| [`getInject`](#getinject)                             | Get the injector instance                                                                       |
| [`getLastColumn`](#getlastcolumn)                     | Returns the column index of the last column that contains content                               |
| [`getLastColumns`](#getlastcolumns)                   | -                                                                                               |
| [`getLastRow`](#getlastrow)                           | Returns the row index of the last row that contains content                                     |
| [`getLastRows`](#getlastrows)                         | -                                                                                               |
| [`getMaxColumns`](#getmaxcolumns)                     | Returns the current number of columns in the sheet, regardless of content                       |
| [`getMaxRows`](#getmaxrows)                           | Returns the current number of rows in the sheet, regardless of content                          |
| [`getMergeData`](#getmergedata)                       | Get all merged cells in the current worksheet                                                   |
| [`getMergedRanges`](#getmergedranges)                 | Get all merged cells in the current sheet                                                       |
| [`getRange`](#getrange)                               | -                                                                                               |
| [`getRowCustomMetadata`](#getrowcustommetadata)       | Get custom metadata of row                                                                      |
| [`getRowDefaultStyle`](#getrowdefaultstyle)           | Get the default style of the worksheet row                                                      |
| [`getRowHeight`](#getrowheight)                       | Gets the height in pixels of the given row                                                      |
| [`getSelection`](#getselection)                       | Get the current selection of the worksheet                                                      |
| [`getSheet`](#getsheet)                               | Get the worksheet instance                                                                      |
| [`getSheetId`](#getsheetid)                           | Get the worksheet id                                                                            |
| [`getSheetName`](#getsheetname)                       | Get the worksheet name                                                                          |
| [`getTabColor`](#gettabcolor)                         | Get the tab color of the sheet                                                                  |
| [`getWorkbook`](#getworkbook)                         | Get the workbook instance                                                                       |
| [`getWorksheetPermission`](#getworksheetpermission)   | Get the WorksheetPermission instance for managing worksheet-level permissions                   |
| [`hasHiddenGridLines`](#hashiddengridlines)           | Returns true if the sheet's gridlines are hidden; otherwise returns false                       |
| [`hideColumn`](#hidecolumn)                           | Hides the column or columns in the given range                                                  |
| [`hideColumns`](#hidecolumns)                         | Hides one or more consecutive columns starting at the given index                               |
| [`hideRow`](#hiderow)                                 | Hides the rows in the given range                                                               |
| [`hideRows`](#hiderows)                               | Hides one or more consecutive rows starting at the given index                                  |
| [`hideSheet`](#hidesheet)                             | Hides this sheet                                                                                |
| [`insertColumnAfter`](#insertcolumnafter)             | Inserts a column after the given column position                                                |
| [`insertColumnBefore`](#insertcolumnbefore)           | Inserts a column before the given column position                                               |
| [`insertColumns`](#insertcolumns)                     | Inserts one or more consecutive blank columns in a sheet starting at the specified location     |
| [`insertColumnsAfter`](#insertcolumnsafter)           | Inserts a given number of columns after the given column position                               |
| [`insertColumnsBefore`](#insertcolumnsbefore)         | Inserts a number of columns before the given column position                                    |
| [`insertDefinedName`](#insertdefinedname)             | Insert a defined name for worksheet                                                             |
| [`insertRowAfter`](#insertrowafter)                   | Inserts a row after the given row position                                                      |
| [`insertRowBefore`](#insertrowbefore)                 | Inserts a row before the given row position                                                     |
| [`insertRows`](#insertrows)                           | Inserts one or more consecutive blank rows in a sheet starting at the specified location        |
| [`insertRowsAfter`](#insertrowsafter)                 | Inserts a number of rows after the given row position                                           |
| [`insertRowsBefore`](#insertrowsbefore)               | Inserts a number of rows before the given row position                                          |
| [`isSheetHidden`](#issheethidden)                     | Returns true if the sheet is currently hidden                                                   |
| [`moveColumns`](#movecolumns)                         | Moves the columns selected by the given range to the position indicated by the destinationIndex |
| [`moveRows`](#moverows)                               | Moves the rows selected by the given range to the position indicated by the destinationIndex    |
| [`onBeforeCellDataChange`](#onbeforecelldatachange)   | -                                                                                               |
| [`onCellDataChange`](#oncelldatachange)               | -                                                                                               |
| [`setActiveRange`](#setactiverange)                   | Sets the active selection region for this sheet                                                 |
| [`setActiveSelection`](#setactiveselection)           | Sets the active selection region for this sheet                                                 |
| [`setColumnCount`](#setcolumncount)                   | Sets the number of columns in the worksheet                                                     |
| [`setColumnCustom`](#setcolumncustom)                 | Set custom properties for given columns                                                         |
| [`setColumnCustomMetadata`](#setcolumncustommetadata) | Set custom metadata of column                                                                   |
| [`setColumnDefaultStyle`](#setcolumndefaultstyle)     | Set the default style of the worksheet row                                                      |
| [`setColumnWidth`](#setcolumnwidth)                   | Sets the width of the given column in pixels                                                    |
| [`setColumnWidths`](#setcolumnwidths)                 | Sets the width of the given columns in pixels                                                   |
| [`setCustomMetadata`](#setcustommetadata)             | Set custom metadata of worksheet                                                                |
| [`setDefaultStyle`](#setdefaultstyle)                 | Set the default style of the worksheet                                                          |
| [`setFreeze`](#setfreeze)                             | Sets the frozen state of the current sheet                                                      |
| [`setFrozenColumns`](#setfrozencolumns)               | -                                                                                               |
| [`setFrozenRows`](#setfrozenrows)                     | -                                                                                               |
| [`setGridLinesColor`](#setgridlinescolor)             | Set the color of the gridlines in the sheet                                                     |
| [`setHiddenGridlines`](#sethiddengridlines)           | Hides or reveals the sheet gridlines                                                            |
| [`setName`](#setname)                                 | Sets the sheet name                                                                             |
| [`setRangesAutoHeight`](#setrangesautoheight)         | Sets the height of the given ranges to auto                                                     |
| [`setRowAutoHeight`](#setrowautoheight)               | Sets the height of the given rows to auto                                                       |
| [`setRowCount`](#setrowcount)                         | Sets the number of rows in the worksheet                                                        |
| [`setRowCustom`](#setrowcustom)                       | Set custom properties for given rows                                                            |
| [`setRowCustomMetadata`](#setrowcustommetadata)       | Set custom metadata of row                                                                      |
| [`setRowDefaultStyle`](#setrowdefaultstyle)           | Set the default style of the worksheet column                                                   |
| [`setRowHeight`](#setrowheight)                       | Sets the row height of the given row in pixels                                                  |
| [`setRowHeights`](#setrowheights)                     | Sets the height of the given rows in pixels                                                     |
| [`setRowHeightsForced`](#setrowheightsforced)         | Sets the height of the given rows in pixels                                                     |
| [`setTabColor`](#settabcolor)                         | Sets the sheet tab color                                                                        |
| [`showColumns`](#showcolumns)                         | Show one or more consecutive columns starting at the given index                                |
| [`showRows`](#showrows)                               | Scrolling sheet to make specific rows visible                                                   |
| [`showSheet`](#showsheet)                             | Shows this sheet                                                                                |
| [`unhideColumn`](#unhidecolumn)                       | Show the column in the given range                                                              |
| [`unhideRow`](#unhiderow)                             | Make the row in the given range visible                                                         |

### @univerjs/sheets-conditional-formatting

| Method                                                                | Description |
| --------------------------------------------------------------------- | ----------- |
| [`addConditionalFormattingRule`](#addconditionalformattingrule)       | -           |
| [`clearConditionalFormatRules`](#clearconditionalformatrules)         | -           |
| [`deleteConditionalFormattingRule`](#deleteconditionalformattingrule) | -           |
| [`getConditionalFormattingRules`](#getconditionalformattingrules)     | -           |
| [`moveConditionalFormattingRule`](#moveconditionalformattingrule)     | -           |
| [`newConditionalFormattingRule`](#newconditionalformattingrule)       | -           |
| [`setConditionalFormattingRule`](#setconditionalformattingrule)       | -           |

### @univerjs/sheets-data-validation

| Method                                                              | Description |
| ------------------------------------------------------------------- | ----------- |
| [`getAllDataValidationErrorAsync`](#getalldatavalidationerrorasync) | -           |
| [`getDataValidation`](#getdatavalidation)                           | -           |
| [`getDataValidations`](#getdatavalidations)                         | -           |
| [`getValidatorStatus`](#getvalidatorstatus)                         | -           |
| [`getValidatorStatusAsync`](#getvalidatorstatusasync)               | -           |

### @univerjs/sheets-drawing

| Method                                                | Description |
| ----------------------------------------------------- | ----------- |
| [`deleteImages`](#deleteimages)                       | -           |
| [`getActiveImages`](#getactiveimages)                 | -           |
| [`getDrawingGroupChildren`](#getdrawinggroupchildren) | -           |
| [`getDrawingParentGroup`](#getdrawingparentgroup)     | -           |
| [`getImageById`](#getimagebyid)                       | -           |
| [`getImages`](#getimages)                             | -           |
| [`groupDrawings`](#groupdrawings)                     | -           |
| [`insertImage`](#insertimage)                         | -           |
| [`insertImages`](#insertimages)                       | -           |
| [`isDrawingGrouped`](#isdrawinggrouped)               | -           |
| [`newOverGridImage`](#newovergridimage)               | -           |
| [`ungroupDrawings`](#ungroupdrawings)                 | -           |
| [`updateImages`](#updateimages)                       | -           |

### @univerjs/sheets-drawing-ui

| Method                                                    | Description |
| --------------------------------------------------------- | ----------- |
| [`addFloatDomToColumnHeader`](#addfloatdomtocolumnheader) | -           |
| [`addFloatDomToPosition`](#addfloatdomtoposition)         | -           |
| [`addFloatDomToRange`](#addfloatdomtorange)               | -           |
| [`batchUpdateFloatDoms`](#batchupdatefloatdoms)           | -           |
| [`getAllFloatDoms`](#getallfloatdoms)                     | -           |
| [`getFloatDomById`](#getfloatdombyid)                     | -           |
| [`removeFloatDom`](#removefloatdom)                       | -           |
| [`saveCellImagesAsync`](#savecellimagesasync)             | -           |
| [`updateFloatDom`](#updatefloatdom)                       | -           |

### @univerjs/sheets-filter

| Method                    | Description |
| ------------------------- | ----------- |
| [`getFilter`](#getfilter) | -           |

### @univerjs/sheets-hyper-link

| Method              | Description                                        |
| ------------------- | -------------------------------------------------- |
| [`getUrl`](#geturl) | Generate a hyperlink URL for the current worksheet |

### @univerjs/sheets-note

| Method                  | Description |
| ----------------------- | ----------- |
| [`getNotes`](#getnotes) | -           |

### @univerjs/sheets-sort

| Method          | Description |
| --------------- | ----------- |
| [`sort`](#sort) | -           |

### @univerjs/sheets-table

| Method                                  | Description |
| --------------------------------------- | ----------- |
| [`addTable`](#addtable)                 | -           |
| [`addTableTheme`](#addtabletheme)       | -           |
| [`getSubTableInfos`](#getsubtableinfos) | -           |
| [`getTableByCell`](#gettablebycell)     | -           |
| [`removeTable`](#removetable)           | -           |
| [`resetFilter`](#resetfilter)           | -           |
| [`setTableFilter`](#settablefilter)     | -           |
| [`setTableName`](#settablename)         | -           |
| [`setTableRange`](#settablerange)       | -           |

### @univerjs/sheets-thread-comment

| Method                              | Description                 |
| ----------------------------------- | --------------------------- |
| [`clearComments`](#clearcomments)   | -                           |
| [`getCommentById`](#getcommentbyid) | -                           |
| [`getComments`](#getcomments)       | -                           |
| [`onCommented`](#oncommented)       | Subscribe to comment events |

### @univerjs/sheets-ui

| Method                                                              | Description |
| ------------------------------------------------------------------- | ----------- |
| [`autoResizeColumns`](#autoresizecolumns)                           | -           |
| [`autoResizeRows`](#autoresizerows)                                 | -           |
| [`customizeColumnHeader`](#customizecolumnheader)                   | -           |
| [`customizeRowHeader`](#customizerowheader)                         | -           |
| [`getScrollState`](#getscrollstate)                                 | -           |
| [`getSkeleton`](#getskeleton)                                       | -           |
| [`getVisibleRange`](#getvisiblerange)                               | -           |
| [`getVisibleRangesOfAllViewports`](#getvisiblerangesofallviewports) | -           |
| [`getZoom`](#getzoom)                                               | -           |
| [`highlightRanges`](#highlightranges)                               | -           |
| [`onScroll`](#onscroll)                                             | -           |
| [`refreshCanvas`](#refreshcanvas)                                   | -           |
| [`scrollToCell`](#scrolltocell)                                     | -           |
| [`setColumnHeaderHeight`](#setcolumnheaderheight)                   | -           |
| [`setRowHeaderWidth`](#setrowheaderwidth)                           | -           |
| [`zoom`](#zoom)                                                     | -           |

### @univerjs-pro/sheets-chart

| Method              | Description                                   |
| ------------------- | --------------------------------------------- |
| [`charts`](#charts) | Returns the worksheet chart collection facade |

### @univerjs-pro/sheets-outline

| Method                                                          | Description                                                     |
| --------------------------------------------------------------- | --------------------------------------------------------------- |
| [`addColumnOutline`](#addcolumnoutline)                         | Add a column outline group to the current worksheet             |
| [`addRowOutline`](#addrowoutline)                               | Add a row outline group to the current worksheet                |
| [`clearDimensionOutlines`](#cleardimensionoutlines)             | Clear outline groups in a row or column range                   |
| [`getDimensionOutlines`](#getdimensionoutlines)                 | Get outline groups on the current worksheet                     |
| [`removeDimensionOutline`](#removedimensionoutline)             | Remove a row or column outline group from the current worksheet |
| [`setDimensionOutlineCollapsed`](#setdimensionoutlinecollapsed) | Collapse or expand an existing row or column outline group      |

### @univerjs-pro/sheets-pivot

| Method                                        | Description |
| --------------------------------------------- | ----------- |
| [`getPivotTableByCell`](#getpivottablebycell) | -           |

### @univerjs-pro/sheets-shape

| Method                        | Description |
| ----------------------------- | ----------- |
| [`getShapes`](#getshapes)     | -           |
| [`insertShape`](#insertshape) | -           |

### @univerjs-pro/sheets-sparkline

| Method                                                | Description |
| ----------------------------------------------------- | ----------- |
| [`addSparkline`](#addsparkline)                       | -           |
| [`composeSparkline`](#composesparkline)               | -           |
| [`getAllSubSparkline`](#getallsubsparkline)           | -           |
| [`getSparklineByCell`](#getsparklinebycell)           | -           |
| [`getSparklineGroupByCell`](#getsparklinegroupbycell) | -           |
| [`unComposeSparkline`](#uncomposesparkline)           | -           |

## APIs

### Range & Selection

### `getActiveRange`

Returns the selected range in the active sheet, or null if there is no active range.

**Signature**

```typescript
getActiveRange(): FRange | null
```

**Returns**

* `FRange` — the active range

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the currently active range
const activeRange = fWorksheet.getActiveRange();
if (activeRange) {
  console.log('Active range:', activeRange.getA1Notation());
}
```

Source: 

`@univerjs/sheets`

### `getRange`

**Signature**

```typescript
getRange(rowOrA1Notation: IRange | number | string, column?: number, numRows?: number, numColumns?: number): FRange
```

**Parameters**

* `rowOrA1Notation` `string | number | IRange` — *No description*
* `column` `number` *(optional)* — *No description*
* `numRows` `number` *(optional)* — *No description*
* `numColumns` `number` *(optional)* — *No description*

**Returns**

* `FRange` — See signature above.

Source: 

`@univerjs/sheets`

### `getSelection`

Get the current selection of the worksheet.

**Signature**

```typescript
getSelection(): FSelection | null
```

**Returns**

* `FSelection` — return the current selections of the worksheet or null if there is no selection.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const selection = fWorksheet.getSelection();
console.log(selection);
```

Source: 

`@univerjs/sheets`

### Cell Data

### `getCellMergeData`

Get the merged cell data of the specified row and column.

**Signature**

```typescript
getCellMergeData(row: number, column: number): FRange | undefined
```

**Parameters**

* `row` `number` — *No description*
* `column` `number` — *No description*

**Returns**

* `FRange` — The merged cell data, or undefined if the cell is not merged

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
const merge = fWorkSheet.getCellMergeData(0, 0);
if (merge) {
  console.log('Merged range:', merge.getA1Notation());
}
```

Source: 

`@univerjs/sheets`

### Row & Column

### `addFloatDomToColumnHeader`

**Signature**

```typescript
addFloatDomToColumnHeader(column: number, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
        id: string;
        dispose: () => void;
    }>
```

**Parameters**

* `column` `number` — *No description*
* `layer` `IFICanvasFloatDom` — *No description*
* `domLayout` `IDOMAnchor` — *No description*
* `id` `string` *(optional)* — *No description*

**Returns**

* `Nullable<{ id: string; dispose: () => void; }>` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `appendRow`

Appends a row to the bottom of the current data region in the sheet. If a cell's content begins with =, it's interpreted as a formula.

**Signature**

```typescript
appendRow(rowContents: CellValue[]): FWorksheet
```

**Parameters**

* `rowContents` `CellValue[]` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining.

**Examples**

```ts
// Appends a new row with 4 columns to the bottom of the current
// data region in the sheet containing the values in the array.
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
fWorkSheet.appendRow([1, 'Hello Univer', true, '=A1']);
```

Source: 

`@univerjs/sheets`

### `autoFitRow`

Make certain row wrap and auto height.

**Signature**

```typescript
autoFitRow(rowPosition: number, auto: BooleanNumber = BooleanNumber.TRUE): FWorksheet
```

**Parameters**

* `rowPosition` `number` — *No description*
* `auto` `BooleanNumber` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorkSheet.autoFitRow(24);
```

Source: 

`@univerjs/sheets`

### `autoResizeColumns`

**Signature**

```typescript
autoResizeColumns(startColumn: number, numColumns?: number): FWorksheet
```

**Parameters**

* `startColumn` `number` — *No description*
* `numColumns` `number` *(optional)* — Number of columns. Defaults to `1`.

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `autoResizeRows`

**Signature**

```typescript
autoResizeRows(startRow: number, numRows?: number): FWorksheet
```

**Parameters**

* `startRow` `number` — *No description*
* `numRows` `number` *(optional)* — Number of rows. Defaults to `1`.

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `customizeColumnHeader`

**Signature**

```typescript
customizeColumnHeader(cfg: IColumnsHeaderCfgParam): void
```

**Parameters**

* `cfg` `IColumnsHeaderCfgParam` — *No description*

Source: 

`@univerjs/sheets-ui`

### `customizeRowHeader`

**Signature**

```typescript
customizeRowHeader(cfg: IRowsHeaderCfgParam): void
```

**Parameters**

* `cfg` `IRowsHeaderCfgParam` — *No description*

Source: 

`@univerjs/sheets-ui`

### `deleteColumn`

Deletes the column at the given column position.

**Signature**

```typescript
deleteColumn(columnPosition: number): FWorksheet
```

**Parameters**

* `columnPosition` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete column C
fWorksheet.deleteColumn(2);
// Delete column A
fWorksheet.deleteColumn(0);
```

Source: 

`@univerjs/sheets`

### `deleteColumns`

Deletes a number of columns starting at the given column position.

**Signature**

```typescript
deleteColumns(columnPosition: number, howMany: number): FWorksheet
```

**Parameters**

* `columnPosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete 3 columns at column index 2 (columns C, D, E)
fWorksheet.deleteColumns(2, 3);
// Delete 1 column at column index 0 (column A)
fWorksheet.deleteColumns(0, 1);
```

Source: 

`@univerjs/sheets`

### `deleteColumnsByPoints`

Deletes the columns specified by the given column points. Each point can be a single column index or a tuple representing a range of columns.

**Signature**

```typescript
deleteColumnsByPoints(columnPoints: Array<number | [number, number]>): FWorksheet
```

**Parameters**

* `columnPoints` `(number | [number, number])[]` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete columns at index 2, and range from index 4 to 6 (columns C, E-G)
fWorksheet.deleteColumnsByPoints([2, [4, 6]]);
```

Source: 

`@univerjs/sheets`

### `deleteRow`

Deletes the row at the given row position.

**Signature**

```typescript
deleteRow(rowPosition: number): FWorksheet
```

**Parameters**

* `rowPosition` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete the third row
fWorksheet.deleteRow(2);
// Delete the first row
fWorksheet.deleteRow(0);
```

Source: 

`@univerjs/sheets`

### `deleteRows`

Deletes a number of rows starting at the given row position.

**Signature**

```typescript
deleteRows(rowPosition: number, howMany: number): FWorksheet
```

**Parameters**

* `rowPosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete 3 rows at row index 2 (rows 3-5)
fWorksheet.deleteRows(2, 3);
// Delete 1 row at row index 0 (first row)
fWorksheet.deleteRows(0, 1);
```

Source: 

`@univerjs/sheets`

### `deleteRowsByPoints`

Deletes the rows specified by the given row points. Each point can be a single row index or a tuple representing a range of rows.

**Signature**

```typescript
deleteRowsByPoints(rowPoints: Array<number | [number, number]>): FWorksheet
```

**Parameters**

* `rowPoints` `(number | [number, number])[]` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Delete rows at index 2, and range from index 4 to 6 (rows 3, 5-7)
fWorksheet.deleteRowsByPoints([2, [4, 6]]);
```

Source: 

`@univerjs/sheets`

### `getColumnCustomMetadata`

Get custom metadata of column

**Signature**

```typescript
getColumnCustomMetadata(index: number): CustomData | undefined
```

**Parameters**

* `index` `number` — *No description*

**Returns**

* `CustomData` — custom metadata

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
const custom = fWorkSheet.getColumnCustomMetadata(0);
console.log(custom);
```

Source: 

`@univerjs/sheets`

### `getColumnDefaultStyle`

Get the default style of the worksheet column

**Signature**

```typescript
getColumnDefaultStyle(index: number, keepRaw: boolean = false): Nullable<IStyleData> | string
```

**Parameters**

* `index` `number` — *No description*
* `keepRaw` `boolean` *(optional)* — *No description*

**Returns**

* `string | Nullable<IStyleData>` — The default style of the worksheet column name or style data

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get default style for column 0 (A)
const colStyle = fWorksheet.getColumnDefaultStyle(0);
console.log(colStyle);
// Get raw style data for column 0
const rawColStyle = fWorksheet.getColumnDefaultStyle(0, true);
console.log(rawColStyle);
```

Source: 

`@univerjs/sheets`

### `getColumnWidth`

Gets the width in pixels of the given column.

**Signature**

```typescript
getColumnWidth(columnPosition: number): number
```

**Parameters**

* `columnPosition` `number` — *No description*

**Returns**

* `number` — The width of the column in pixels

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

// Set the long text value in cell A1
const fRange = fWorksheet.getRange('A1');
fRange.setValue('Whenever it is a damp, drizzly November in my soul...');

// Set the column A to a width which fits the text
fWorksheet.autoResizeColumns(0);

// Get the width of the column A
console.log(fWorksheet.getColumnWidth(0));
```

Source: 

`@univerjs/sheets`

### `getFrozenColumnRange`

Get freezed columns

**Signature**

```typescript
getFrozenColumnRange(): IColumnRange
```

**Returns**

* `IColumnRange` — The range of the frozen columns.

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the range of the frozen columns
const frozenColumns = fWorkSheet.getFrozenColumnRange();
console.log(frozenColumns);
```

Source: 

`@univerjs/sheets`

### `getFrozenColumns`

Get the number of frozen columns.

**Signature**

```typescript
getFrozenColumns(): number
```

**Returns**

* `number` — The number of frozen columns, returns 0 if no columns are frozen.

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the number of frozen columns
const frozenColumns = fWorkSheet.getFrozenColumns();
console.log(frozenColumns);
```

Source: 

`@univerjs/sheets`

### `getFrozenRowRange`

Get freezed rows.

**Signature**

```typescript
getFrozenRowRange(): IRowRange
```

**Returns**

* `IRowRange` — The range of the frozen rows.

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the range of the frozen rows
const frozenRows = fWorkSheet.getFrozenRowRange();
console.log(frozenRows);
```

Source: 

`@univerjs/sheets`

### `getFrozenRows`

Get the number of frozen rows.

**Signature**

```typescript
getFrozenRows(): number
```

**Returns**

* `number` — The number of frozen rows. returns 0 if no rows are frozen.

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the number of frozen rows
const frozenRows = fWorkSheet.getFrozenRows();
console.log(frozenRows);
```

Source: 

`@univerjs/sheets`

### `getGridLinesColor`

Get the color of the gridlines in the sheet.

**Signature**

```typescript
getGridLinesColor(): string | undefined
```

**Returns**

* `string` — The color of the gridlines in the sheet or undefined. The default color is 'rgb(214, 216, 219)'.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// get the gridlines color of the sheet
console.log(fWorkSheet.getGridLinesColor());
```

Source: 

`@univerjs/sheets`

### `getLastColumn`

Returns the column index of the last column that contains content.

**Signature**

```typescript
getLastColumn(): number
```

**Returns**

* `number` — the column index of the last column that contains content.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// Assume the sheet is a empty sheet
const cellRange = fWorkSheet.getRange('J50');
cellRange.setValue('Hello World');
console.log(fWorkSheet.getLastColumn()); // 9
```

Source: 

`@univerjs/sheets`

### `getLastColumns`

> [!WARN]
> Deprecated — use 
> 
> `getLastColumn`
> 
>  instead.
> Returns the column index of the last column that contains content.

**Signature**

```typescript
getLastColumns(): number
```

**Returns**

* `number` — the column index of the last column that contains content.

Source: 

`@univerjs/sheets`

### `getLastRow`

Returns the row index of the last row that contains content.

**Signature**

```typescript
getLastRow(): number
```

**Returns**

* `number` — the row index of the last row that contains content.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// Assume the sheet is a empty sheet
const cellRange = fWorkSheet.getRange('J50');
cellRange.setValue('Hello World');
console.log(fWorkSheet.getLastRow()); // 49
```

Source: 

`@univerjs/sheets`

### `getLastRows`

> [!WARN]
> Deprecated — use 
> 
> `getLastRow`
> 
>  instead.
> Returns the row index of the last row that contains content.

**Signature**

```typescript
getLastRows(): number
```

**Returns**

* `number` — the row index of the last row that contains content.

Source: 

`@univerjs/sheets`

### `getMaxColumns`

Returns the current number of columns in the sheet, regardless of content.

**Signature**

```typescript
getMaxColumns(): number
```

**Returns**

* `number` — The maximum columns count of the sheet

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const totalColumns = fWorksheet.getMaxColumns();
console.log(`Sheet has ${totalColumns} columns`);
```

Source: 

`@univerjs/sheets`

### `getMaxRows`

Returns the current number of rows in the sheet, regardless of content.

**Signature**

```typescript
getMaxRows(): number
```

**Returns**

* `number` — The maximum rows count of the sheet

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const totalRows = fWorksheet.getMaxRows();
console.log(`Sheet has ${totalRows} rows`);
```

Source: 

`@univerjs/sheets`

### `getRowCustomMetadata`

Get custom metadata of row

**Signature**

```typescript
getRowCustomMetadata(index: number): CustomData | undefined
```

**Parameters**

* `index` `number` — *No description*

**Returns**

* `CustomData` — custom metadata

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
const custom = fWorkSheet.getRowCustomMetadata(0);
console.log(custom);
```

Source: 

`@univerjs/sheets`

### `getRowDefaultStyle`

Get the default style of the worksheet row

**Signature**

```typescript
getRowDefaultStyle(index: number, keepRaw: boolean = false): Nullable<IStyleData> | string
```

**Parameters**

* `index` `number` — *No description*
* `keepRaw` `boolean` *(optional)* — *No description*

**Returns**

* `string | Nullable<IStyleData>` — The default style of the worksheet row name or style data

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get default style for row 0 (1)
const rowStyle = fWorksheet.getRowDefaultStyle(0);
console.log(rowStyle);
// Get raw style data for row 0
const rawRowStyle = fWorksheet.getRowDefaultStyle(0, true);
console.log(rawRowStyle);
```

Source: 

`@univerjs/sheets`

### `getRowHeight`

Gets the height in pixels of the given row.

**Signature**

```typescript
getRowHeight(rowPosition: number): number
```

**Parameters**

* `rowPosition` `number` — *No description*

**Returns**

* `number` — The height in pixels of the given row.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

// Set the value of the cell A1 to 'Hello, Univer!', set the font size to 30 and font weight to bold
const fRange = fWorksheet.getRange('A1');
fRange.setValue('Hello, Univer!').setFontSize(30).setFontWeight('bold');

// Get the height of the first row
console.log(fWorksheet.getRowHeight(0));
```

Source: 

`@univerjs/sheets`

### `getTabColor`

Get the tab color of the sheet.

**Signature**

```typescript
getTabColor(): string | undefined
```

**Returns**

* `string` — The tab color of the sheet or undefined.
  The default color is css style property 'unset'.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// get the tab color of the sheet
console.log(fWorkSheet.getTabColor());
```

Source: 

`@univerjs/sheets`

### `hideColumn`

Hides the column or columns in the given range.

**Signature**

```typescript
hideColumn(column: FRange): FWorksheet
```

**Parameters**

* `column` `FRange` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Hide columns C, D, E
const column1 = fWorksheet.getRange('C:E');
fWorksheet.hideColumn(column1);
// Hide column A
const column2 = fWorksheet.getRange('A:A');
fWorksheet.hideColumn(column2);
```

Source: 

`@univerjs/sheets`

### `hideColumns`

Hides one or more consecutive columns starting at the given index. Use 0-index for this method

**Signature**

```typescript
hideColumns(columnIndex: number, numColumn: number = 1): FWorksheet
```

**Parameters**

* `columnIndex` `number` — *No description*
* `numColumn` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Hide columns C, D, E
fWorksheet.hideColumns(2, 3);
// Hide column A
fWorksheet.hideColumns(0, 1);
```

Source: 

`@univerjs/sheets`

### `hideRow`

Hides the rows in the given range.

**Signature**

```typescript
hideRow(row: FRange): FWorksheet
```

**Parameters**

* `row` `FRange` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Hide 3 rows starting from row index 1 (rows 2-4)
const row1 = fWorksheet.getRange('2:4');
fWorksheet.hideRow(row1);
// Hide single row at index 0 (first row)
const row2 = fWorksheet.getRange('1:1');
fWorksheet.hideRow(row2);
```

Source: 

`@univerjs/sheets`

### `hideRows`

Hides one or more consecutive rows starting at the given index. Use 0-index for this method

**Signature**

```typescript
hideRows(rowIndex: number, numRow: number = 1): FWorksheet
```

**Parameters**

* `rowIndex` `number` — *No description*
* `numRow` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Hide 3 rows starting from row index 1 (rows 2-4)
fWorksheet.hideRows(1, 3);
// Hide single row at index 0 (first row)
fWorksheet.hideRows(0);
```

Source: 

`@univerjs/sheets`

### `insertColumnAfter`

Inserts a column after the given column position.

**Signature**

```typescript
insertColumnAfter(afterPosition: number): FWorksheet
```

**Parameters**

* `afterPosition` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert a column after column C
fWorksheet.insertColumnAfter(2);
// Insert a column after column A
fWorksheet.insertColumnAfter(0);
```

Source: 

`@univerjs/sheets`

### `insertColumnBefore`

Inserts a column before the given column position.

**Signature**

```typescript
insertColumnBefore(beforePosition: number): FWorksheet
```

**Parameters**

* `beforePosition` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert a column before column C
fWorksheet.insertColumnBefore(2);
// Insert a column before column A
fWorksheet.insertColumnBefore(0);
```

Source: 

`@univerjs/sheets`

### `insertColumns`

Inserts one or more consecutive blank columns in a sheet starting at the specified location.

**Signature**

```typescript
insertColumns(columnIndex: number, numColumns: number = 1): FWorksheet
```

**Parameters**

* `columnIndex` `number` — *No description*
* `numColumns` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 columns before column C
fWorksheet.insertColumns(2, 3);
// Insert 1 column before column A
fWorksheet.insertColumns(0);
```

Source: 

`@univerjs/sheets`

### `insertColumnsAfter`

Inserts a given number of columns after the given column position.

**Signature**

```typescript
insertColumnsAfter(afterPosition: number, howMany: number): FWorksheet
```

**Parameters**

* `afterPosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 columns after column C
fWorksheet.insertColumnsAfter(2, 3);
// Insert 1 column after column A
fWorksheet.insertColumnsAfter(0, 1);
```

Source: 

`@univerjs/sheets`

### `insertColumnsBefore`

Inserts a number of columns before the given column position.

**Signature**

```typescript
insertColumnsBefore(beforePosition: number, howMany: number): FWorksheet
```

**Parameters**

* `beforePosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 columns before column C
fWorksheet.insertColumnsBefore(2, 3);
// Insert 1 column before column A
fWorksheet.insertColumnsBefore(0, 1);
```

Source: 

`@univerjs/sheets`

### `insertRowAfter`

Inserts a row after the given row position.

**Signature**

```typescript
insertRowAfter(afterPosition: number): FWorksheet
```

**Parameters**

* `afterPosition` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert a row after the third row
fWorksheet.insertRowAfter(2);
// Insert a row after the first row
fWorksheet.insertRowAfter(0);
```

Source: 

`@univerjs/sheets`

### `insertRowBefore`

Inserts a row before the given row position.

**Signature**

```typescript
insertRowBefore(beforePosition: number): FWorksheet
```

**Parameters**

* `beforePosition` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert a row before the third row
fWorksheet.insertRowBefore(2);
// Insert a row before the first row
fWorksheet.insertRowBefore(0);
```

Source: 

`@univerjs/sheets`

### `insertRows`

Inserts one or more consecutive blank rows in a sheet starting at the specified location.

**Signature**

```typescript
insertRows(rowIndex: number, numRows: number = 1): FWorksheet
```

**Parameters**

* `rowIndex` `number` — *No description*
* `numRows` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 rows before the third row
fWorksheet.insertRows(2, 3);
// Insert 1 row before the first row
fWorksheet.insertRows(0);
```

Source: 

`@univerjs/sheets`

### `insertRowsAfter`

Inserts a number of rows after the given row position.

**Signature**

```typescript
insertRowsAfter(afterPosition: number, howMany: number): FWorksheet
```

**Parameters**

* `afterPosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 rows after the third row
fWorksheet.insertRowsAfter(2, 3);
// Insert 1 row after the first row
fWorksheet.insertRowsAfter(0, 1);
```

Source: 

`@univerjs/sheets`

### `insertRowsBefore`

Inserts a number of rows before the given row position.

**Signature**

```typescript
insertRowsBefore(beforePosition: number, howMany: number): FWorksheet
```

**Parameters**

* `beforePosition` `number` — *No description*
* `howMany` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Insert 3 rows before the third row
fWorksheet.insertRowsBefore(2, 3);
// Insert 1 row before the first row
fWorksheet.insertRowsBefore(0, 1);
```

Source: 

`@univerjs/sheets`

### `moveColumns`

Moves the columns selected by the given range to the position indicated by the destinationIndex. The columnSpec itself does not have to exactly represent an entire column or group of columns to move—it selects all columns that the range spans.

**Signature**

```typescript
moveColumns(columnSpec: FRange, destinationIndex: number): FWorksheet
```

**Parameters**

* `columnSpec` `FRange` — *No description*
* `destinationIndex` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Move columns C, D, E to column index 2 (columns B, C, D)
const columnSpec1 = fWorksheet.getRange('C:E');
fWorksheet.moveColumns(columnSpec1, 1);
// Move column F to column index 0 (column A)
const columnSpec2 = fWorksheet.getRange('F:F');
fWorksheet.moveColumns(columnSpec2, 0);
```

Source: 

`@univerjs/sheets`

### `moveRows`

Moves the rows selected by the given range to the position indicated by the destinationIndex. The rowSpec itself does not have to exactly represent an entire row or group of rows to move—it selects all rows that the range spans.

**Signature**

```typescript
moveRows(rowSpec: FRange, destinationIndex: number): FWorksheet
```

**Parameters**

* `rowSpec` `FRange` — *No description*
* `destinationIndex` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Move 3 rows at row index 2 (rows 3-5) to row index 0
const rowSpec1 = fWorksheet.getRange('3:5');
fWorksheet.moveRows(rowSpec1, 0);
// Move 1 row at row index 0 (first row) to row index 2
const rowSpec2 = fWorksheet.getRange('1:1');
fWorksheet.moveRows(rowSpec2, 2);
```

Source: 

`@univerjs/sheets`

### `setColumnCount`

Sets the number of columns in the worksheet.

**Signature**

```typescript
setColumnCount(columnCount: number): FWorksheet
```

**Parameters**

* `columnCount` `number` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();

// Set the number of columns in the worksheet to 10
fWorkSheet.setColumnCount(10);
```

Source: 

`@univerjs/sheets`

### `setColumnCustom`

Set custom properties for given columns.

**Signature**

```typescript
setColumnCustom(custom: IObjectArrayPrimitiveType<CustomData>): FWorksheet
```

**Parameters**

* `custom` `IObjectArrayPrimitiveType<CustomData>` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorkSheet.setColumnCustom({ 0: { key: 'value' } });
```

Source: 

`@univerjs/sheets`

### `setColumnCustomMetadata`

Set custom metadata of column

**Signature**

```typescript
setColumnCustomMetadata(index: number, custom: CustomData | undefined): FWorksheet
```

**Parameters**

* `index` `number` — *No description*
* `custom` `CustomData` — *No description*

**Returns**

* `FWorksheet` — Current worksheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
fWorkSheet.setColumnCustomMetadata(0, { key: 'value' });
```

Source: 

`@univerjs/sheets`

### `setColumnDefaultStyle`

Set the default style of the worksheet row

**Signature**

```typescript
setColumnDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet
```

**Parameters**

* `index` `number` — *No description*
* `style` `string | Nullable<IStyleData>` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();
fWorksheet.setColumnDefaultStyle(0, 'default');
// or
// fWorksheet.setColumnDefaultStyle(0, {fs: 12, ff: 'Arial'});
```

Source: 

`@univerjs/sheets`

### `setColumnHeaderHeight`

**Signature**

```typescript
setColumnHeaderHeight(height: number): FWorksheet
```

**Parameters**

* `height` `number` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `setColumnWidth`

Sets the width of the given column in pixels.

**Signature**

```typescript
setColumnWidth(columnPosition: number, width: number): FWorksheet
```

**Parameters**

* `columnPosition` `number` — *No description*
* `width` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Set width of column B to 100 pixels
fWorksheet.setColumnWidth(1, 100);
```

Source: 

`@univerjs/sheets`

### `setColumnWidths`

Sets the width of the given columns in pixels.

**Signature**

```typescript
setColumnWidths(startColumn: number, numColumn: number, width: number): FWorksheet
```

**Parameters**

* `startColumn` `number` — *No description*
* `numColumn` `number` — *No description*
* `width` `number` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Set width of columns B-D (index 1-3) to 100 pixels
fWorksheet.setColumnWidths(1, 3, 100);
```

Source: 

`@univerjs/sheets`

### `setFrozenColumns`

**Signature**

```typescript
setFrozenColumns(...args: [number] | [number, number]): FWorksheet
```

**Parameters**

* `args` `[number, number] | [number]` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets`

### `setFrozenRows`

**Signature**

```typescript
setFrozenRows(...args: [number] | [number, number]): FWorksheet
```

**Parameters**

* `args` `[number, number] | [number]` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets`

### `setGridLinesColor`

Set the color of the gridlines in the sheet.

**Signature**

```typescript
setGridLinesColor(color: string | undefined): FWorksheet
```

**Parameters**

* `color` `string` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// set the gridlines color to red
fWorkSheet.setGridLinesColor('#ff0000');
```

Source: 

`@univerjs/sheets`

### `setRowAutoHeight`

Sets the height of the given rows to auto.

**Signature**

```typescript
setRowAutoHeight(startRow: number, numRows: number): FWorksheet
```

**Parameters**

* `startRow` `number` — *No description*
* `numRows` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorksheet.setRowAutoHeight(1, 10);
```

Source: 

`@univerjs/sheets`

### `setRowCount`

Sets the number of rows in the worksheet.

**Signature**

```typescript
setRowCount(rowCount: number): FWorksheet
```

**Parameters**

* `rowCount` `number` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();

// Set the number of rows in the worksheet to 40
fWorkSheet.setRowCount(40);
```

Source: 

`@univerjs/sheets`

### `setRowCustom`

Set custom properties for given rows.

**Signature**

```typescript
setRowCustom(custom: IObjectArrayPrimitiveType<CustomData>): FWorksheet
```

**Parameters**

* `custom` `IObjectArrayPrimitiveType<CustomData>` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorkSheet.setRowCustom({ 0: { key: 'value' } });
```

Source: 

`@univerjs/sheets`

### `setRowCustomMetadata`

Set custom metadata of row

**Signature**

```typescript
setRowCustomMetadata(index: number, custom: CustomData | undefined): FWorksheet
```

**Parameters**

* `index` `number` — *No description*
* `custom` `CustomData` — *No description*

**Returns**

* `FWorksheet` — Current worksheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
fWorkSheet.setRowCustomMetadata(0, { key: 'value' });
```

Source: 

`@univerjs/sheets`

### `setRowDefaultStyle`

Set the default style of the worksheet column

**Signature**

```typescript
setRowDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet
```

**Parameters**

* `index` `number` — *No description*
* `style` `string | Nullable<IStyleData>` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();
fWorksheet.setRowDefaultStyle(0, 'default');
// or
// fWorksheet.setRowDefaultStyle(0, {fs: 12, ff: 'Arial'});
```

Source: 

`@univerjs/sheets`

### `setRowHeaderWidth`

**Signature**

```typescript
setRowHeaderWidth(width: number): FWorksheet
```

**Parameters**

* `width` `number` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `setRowHeight`

Sets the row height of the given row in pixels. By default, rows grow to fit cell contents. If you want to force rows to a specified height, use setRowHeightsForced(startRow, numRows, height).

**Signature**

```typescript
setRowHeight(rowPosition: number, height: number): FWorksheet
```

**Parameters**

* `rowPosition` `number` — *No description*
* `height` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Set the height of the second row to 30 pixels
fWorksheet.setRowHeight(1, 30);
// Set the height of the first row to 20 pixels
fWorksheet.setRowHeight(0, 20);
```

Source: 

`@univerjs/sheets`

### `setRowHeights`

Sets the height of the given rows in pixels.
By default, rows grow to fit cell contents. If you want to force rows to a specified height, use setRowHeightsForced(startRow, numRows, height).

**Signature**

```typescript
setRowHeights(startRow: number, numRows: number, height: number): FWorksheet
```

**Parameters**

* `startRow` `number` — *No description*
* `numRows` `number` — *No description*
* `height` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorksheet.setRowHeights(1, 10, 30);
```

Source: 

`@univerjs/sheets`

### `setRowHeightsForced`

Sets the height of the given rows in pixels. By default, rows grow to fit cell contents. When you use setRowHeightsForced, rows are forced to the specified height even if the cell contents are taller than the row height.

**Signature**

```typescript
setRowHeightsForced(startRow: number, numRows: number, height: number): FWorksheet
```

**Parameters**

* `startRow` `number` — *No description*
* `numRows` `number` — *No description*
* `height` `number` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorksheet.setRowHeightsForced(1, 10, 30);
```

Source: 

`@univerjs/sheets`

### `setTabColor`

Sets the sheet tab color.

**Signature**

```typescript
setTabColor(color: string): FWorksheet
```

**Parameters**

* `color` `string` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// set the tab color to red
fWorkSheet.setTabColor('#ff0000');
```

Source: 

`@univerjs/sheets`

### `showColumns`

Show one or more consecutive columns starting at the given index. Use 0-index for this method

**Signature**

```typescript
showColumns(columnIndex: number, numColumns: number = 1): FWorksheet
```

**Parameters**

* `columnIndex` `number` — *No description*
* `numColumns` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Unhide columns C, D, E
fWorksheet.showColumns(2, 3);
// Unhide column A
fWorksheet.showColumns(0, 1);
```

Source: 

`@univerjs/sheets`

### `showRows`

Scrolling sheet to make specific rows visible.

**Signature**

```typescript
showRows(rowIndex: number, numRows: number = 1): FWorksheet
```

**Parameters**

* `rowIndex` `number` — *No description*
* `numRows` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Show 3 rows starting from row index 1 (rows 2-4)
fWorksheet.showRows(1, 3);
// Show single row at index 0 (first row)
fWorksheet.showRows(0);
```

Source: 

`@univerjs/sheets`

### `unhideColumn`

Show the column in the given range.

**Signature**

```typescript
unhideColumn(column: FRange): FWorksheet
```

**Parameters**

* `column` `FRange` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Unhide columns C, D, E
const column1 = fWorksheet.getRange('C:E');
fWorksheet.unhideColumn(column1);
// Unhide column A
const column2 = fWorksheet.getRange('A:A');
fWorksheet.unhideColumn(column2);
```

Source: 

`@univerjs/sheets`

### `unhideRow`

Make the row in the given range visible.

**Signature**

```typescript
unhideRow(row: FRange): FWorksheet
```

**Parameters**

* `row` `FRange` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Unhide 3 rows starting from row index 1 (rows 2-4)
const row1 = fWorksheet.getRange('2:4');
fWorksheet.unhideRow(row1);
// Unhide single row at index 0 (first row)
const row2 = fWorksheet.getRange('1:1');
fWorksheet.unhideRow(row2);
```

Source: 

`@univerjs/sheets`

### Visibility & Protection

### `hideSheet`

Hides this sheet. Has no effect if the sheet is already hidden. If this method is called on the only visible sheet, it throws an exception.

**Signature**

```typescript
hideSheet(): FWorksheet
```

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// hide the active sheet
fWorkSheet.hideSheet();
```

Source: 

`@univerjs/sheets`

### `showSheet`

Shows this sheet. Has no effect if the sheet is already visible.

**Signature**

```typescript
showSheet(): FWorksheet
```

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheets = fWorkbook.getSheets();
// show the last sheet
fWorkSheets[fWorkSheets.length - 1].showSheet();
```

Source: 

`@univerjs/sheets`

### Charts & Drawings

### `deleteImages`

**Signature**

```typescript
deleteImages(sheetImages: FOverGridImage[]): FWorksheet
```

**Parameters**

* `sheetImages` `FOverGridImage[]` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `getActiveImages`

**Signature**

```typescript
getActiveImages(): FOverGridImage[]
```

**Returns**

* `FOverGridImage[]` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `charts`

Returns the worksheet chart collection facade.

**Signature**

```typescript
readonly charts: FWorksheetCharts
```

**Returns**

* `FWorksheetCharts` — Worksheet-scoped chart collection APIs.

Source: 

`@univerjs-pro/sheets-chart`

### `getDrawingGroupChildren`

**Signature**

```typescript
getDrawingGroupChildren(groupId: string, recursive?: boolean): ISheetDrawing[]
```

**Parameters**

* `groupId` `string` — The group drawing id.
* `recursive` `boolean` *(optional)* — Whether to return all descendants.

**Returns**

* `ISheetDrawing[]` — The child drawings in the group.

Source: 

`@univerjs/sheets-drawing`

### `getDrawingParentGroup`

**Signature**

```typescript
getDrawingParentGroup(drawingId: string): ISheetDrawing | null
```

**Parameters**

* `drawingId` `string` — The child drawing id.

**Returns**

* `ISheetDrawing | null` — The parent group drawing, or `null` if the drawing is not grouped.

Source: 

`@univerjs/sheets-drawing`

### `getImageById`

**Signature**

```typescript
getImageById(id: string): FOverGridImage | null
```

**Parameters**

* `id` `string` — *No description*

**Returns**

* `FOverGridImage` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `getImages`

**Signature**

```typescript
getImages(): FOverGridImage[]
```

**Returns**

* `FOverGridImage[]` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `groupDrawings`

**Signature**

```typescript
groupDrawings(drawingIds: string[], groupId?: string): string | null
```

**Parameters**

* `drawingIds` `string[]` — Drawing ids to group on the current sheet.
* `groupId` `string` *(optional)* — Optional id for the new group drawing.

**Returns**

* `string | null` — The group drawing id, or `null` when grouping cannot be completed.

Source: 

`@univerjs/sheets-drawing`

### `getShapes`

Returns all shapes and connectors on this worksheet.

**Signature**

```typescript
getShapes(): Array<FSheetShape | FConnectorShape>
```

**Returns**

* `Array<FSheetShape | FConnectorShape>` — Live worksheet shape facades.

Source: 

`@univerjs-pro/sheets-shape`

### `getShape`

Returns a worksheet shape by its stable identifier.

**Signature**

```typescript
getShape(shapeId: string): FSheetShape | FConnectorShape | null
```

**Parameters**

* `shapeId` `string` — The shape identifier.

**Returns**

* `FSheetShape | FConnectorShape | null` — The live shape facade, or `null` when it does not exist.

Source: 

`@univerjs-pro/sheets-shape`

### `insertImage`

**Signature**

```typescript
async insertImage(url: IFBlobSource | string, column?: number, row?: number, offsetX?: number, offsetY?: number): Promise<boolean>
```

**Parameters**

* `url` `any` — *No description*
* `column` `number` *(optional)* — *No description*
* `row` `number` *(optional)* — *No description*
* `offsetX` `number` *(optional)* — *No description*
* `offsetY` `number` *(optional)* — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `insertImages`

**Signature**

```typescript
insertImages(sheetImages: ISheetImage[]): FWorksheet
```

**Parameters**

* `sheetImages` `ISheetImage[]` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `isDrawingGrouped`

**Signature**

```typescript
isDrawingGrouped(drawingId: string): boolean
```

**Parameters**

* `drawingId` `string` — The drawing id.

**Returns**

* `boolean` — `true` if the drawing has a parent group.

Source: 

`@univerjs/sheets-drawing`

### `insertShape`

Inserts a shape or connector into this worksheet.

**Signature**

```typescript
insertShape(input: IShapeCreateInput): FSheetShape | FConnectorShape | null
```

**Parameters**

* `input` `IShapeCreateInput` — Common shape creation input.

**Returns**

* `FSheetShape | FConnectorShape | null` — A live worksheet shape facade, or `null` when creation fails.

Source: 

`@univerjs-pro/sheets-shape`

### `newOverGridImage`

**Signature**

```typescript
newOverGridImage(): FOverGridImageBuilder
```

**Returns**

* `FOverGridImageBuilder` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### `saveCellImagesAsync`

**Signature**

```typescript
async saveCellImagesAsync(options?: ISaveCellImagesOptions, ranges?: FRange[]): Promise<boolean>
```

**Parameters**

* `options` `ISaveCellImagesOptions` *(optional)* — *No description*
* `ranges` `FRange[]` *(optional)* — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `ungroupDrawings`

**Signature**

```typescript
ungroupDrawings(groupIds: string[]): boolean
```

**Parameters**

* `groupIds` `string[]` — Group drawing ids to ungroup.

**Returns**

* `boolean` — `true` if the operation succeeds.

Source: 

`@univerjs/sheets-drawing`

### `updateImages`

**Signature**

```typescript
updateImages(sheetImages: ISheetImage[]): FWorksheet
```

**Parameters**

* `sheetImages` `ISheetImage[]` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-drawing`

### Filter & Sort

### `getFilter`

**Signature**

```typescript
getFilter(): FFilter | null
```

**Returns**

* `FFilter` — See signature above.

Source: 

`@univerjs/sheets-filter`

### `resetFilter`

**Signature**

```typescript
resetFilter(tableId: string, column: number): Promise<boolean>
```

**Parameters**

* `tableId` `string` — *No description*
* `column` `number` — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `setTableFilter`

**Signature**

```typescript
setTableFilter(tableId: string, column: number, filter: ITableFilterItem): Promise<boolean>
```

**Parameters**

* `tableId` `string` — *No description*
* `column` `number` — *No description*
* `filter` `ITableFilterItem` — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `sort`

**Signature**

```typescript
sort(colIndex: number, asc = true): FWorksheet
```

**Parameters**

* `colIndex` `number` — *No description*
* `asc` `boolean` *(optional)* — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-sort`

### Miscellaneous

### `activate`

Activates this sheet. Does not alter the sheet itself, only the parent's notion of the active sheet.

**Signature**

```typescript
activate(): FWorksheet
```

**Returns**

* `FWorksheet` — Current sheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheets = fWorkbook.getSheets();
// activate the last sheet
fWorkSheets[fWorkSheets.length - 1].activate();
```

Source: 

`@univerjs/sheets`

### `addConditionalFormattingRule`

**Signature**

```typescript
addConditionalFormattingRule(rule: IConditionFormattingRule): FWorksheet
```

**Parameters**

* `rule` `IConditionFormattingRule` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `addFloatDomToPosition`

**Signature**

```typescript
addFloatDomToPosition(layer: IFICanvasFloatDom, id?: string): Nullable<{
        id: string;
        dispose: () => void;
    }>
```

**Parameters**

* `layer` `IFICanvasFloatDom` — *No description*
* `id` `string` *(optional)* — *No description*

**Returns**

* `Nullable<{ id: string; dispose: () => void; }>` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `addFloatDomToRange`

**Signature**

```typescript
addFloatDomToRange(fRange: FRange, layer: IFICanvasFloatDom, domLayout: IDOMAnchor, id?: string): Nullable<{
        id: string;
        dispose: () => void;
    }>
```

**Parameters**

* `fRange` `FRange` — *No description*
* `layer` `IFICanvasFloatDom` — *No description*
* `domLayout` `IDOMAnchor` — *No description*
* `id` `string` *(optional)* — *No description*

**Returns**

* `Nullable<{ id: string; dispose: () => void; }>` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `addSparkline`

**Signature**

```typescript
addSparkline(sourceRanges: IRange[], targetRanges: IRange[], type: SparklineTypeEnum.LINE_CHART): FSparkline | undefined
```

**Parameters**

* `sourceRanges` `IRange[]` — *No description*
* `targetRanges` `IRange[]` — *No description*
* `type` `SparklineTypeEnum.LINE_CHART` — *No description*

**Returns**

* `FSparkline` — See signature above.

Source: 

`@univerjs-pro/sheets-sparkline`

### `addTable`

**Signature**

```typescript
addTable(tableName: string, rangeInfo: ITableRange, tableId?: string, options?: ITableOptions): Promise<boolean> | boolean
```

**Parameters**

* `tableName` `string` — *No description*
* `rangeInfo` `ITableRange` — *No description*
* `tableId` `string` *(optional)* — *No description*
* `options` `ITableOptions` *(optional)* — *No description*

**Returns**

* `boolean | Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `addTableTheme`

**Signature**

```typescript
addTableTheme(tableId: string, themeStyleJSON: IRangeThemeStyleJSON): Promise<boolean>
```

**Parameters**

* `tableId` `string` — *No description*
* `themeStyleJSON` `IRangeThemeStyleJSON` — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `batchUpdateFloatDoms`

**Signature**

```typescript
batchUpdateFloatDoms(updates: Array<{ id: string; config: Partial<Omit<IFCanvasFloatDomResult, 'id'>> }>): this
```

**Parameters**

* `updates` `{ id: string; config: Partial<Omit<IFCanvasFloatDomResult, "id">>; }[]` — *No description*

**Returns**

* `this` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `cancelFreeze`

Cancels the frozen state of the current sheet.

**Signature**

```typescript
cancelFreeze(): FWorksheet
```

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Cancel freeze
fWorksheet.cancelFreeze();
```

Source: 

`@univerjs/sheets`

### `clear`

Clears the sheet of content and formatting information.Or Optionally clears only the contents or only the formatting.

**Signature**

```typescript
clear(options?: IFacadeClearOptions): FWorksheet
```

**Parameters**

* `options` `IFacadeClearOptions` *(optional)* — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// clear the sheet of content and formatting information
fWorkSheet.clear();
// clear the sheet of content only
fWorkSheet.clear({ contentsOnly: true });
```

Source: 

`@univerjs/sheets`

### `clearConditionalFormatRules`

**Signature**

```typescript
clearConditionalFormatRules(): FWorksheet
```

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `clearContents`

Clears the sheet of contents, while preserving formatting information.

**Signature**

```typescript
clearContents(): FWorksheet
```

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// clear the sheet of content only
fWorkSheet.clearContents();
```

Source: 

`@univerjs/sheets`

### `clearFormats`

Clears the sheet of formatting, while preserving contents.

**Signature**

```typescript
clearFormats(): FWorksheet
```

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// clear the sheet of formatting only
fWorkSheet.clearFormats();
```

Source: 

`@univerjs/sheets`

### `composeSparkline`

**Signature**

```typescript
composeSparkline(ranges: IRange[]): void
```

**Parameters**

* `ranges` `IRange[]` — *No description*

Source: 

`@univerjs-pro/sheets-sparkline`

### `deleteConditionalFormattingRule`

**Signature**

```typescript
deleteConditionalFormattingRule(cfId: string): FWorksheet
```

**Parameters**

* `cfId` `string` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `dispose`

**Signature**

```typescript
dispose(): void
```

Source: 

`@univerjs/sheets`

### `equalTo`

Judge whether provided FWorksheet is equal to current.

**Signature**

```typescript
equalTo(other: FWorksheet): boolean
```

**Parameters**

* `other` `FWorksheet` — *No description*

**Returns**

* `boolean` — true if the FWorksheet is equal to the current FWorksheet, false otherwise.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const sheets = fWorkbook.getSheets();
const fWorkSheet = fWorkbook.getActiveSheet();
console.log(fWorkSheet.equalTo(sheets[0])); // true, if the active sheet is the first sheet.
```

Source: 

`@univerjs/sheets`

### `getActiveCell`

Returns the active cell in this sheet.

**Signature**

```typescript
getActiveCell(): FRange | null
```

**Returns**

* `FRange` — The active cell

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
console.log(fWorkSheet.getActiveCell().getA1Notation());
```

Source: 

`@univerjs/sheets`

### `getAllDataValidationErrorAsync`

**Signature**

```typescript
async getAllDataValidationErrorAsync(): Promise<IDataValidationError[]>
```

**Returns**

* `Promise<IDataValidationError[]>` — See signature above.

Source: 

`@univerjs/sheets-data-validation`

### `getAllFloatDoms`

**Signature**

```typescript
getAllFloatDoms(): IFCanvasFloatDomResult[]
```

**Returns**

* `IFCanvasFloatDomResult[]` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `getAllSubSparkline`

**Signature**

```typescript
getAllSubSparkline(): Map<string, ISparklineGroup> | undefined
```

**Returns**

* `Map<string, ISparklineGroup>` — See signature above.

Source: 

`@univerjs-pro/sheets-sparkline`

### `getConditionalFormattingRules`

**Signature**

```typescript
getConditionalFormattingRules(): IConditionFormattingRule[]
```

**Returns**

* `IConditionFormattingRule[]` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `getCustomMetadata`

Get custom metadata of worksheet

**Signature**

```typescript
getCustomMetadata(): CustomData | undefined
```

**Returns**

* `CustomData` — custom metadata

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
const custom = fWorkSheet.getCustomMetadata();
console.log(custom);
```

Source: 

`@univerjs/sheets`

### `getDataRange`

Returns a Range corresponding to the dimensions in which data is present.
This is functionally equivalent to creating a Range bounded by A1 and (Sheet.getLastColumn(), Sheet.getLastRow()).

**Signature**

```typescript
getDataRange(): FRange
```

**Returns**

* `FRange` — The range of the data in the sheet.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// Assume the sheet is a empty sheet
const cellRange = fWorkSheet.getRange('J50');
cellRange.setValue('Hello World');
console.log(fWorkSheet.getDataRange().getA1Notation()); // A1:J50
```

Source: 

`@univerjs/sheets`

### `getDataValidation`

**Signature**

```typescript
getDataValidation(ruleId: string): Nullable<FDataValidation>
```

**Parameters**

* `ruleId` `string` — *No description*

**Returns**

* `Nullable<FDataValidation>` — See signature above.

Source: 

`@univerjs/sheets-data-validation`

### `getDataValidations`

**Signature**

```typescript
getDataValidations(): FDataValidation[]
```

**Returns**

* `FDataValidation[]` — See signature above.

Source: 

`@univerjs/sheets-data-validation`

### `getDefaultStyle`

Get the default style of the worksheet.

**Signature**

```typescript
getDefaultStyle(): Nullable<IStyleData> | string
```

**Returns**

* `string | Nullable<IStyleData>` — Default style of the worksheet.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const defaultStyle = fWorksheet.getDefaultStyle();
console.log(defaultStyle);
```

Source: 

`@univerjs/sheets`

### `getDefinedNames`

Get all the defined names in the worksheet.

**Signature**

```typescript
getDefinedNames(): FDefinedName[]
```

**Returns**

* `FDefinedName[]` — All the defined names in the worksheet

**Examples**

```ts
// The code below gets all the defined names in the worksheet
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const definedNames = fWorksheet.getDefinedNames();
console.log(definedNames, definedNames[0]?.getFormulaOrRefString());
```

Source: 

`@univerjs/sheets`

### `getFloatDomById`

**Signature**

```typescript
getFloatDomById(id: string): Nullable<IFCanvasFloatDomResult>
```

**Parameters**

* `id` `string` — *No description*

**Returns**

* `Nullable<IFCanvasFloatDomResult>` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `getFreeze`

Get the freeze state of the current sheet.

**Signature**

```typescript
getFreeze(): IFreeze
```

**Returns**

* `IFreeze` — The freeze state of the current sheet

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get the freeze state of the current sheet
const freeze = fWorksheet.getFreeze();
console.log(freeze);
```

Source: 

`@univerjs/sheets`

### `getIndex`

Gets the position of the sheet in its parent spreadsheet. Starts at 0.

**Signature**

```typescript
getIndex(): number
```

**Returns**

* `number` — The position of the sheet in its parent spreadsheet.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// get the position of the active sheet
const position = fWorkSheet.getIndex();
console.log(position);
```

Source: 

`@univerjs/sheets`

### `getInject`

Get the injector instance.

**Signature**

```typescript
getInject(): Injector
```

**Returns**

* `Injector` — The injector instance.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const injector = fWorksheet.getInject();
console.log(injector);
```

Source: 

`@univerjs/sheets`

### `getMergeData`

Get all merged cells in the current worksheet

**Signature**

```typescript
getMergeData(): FRange[]
```

**Returns**

* `FRange[]` — All the merged cells in the worksheet

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get all merged ranges in the sheet
const mergedData = fWorksheet.getMergeData();
// Process each merged range
mergedData.forEach(range => {
  console.log(range.getA1Notation());
});
```

Source: 

`@univerjs/sheets`

### `getMergedRanges`

Get all merged cells in the current sheet

**Signature**

```typescript
getMergedRanges(): FRange[]
```

**Returns**

* `FRange[]` — all merged cells

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Get all merged ranges in the sheet
const mergedRanges = fWorksheet.getMergedRanges();
// Process each merged range
mergedRanges.forEach(range => {
  console.log(range.getA1Notation());
});
```

Source: 

`@univerjs/sheets`

### Outline

### `addColumnOutline`

Add a column outline group to the current worksheet.

The column index is zero-based. The group covers `numColumns` columns starting at `startColumn`, so `addColumnOutline(0, 3)` groups columns A to C. Invalid groups are ignored and will not be added, including negative ranges, zero or negative column counts, ranges outside the worksheet, crossing groups, and groups that exceed the maximum outline depth.

**Signature**

```typescript
addColumnOutline(startColumn: number, numColumns: number): FWorksheet
```

**Parameters**

* `startColumn` `number` — The zero-based start column index of the outline group.
* `numColumns` `number` — The number of columns included in the outline group.

**Returns**

* `FWorksheet` — The current worksheet instance, allowing chained facade calls.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

// Group columns B to E.
fWorksheet.addColumnOutline(1, 4);
```

Source: 

`@univerjs-pro/sheets-outline`

### `addRowOutline`

Add a row outline group to the current worksheet.

The row index is zero-based. The group covers `numRows` rows starting at `startRow`, so `addRowOutline(1, 3)` groups rows 2 to 4. Invalid groups are ignored and will not be added, including negative ranges, zero or negative row counts, ranges outside the worksheet, crossing groups, and groups that exceed the maximum outline depth.

**Signature**

```typescript
addRowOutline(startRow: number, numRows: number): FWorksheet
```

**Parameters**

* `startRow` `number` — The zero-based start row index of the outline group.
* `numRows` `number` — The number of rows included in the outline group.

**Returns**

* `FWorksheet` — The current worksheet instance, allowing chained facade calls.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

// Group rows 2 to 6.
fWorksheet.addRowOutline(1, 5);
```

Source: 

`@univerjs-pro/sheets-outline`

### `clearDimensionOutlines`

Clear outline groups in a row or column range.

The range uses zero-based indexes and is inclusive: `[start, end]`. Only outline groups on the specified axis whose ranges are fully contained in this range are removed.

**Signature**

```typescript
clearDimensionOutlines(axis: DimensionOutlineAxis, start: number, end: number): FWorksheet
```

**Parameters**

* `axis` `DimensionOutlineAxis` — The outline axis to clear.
* `start` `number` — The zero-based inclusive start index of the clear range.
* `end` `number` — The zero-based inclusive end index of the clear range.

**Returns**

* `FWorksheet` — The current worksheet instance, allowing chained facade calls.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

// Remove row outline groups fully contained in rows 2 to 10.
fWorksheet.clearDimensionOutlines(univerAPI.Enum.DimensionOutlineAxis.ROW, 1, 9);
```

Source: 

`@univerjs-pro/sheets-outline`

### `getDimensionOutlines`

Get outline groups on the current worksheet.

When `axis` is omitted, both row and column outline groups are returned. The returned array is a snapshot of the current outline data; use command or facade methods to make changes instead of mutating the returned objects directly.

**Signature**

```typescript
getDimensionOutlines(axis?: DimensionOutlineAxis): IDimensionOutline[]
```

**Parameters**

* `axis` `DimensionOutlineAxis` *(optional)* — Optional outline axis filter.

**Returns**

* `IDimensionOutline[]` — The outline groups on the current worksheet.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

const rowOutlines = fWorksheet.getDimensionOutlines(univerAPI.Enum.DimensionOutlineAxis.ROW);
rowOutlines.forEach((outline) => {
  console.log(outline.id, outline.start, outline.end, outline.collapsed);
});
```

Source: 

`@univerjs-pro/sheets-outline`

### `removeDimensionOutline`

Remove a row or column outline group from the current worksheet.

Use `getDimensionOutlines()` to read the current outline ids. Removing a parent outline does not remove unrelated sibling outlines.

**Signature**

```typescript
removeDimensionOutline(outlineId: string): FWorksheet
```

**Parameters**

* `outlineId` `string` — The id of the outline group to remove.

**Returns**

* `FWorksheet` — The current worksheet instance, allowing chained facade calls.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

const [firstRowOutline] = fWorksheet.getDimensionOutlines(univerAPI.Enum.DimensionOutlineAxis.ROW);
if (firstRowOutline) {
  fWorksheet.removeDimensionOutline(firstRowOutline.id);
}
```

Source: 

`@univerjs-pro/sheets-outline`

### `setDimensionOutlineCollapsed`

Collapse or expand an existing row or column outline group.

Pass `true` to collapse the group and hide its grouped rows or columns. Pass `false` to expand it and show the grouped rows or columns again, subject to other nested collapsed groups.

**Signature**

```typescript
setDimensionOutlineCollapsed(outlineId: string, collapsed: boolean): FWorksheet
```

**Parameters**

* `outlineId` `string` — The id of the outline group to update.
* `collapsed` `boolean` — Whether the outline group should be collapsed.

**Returns**

* `FWorksheet` — The current worksheet instance, allowing chained facade calls.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();

const [firstColumnOutline] = fWorksheet.getDimensionOutlines(univerAPI.Enum.DimensionOutlineAxis.COLUMN);
if (firstColumnOutline) {
  // Collapse the group.
  fWorksheet.setDimensionOutlineCollapsed(firstColumnOutline.id, true);

  // Expand it later.
  fWorksheet.setDimensionOutlineCollapsed(firstColumnOutline.id, false);
}
```

Source: 

`@univerjs-pro/sheets-outline`

### `getPivotTableByCell`

**Signature**

```typescript
getPivotTableByCell(row: number, col: number): FPivotTable | undefined
```

**Parameters**

* `row` `number` — *No description*
* `col` `number` — *No description*

**Returns**

* `FPivotTable` — See signature above.

Source: 

`@univerjs-pro/sheets-pivot`

### `getScrollState`

**Signature**

```typescript
getScrollState(): IScrollState
```

**Returns**

* `IScrollState` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `getSheet`

Get the worksheet instance.

**Signature**

```typescript
getSheet(): Worksheet
```

**Returns**

* `Worksheet` — The worksheet instance.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const sheet = fWorksheet.getSheet();
console.log(sheet);
```

Source: 

`@univerjs/sheets`

### `getSheetId`

Get the worksheet id.

**Signature**

```typescript
getSheetId(): string
```

**Returns**

* `string` — The id of the worksheet.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const sheetId = fWorksheet.getSheetId();
console.log(sheetId);
```

Source: 

`@univerjs/sheets`

### `getSheetName`

Get the worksheet name.

**Signature**

```typescript
getSheetName(): string
```

**Returns**

* `string` — The name of the worksheet.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const sheetName = fWorksheet.getSheetName();
console.log(sheetName);
```

Source: 

`@univerjs/sheets`

### `getSkeleton`

**Signature**

```typescript
getSkeleton(): Nullable<SpreadsheetSkeleton>
```

**Returns**

* `Nullable<SpreadsheetSkeleton>` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `getSparklineByCell`

**Signature**

```typescript
getSparklineByCell(row: number, col: number): FSparkline | undefined
```

**Parameters**

* `row` `number` — *No description*
* `col` `number` — *No description*

**Returns**

* `FSparkline` — See signature above.

Source: 

`@univerjs-pro/sheets-sparkline`

### `getSparklineGroupByCell`

**Signature**

```typescript
getSparklineGroupByCell(row: number, col: number): FSparklineGroup | undefined
```

**Parameters**

* `row` `number` — *No description*
* `col` `number` — *No description*

**Returns**

* `FSparklineGroup` — See signature above.

Source: 

`@univerjs-pro/sheets-sparkline`

### `getSubTableInfos`

**Signature**

```typescript
getSubTableInfos(): ITableInfoWithUnitId[]
```

**Returns**

* `ITableInfoWithUnitId[]` — See signature above.

Source: 

`@univerjs/sheets-table`

### `getTableByCell`

**Signature**

```typescript
getTableByCell(row: number, column: number): ITableInfoWithUnitId | undefined
```

**Parameters**

* `row` `number` — *No description*
* `column` `number` — *No description*

**Returns**

* `any` — See signature above.

Source: 

`@univerjs/sheets-table`

### `getUrl`

Generate a hyperlink URL for the current worksheet.

**Signature**

```typescript
getUrl(): string
```

**Returns**

* `string` — The generated URL string (e.g. `#gid=sheet1`).

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorksheet = fWorkbook.getActiveSheet();
console.log(fWorksheet.getUrl()); // #gid=...
```

Source: 

`@univerjs/sheets-hyper-link`

### `getValidatorStatus`

**Signature**

```typescript
getValidatorStatus(): Promise<ObjectMatrix<Nullable<DataValidationStatus>>>
```

**Returns**

* `Promise<ObjectMatrix<Nullable<DataValidationStatus>>>` — See signature above.

Source: 

`@univerjs/sheets-data-validation`

### `getValidatorStatusAsync`

**Signature**

```typescript
getValidatorStatusAsync(): Promise<ObjectMatrix<Nullable<DataValidationStatus>>>
```

**Returns**

* `Promise<ObjectMatrix<Nullable<DataValidationStatus>>>` — See signature above.

Source: 

`@univerjs/sheets-data-validation`

### `getVisibleRange`

**Signature**

```typescript
getVisibleRange(): IRange | null
```

**Returns**

* `IRange` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `getVisibleRangesOfAllViewports`

**Signature**

```typescript
getVisibleRangesOfAllViewports(): Map<SHEET_VIEWPORT_KEY, IRange> | null
```

**Returns**

* `Map<SHEET_VIEWPORT_KEY, IRange>` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `getWorkbook`

Get the workbook instance.

**Signature**

```typescript
getWorkbook(): Workbook
```

**Returns**

* `Workbook` — The workbook instance.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const workbook = fWorksheet.getWorkbook();
console.log(workbook);
```

Source: 

`@univerjs/sheets`

### `getWorksheetPermission`

Get the WorksheetPermission instance for managing worksheet-level permissions.
This is the new permission API that provides worksheet-specific permission control.

**Signature**

```typescript
getWorksheetPermission(): FWorksheetPermission
```

**Returns**

* `FWorksheetPermission` — - The WorksheetPermission instance.

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const permission = fWorksheet.getWorksheetPermission();

// Set worksheet to read-only mode
await permission.setMode('readOnly');

// Check if a specific cell can be edited
const canEdit = permission.canEditCell(0, 0);

// Protect multiple ranges at once
const range1 = fWorksheet.getRange('A1:B10');
const range2 = fWorksheet.getRange('D1:E10');
await permission.protectRanges([
  { ranges: [range1], options: { name: 'Range 1', allowViewByOthers: false } },
  { ranges: [range2], options: { name: 'Range 2', allowViewByOthers: false } }
]);

// Subscribe to permission changes
permission.permission$.subscribe(snapshot => {
  console.log('Worksheet permissions changed:', snapshot);
});
```

Source: 

`@univerjs/sheets`

### `getZoom`

**Signature**

```typescript
getZoom(): number
```

**Returns**

* `number` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `hasHiddenGridLines`

Returns true if the sheet's gridlines are hidden; otherwise returns false. Gridlines are visible by default.

**Signature**

```typescript
hasHiddenGridLines(): boolean
```

**Returns**

* `boolean` — True if the sheet's gridlines are hidden; otherwise false.

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// check if the gridlines are hidden
if (fWorkSheet.hasHiddenGridLines()) {
   console.log('Gridlines are hidden');
}
```

Source: 

`@univerjs/sheets`

### `highlightRanges`

**Signature**

```typescript
highlightRanges(ranges: FRange[], style?: Nullable<Partial<ISelectionStyle>>, primary?: Nullable<ISelectionCell>): IDisposable
```

**Parameters**

* `ranges` `FRange[]` — *No description*
* `style` `Nullable<Partial<ISelectionStyle>>` *(optional)* — *No description*
* `primary` `Nullable<ISelectionCell>` *(optional)* — *No description*

**Returns**

* `IDisposable` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `insertDefinedName`

Insert a defined name for worksheet.

**Signature**

```typescript
insertDefinedName(name: string, formulaOrRefString: string): void
```

**Parameters**

* `name` `string` — *No description*
* `formulaOrRefString` `string` — *No description*

**Examples**

```ts
// The code below inserts a defined name
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorksheet.insertDefinedName('MyDefinedName', 'Sheet1!$A$1');
```

Source: 

`@univerjs/sheets`

### `isSheetHidden`

Returns true if the sheet is currently hidden.

**Signature**

```typescript
isSheetHidden(): boolean
```

**Returns**

* `boolean` — True if the sheet is hidden; otherwise, false.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheets = fWorkbook.getSheets();
// check if the last sheet is hidden
console.log(fWorkSheets[fWorkSheets.length - 1].isSheetHidden());
```

Source: 

`@univerjs/sheets`

### `moveConditionalFormattingRule`

**Signature**

```typescript
moveConditionalFormattingRule(cfId: string, toCfId: string, type: IAnchor['type'] = 'after'): FWorksheet
```

**Parameters**

* `cfId` `string` — *No description*
* `toCfId` `string` — *No description*
* `type` `IAnchor` *(optional)* — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `newConditionalFormattingRule`

**Signature**

```typescript
newConditionalFormattingRule(): FConditionalFormattingBuilder
```

**Returns**

* `FConditionalFormattingBuilder` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `onBeforeCellDataChange`

> [!WARN]
> Deprecated — use 
> 
> `univerAPI.addEvent(univerAPI.Event.BeforeSheetEditEnd, (params) =&gt; &#123;&#125;)`
> 
>  instead

**Signature**

```typescript
onBeforeCellDataChange(callback: (cellValue: ObjectMatrix<Nullable<ICellData>>) => void): IDisposable
```

**Parameters**

* `callback` `(cellValue: ObjectMatrix<Nullable<ICellData>>) => void` — *No description*

**Returns**

* `IDisposable` — See signature above.

Source: 

`@univerjs/sheets`

### `onCellDataChange`

> [!WARN]
> Deprecated — use 
> 
> `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) =&gt; &#123;&#125;)`
> 
>  instead

**Signature**

```typescript
onCellDataChange(callback: (cellValue: ObjectMatrix<Nullable<ICellData>>) => void): IDisposable
```

**Parameters**

* `callback` `(cellValue: ObjectMatrix<Nullable<ICellData>>) => void` — *No description*

**Returns**

* `IDisposable` — See signature above.

Source: 

`@univerjs/sheets`

### `onScroll`

**Signature**

```typescript
onScroll(callback: (params: Nullable<IViewportScrollState>) => void): IDisposable
```

**Parameters**

* `callback` `(params: any) => void` — *No description*

**Returns**

* `IDisposable` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `refreshCanvas`

**Signature**

```typescript
refreshCanvas(): FWorksheet
```

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `removeFloatDom`

**Signature**

```typescript
removeFloatDom(id: string): this
```

**Parameters**

* `id` `string` — *No description*

**Returns**

* `this` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `removeTable`

**Signature**

```typescript
removeTable(tableId: string): Promise<boolean>
```

**Parameters**

* `tableId` `string` — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `scrollToCell`

**Signature**

```typescript
scrollToCell(row: number, column: number, duration?: number): FWorksheet
```

**Parameters**

* `row` `number` — *No description*
* `column` `number` — *No description*
* `duration` `number` *(optional)* — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### `setActiveRange`

Sets the active selection region for this sheet.

**Signature**

```typescript
setActiveRange(range: FRange): FWorksheet
```

**Parameters**

* `range` `FRange` — *No description*

**Returns**

* `FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorkSheet.setActiveRange(fWorkSheet.getRange('A10:B10'));
```

Source: 

`@univerjs/sheets`

### `setActiveSelection`

Sets the active selection region for this sheet.

**Signature**

```typescript
setActiveSelection: (range: FRange) => FWorksheet
```

**Returns**

* `(range: FRange) => FWorksheet` — This sheet, for chaining

**Examples**

```ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorkSheet.setActiveSelection(fWorkSheet.getRange('A10:B10'));
```

Source: 

`@univerjs/sheets`

### `setConditionalFormattingRule`

**Signature**

```typescript
setConditionalFormattingRule(cfId: string, rule: IConditionFormattingRule): FWorksheet
```

**Parameters**

* `cfId` `string` — *No description*
* `rule` `IConditionFormattingRule` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-conditional-formatting`

### `setCustomMetadata`

Set custom metadata of worksheet

**Signature**

```typescript
setCustomMetadata(custom: CustomData | undefined): FWorksheet
```

**Parameters**

* `custom` `CustomData` — *No description*

**Returns**

* `FWorksheet` — Current worksheet, for chaining.

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
fWorkSheet.setCustomMetadata({ key: 'value' });
```

Source: 

`@univerjs/sheets`

### `setDefaultStyle`

Set the default style of the worksheet

**Signature**

```typescript
setDefaultStyle(style: string | Nullable<IStyleData>): FWorksheet
```

**Parameters**

* `style` `string | Nullable<IStyleData>` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
fWorksheet.setDefaultStyle('default');
// or
// fWorksheet.setDefaultStyle({fs: 12, ff: 'Arial'});
```

Source: 

`@univerjs/sheets`

### `setFreeze`

> [!WARN]
> Deprecated — use 
> 
> `setFrozenRows`
> 
>  and 
> 
> `setFrozenColumns`
> 
>  instead.

Sets the frozen state of the current sheet.

**Signature**

```typescript
setFreeze(freeze: IFreeze): FWorksheet
```

**Parameters**

* `freeze` `IFreeze` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
// Freeze first 3 rows and 2 columns
fWorksheet.setFreeze({
  startRow: 3,
  startColumn: 2,
  xSplit: 2,
  ySplit: 3
});
```

Source: 

`@univerjs/sheets`

### `setHiddenGridlines`

Hides or reveals the sheet gridlines.

**Signature**

```typescript
setHiddenGridlines(hidden: boolean): FWorksheet
```

**Parameters**

* `hidden` `boolean` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
 ts
const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
// hide the gridlines
fWorkSheet.setHiddenGridlines(true);
```

Source: 

`@univerjs/sheets`

### `setName`

Sets the sheet name.

**Signature**

```typescript
setName(name: string): FWorksheet
```

**Parameters**

* `name` `string` — *No description*

**Returns**

* `FWorksheet` — Returns the current worksheet instance for method chaining

**Examples**

```ts
const fWorkbook = univerAPI.getActiveWorkbook();
const fWorkSheet = fWorkbook.getActiveSheet();
// set the sheet name to 'Sheet1'
fWorkSheet.setName('NewSheet1');
```

Source: 

`@univerjs/sheets`

### `setRangesAutoHeight`

Sets the height of the given ranges to auto.

**Signature**

```typescript
setRangesAutoHeight(ranges: IRange[]): FWorksheet
```

**Parameters**

* `ranges` `IRange[]` — *No description*

**Returns**

* `FWorksheet` — This worksheet instance for chaining

**Examples**

```ts
const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
const ranges = [
{ startRow: 1, endRow: 10, startColumn: 0, endColumn: 10 },
{ startRow: 11, endRow: 20, startColumn: 0, endColumn: 10 },
]
fWorksheet.setRangesAutoHeight(ranges);
```

Source: 

`@univerjs/sheets`

### `setTableName`

**Signature**

```typescript
setTableName(tableId: string, tableName: string): Promise<boolean> | boolean
```

**Parameters**

* `tableId` `string` — *No description*
* `tableName` `string` — *No description*

**Returns**

* `boolean | Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `setTableRange`

**Signature**

```typescript
setTableRange(tableId: string, rangeInfo: ITableRange): Promise<boolean>
```

**Parameters**

* `tableId` `string` — *No description*
* `rangeInfo` `ITableRange` — *No description*

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-table`

### `unComposeSparkline`

**Signature**

```typescript
unComposeSparkline(ranges: IRange[]): void
```

**Parameters**

* `ranges` `IRange[]` — *No description*

Source: 

`@univerjs-pro/sheets-sparkline`

### `updateFloatDom`

**Signature**

```typescript
updateFloatDom(id: string, config: Partial<Omit<IFCanvasFloatDomResult, 'id'>>): this
```

**Parameters**

* `id` `string` — *No description*
* `config` `Partial<Omit<IFCanvasFloatDomResult, "id">>` — *No description*

**Returns**

* `this` — See signature above.

Source: 

`@univerjs/sheets-drawing-ui`

### `zoom`

**Signature**

```typescript
zoom(zoomRatio: number): FWorksheet
```

**Parameters**

* `zoomRatio` `number` — *No description*

**Returns**

* `FWorksheet` — See signature above.

Source: 

`@univerjs/sheets-ui`

### Comments & Notes

### `clearComments`

**Signature**

```typescript
clearComments(): Promise<boolean>
```

**Returns**

* `Promise<boolean>` — See signature above.

Source: 

`@univerjs/sheets-thread-comment`

### `getCommentById`

**Signature**

```typescript
getCommentById(commentId: string): FThreadComment | undefined
```

**Parameters**

* `commentId` `string` — *No description*

**Returns**

* `FThreadComment` — See signature above.

Source: 

`@univerjs/sheets-thread-comment`

### `getComments`

**Signature**

```typescript
getComments(): FThreadComment[]
```

**Returns**

* `FThreadComment[]` — See signature above.

Source: 

`@univerjs/sheets-thread-comment`

### `getNotes`

**Signature**

```typescript
getNotes(): ISheetNote[]
```

**Returns**

* `ISheetNote[]` — See signature above.

Source: 

`@univerjs/sheets-note`

### `onCommented`

Subscribe to comment events.

**Signature**

```typescript
onCommented(callback: (params: IAddCommentCommandParams) => void): IDisposable
```

**Parameters**

* `callback` `(params: IAddCommentCommandParams) => void` — *No description*

**Returns**

* `IDisposable` — See signature above.

Source: 

`@univerjs/sheets-thread-comment`
