@aomao/plugin-codeblock-vue
Version:
43 lines (42 loc) • 1.45 kB
TypeScript
import type { Editor } from 'codemirror';
import { Card, CardToolbarItemOptions, CardType, ToolbarItemOptions, CardValue } from '@aomao/engine';
import CodeBlockEditor from './editor';
import { CodeBlockEditorInterface } from './types';
import './index.css';
export interface CodeBlockValue extends CardValue {
mode?: string;
code?: string;
autoWrap?: boolean;
}
declare class CodeBlcok<V extends CodeBlockValue = CodeBlockValue> extends Card<V> {
#private;
mirror?: Editor;
static get cardName(): string;
static get cardType(): CardType;
static get autoSelected(): boolean;
static get singleSelectable(): boolean;
static getModes(): ({
value: string;
syntax: string;
name: string;
alias?: undefined;
} | {
value: string;
syntax: string;
alias: string[];
name: string;
})[];
static get lazyRender(): boolean;
resize: () => import("@aomao/engine").NodeInterface | undefined;
codeEditor?: CodeBlockEditorInterface;
init(): void;
toolbar(): Array<CardToolbarItemOptions | ToolbarItemOptions>;
focusEditor(): void;
onSelectLeft(event: KeyboardEvent): void;
onSelectRight(event: KeyboardEvent): void;
onSelectDown(event: KeyboardEvent): void;
onSelectUp(event: KeyboardEvent): void;
render(): void;
}
export default CodeBlcok;
export { CodeBlockEditor };