UNPKG

@rickx/ckeditor5-upload-adapter

Version:
27 lines (26 loc) 833 B
import { Plugin, FileRepository } from 'ckeditor5'; /** * The Upload adapter allows uploading images to an application running on your server using * * ```ts * ClassicEditor * .create(document.querySelector('#editor'), { * customUpload: { * onUpload: (file) => { * // do any upload stuff here with the JS-File-Object * return Promise.resolve({ url: 'http://server/default-size.image.png' }) * }, * onAbort: () => { * // abort the upload here. The promise from onImageUpload should be rejected after that. * } * } * }) * .then( ... ) * .catch( ... ); * ``` */ export default class CustomUploadAdapter extends Plugin { static get requires(): readonly [typeof FileRepository]; static get pluginName(): "CustomUploadAdapter"; init(): void; }