Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
chore(core): add getUniver api
Dushusirac4b58984d9b
diff --git a/examples/univer-sheet-ts/src/main.tsx b/examples/univer-sheet-ts/src/main.tsxindex e6bfa84ef4..e4e325a274 100644--- a/examples/univer-sheet-ts/src/main.tsx+++ b/examples/univer-sheet-ts/src/main.tsx@@ -43,9 +43,9 @@ const uiDefaultConfigDemo = {};const univer = new Univer();-univer.installPlugin(new RenderEngine());-univer.installPlugin(new UniverComponentSheet());-univer.installPlugin(new BaseComponentPlugin());+univer.install(new RenderEngine());+univer.install(new UniverComponentSheet());+univer.install(new BaseComponentPlugin());// const univerSheetDemo = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA_DEMO);// const univerSheetDemo = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA_DEMO1);// const univerSheetDemo = UniverSheet.newInstance(DEFAULT_WORKBOOK_DATA_DEMO2);diff --git a/packages/core/src/Basics/ContextBase.ts b/packages/core/src/Basics/ContextBase.tsindex fcc367e4ce..9816ea0667 100644--- a/packages/core/src/Basics/ContextBase.ts+++ b/packages/core/src/Basics/ContextBase.ts@@ -69,4 +69,8 @@ export abstract class ContextBase {getCommandManager(): CommandManager {return this._commandManager;}++ getUniver(): Univer {+ return this._univer;+ }}diff --git a/packages/core/src/Basics/Univer.ts b/packages/core/src/Basics/Univer.tsindex 0f9187f3d0..85bf966100 100644--- a/packages/core/src/Basics/Univer.ts+++ b/packages/core/src/Basics/Univer.ts@@ -58,7 +58,7 @@ export class Univer {** @param plugin - install plugin*/- installPlugin(plugin: Plugin): void {+ install(plugin: Plugin): void {this._context.getPluginManager().install(plugin);}@@ -67,7 +67,7 @@ export class Univer {** @param name - plugin name*/- uninstallPlugin(name: string): void {+ uninstall(name: string): void {this._context.getPluginManager().uninstall(name);}}