ckbox/utils
@ckeditor/ckeditor5-ckbox/src/utils
Filtering
Functions
-
blurHashToDataUrl( [ hash ] ) → string | undefined
module:ckbox/utils~blurHashToDataUrl
Generates an image data URL from its
blurhash
representation.Parameters
[ hash ] : string
Returns
string | undefined
-
convertMimeTypeToExtension( mimeType ) → string
module:ckbox/utils~convertMimeTypeToExtension
Returns an extension a typical file in the specified
mimeType
format would have.Parameters
mimeType : string
Returns
string
-
getContentTypeOfUrl( url, options = { options.signal } ) → Promise<string>
module:ckbox/utils~getContentTypeOfUrl
Tries to fetch the given
url
and returns 'content-type' of the response.Parameters
url : string
options : object
-
Properties
options.signal : AbortSignal
Returns
Promise<string>
-
getFileExtension( file ) → string
module:ckbox/utils~getFileExtension
-
getImageUrls( imageUrls ) → object
module:ckbox/utils~getImageUrls
Converts image source set provided by the CKBox into an object containing:
- responsive URLs for the "webp" image format,
- one fallback URL for browsers that do not support the "webp" format.
Parameters
imageUrls : CKBoxImageUrls
Returns
object
-
getWorkspaceId( token, [ defaultWorkspaceId ] ) → string | null
module:ckbox/utils~getWorkspaceId
Returns a workspace id to use for communication with the CKBox service.
Parameters
token : InitializedToken
[ defaultWorkspaceId ] : string
The default workspace to use taken from editor config.
Returns
string | null
-
internal
sendHttpRequest( __namedParameters = { __namedParameters.authorization, [__namedParameters.data], [__namedParameters.method], [__namedParameters.onUploadProgress], __namedParameters.signal, __namedParameters.url } ) → Promise<any>
module:ckbox/utils~sendHttpRequest
Sends the HTTP request.
Parameters
__namedParameters : object
-
Properties
__namedParameters.authorization : string
[ __namedParameters.data ] : null | FormData
[ __namedParameters.method ] : 'POST' | 'GET'
[ __namedParameters.onUploadProgress ] : ( ProgressEvent<EventTarget> ) => void
__namedParameters.signal : AbortSignal
__namedParameters.url : URL
Returns
Promise<any>
Every day, we work hard to keep our documentation complete. Have you spotted outdated information? Is something missing? Please report it via our issue tracker.
With the release of version 42.0.0, we have rewritten much of our documentation to reflect the new import paths and features. We appreciate your feedback to help us ensure its accuracy and completeness.