Facade API
Learn how to use Facade API in a Univer Bases application.
Facade API provides an application-facing layer over the Bases model. Use it for common operations such as creating bases, tables, fields, records, views, filters, sorts, groups, selections, and UI navigation.
Caution
Base model mutations are synchronous. UI activation methods return promises and should be awaited.
Enable facade entries
Import the facade entry for every Bases capability used by your application:
TypeScript
import { FUniver } from '@univerjs/core/facade'import '@univerjs-pro/bases/facade'import '@univerjs-pro/bases-ui/facade'Create the API object after the Univer instance and required plugins are registered:
TypeScript
const univerAPI = FUniver.newAPI(univer)Next steps
The Facade extensions are now enabled. Continue with:
- General API for shared commands, events, undo and redo, UI extensions, networking, enums, and utilities.
- Univer Bases API for creating and reading Bases and working with their model and UI state.
- Bases facade reference for the complete method reference.
How is this guide?