Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Add ImageUploadConfig documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Aug 28, 2019
1 parent 0309e9f commit 7dde008
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/imageupload.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,46 @@ export default class ImageUpload extends Plugin {
return [ ImageUploadEditing, ImageUploadUI, ImageUploadProgress ];
}
}

/**
* Image upload configuration.
*
* @member {module:image/imageupload~ImageUploadConfig} module:image/image~ImageConfig#upload
*/

/**
* The configuration of the image upload feature. Used by the image upload feature in the `@ckeditor/ckeditor5-image` package.
*
* ClassicEditor
* .create( editorElement, {
* image: {
* upload: ... // Image upload feature options.
* }
* } )
* .then( ... )
* .catch( ... );
*
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
*
* @interface module:image/imageupload~ImageUploadConfig
*/

/**
* List of accepted image types.
*
* The accepted types of images can be customize to allow only certain types of images:
*
* // Allow only JPEG and PNG images:
* const imageUploadConfig = {
* types: [ 'png', 'jpeg' ]
* };
*
* The type string should match [one of the sub-types](https://www.iana.org/assignments/media-types/media-types.xhtml#image)
* of the image mime-type. E.g. for the `image/jpeg` mime-type use `jpeg`.
*
* **Note:** This setting only restricts some image types to be selected and uploaded through the CKEditor UI and commands. Image type
* recognition and filtering should be also implemented on the server that accepts images uploads.
*
* @member {Array.<String>} module:image/imageupload~ImageUploadConfig#types
* @default [ 'jpeg', 'png', 'gif', 'bmp', 'webp', 'tiff' ]
*/

0 comments on commit 7dde008

Please sign in to comment.