@ckeditor/ckeditor5-vue
Version:
Official Vue.js 3+ component for CKEditor 5 – the best browser-based rich text editor.
30 lines (29 loc) • 1.07 kB
TypeScript
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/
import { type MaybeRefOrGetter } from 'vue';
import { type AsyncComposableResult } from './composables/useAsync.js';
import { type CKEditorCloudConfig, type CKEditorCloudResult } from '@ckeditor/ckeditor5-integrations-common';
/**
* A composable function that loads CKEditor Cloud services.
*
* @param config The configuration of the CKEditor Cloud services.
* @returns The result of the loaded CKEditor Cloud services.
* @template Config The type of the CKEditor Cloud configuration.
* @example
* ```ts
* const { data } = useCKEditorCloud( {
* version: '43.0.0',
* languages: [ 'en', 'de' ],
* premium: true
* } );
*
* if ( data.value ) {
* const { CKEditor, CKEditorPremiumFeatures } = data.value;
* const { Paragraph } = CKEditor;
*
* // ..
* }
*/
export default function useCKEditorCloud<Config extends CKEditorCloudConfig>(config: MaybeRefOrGetter<Config>): AsyncComposableResult<CKEditorCloudResult<Config>>;