API Reference
@univerjs
@univerjs/core
Readme

@univerjs/core v0.1.17Docs


@univerjs/core

Namespaces

NamespaceDescription
JSON1-

Enumerations

EnumerationDescription
AbsoluteRefTypenone: A1 row: A$1 column: $A1 all: $A$1
AlignTypeH-
AlignTypeV-
ArrangeTypeEnum-
ArrowsAndMarkersShapes-
AutoFillSeriesCopyright 2023-present DreamNum Inc.
BaselineOffset-
BasicShapesCopyright 2023-present DreamNum Inc.
BlockTypeType of block
BooleanNumberGeneral Boolean Enum
BorderStyleTypesCopyright 2023-present DreamNum Inc.
BorderType-
BulletAlignmentThe types of alignment for a bullet.
CellValueTypeGeneral Boolean Enum
ColorTypeCopyright 2023-present DreamNum Inc.
ColumnSeparatorTypeThe style of column separators between columns.
CommandType-
CommonHideTypesCopyright 2023-present DreamNum Inc.
ContentAlignmentThe content alignments for a Shape or TableCell. The supported alignments correspond to predefined text anchoring types from the ECMA-376 standard.
CopyPasteTypeCopyright 2023-present DreamNum Inc.
CustomRangeType-
DashStyleTypeThe kinds of dashes with which linear geometry can be rendered.
DataStreamTreeNodeTypeCopyright 2023-present DreamNum Inc.
DataStreamTreeTokenType-
DataValidationErrorStyleCopyright 2023-present DreamNum Inc.
DataValidationImeModeCopyright 2023-present DreamNum Inc.
DataValidationOperatorCopyright 2023-present DreamNum Inc.
DataValidationRenderModeCopyright 2023-present DreamNum Inc.
DataValidationStatusCopyright 2023-present DreamNum Inc.
DataValidationTypeCopyright 2023-present DreamNum Inc.
DeveloperMetadataVisibilityCopyright 2023-present DreamNum Inc.
DimensionCopyright 2023-present DreamNum Inc.
DirectionCopyright 2023-present DreamNum Inc.
DocStyleType-
DrawingTypeEnum-
EXTENSION_NAMESCopyright 2023-present DreamNum Inc.
FollowNumberWithTypeFollow the space after the list
FontItalicFontItalic
FontStyleTypeTypes of font style
FontWeightFontWeight
FormatTypeCopyright 2023-present DreamNum Inc.
GlyphTypeAn enumeration of the supported glyph types.
GridType-
HorizontalAlignAn enum that specifies the horizontal alignment of text.
InterpolationPointTypeCopyright 2023-present DreamNum Inc.
LifecycleStagesThis enum defines multiple lifecycle stages in Univer SDK.
LocaleTypeCopyright 2023-present DreamNum Inc.
LogLevel-
NamedStyleTypeTypes of name style
NumberUnitType-
ObjectRelativeFromH-
ObjectRelativeFromV-
OtherShapes-
PageElementType-
PageOrientTypePaper orientation, whether it's portrait (vertical) or landscape (horizontal)
PageType-
ParagraphElementType-
PermissionStatus-
PositionedObjectLayoutTypeThe possible layouts of a [PositionedObject]
PresetListType-
ProtectionTypeCopyright 2023-present DreamNum Inc.
RANGE_TYPECopyright 2023-present DreamNum Inc.
RelativeDateCopyright 2023-present DreamNum Inc.
RelativeSlideLink-
SectionTypeRepresents how the start of the current section is positioned relative to the previous section.
SheetTypesCopyright 2023-present DreamNum Inc.
SpacingRule-
SpecialShapes-
TabStopAlignmentThe alignment of the tab stop.
TextDecorationTypes of text decoration
TextDirectionCopyright 2023-present DreamNum Inc.
TextDirectionTypeDirection of text
TextXActionType-
ThemeColorTypeCopyright 2023-present DreamNum Inc.
ThemeColors-
UniverInstanceType-
UpdateDocsAttributeTypeCopyright 2023-present DreamNum Inc.
VerticalAlignAn enum that specifies the vertical alignment of text.
WidthTypeType of width
WrapStrategyAn enumeration of the strategies used to handle cell text wrapping.
WrapTextTypeTypes of wrap text
characterSpacingControlType-

Classes

