@binarycastle/vue-html-editor
Version:
A powerful and extensible HTML editor component for Vue 3 with plugin support
83 lines (63 loc) • 2.56 kB
TypeScript
import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { DefineComponent } from 'vue';
import { EditorPlugin as EditorPlugin_2 } from '../types/plugin';
import { PublicProps } from 'vue';
declare type __VLS_Props = Props;
declare type __VLS_PublicProps = {
modelValue?: string;
} & __VLS_Props;
export declare const boldPlugin: EditorPlugin;
export declare const defaultPlugins: EditorPlugin_2[];
export declare interface EditorPlugin {
command: string;
icon: string;
title: string;
execute: (editorElement: HTMLElement) => void;
isActive?: () => boolean;
}
export declare class EditorPluginRegistry implements PluginRegistry {
private plugins;
register(plugin: EditorPlugin): void;
unregister(command: string): void;
getPlugins(): EditorPlugin[];
getPlugin(command: string): EditorPlugin | undefined;
executeCommand(command: string, editorElement: HTMLElement): boolean;
clear(): void;
}
export declare const imagePlugin: EditorPlugin;
export declare const italicPlugin: EditorPlugin;
export declare const linkPlugin: EditorPlugin;
export declare const orderedListPlugin: EditorPlugin;
export declare interface PluginRegistry {
register: (plugin: EditorPlugin) => void;
unregister: (command: string) => void;
getPlugins: () => EditorPlugin[];
getPlugin: (command: string) => EditorPlugin | undefined;
executeCommand: (command: string, editorElement: HTMLElement) => boolean;
}
export declare const pluginRegistry: EditorPluginRegistry;
declare interface Props {
toolbarAlwaysShow?: boolean;
plugins?: EditorPlugin[];
css?: string;
noEditorClasses?: boolean;
}
export declare const removeFormatPlugin: EditorPlugin;
export declare const strikeThroughPlugin: EditorPlugin;
export declare const underlinePlugin: EditorPlugin;
export declare const unorderedListPlugin: EditorPlugin;
export declare const VHtmlEditor: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
"update:modelValue": (value: string) => any;
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
}>, {
toolbarAlwaysShow: boolean;
plugins: EditorPlugin[];
css: string;
noEditorClasses: boolean;
}, {}, {}, {}, string, ComponentProvideOptions, false, {
editorRef: HTMLDivElement;
toolbarRef: HTMLDivElement;
}, HTMLDivElement>;
export { }