From 6fbd1fe6e113d50d86d57d06d92b7c9394659f25 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 19 Apr 2022 14:30:58 +0200 Subject: [PATCH] Up types --- index.d.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index eade409e2..ed03f0935 100644 --- a/index.d.ts +++ b/index.d.ts @@ -29,6 +29,10 @@ declare namespace Backbone { } declare module grapesjs { + type PluginOptions = Record; + + type Plugin = (editor: Editor, config: T) => void; + interface EditorConfig { /** Selector which indicates where render the editor */ container?: string | HTMLElement; @@ -37,7 +41,7 @@ declare module grapesjs { autorender?: boolean; /** Array of plugins to execute on start */ - plugins?: any[]; + plugins?: (string | Plugin)[]; /** Custom options for plugins */ pluginsOpts?: Record; @@ -3626,7 +3630,7 @@ declare module grapesjs { * @param storage.load - Load method * @param storage.store - Store method */ - add(id: string, storage: IStorage): this; + add(id: string, storage: IStorage): this; /** * Returns storage by id * @param id - Storage ID @@ -3684,9 +3688,9 @@ declare module grapesjs { } - interface IStorage { - load: (options: StorageOptions) => Promise; - store: (data: ProjectData, options: StorageOptions) => Promise; + interface IStorage { + load: (options: T) => Promise; + store: (data: ProjectData, options: T) => Promise; } /**