ClassDescription
ActionIterator-
AuthzIoLocalServiceDo not use the mock implementation in a production environment as it is a minimal version.
ClientSnapshotServerServiceThe server needs to fully implement all interfaces, but when used by the client, use saveSheetBlock to cache the sheet block locally, and use getSheetBlock to obtain the sheet block.
Color-
ColorBuilder-
ColorKit-
CommandService-
ConfigService-
ContextService-
DesktopLogService-
Disposable-
DisposableCollection-
DocumentDataModel-
Entry-
EntryIterator-
ErrorService-
EventStateA class serves as a medium between the observable and its observers
EventSubjectThis is a custom implementation of RxJS subject. It handles events on canvas elements. In addition to the event, it also emits a state object that can be used to controls the propagation of the event.
HLSColor-
InterceptorManager-
JSONX-
KeyIterator-
LRUHelperCopyright 2023-present DreamNum Inc.
LRUMap-
LifecycleInitializerServiceThis service is used to initialize modules on a certain lifecycle stage. Refer to runOnLifecycle and OnLifecycle for more details.
LifecycleServiceThis service controls the lifecycle of a Univer instance. Other modules can inject this service to read the current lifecycle stage or subscribe to lifecycle changes.
LocalUndoRedoServiceThis UndoRedoService is local.
LocaleServiceThis service provides i18n and timezone / location features to other modules.
MemoryCursorCopyright 2023-present DreamNum Inc.
ObjectMatrixA two-dimensional array represented by a two-level deep object and provides an array-like API
PermissionService-
PluginPlug-in base class, all plug-ins must inherit from this base class. Provide basic methods.
PluginServiceThis service manages plugin registration.
RangeAccess and modify spreadsheet ranges.
RectangleThis class provides a set of methods to calculate IRange.
RefAliasCopyright 2023-present DreamNum Inc.
RegistryCopyright 2023-present DreamNum Inc.
RegistryAsMapAdd extension modules statically when the plugin is initialized, so that the plugin can register these extension modules uniformly
ResourceManagerService-
RgbColor-
RxDisposable-
SheetViewModel-
SlideDataModel-
StylesStyles in a workbook, cells locate styles based on style IDs
TextX-
ThemeColor-
ThemeService-
ToolsUniversal tool library
UnitModel-
Univer-
UniverInstanceServiceIUniverInstanceService holds all the current univer instances and provides a set of methods to add and remove univer instances.
UserManagerService-
ValueIterator-
WorkbookAccess and create Univer Sheets files
WorksheetThe model of a Worksheet.

Interfaces

