@gdyfe/ssml
Version:
102 lines (101 loc) • 3.12 kB
TypeScript
import { type IDomEditor } from '@wangeditor/editor';
import { type PartialSSMLEditorConfig } from '../config';
/**
* 获取编辑器实例
*/
declare function getEditor(): IDomEditor | undefined;
/**
* 获取当前SSML内容
*/
declare function getSSML(): string;
/**
* 获取当前HTML内容
*/
declare function getHTML(): string;
/**
* 设置编辑器焦点
*/
declare function setFocus(): void;
/**
* 在光标位置插入动作标签
* @param name 动作名称
* @param tag 动作标签(可选)
* @returns 是否插入成功
*
* @example
* ```typescript
* // 基本用法
* const editorRef = ref<InstanceType<typeof EditorView> | null>(null);
*
* // 插入带有名称的动作标签
* editorRef.value?.insertAction('pauseAction');
*
* // 插入带有名称和自定义标签的动作标签
* editorRef.value?.insertAction('customAction', 'tag123');
*
* // 检查是否成功插入
* const result = editorRef.value?.insertAction('someAction');
* if (result) {
* console.log('动作标签插入成功');
* } else {
* console.log('动作标签插入失败');
* }
* ```
*/
declare function insertAction(name: string, tag?: string): boolean;
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
modelValue: {
type: import("vue").PropType<string | undefined>;
required: true;
default: string;
};
editorKey: {
type: import("vue").PropType<symbol>;
default: () => symbol;
};
config: {
type: import("vue").PropType<PartialSSMLEditorConfig>;
};
}, {
getEditor: typeof getEditor;
getSSML: typeof getSSML;
getHTML: typeof getHTML;
setFocus: typeof setFocus;
insertAction: typeof insertAction;
/**
* 检查编辑器是否已完全挂载
*/
isMounted: () => boolean;
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
created: (editor: IDomEditor) => void;
change: (editor: IDomEditor) => void;
'update:modelValue': (value: string | undefined) => void;
mounted: (editor: IDomEditor) => void;
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
modelValue: {
type: import("vue").PropType<string | undefined>;
required: true;
default: string;
};
editorKey: {
type: import("vue").PropType<symbol>;
default: () => symbol;
};
config: {
type: import("vue").PropType<PartialSSMLEditorConfig>;
};
}>> & {
onCreated?: ((editor: IDomEditor) => any) | undefined;
onChange?: ((editor: IDomEditor) => any) | undefined;
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
onMounted?: ((editor: IDomEditor) => any) | undefined;
}, {
modelValue: string | undefined;
editorKey: symbol;
}, {}>, Partial<Record<string, (_: {}) => any>> & Partial<Record<string, (_: {}) => any>>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};