UNPKG

@ckeditor/ckeditor5-vue

Version:

Official Vue.js 3+ component for CKEditor 5 – the best browser-based rich text editor.

26 lines (25 loc) 1.15 kB
/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options */ import type { Editor, EventInfo } from 'ckeditor5'; import { type Ref, type EmitFn, type ModelRef, type MaybeRefOrGetter } from 'vue'; /** * Hook that synchronizes editor state with currently set vue model. */ export declare function useEditorVModel<TEditor extends Editor>({ disableTwoWayDataBinding, emit, instance, model }: Attrs<TEditor>): Result<TEditor>; type Attrs<TEditor extends Editor> = { disableTwoWayDataBinding: MaybeRefOrGetter<boolean>; model: ModelRef<string>; emit: EmitFn<EditorVModelEvents<TEditor>>; instance: Ref<TEditor | undefined>; }; type Result<TEditor extends Editor> = { lastEditorData: Ref<string | undefined>; assignEditorDataToModel(editor: TEditor, evt?: EventInfo | null): void; }; export type EditorVModelEvents<TEditor extends Editor> = { input: [data: string, event: EventInfo | null, editor: TEditor]; 'update:modelValue': [data: string, event: EventInfo | null, editor: TEditor]; }; export {};