InterfaceDescription
ClassClass type
IAbsoluteTransformCopyright 2023-present DreamNum Inc.
IAuthzIoService-
IBorderDataStyle properties of top, bottom, left and right border
IBorderStyleDataStyle properties of border
IBulletProperties of list
ICellCustomRender-
ICellDataCell data
ICellDataForSheetInterceptorCell data
ICellMarks-
ICellMarksStyle-
ICellRenderContext-
IChartPropertiesChartProperties
IColorFormat of RBGA color
IColorStyleRGB color or theme color
IColumnDataProperties of column data
ICommand-
ICommandInfoThe command info, only a command id and responsible params
ICommandService-
IConfigService-
IContextService-
ICopyToOptionsDataOption of copyTo function
ICropPropertiesProperties of crop image
ICustomBlockCustom Block
ICustomRange-
IDataValidationRule-
IDataValidationRuleBase-
IDataValidationRuleInfo-
IDataValidationRuleOptions-
IDeleteActionDelete mutation is used to delete text at the given position.
IDocDrawingBaseProperties of Drawing 20.4.2.8 inline (Inline DrawingML Object) 20.4.2.15 wrapNone (No Text Wrapping) 20.4.2.16 wrapPolygon (Wrapping Polygon) 20.4.2.17 wrapSquare (Square Wrapping) 20.4.2.18 wrapThrough (Through Wrapping) 20.4.2.19 wrapTight (Tight Wrapping) 20.4.2.20 wrapTopAndBottom (Top and Bottom Wrapping)
IDocDrawingPositionProperties of a draw object
IDocStyle-
IDocStyleBaseBasics properties of doc style
IDocStylesSet of IStyles
IDocsBorderProperties of doc border
IDocumentBodyProperties of document body Contain three update types: range overlay, range mutual exclusion, and placeholder \v COLUMN_BREAK \f PAGE_BREAK \0 DOCS_END \t TAB
IDocumentDataProperties of document
IDocumentLayout-
IDocumentRenderConfigthe alignment mode is returned with respect to the offset of the sheet cell, because the document needs to render the layout for cells and support alignment across multiple cells (e.g., horizontal alignment of long text in overflow mode). The alignment mode of the document itself cannot meet this requirement, so an additional renderConfig needs to be added during the rendering of the document component. This means that there are two coexisting alignment modes. In certain cases, such as in an editor, conflicts may arise, requiring only one alignment mode to be retained. By removing the relevant configurations in renderConfig, the alignment mode of the sheet cell can be modified. The alternative alignment mode is applied to paragraphs within the document.
IDocumentSettings-
IDocumentStyleBasics properties of doc style
IDrawingParam-
IDrawingSearch-
IDrawingSpace-
IDrawingsSet of Drawings
IError-
IEventObserver-
IExecutionOptions-
IFooterDataProperties of doc footer
IFootersSet of footer
IFreezeCopyright 2023-present DreamNum Inc.
IGridRangeRange data of grid
IHeaderAndFooterBase-
IHeaderDataProperties of doc header
IHeadersSet of headers
IHyperlink-
IImage-
IImagePropertiesCopyright 2023-present DreamNum Inc.
IIndentStart-
IInsertActionInsert mutation is used to insert text (maybe with rich text properties) at the given position.
IInterceptor-
IKeyTypeCustom type of key
IKeyValueKey value object
ILanguagePack-
IListDataThe properties of a list which describe the look and feel of bullets belonging to paragraphs associated with a list.
IListsSet of lists
ILocalStorageService-
ILocales-
ILogContextCopyright 2023-present DreamNum Inc.
ILogService-
IMargin-
IMultiCommand-
IMutationMutation would change the model of Univer applications.
IMutationCommonParams-
IMutationInfo-
INestingLevelContains properties describing the look and feel of a list bullet at a given level of nesting.
INumberUnit-
IObjectArrayPrimitiveType-
IObjectMatrixPrimitiveTypeObject Matrix Primitive Type
IObjectPositionH-
IObjectPositionV-
IOffset-
IOperationOperation would change the state of Univer applications. State should only be in memory and does not require conflicting resolution.
IOperationInfo-
IOptionDataWhether to clear only the contents. Whether to clear only the format; note that clearing format also clears data validation rules.
IOutline-
IPaddingDataTop,right,bottom,left padding
IPageElement-
IParagraph-
IParagraphBorderProperties of paragraph border
IParagraphStyleProperties of paragraph style
IPermissionParam-
IPermissionPoint-
IPermissionService-
IPermissionTypes-
IPlaceholder-
IPositionProperties of selection data
IRangeRange data structure
IRangeArrayDataOne of the range types,
IRangeCellDataThe row and column numbers represent a cell
IRangeWithCoordProperties of selection data
IRectLTRB-
IReferenceSource-
IResourceHook-
IResourceLoaderService-
IResourceManagerService-
IRetainActionRetain mutation is used to move the cursor or to update properties of the text in the given range.
IRgbColorCopyright 2023-present DreamNum Inc.
IRichTextProps-
IRotationSkewFlipTransform-
IRowAutoHeightInfo-
IRowColIterCopyright 2023-present DreamNum Inc.
IRowDataProperties of row data
IRowRange-
IScale-
ISectionBreakProperties of section break
ISectionBreakBase-
ISectionColumnPropertiesProperties of section column
ISelection-
ISelectionCellRange data structure
ISelectionCellWithCoordProperties of selection data
ISelectionWithCoord-
ISequenceExecuteResultCopyright 2023-present DreamNum Inc.
IServiceDataCopyright 2023-present DreamNum Inc.
IShadingProperties of shading
IShapeIShape
IShapePropertiesShapeProperties
ISheetDataValidationRule-
ISingleCell-
ISizeCopyright 2023-present DreamNum Inc.
ISlideData-
ISlidePage-
ISnapshotServerService-
ISrcRect-
IStyleBaseBasics properties of cell style
IStyleDataProperties of cell style
IStyleSheet-
ITabStopA tab stop within a paragraph.
ITableProperties of table
ITableCellProperties of table cell
ITableCellBorderProperties of cell border
ITableCellStyleProperties of style of table cell
ITableOfContent-
ITableRowProperties of row of table
ITableRowStyleProperties of style table row
ITextDecorationProperties of text decoration
ITextRange-
ITextRangeParam-
ITextRangeStart-
ITextRotation-
ITextRunA ParagraphElement that represents a run of text that all has the same styling.
ITextStyleProperties of text style
ITransformState-
IUndoRedoCommandInfos-
IUndoRedoCommandInfosByInterceptor-
IUndoRedoItem-
IUndoRedoService-
IUndoRedoStatus-
IUnitRangeRange data of Unit
IUnitRangeName-
IUnitRangeWithNameRange data of Unit
IUniverData-
IUniverInstanceServiceIUniverInstanceService holds all the current univer instances and provides a set of methods to add and remove univer instances.
IUser-
IWorkbookDataProperties of a workbook's configuration
IWorksheetDataSnapshot of a worksheet.
IWorksheetOrderDataCopyright 2023-present DreamNum Inc.

