UNPKG

@gaoding/editor-sdk

Version:

稿定编辑器对外 SDK

43 lines (42 loc) 1.04 kB
interface Config { appId: string; container?: string; onCloseModal?: () => Promise<void | boolean> | void | boolean; /** * 获取用户权益授权码 */ getUseRightCert?(info: { appId: string; abilityCode: string; workId: string; }): Promise<string | false | Error>; /** * 获取用户标识code */ authorize?(): Promise<string>; } export declare function createKoutuEditor(config: Config): { onSave: (fn: (info: { workId: string; files: Blob[]; }) => void) => void; onClose: (fn: () => any) => void; close: () => void; koutu: (url: string) => Promise<{ result: string; workId: string; }>; editKoutu: (id: string, query?: { [k: string]: any; }) => Promise<false | { files: Blob[]; workId: number; }>; importImage: (file: string | Blob, query?: { [k: string]: any; }) => Promise<false | { files: Blob[]; workId: number; }>; }; export {};