FUniverCollaborationClientMixin
| packages | @univerjs-pro/collaboration-client |
|---|
APIs
_initialize
Signature
_initialize(injector: Injector): voidgetCollaboration
Get the collaboration instance to manage the collaboration issue of the current univer.
Signature
getCollaboration(): FCollaborationReturns
- (
FCollaboration) — The collaboration instance.
Examples
const collaboration = univerAPI.getCollaboration()loadServerUnit
Load the server unit by the given unit id and unit type.
Signature
loadServerUnit(unitId: string, unitType: UniverInstanceType, subUnitId?: string): Promise<UnitModel | null>Parameters
unitId(string) — The unit id.unitType(UniverInstanceType) — The unit type.subUnitId(string) — The sub unit id.
Returns
- (
Promise<UnitModel | null>) — The promise with the unit model.
Examples
const unitModel = await univerAPI.loadServerUnit('unitId', univerAPI.Enum.UniverInstanceType.UNIVER_SHEET)
console.log(unitModel, unitModel?.getSnapshot())loadServerUnitOfRevision
Load the server unit by the given unit id, unit type and revision.
Signature
loadServerUnitOfRevision(unitId: string, unitType: UniverInstanceType, rev: number): Promise<UnitModel | null>Parameters
unitId(string) — The unit id.unitType(UniverInstanceType) — The unit type.rev(number) — The revision number.
Returns
- (
Promise<UnitModel | null>) — The promise with the unit model.
Examples
const unitModel = await univerAPI.loadServerUnitOfRevision('unitId', univerAPI.Enum.UniverInstanceType.UNIVER_SHEET, 1)
console.log(unitModel, unitModel?.getSnapshot())