From 12ca730a802177224922c2098bd34dde5a45b2fd Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 5 Nov 2022 10:50:57 +0400 Subject: [PATCH] Revert "Update block properties in d.ts" This reverts commit 2abeebd6a60cc412b56a38801f2141928ea77714. --- index.d.ts | 60 +++++++++++++----------------------------------------- 1 file changed, 14 insertions(+), 46 deletions(-) diff --git a/index.d.ts b/index.d.ts index 6f11d3f74..9e6de55d1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1630,7 +1630,7 @@ declare namespace grapesjs { * }); * @param id - Block ID */ - add(id: string, block: BlockProperties): any; + add(id: string, block: BlockOptions): any; /** * Get the block by id. * @example @@ -1707,32 +1707,14 @@ declare namespace grapesjs { ): HTMLElement; } - interface BlockCategoryProperties { - /** - * Category id. - */ - id: string; - /** - * Category label. - */ - label: string; - /** - * Category open state. - * @default true - */ - open?: boolean; - /** - * Category order. - */ - order?: string | number; - /** - * Category attributes. - * @default {} - */ - attributes?: Record; + interface BlockCategoryOptions { + id: string, + label: string, + open?: boolean, + attributes?: Record, } - interface BlockProperties { + interface BlockOptions { /** * Block label, eg. `My block` */ @@ -1743,54 +1725,40 @@ declare namespace grapesjs { content: string | any; /** * HTML string for the media/icon of the block, eg. ` editor.getWrapper().append(block.get('content')) + * Custom behavior on click, eg. `(block, editor) => editor.getWrapper().append(block.get('content'))` */ - onClick?: (block: Block, editor: Editor) => void; + onClick?: (...params: any[]) => any; /** * Block attributes */ attributes?: Record; - - id?: string; - - /** - * @deprecated - */ - activeOnRender?: boolean; } - - interface Block extends Backbone.Model { + interface Block extends Backbone.Model { /** * Get block id */