Browse Source

Revert "Update block properties in d.ts"

This reverts commit 2abeebd6a6.
pull/4746/head
Artur Arseniev 4 years ago
parent
commit
12ca730a80
  1. 60
      index.d.ts

60
index.d.ts

@ -1630,7 +1630,7 @@ declare namespace grapesjs {
* }); * });
* @param id - Block ID * @param id - Block ID
*/ */
add(id: string, block: BlockProperties): any; add(id: string, block: BlockOptions): any;
/** /**
* Get the block by id. * Get the block by id.
* @example * @example
@ -1707,32 +1707,14 @@ declare namespace grapesjs {
): HTMLElement; ): HTMLElement;
} }
interface BlockCategoryProperties { interface BlockCategoryOptions {
/** id: string,
* Category id. label: string,
*/ open?: boolean,
id: string; attributes?: Record<string, any>,
/**
* Category label.
*/
label: string;
/**
* Category open state.
* @default true
*/
open?: boolean;
/**
* Category order.
*/
order?: string | number;
/**
* Category attributes.
* @default {}
*/
attributes?: Record<string, any>;
} }
interface BlockProperties { interface BlockOptions {
/** /**
* Block label, eg. `My block` * Block label, eg. `My block`
*/ */
@ -1743,54 +1725,40 @@ declare namespace grapesjs {
content: string | any; content: string | any;
/** /**
* HTML string for the media/icon of the block, eg. `<svg ...`, `<img ...`, etc. * HTML string for the media/icon of the block, eg. `<svg ...`, `<img ...`, etc.
* @default '' * @defaultValue ''
*/ */
media?: string; media?: string;
/** /**
* Block category, eg. `Basic blocks` * Block category, eg. `Basic blocks`
* @default '' * @defaultValue ''
*/ */
category?: string | BlockCategoryProperties; category?: string | BlockCategoryOptions;
/** /**
* If true, triggers the `active` event on the dropped component. * If true, triggers the `active` event on the dropped component.
* @default false
*/ */
activate?: boolean; activate?: boolean;
/** /**
* If true, the dropped component will be selected. * If true, the dropped component will be selected.
* @default false
*/ */
select?: boolean; select?: boolean;
/** /**
* If true, all IDs of dropped components and their styles will be changed. * If true, all IDs of dropped components and their styles will be changed.
* @default false
*/ */
resetId?: boolean; resetId?: boolean;
/** /**
* Disable the block from being interacted. * Disable the block from being interacted
* @default false
*/ */
disable?: boolean; disable?: boolean;
/** /**
* Custom behavior on click. * Custom behavior on click, eg. `(block, editor) => editor.getWrapper().append(block.get('content'))`
* @example
* onClick: (block, editor) => editor.getWrapper().append(block.get('content'))
*/ */
onClick?: (block: Block, editor: Editor) => void; onClick?: (...params: any[]) => any;
/** /**
* Block attributes * Block attributes
*/ */
attributes?: Record<string, any>; attributes?: Record<string, any>;
id?: string;
/**
* @deprecated
*/
activeOnRender?: boolean;
} }
interface Block extends Backbone.Model<BlockOptions> {
interface Block extends Backbone.Model<BlockProperties> {
/** /**
* Get block id * Get block id
*/ */

Loading…
Cancel
Save