@ctrl/ngx-codemirror
Version:
CodeMirror wrapper for Angular
61 lines (60 loc) • 2.91 kB
TypeScript
import { AfterViewInit, DoCheck, ElementRef, EventEmitter, KeyValueDiffers, NgZone, OnDestroy } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { Editor, EditorChange, EditorFromTextArea, ScrollInfo } from 'codemirror';
import * as i0 from "@angular/core";
export declare class CodemirrorComponent implements AfterViewInit, OnDestroy, ControlValueAccessor, DoCheck {
private _differs;
private _ngZone;
className: string;
name: string;
autoFocus: boolean;
/**
* set options for codemirror
* @link http://codemirror.net/doc/manual.html#config
*/
set options(value: {
[key: string]: any;
});
preserveScrollPosition: boolean;
cursorActivity: EventEmitter<Editor>;
focusChange: EventEmitter<boolean>;
scroll: EventEmitter<ScrollInfo>;
drop: EventEmitter<[Editor, DragEvent]>;
codeMirrorLoaded: EventEmitter<CodemirrorComponent>;
ref: ElementRef<HTMLTextAreaElement>;
value: string;
disabled: boolean;
isFocused: boolean;
codeMirror?: EditorFromTextArea;
/**
* either global variable or required library
*/
private _codeMirror;
private _differ?;
private _options;
constructor(_differs: KeyValueDiffers, _ngZone: NgZone);
get codeMirrorGlobal(): any;
ngAfterViewInit(): void;
ngDoCheck(): void;
ngOnDestroy(): void;
codemirrorValueChanged(cm: Editor, change: EditorChange): void;
setOptionIfChanged(optionName: string, newValue: any): void;
focusChanged(focused: boolean): void;
scrollChanged(cm: Editor): void;
cursorActive(cm: Editor): void;
dropFiles(cm: Editor, e: DragEvent): void;
/** Implemented as part of ControlValueAccessor. */
writeValue(value: string): void;
/** Implemented as part of ControlValueAccessor. */
registerOnChange(fn: (value: string) => void): void;
/** Implemented as part of ControlValueAccessor. */
registerOnTouched(fn: () => void): void;
/** Implemented as part of ControlValueAccessor. */
setDisabledState(isDisabled: boolean): void;
/** Implemented as part of ControlValueAccessor. */
private onChange;
/** Implemented as part of ControlValueAccessor. */
private onTouched;
static ɵfac: i0.ɵɵFactoryDeclaration<CodemirrorComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<CodemirrorComponent, "ngx-codemirror", never, { "className": { "alias": "className"; "required": false; }; "name": { "alias": "name"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "options": { "alias": "options"; "required": false; }; "preserveScrollPosition": { "alias": "preserveScrollPosition"; "required": false; }; }, { "cursorActivity": "cursorActivity"; "focusChange": "focusChange"; "scroll": "scroll"; "drop": "drop"; "codeMirrorLoaded": "codeMirrorLoaded"; }, never, never, false, never>;
}