Type Aliases

Type aliasDescription
AsyncFunction-
CellValueCell value type
CommandListener-
DependencyOverrideOverrides the dependencies defined in the plugin. Only dependencies that are identified by IdentifierDecorator can be overridden. If you override a dependency with null, the original dependency will be removed.
DrawingType-
IColumnStartEndDataColumn data type
IComposeInterceptors-
IRangeStringDataOne of the range types,
IRangeTyperange types
IRowStartEndDataRow data type
InterceptorHandler-
LanguageValueCopyright 2023-present DreamNum Inc.
LocaleTypes-
NoNeedCheckedTypewrap any
NullableCopyright 2023-present DreamNum Inc.
PluginCtor-
PresetGeometryType-
ShapeType20.1.9.18 prstGeom (Preset geometry)
TPriority-
TextXAction-
UnitType-
WorkbookPermissionPointConstructor-

Variables

VariableDescription
COLORS-
DEFAULT_CELLUsed as an init cell return value
DEFAULT_DOC-
DEFAULT_DOCUMENT_SUB_COMPONENT_IDCopyright 2023-present DreamNum Inc.
DEFAULT_EMPTY_DOCUMENT_VALUE-
DEFAULT_RANGEUsed as an illegal range return value
DEFAULT_RANGE_ARRAYUsed as an illegal range array return value
DEFAULT_SELECTIONUsed as an init selection return value
DEFAULT_SLIDE-
DEFAULT_STYLESDefault styles.
DEFAULT_WORKSHEET_COLUMN_COUNT-
DEFAULT_WORKSHEET_COLUMN_COUNT_KEY-
DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT-
DEFAULT_WORKSHEET_COLUMN_TITLE_HEIGHT_KEY-
DEFAULT_WORKSHEET_COLUMN_WIDTH-
DEFAULT_WORKSHEET_COLUMN_WIDTH_KEY-
DEFAULT_WORKSHEET_ROW_COUNT-
DEFAULT_WORKSHEET_ROW_COUNT_KEY-
DEFAULT_WORKSHEET_ROW_HEIGHT-
DEFAULT_WORKSHEET_ROW_HEIGHT_KEY-
DEFAULT_WORKSHEET_ROW_TITLE_WIDTH-
DEFAULT_WORKSHEET_ROW_TITLE_WIDTH_KEY-
DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY-
DOCS_NORMAL_EDITOR_UNIT_ID_KEY-
EDITOR_ACTIVATED-
FOCUSING_COMMON_DRAWINGSThe focusing state of the common drawings.
FOCUSING_DOC-
FOCUSING_EDITOR_BUT_HIDDEN-
FOCUSING_EDITOR_INPUT_FORMULA-
FOCUSING_EDITOR_STANDALONE-
FOCUSING_FORMULA_EDITORThe focusing state of the formula editor (Fx bar).
FOCUSING_SHEETCopyright 2023-present DreamNum Inc.
FOCUSING_SLIDE-
FOCUSING_UNIVER_EDITOR-
FOCUSING_UNIVER_EDITOR_STANDALONE_SINGLE_MODE-
MOVE_BUFFER_VALUE-
NilCommand-
PRESET_LIST_TYPE-
RGBA_PAREN-
RGB_PAREN-
ROTATE_BUFFER_VALUE-
RedoCommand-
RedoCommandId-
THEME_COLORS-
UndoCommand-
UndoCommandId-
skipParseTagNamesCopyright 2023-present DreamNum Inc.
textDecoder-
textEncoder-

Functions

