Skip to content

Commit

Permalink
feat(core): add registerPlugin config types (#1484)
Browse files Browse the repository at this point in the history
* fix(docs): remove deprecated property `standalone`

* feat(engine-formula): make IUniverFormulaEngine.function optional

* feat(core): add registerPlugin config types
  • Loading branch information
gityoog authored and Jocs committed Mar 23, 2024
1 parent 37b6253 commit 24d950a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions examples/src/docs/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ univer.registerPlugin(UniverUIPlugin, {
container: 'app',
header: true,
});
univer.registerPlugin(UniverDocsPlugin, {
standalone: true,
});
univer.registerPlugin(UniverDocsPlugin);
univer.registerPlugin(UniverDocsUIPlugin, {
container: 'univerdoc',
layout: {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/basics/univer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export class Univer extends PluginHolder {
// #region register plugins

/** Register a plugin into univer. */
registerPlugin<T extends Plugin>(plugin: PluginCtor<T>, config?: any): void {
registerPlugin<T extends PluginCtor<Plugin>>(plugin: T, config?: ConstructorParameters<T>[0]): void {
if (plugin.type === PluginType.Univer) {
this._registerUniverPlugin(plugin, config);
} else if (plugin.type === PluginType.Sheet) {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine-formula/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const PLUGIN_NAME = 'base-formula-engine';

interface IUniverFormulaEngine {
notExecuteFormula?: boolean;
function: Array<[Ctor<BaseFunction>, IFunctionNames]>;
function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
}

export class UniverFormulaEnginePlugin extends Plugin {
Expand Down

0 comments on commit 24d950a

Please sign in to comment.