@gaoding/editor-sdk
Version:
稿定编辑器对外 SDK
80 lines (79 loc) • 1.95 kB
TypeScript
interface IConfig {
/**
* 编辑器下载,或选择预览图时触发
* @param {Blob} blob
* @returns {*}
* @memberof IConfig
*/
onUpload?: (blob: Blob) => any;
onCompleted(file: any): any;
onTempletLoaded?: (editor: any) => any;
onClose?: () => any;
container?: string;
/**
* onUpload 执行后,是否自动关闭弹窗,默认为 true
* @type {{[k: string]: string}}
* @memberof IConfig
*/
autoClose?: boolean;
/**
* 提供按钮文案自定义,默认为“完成”
* @type {{[k: string]: string}}
* @memberof IConfig
*/
buttonText?: string;
/**
* 自定义iFrame样式
* @type {{[k: string]: string}}
* @memberof IConfig
*/
style?: {
[k: string]: string;
};
/**
* appId区分区分编辑器类型 (图片编辑器、平面编辑器、H5编辑器)
* @type {String}
* @memberof IConfig
*/
appId: string;
/**
* 域名环境配置
* @type {String}
* @memberof IConfig
*/
env?: string;
}
export declare class GdEditorSdk {
constructor(config: IConfig);
private config;
private wrapper;
private frame;
private mask;
private container;
private autoResize;
/**
* 打开iframe 弹窗
*
* @param {{ filter: string; ext: {[k: string]: string} }} options
* @param options.ext 扩展查询参数,用于渠道统计
* @param options.filterFont 是否过滤字体检查
* @param options.image 指定底图供图片编辑器使用
* @memberof GdEditorSdk
*/
open(options: {
ext?: {
[k: string]: string;
};
}): void;
/**
* 关闭弹窗
*
* @memberof GdEditorSdk
*/
close(cbDisabled?: boolean): void;
private createMask;
private createCloseBtn;
private cb;
private toggleScrollSwitch;
}
export {};