Browse Source

Fix conflicts

pull/4685/head
Artur Arseniev 4 years ago
parent
commit
1554ef2b28
  1. 29
      index.d.ts

29
index.d.ts

@ -26,6 +26,7 @@ declare namespace Backbone {
forEach(iterator: (item: TModel) => void, context?: any): TModel[]; forEach(iterator: (item: TModel) => void, context?: any): TModel[];
filter(iterator: (item: TModel) => boolean, context?: any): TModel[]; filter(iterator: (item: TModel) => boolean, context?: any): TModel[];
map(iterator: (item: TModel) => any, context?: any): any[]; map(iterator: (item: TModel) => any, context?: any): any[];
each(callback: (item: TModel) => void);
} }
interface GenericModel extends Model<{}> { } interface GenericModel extends Model<{}> { }
@ -91,7 +92,9 @@ declare namespace grapesjs {
/** By default Grapes injects base CSS into the canvas. For example, it sets body margin to 0 /** By default Grapes injects base CSS into the canvas. For example, it sets body margin to 0
* and sets a default background color of white. This CSS is desired in most cases. * and sets a default background color of white. This CSS is desired in most cases.
* use this property if you wish to overwrite the base CSS to your own CSS. This is most * use this property if you wish to overwrite the base CSS to your own CSS. This is most
* useful if for example your template is not based off a document with 0 as body margin. */ * useful if for example your template is not based off a document with 0 as body margin.
* @deprecated in favor of `config.canvas.frameStyle`
*/
baseCss?: string; baseCss?: string;
/** CSS that could only be seen (for instance, inside the code viewer) */ /** CSS that could only be seen (for instance, inside the code viewer) */
@ -258,6 +261,8 @@ declare namespace grapesjs {
keepUnusedStyles?: 0; keepUnusedStyles?: 0;
layerManager?: LayerManagerConfig; layerManager?: LayerManagerConfig;
parser?: ParserConfig;
} }
interface AssetManagerConfig { interface AssetManagerConfig {
@ -399,6 +404,7 @@ declare namespace grapesjs {
customBadgeLabel?: Function; customBadgeLabel?: Function;
autoscrollLimit?: number; autoscrollLimit?: number;
notTextable?: Array<string>; notTextable?: Array<string>;
frameStyle?: string;
} }
interface StyleManagerConfig { interface StyleManagerConfig {
@ -537,6 +543,7 @@ declare namespace grapesjs {
statesLabel?: string; statesLabel?: string;
selectedLabel?: string; selectedLabel?: string;
states?: Array<object>; states?: Array<object>;
componentFirst?: boolean;
} }
interface DeviceManagerConfig { interface DeviceManagerConfig {
@ -630,6 +637,10 @@ declare namespace grapesjs {
extend?: any; extend?: any;
} }
interface ParserConfig {
optionsHtml?: object;
}
function init(config: EditorConfig): Editor; function init(config: EditorConfig): Editor;
interface Trait extends Backbone.Model<TraitOptions> { interface Trait extends Backbone.Model<TraitOptions> {
@ -922,11 +933,13 @@ declare namespace grapesjs {
* @param [opts.avoidUpdateStyle = false] - If the HTML string contains styles, * @param [opts.avoidUpdateStyle = false] - If the HTML string contains styles,
* by default, they will be created and, if already exist, updated. When this option * by default, they will be created and, if already exist, updated. When this option
* is true, styles already created will not be updated. * is true, styles already created will not be updated.
* @param [opts.at] - If provided, an index to insert these components at.
*/ */
addComponents( addComponents(
components: object[] | any | string, components: object[] | any | string,
opts?: { opts?: {
avoidUpdateStyle?: boolean; avoidUpdateStyle?: boolean;
at?: number;
} }
): Component[]; ): Component[];
/** /**
@ -1248,6 +1261,8 @@ declare namespace grapesjs {
* const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`; * const strHtml = editor.html`Escaped ${unsafeStr}, unescaped $${safeStr}`;
*/ */
html(literals: string[], substs: string[]): string; html(literals: string[], substs: string[]): string;
getModel(): Backbone.Model<any>;
} }
type GrapesEvent = type GrapesEvent =
@ -1339,7 +1354,7 @@ declare namespace grapesjs {
| `stop:${string}` | `stop:${string}`
| `abort:${string}`; | `abort:${string}`;
type GeneralEvent = 'canvasScroll' | 'undo' | 'redo' | 'load'; type GeneralEvent = 'canvasScroll' | 'undo' | 'redo' | 'load' | 'update';
/** /**
* You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/asset_manager/config/config.js) * You can customize the initial state of the module from the editor initialization, by passing the following [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/asset_manager/config/config.js)
@ -1645,12 +1660,12 @@ declare namespace grapesjs {
* const block = blockManager.get('BLOCK_ID'); * const block = blockManager.get('BLOCK_ID');
* blockManager.remove(block); * blockManager.remove(block);
*/ */
remove(): any; remove(block: object | string): any;
/** /**
* Get all available categories. * Get all available categories.
* It's possible to add categories only within blocks via 'add()' method * It's possible to add categories only within blocks via 'add()' method
*/ */
getCategories(): any[] | Backbone.Collection<Backbone.Model<{}>>; getCategories(): Backbone.Collection<Backbone.Model<any>>;
/** /**
* Return the Blocks container element * Return the Blocks container element
*/ */
@ -2310,7 +2325,7 @@ declare namespace grapesjs {
* *
* [Component]: component.html * [Component]: component.html
*/ */
interface Component extends Backbone.Model<ComponentModelProperties> { interface Component extends Backbone.Model<ComponentModelProperties>, Styleable {
view?: ComponentView; view?: ComponentView;
/** /**
@ -4017,7 +4032,7 @@ declare namespace grapesjs {
* const device = deviceManager.get('some-id'); * const device = deviceManager.get('some-id');
* deviceManager.select(device); * deviceManager.select(device);
*/ */
select(): void; select(device: string | any): void;
/** /**
* Get the selected device * Get the selected device
* @example * @example
@ -4423,7 +4438,7 @@ declare namespace grapesjs {
* // Remove by selector * // Remove by selector
* css.remove('.my-cls-2'); * css.remove('.my-cls-2');
*/ */
remove(): any; remove(toRemove: object | string): any;
/** /**
* Remove all rules * Remove all rules
*/ */

Loading…
Cancel
Save