FunctionDescription
ABCToNumberCopyright 2023-present DreamNum Inc.
DependentOnUse this decorator to declare dependencies among plugins. If a dependent plugin is not registered yet, Univer will automatically register it with no configuration.
IAuthzIoService-
ICommandService-
IConfigService-
IContextService-
ILocalStorageService-
ILogService-
IPermissionService-
IResourceLoaderService-
IResourceManagerService-
ISnapshotServerService-
IUndoRedoService-
IUniverInstanceService-
OnLifecycleRegister the decorated class to be automatically instantiated when Univer progresses to the certain lifecycle stage.
afterInitApply-
b64DecodeUnicode-
b64EncodeUnicodeCopyright 2023-present DreamNum Inc.
binarySearchArrayCopyright 2023-present DreamNum Inc.
cellToRangeCovert row/column to range object
checkForSubstrings-
checkIfMove-
checkParagraphHasBullet-
checkParagraphHasIndent-
checkParagraphHasIndentByStyle-
codeToBlobCopyright 2023-present DreamNum Inc.
composeBody-
composeInterceptors-
concatMatrixArray-
convertBodyToHtml-
covertTextRunToHtml-
createDefaultUser-
createInterceptorKey-
createInternalEditorID-
createRowColIter-
debounceCreates a debounced function that delays invoking the provided function until after wait milliseconds have elapsed since the last time the debounced function was invoked.
dedupeDeduplicate an array.
deepCompare-
deleteContent-
extractPureTextFromCellGet pure text in a cell.
fromCallbackCreates an observable from a callback function.
fromObservable-
generateTemporarySnap-
getArrayLength-
getBodySlice-
getBodySliceHtml-
getBorderStyleType-
getCellInfoInMergeDataDetermines whether the cell(row, column) is within the range of the merged cells.
getCellValueType-
getColorStyle-
getDocsUpdateBody-
getReverseDirection-
getSheetBlocksFromSnapshot-
getWorksheetUID-
groupBy-
handleJsonToDomConvert rich text json to DOM
handleStyleToStringtransform style object to string
hashAlgorithmCopyright 2023-present DreamNum Inc.
horizontalLineSegmentsSubtraction-
insertMatrixArray-
insertTextToContent-
isBlackColor-
isBooleanStringCopyright 2023-present DreamNum Inc.
isCellCoverable-
isCellV-
isEmptyCell-
isFormulaIdany string
isFormulaStringA string starting with an equal sign is a formula
isICellData-
isInternalEditorID-
isNullCell-
isNumericCopyright 2023-present DreamNum Inc.
isRangesEqual-
isRealNumDetermine whether it is a pure number, "12" and "12e+3" are both true
isSafeNumeric-
isSameStyleTextRun-
isUnitRangesEqual-
isValidRange-
isWhiteColor-
makeArray-
makeCellRangeToRangeData-
makeCellToSelection-
mergeOverrideWithDependencies-
mergeSetsMerge the second set to the first set.
mergeWorksheetSnapshotWithDefaultThis function is used to merge the user passed in snapshot with the default snapshot without changing the user's snapshot's reference.
moveMatrixArray-
moveRangeByOffset-
normalizeTextRuns-
numberToABCcolumn subscript number to letters
numberToListABCColumn subscript numbers are converted to list-style letters, for example, after 25, it means AA BB CC, not AA AB AC
orderSearchArray-
queryObjectMatrix-
removeCopyright 2023-present DreamNum Inc.
repeatStringNumTimesRepeats the given string (first argument) num times (second argument). If num is not positive, an empty string is returned.
replaceInDocumentBody-
requestImmediateMacroTaskCopyright 2023-present DreamNum Inc.
rotateRotate an array without mutating the original array.
runOnLifecycleRegister a dependency to be automatically instantiated when Univer progresses to the certain lifecycle stage.
searchArray-
selectionToArrayTransform an IRange object to an array.
sequenceExecute tasks in sequence, if one of the tasks return false, the sequence will be stopped.
sequenceAsyncExecute promise tasks in sequence, if one of the tasks return false, the sequence will be stopped.
sequenceExecute-
sequenceExecuteAsync-
shallowEqual-
sliceMatrixArray-
sortRulesCopyright 2023-present DreamNum Inc.
sortRulesByDesc-
sortRulesFactory-
spliceArray-
throttleCopyright 2023-present DreamNum Inc.
toDisposable-
transformDocumentDataToSnapshot-
transformSnapshotToDocumentData-
transformSnapshotToWorkbookDataAssemble a snapshot to a workbook.
transformWorkbookDataToSnapshot-

Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.