diff --git a/index.d.ts b/index.d.ts index c5d1efaeb..d1beb8bec 100644 --- a/index.d.ts +++ b/index.d.ts @@ -921,7 +921,7 @@ declare namespace grapesjs { * @param options - Custom options * @returns The return is defined by the command */ - runCommand(id: string, options: any): any; + runCommand(id: string, options?: Record): any; /** * Stop the command if stop method was provided * @example @@ -930,7 +930,7 @@ declare namespace grapesjs { * @param options - Custom options * @returns The return is defined by the command */ - stopCommand(id: string, options: any): any; + stopCommand(id: string, options?: Record): any; /** * Store data to the current storage * @param options - Storage options diff --git a/src/editor/index.ts b/src/editor/index.ts index 09e472afc..97c90ef0a 100644 --- a/src/editor/index.ts +++ b/src/editor/index.ts @@ -493,7 +493,7 @@ export default class EditorModule implements IBaseModule { * @example * editor.runCommand('myCommand', {someValue: 1}); */ - runCommand(id: string, options = {}) { + runCommand(id: string, options: Record = {}) { return this.em.get('Commands').run(id, options); } @@ -505,7 +505,7 @@ export default class EditorModule implements IBaseModule { * @example * editor.stopCommand('myCommand', {someValue: 1}); */ - stopCommand(id: string, options = {}) { + stopCommand(id: string, options: Record = {}) { return this.em.get('Commands').stop(id, options); }