ngx-editor
Version:
The Rich Text Editor for Angular, Built on ProseMirror
46 lines (45 loc) • 1.45 kB
TypeScript
import { ParseOptions, Schema } from 'prosemirror-model';
import { Plugin } from 'prosemirror-state';
import { EditorProps, EditorView } from 'prosemirror-view';
import { Observable } from 'rxjs';
import EditorCommands from './EditorCommands';
import { HTML } from './trustedTypesUtil';
type JSONDoc = Record<string, unknown>;
type Content = HTML | null | JSONDoc;
interface Options {
content?: Content;
history?: boolean;
keyboardShortcuts?: boolean;
inputRules?: boolean;
schema?: Schema;
plugins?: Plugin[];
nodeViews?: EditorProps['nodeViews'];
attributes?: EditorProps['attributes'];
features?: EditorFeatures;
handleScrollToSelection?: EditorProps['handleScrollToSelection'];
linkValidationPattern?: string;
parseOptions?: ParseOptions;
}
interface EditorFeatures {
linkOnPaste?: boolean;
resizeImage?: boolean;
}
declare class Editor {
private options;
view: EditorView;
constructor(options?: Options);
private valueChangesSubject;
private updateSubject;
get valueChanges(): Observable<JSONDoc>;
get update(): Observable<EditorView>;
get schema(): Schema;
get linkValidationPattern(): string;
get commands(): EditorCommands;
get features(): EditorFeatures;
private handleTransactions;
private createEditor;
setContent(content: Content): void;
registerPlugin(plugin: Plugin): void;
destroy(): void;
}
export default Editor;