@univerjs/facade v0.1.17 • Docs
Class: FWorkbook
Constructors
new FWorkbook()
new FWorkbook(
_workbook,
_injector,
_resourceLoaderService,
_selectionManagerService,
_univerInstanceService,
_commandService): FWorkbook
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
_injector | Injector |
_resourceLoaderService | IResourceLoaderService |
_selectionManagerService | SelectionManagerService |
_univerInstanceService | IUniverInstanceService |
_commandService | ICommandService |
Returns
Defined in
sheets/f-workbook.ts:40 (opens in a new tab)
Properties
Property | Modifier | Type | Defined in |
---|---|---|---|
id | readonly | string | sheets/f-workbook.ts:38 (opens in a new tab) |
Methods
create()
create(
name,
rows,
column): FWorksheet
Create a new worksheet and returns a handle to it.
Parameters
Parameter | Type | Description |
---|---|---|
name | string | Name of the new sheet |
rows | number | How may rows would the new sheet have |
column | number | How many columns would the new sheet have |
Returns
The new created sheet
Defined in
sheets/f-workbook.ts:98 (opens in a new tab)
deleteSheet()
deleteSheet(sheet): void
Deletes the specified worksheet.
Parameters
Parameter | Type | Description |
---|---|---|
sheet | FWorksheet | The worksheet to delete. |
Returns
void
Defined in
sheets/f-workbook.ts:191 (opens in a new tab)
getActiveSheet()
getActiveSheet(): null | FWorksheet
Get the active sheet of the workbook.
Returns
null
| FWorksheet
The active sheet of the workbook
Defined in
sheets/f-workbook.ts:72 (opens in a new tab)
getId()
getId(): string
Returns
string
Defined in
sheets/f-workbook.ts:52 (opens in a new tab)
getName()
getName(): string
Returns
string
Defined in
sheets/f-workbook.ts:56 (opens in a new tab)
getSheetByName()
getSheetByName(name): null | FWorksheet
Get a worksheet by sheet name.
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the sheet to get. |
Returns
null
| FWorksheet
The worksheet with given sheet name
Defined in
sheets/f-workbook.ts:141 (opens in a new tab)
getSheetBySheetId()
getSheetBySheetId(sheetId): null | FWorksheet
Get a worksheet by sheet id.
Parameters
Parameter | Type | Description |
---|---|---|
sheetId | string | The id of the sheet to get. |
Returns
null
| FWorksheet
The worksheet with given sheet id
Defined in
sheets/f-workbook.ts:127 (opens in a new tab)
getSheets()
getSheets(): FWorksheet[]
Gets all the worksheets in this workbook
Returns
An array of all the worksheets in the workbook
Defined in
sheets/f-workbook.ts:85 (opens in a new tab)
getSnapshot()
getSnapshot(): IWorkbookData
Returns workbook snapshot data, including conditional formatting, data validation, and other plugin data.
Returns
Defined in
sheets/f-workbook.ts:63 (opens in a new tab)
insertSheet()
insertSheet(): FWorksheet
Inserts a new worksheet into the workbook. Using a default sheet name. The new sheet becomes the active sheet
Returns
The new sheet
Defined in
sheets/f-workbook.ts:169 (opens in a new tab)
onBeforeCommandExecute()
onBeforeCommandExecute(callback): IDisposable
Register a callback that will be triggered before invoking a command targeting the Univer sheet.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | the callback. |
Returns
IDisposable
A function to dispose the listening.
Defined in
sheets/f-workbook.ts:221 (opens in a new tab)
onCommandExecuted()
onCommandExecuted(callback): IDisposable
Register a callback that will be triggered when a command is invoked targeting the Univer sheet.
Parameters
Parameter | Type | Description |
---|---|---|
callback | CommandListener | the callback. |
Returns
IDisposable
A function to dispose the listening.
Defined in
sheets/f-workbook.ts:236 (opens in a new tab)
onSelectionChange()
onSelectionChange(callback): IDisposable
Parameters
Parameter | Type |
---|---|
callback | (selections ) => void |
Returns
IDisposable
Defined in
sheets/f-workbook.ts:246 (opens in a new tab)
redo()
redo(): Promise<boolean>
Returns
Promise
<boolean
>
Defined in
sheets/f-workbook.ts:207 (opens in a new tab)
setActiveSheet()
setActiveSheet(sheet): FWorksheet
Sets the given worksheet to be the active worksheet in the workbook.
Parameters
Parameter | Type | Description |
---|---|---|
sheet | FWorksheet | The worksheet to set as the active worksheet. |
Returns
The active worksheet
Defined in
sheets/f-workbook.ts:155 (opens in a new tab)
undo()
undo(): Promise<boolean>
Returns
Promise
<boolean
>