Browse Source

Update storage manager types

pull/4234/head
Ju99ernaut 5 years ago
parent
commit
a4f101af0b
  1. 45
      index.d.ts

45
index.d.ts

@ -1,5 +1,5 @@
declare namespace Backbone { declare namespace Backbone {
interface ModelProperties {} interface ModelProperties { }
class Model<T extends ModelProperties> { class Model<T extends ModelProperties> {
constructor(attr?: T, opt?: any); constructor(attr?: T, opt?: any);
@ -25,7 +25,7 @@ declare namespace Backbone {
reset(models?: Array<{} | TModel>): TModel[]; reset(models?: Array<{} | TModel>): TModel[];
} }
interface GenericModel extends Model<{}> {} interface GenericModel extends Model<{}> { }
} }
declare module grapesjs { declare module grapesjs {
@ -319,22 +319,33 @@ declare module grapesjs {
id?: string; id?: string;
autosave?: boolean; autosave?: boolean;
autoload?: boolean; autoload?: boolean;
type?: "local" | "remote"; type?: string;
stepsBeforeSave?: number; stepsBeforeSave?: number;
storeComponents?: boolean; recovery?: boolean | Function;
storeStyles?: boolean; onStore?: (data: any) => any;
storeHtml?: boolean; onLoad?: (data: any) => any;
storeCss?: boolean; options: {
local: LocalStorageConfig;
remote: RemoteStorageConfig;
[key: string]: any;
};
}
interface LocalStorageConfig {
key?: string;
checkLocal?: boolean; checkLocal?: boolean;
}
interface RemoteStorageConfig {
params?: object; params?: object;
headers?: object; headers?: object;
urlStore?: string; urlStore?: string;
urlLoad?: string; urlLoad?: string;
contentTypeJson?: boolean; contentTypeJson?: boolean;
credentials?: RequestCredentials; credentials?: RequestCredentials;
fetchOptions: string | ((opts: object) => object);
beforeSend(jqXHR: any, settings: object): void; onStore?: (data: any) => any;
onComplete(jqXHR: any, status: any): void; onLoad?: (data: any) => any;
} }
interface DomComponentsConfig { interface DomComponentsConfig {
@ -454,9 +465,9 @@ declare module grapesjs {
buttons: Button[]; buttons: Button[];
} }
interface Panel extends Backbone.Model<PanelOptions> {} interface Panel extends Backbone.Model<PanelOptions> { }
interface Button extends Backbone.Model<ButtonOptions> {} interface Button extends Backbone.Model<ButtonOptions> { }
interface ButtonOptions { interface ButtonOptions {
id: string; id: string;
@ -486,7 +497,7 @@ declare module grapesjs {
}): void; }): void;
} }
interface View {} interface View { }
interface LayerManager { interface LayerManager {
/** /**
@ -3642,6 +3653,12 @@ declare module grapesjs {
* Get current storage * Get current storage
*/ */
getCurrentStorage(): IStorage; getCurrentStorage(): IStorage;
/**
* Get storage options by type.
* @param type Storage type
* @returns Storage Options
* */
getStorageOptions(type: string): StorageOptions;
} }
interface ProjectData { interface ProjectData {
@ -4993,7 +5010,7 @@ declare module grapesjs {
y?: number; y?: number;
} }
interface Frame extends Backbone.Model<FrameOptions> {} interface Frame extends Backbone.Model<FrameOptions> { }
/** /**
* 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/i18n/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/i18n/config.js)

Loading…
Cancel
Save