Common enums
Common named values for content, layout, and Univer initialization.
Import these enums from @univerjs/core. Their names make code easier to read than the numeric values stored in snapshots.
| Purpose | Enum |
|---|---|
| Cell value interpretation | CellValueType |
| Numeric boolean flags in snapshots | BooleanNumber |
| Cell and text alignment | HorizontalAlign · VerticalAlign |
| Text wrapping and borders | WrapStrategy · BorderStyleTypes |
| Initialization progress | LifecycleStages |
| Unit creation | UniverInstanceType |
| Locale and logging | LocaleType · LogLevel |
For feature-specific values exposed as univerAPI.Enum, browse the complete Facade enum catalog. It includes values for validation, filtering, charts, shapes, Slides, Boards, Bases, and other loaded plugins.
TypeScript
import { WrapStrategy } from '@univerjs/core'const sheet = univerAPI.getActiveWorkbook()?.getActiveSheet()if (!sheet) throw new Error('No active worksheet')sheet.getRange('A1:B4').setWrapStrategy(WrapStrategy.WRAP)How is this guide?