Workbook Data Structure
IWorkbookData
IWorkbookData is the snapshot of a workbook in Univer Sheets.
Properties
| Property | Type | Description |
|---|---|---|
| id | string | Unique identifier of the workbook. |
| name | string | Name of the workbook. |
| appVersion | string | Version of the Univer model definition. |
| locale | LocaleType | Locale of the document. |
| styles | Record<string, Nullable<IStyleData>> | Style references for the workbook. |
| sheetOrder | string[] | The worksheet IDs, in the order the sheets appear. |
| sheets | { [sheetId: string]: Partial<IWorksheetData> } | Record containing data for each worksheet. |
| resources? | IResources | Data owned by plugins. |
Example
TypeScript
const workbookData: IWorkbookData = { id: 'unique-workbook-id', name: 'My Workbook', appVersion: '0.10.2', locale: LocaleType.EN_US, styles: {/* style definitions */}, sheetOrder: ['sheet1', 'sheet2'], sheets: { sheet1: {/* sheet data */}, sheet2: {/* sheet data */}, },}Usage
Univer Sheets stores workbook data in IWorkbookData. The structure is used in two situations:
The resources property holds data owned by plugins. See Plugin Custom Model.
How is this guide?