Bases sub-types
Composite types referenced by Base snapshots, tables, fields, records, and views.
Composite types referenced by Base snapshots, tables, fields, records, and views. Supporting IBaseSnapshot. Types are ordered from direct top-level fields to deeper nested structures and enums.
Overview
BaseId
import type { BaseId } from '@univerjs/core' · Used by IBaseSnapshot
type BaseId = stringITableSnapshot
import type { ITableSnapshot } from '@univerjs/core' · Used by IBaseSnapshot
interface ITableSnapshot { id: TableId name: string formulaName?: string fields: Record<FieldId, IFieldSnapshot> fieldOrder: FieldId[] records: Record<RecordId, IRecordSnapshot> recordOrder?: RecordId[] rowIndex?: Record<RecordId, number> rowId?: Record<number, RecordId> colIndex?: Record<FieldId, number> colId?: Record<number, FieldId> cellData?: BaseCellMatrix resources?: IBaseResources views: Record<ViewId, IViewSnapshot> viewOrder: ViewId[] primaryFieldId: FieldId}Related types: TableId · FieldId · IFieldSnapshot · RecordId · IRecordSnapshot · BaseCellMatrix · IBaseResources · ViewId · IViewSnapshot
TableId
import type { TableId } from '@univerjs/core' · Used by IBaseSnapshot · ITableSnapshot · IViewSnapshot
type TableId = stringBaseCellMatrix
import type { BaseCellMatrix } from '@univerjs/core' · Used by ITableSnapshot
type BaseCellMatrix = Record<number, Record<number, IBaseCellData>>FieldId
import type { FieldId } from '@univerjs/core' · Used by ITableSnapshot · IFieldSnapshot · IRecordSnapshot · IViewSnapshot · ISortConfig · IGroupConfig · IKanbanViewConfig · ICalendarViewConfig · IGanttViewConfig · IGalleryViewConfig · IFilterCondition · ICardLayoutConfig · IBaseViewColorCondition
type FieldId = stringIBaseResources
import type { IBaseResources } from '@univerjs/core' · Used by ITableSnapshot
interface IBaseResources { multiValueSets?: Record<string, string[]> memberSets?: Record<string, string[]> attachmentSets?: Record<string, string[]> attachments?: Record<string, Record<string, unknown>>}IFieldSnapshot
import type { IFieldSnapshot } from '@univerjs/core' · Used by ITableSnapshot
interface IFieldSnapshot { id: FieldId name: string description?: string type: BaseFieldType config: FieldConfig defaultValue?: CellValue system?: boolean readonly?: boolean}Related types: FieldId · BaseFieldType · FieldConfig · CellValue
IRecordSnapshot
import type { IRecordSnapshot } from '@univerjs/core' · Used by ITableSnapshot
interface IRecordSnapshot { id: RecordId values: Record<FieldId, CellValue> orderKey: string createdAt: number updatedAt: number createdBy?: string updatedBy?: string}Related types: RecordId · FieldId · CellValue
IViewSnapshot
import type { IViewSnapshot } from '@univerjs/core' · Used by ITableSnapshot
interface IViewSnapshot<TConfig extends ViewSpecificConfig = ViewSpecificConfig> { id: ViewId tableId: TableId name: string type: BaseViewType fieldOrder?: FieldId[] fieldSettings?: Record<FieldId, IViewFieldSetting> filter?: IFilterConfig | null sort?: ISortConfig[] group?: IGroupConfig[] config: TConfig}Related types: ViewId · TableId · BaseViewType · FieldId · IViewFieldSetting · IFilterConfig · ISortConfig · IGroupConfig
RecordId
import type { RecordId } from '@univerjs/core' · Used by ITableSnapshot · IRecordSnapshot
type RecordId = stringViewId
import type { ViewId } from '@univerjs/core' · Used by ITableSnapshot · IViewSnapshot
type ViewId = stringBaseCellValue
import type { BaseCellValue } from '@univerjs/core' · Used by IFieldSnapshot · IRecordSnapshot
type BaseCellValue = | PrimitiveCellValue | PrimitiveCellValue[] | Record<string, unknown> | Record<string, unknown>[] | nullRelated types: PrimitiveCellValue
BaseFieldType
import { BaseFieldType } from '@univerjs/core' · Used by IFieldSnapshot
enum BaseFieldType { Text = 'text', SingleSelect = 'singleSelect', MultiSelect = 'multiSelect', Person = 'person', Group = 'group', Date = 'date', Attachment = 'attachment', Number = 'number', Checkbox = 'checkbox', Link = 'link', Formula = 'formula', Numbering = 'numbering', Phone = 'phone', Email = 'email', Progress = 'progress', Currency = 'currency', Rating = 'rating', RecordLink = 'recordLink', RecordId = 'recordId', CreatedBy = 'createdBy', UpdatedBy = 'updatedBy', CreatedAt = 'createdAt', UpdatedAt = 'updatedAt',}BaseViewType
import { BaseViewType } from '@univerjs/core' · Used by IViewSnapshot
enum BaseViewType { Grid = 'grid', Kanban = 'kanban', Calendar = 'calendar', Gantt = 'gantt', Gallery = 'gallery', Pivot = 'pivot',}FieldConfig
import type { FieldConfig } from '@univerjs/core' · Used by IFieldSnapshot
type FieldConfig = Record<string, unknown>IBaseCellData
import type { IBaseCellData } from '@univerjs/core' · Used by BaseCellMatrix
interface IBaseCellData { v?: BaseCellPrimitiveValue t?: BaseCellValueType | null p?: IDocumentData | null f?: string | null si?: string | null}Related types: BaseCellPrimitiveValue · BaseCellValueType · IDocumentData
IFilterConfig
import type { IFilterConfig } from '@univerjs/core' · Used by IViewSnapshot
interface IFilterConfig { conjunction: BaseFilterConjunction conditions: IFilterCondition[]}Related types: BaseFilterConjunction · IFilterCondition
IGroupConfig
import type { IGroupConfig } from '@univerjs/core' · Used by IViewSnapshot
interface IGroupConfig { fieldId: FieldId direction?: BaseSortDirection hideEmptyGroup?: boolean}Related types: FieldId · BaseSortDirection
ISortConfig
import type { ISortConfig } from '@univerjs/core' · Used by IViewSnapshot
interface ISortConfig { fieldId: FieldId direction: BaseSortDirection}Related types: FieldId · BaseSortDirection
IViewFieldSetting
import type { IViewFieldSetting } from '@univerjs/core' · Used by IViewSnapshot
interface IViewFieldSetting { hidden?: boolean width?: number showInCard?: boolean}ViewSpecificConfig
import type { ViewSpecificConfig } from '@univerjs/core' · Used by IViewSnapshot
type ViewSpecificConfig = | IGridViewConfig | IKanbanViewConfig | ICalendarViewConfig | IGanttViewConfig | IGalleryViewConfig | (IBaseViewCommonConfig & Record<string, unknown>)Related types: IGridViewConfig · IKanbanViewConfig · ICalendarViewConfig · IGanttViewConfig · IGalleryViewConfig · IBaseViewCommonConfig
BaseCellPrimitiveValue
import type { BaseCellPrimitiveValue } from '@univerjs/core' · Used by IBaseCellData
type BaseCellPrimitiveValue = string | number | boolean | nullBaseCellValueType
import type { BaseCellValueType } from '@univerjs/core' · Used by IBaseCellData
type BaseCellValueType = CellValueTypeRelated types: CellValueType
BaseFilterConjunction
import { BaseFilterConjunction } from '@univerjs/core' · Used by IFilterConfig
enum BaseFilterConjunction { AND = 'and', OR = 'or',}BasePrimitiveCellValue
import type { BasePrimitiveCellValue } from '@univerjs/core' · Used by BaseCellValue
type BasePrimitiveCellValue = string | number | booleanBaseSortDirection
import { BaseSortDirection } from '@univerjs/core' · Used by ISortConfig · IGroupConfig
enum BaseSortDirection { ASC = 'asc', DESC = 'desc',}IBaseViewCommonConfig
import type { IBaseViewCommonConfig } from '@univerjs/core' · Used by ViewSpecificConfig · IGridViewConfig · IKanbanViewConfig · ICalendarViewConfig · IGanttViewConfig · IGalleryViewConfig
Configuration shared by every Base view type.
interface IBaseViewCommonConfig { conditionalColoring?: IBaseConditionalColoringConfig | null}Related types: IBaseConditionalColoringConfig
ICalendarViewConfig
import type { ICalendarViewConfig } from '@univerjs/core' · Used by ViewSpecificConfig
interface ICalendarViewConfig extends IBaseViewCommonConfig { startDateFieldId: FieldId endDateFieldId?: FieldId titleFieldId?: FieldId colorFieldId?: FieldId mode: 'month' | 'week' | 'day' timeslotSize?: 'short' | 'medium' | 'long' timeZone?: 'local' | string displayColor?: { type: 'custom'; color: string } | { type: 'selectField'; fieldId: FieldId } fieldSettings?: Record<FieldId, { hidden?: boolean; order?: number }>}Related types: IBaseViewCommonConfig · FieldId
IFilterCondition
import type { IFilterCondition } from '@univerjs/core' · Used by IFilterConfig
interface IFilterCondition { fieldId: FieldId operator: BaseFilterOperator operand?: unknown}Related types: FieldId · BaseFilterOperator
IGalleryViewConfig
import type { IGalleryViewConfig } from '@univerjs/core' · Used by ViewSpecificConfig
interface IGalleryViewConfig extends IBaseViewCommonConfig { card: ICardLayoutConfig coverFieldId?: FieldId | null cardLayout?: KanbanCardLayoutMode showFieldNames?: boolean fieldSettings?: Record<FieldId, IKanbanFieldCardSetting> cardSize?: 'small' | 'medium' | 'large'}Related types: IBaseViewCommonConfig · ICardLayoutConfig · FieldId · KanbanCardLayoutMode · IKanbanFieldCardSetting
IGanttViewConfig
import type { IGanttViewConfig } from '@univerjs/core' · Used by ViewSpecificConfig
interface IGanttViewConfig extends IBaseViewCommonConfig { startDateFieldId: FieldId endDateFieldId: FieldId titleFieldId?: FieldId progressFieldId?: FieldId dependencyFieldId?: FieldId scale: 'week' | 'month' | 'quarter' | 'year' leftPaneWidth?: number leftPaneCollapsed?: boolean showTodayLine?: boolean showWeekend?: boolean displayColor?: | { type: 'custom'; color: string } | { type: 'selectField'; fieldId: FieldId } | { type: 'conditional'; rules: IBaseViewColorCondition[] } fieldSettings?: Record<FieldId, { hidden?: boolean; order?: number }> workingDaysOnly?: boolean workingDays?: { weekdays: Array<1 | 2 | 3 | 4 | 5 | 6 | 7> exceptions: Array<{ id: string date: number name: string type: 'off' | 'working' }> }}Related types: IBaseViewCommonConfig · FieldId · IBaseViewColorCondition
IGridViewConfig
import type { IGridViewConfig } from '@univerjs/core' · Used by ViewSpecificConfig
interface IGridViewConfig extends IBaseViewCommonConfig { frozenFieldCount?: number showRecordIndex?: boolean rowHeight?: 'short' | 'medium' | 'tall' | 'extraTall'}Related types: IBaseViewCommonConfig
IKanbanViewConfig
import type { IKanbanViewConfig } from '@univerjs/core' · Used by ViewSpecificConfig
interface IKanbanViewConfig extends IBaseViewCommonConfig { groupFieldId: FieldId coverFieldId?: FieldId | null cardLayout?: KanbanCardLayoutMode showFieldNames?: boolean fieldSettings?: Record<FieldId, IKanbanFieldCardSetting> columnSettings?: Record<string, IKanbanColumnSetting> card?: ICardLayoutConfig}Related types: IBaseViewCommonConfig · FieldId · KanbanCardLayoutMode · IKanbanFieldCardSetting · IKanbanColumnSetting · ICardLayoutConfig
BaseFilterOperator
import { BaseFilterOperator } from '@univerjs/core' · Used by IFilterCondition
enum BaseFilterOperator { IS = 'is', IS_NOT = 'isNot', CONTAINS = 'contains', NOT_CONTAINS = 'notContains', IS_EMPTY = 'isEmpty', IS_NOT_EMPTY = 'isNotEmpty', GREATER_THAN = 'greaterThan', GREATER_THAN_OR_EQUAL = 'greaterThanOrEqual', LESS_THAN = 'lessThan', LESS_THAN_OR_EQUAL = 'lessThanOrEqual', BEFORE = 'before', AFTER = 'after',}IBaseConditionalColoringConfig
import type { IBaseConditionalColoringConfig } from '@univerjs/core' · Used by IBaseViewCommonConfig
Persisted conditional coloring configuration for one Base view.
interface IBaseConditionalColoringConfig { rules: IBaseConditionalColorRule[]}Related types: IBaseConditionalColorRule
IBaseViewColorCondition
import type { IBaseViewColorCondition } from '@univerjs/core' · Used by IGanttViewConfig · IBaseConditionalColorRule
A color condition stored by a Base view.
Rules are evaluated in array order. Earlier matching rules are painted last and therefore have higher visual priority than later matching rules.
interface IBaseViewColorCondition { id: string color: string target?: BaseConditionalColorTarget fieldId: FieldId operator: BaseConditionalColorOperator operand?: unknown dateMode?: BaseConditionalDateMode}Related types: BaseConditionalColorTarget · FieldId · BaseConditionalColorOperator · BaseConditionalDateMode
ICardLayoutConfig
import type { ICardLayoutConfig } from '@univerjs/core' · Used by IKanbanViewConfig · IGalleryViewConfig
interface ICardLayoutConfig { titleFieldId?: FieldId coverFieldId?: FieldId | null fieldIds: FieldId[]}Related types: FieldId
IKanbanColumnSetting
import type { IKanbanColumnSetting } from '@univerjs/core' · Used by IKanbanViewConfig
interface IKanbanColumnSetting { title?: string color?: string collapsed?: boolean}IKanbanFieldCardSetting
import type { IKanbanFieldCardSetting } from '@univerjs/core' · Used by IKanbanViewConfig · IGalleryViewConfig
interface IKanbanFieldCardSetting { hidden?: boolean order?: number}KanbanCardLayoutMode
import type { KanbanCardLayoutMode } from '@univerjs/core' · Used by IKanbanViewConfig · IGalleryViewConfig
type KanbanCardLayoutMode = 'normal' | 'compose'BaseConditionalColorOperator
import type { BaseConditionalColorOperator } from '@univerjs/core' · Used by IBaseViewColorCondition
type BaseConditionalColorOperator = (typeof BaseConditionalColorOperator)[keyof typeof BaseConditionalColorOperator]BaseConditionalColorTarget
import type { BaseConditionalColorTarget } from '@univerjs/core' · Used by IBaseViewColorCondition · IBaseConditionalColorRule
type BaseConditionalColorTarget = (typeof BaseConditionalColorTarget)[keyof typeof BaseConditionalColorTarget]BaseConditionalDateMode
import type { BaseConditionalDateMode } from '@univerjs/core' · Used by IBaseViewColorCondition
type BaseConditionalDateMode = (typeof BaseConditionalDateMode)[keyof typeof BaseConditionalDateMode]IBaseConditionalColorRule
import type { IBaseConditionalColorRule } from '@univerjs/core' · Used by IBaseConditionalColoringConfig
A complete Base conditional coloring rule used by Grid and other Base views.
interface IBaseConditionalColorRule extends IBaseViewColorCondition { target: BaseConditionalColorTarget}Related types: IBaseViewColorCondition · BaseConditionalColorTarget
Насколько полезно это руководство?