Current section

Files

Jump to
ckeditor5_phoenix dist hooks editor plugins sync-editor-with-phoenix.d.ts
Raw

dist/hooks/editor/plugins/sync-editor-with-phoenix.d.ts

import { PluginConstructor } from 'ckeditor5';
import { EditorId } from '../typings';
/**
* Creates a SyncEditorWithPhoenix plugin class. It's not two way binding, but
* it allows you to push editor data to Phoenix on change, focus and blur events, and
* also to set editor data from Phoenix.
*
* In order to debug two-way binding, check `EditorRootValueSentinel` component, which is used
* to assign the value to the editor based on modification of the Elixir component's assigns.
*
* @param options The options for the plugin, including editorId, debounce time, events to listen to, and pushEvent/handleEvent functions.
* @returns A Promise that resolves to the SyncEditorWithPhoenix plugin constructor.
*/
export declare function createSyncEditorWithPhoenixPlugin(options: Attrs): Promise<PluginConstructor>;
type Attrs = {
editorId: EditorId;
saveDebounceMs: number;
events: {
change: boolean;
focus: boolean;
blur: boolean;
ready: boolean;
};
pushEvent: (event: string, payload: any) => void;
handleEvent: (event: string, callback: (payload: any) => void) => void;
};
export {};
//# sourceMappingURL=sync-editor-with-phoenix.d.ts.map