Workbook Data Structure

GitHubEdit on GitHub

IWorkbookData

IWorkbookData represents the snapshot of a workbook in Univer Sheet.

Properties

PropertyTypeDescription
idstringUnique identifier of the Univer Sheets.
namestringName of the Univer Sheets.
appVersionstringVersion of the Univer model definition.
localeLocaleTypeLocale of the document.
stylesRecord<string, Nullable<IStyleData>>Style references for the workbook.
sheetOrderstring[]Array of sheet IDs representing the order of worksheets.
sheets{ [sheetId: string]: Partial<IWorksheetData> }Record containing data for each worksheet.
resources?IResourcesStore the data of plugins

Example

const workbookData: IWorkbookData = {
  id: 'unique-workbook-id',
  name: 'My Workbook',
  appVersion: '1.0.0',
  locale: LocaleType.EN_US,
  styles: { /* style definitions */ },
  sheetOrder: ['sheet1', 'sheet2'],
  sheets: {
    sheet1: { /* sheet data */ },
    sheet2: { /* sheet data */ },
  },
}

Usage

IWorkbookData is the object used to store data in Univer Sheets. It is mainly used for:

  1. Creating a Univer Sheets using IWorkbookData
  2. Saving IWorkbookData from Univer Sheets

resources property is used to store plugin data. Go to Plugin Custom Model