import { Environment, editor } from 'monaco-editor'; import * as i0 from '@angular/core'; import { AfterViewInit, TemplateRef, EventEmitter } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { OnChangeType, NzSafeAny, OnTouchedType } from 'ng-zorro-antd/core/types'; import { BehaviorSubject, Observable } from 'rxjs'; /** * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE */ import IStandAloneEditorConstructionOptions = editor.IStandaloneEditorConstructionOptions; import IDiffEditorConstructionOptions = editor.IDiffEditorConstructionOptions; declare global { interface Window { MonacoEnvironment?: Environment | undefined; } } type EditorOptions = IStandAloneEditorConstructionOptions; type DiffEditorOptions = IDiffEditorConstructionOptions; type JoinedEditorOptions = EditorOptions | DiffEditorOptions; type NzEditorMode = 'normal' | 'diff'; declare const NzCodeEditorLoadingStatus: { readonly UNLOAD: "unload"; readonly LOADING: "loading"; readonly LOADED: "LOADED"; }; type NzCodeEditorLoadingStatus = (typeof NzCodeEditorLoadingStatus)[keyof typeof NzCodeEditorLoadingStatus]; declare class NzCodeEditorComponent implements AfterViewInit, ControlValueAccessor { private nzCodeEditorService; private ngZone; private platform; private destroyRef; nzEditorMode: NzEditorMode; nzOriginalText: string; nzLoading: boolean; nzFullControl: boolean; nzToolkit?: TemplateRef; set nzEditorOption(value: JoinedEditorOptions); readonly nzEditorInitialized: EventEmitter; editorOptionCached: JoinedEditorOptions; private readonly el; private resize$; private editorOption$; private editorInstance; private value; private modelSet; private onDidChangeContentDisposable; constructor(); /** * Initialize a monaco editor instance. */ ngAfterViewInit(): void; writeValue(value: string): void; registerOnChange(fn: OnChangeType): NzSafeAny; registerOnTouched(fn: OnTouchedType): void; onChange: OnChangeType; onTouch: OnTouchedType; layout(): void; private setup; private registerOptionChanges; private initMonacoEditorInstance; private registerResizeChange; private setValue; /** * {@link editor.ICodeEditor}#setValue resets the cursor position to the start of the document. * This helper memorizes the cursor position and selections and restores them after the given * function has been called. */ private preservePositionAndSelections; private setValueEmitter; private emitValue; private updateOptionToMonaco; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_nzLoading: unknown; static ngAcceptInputType_nzFullControl: unknown; } declare class NzCodeEditorModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } declare class NzCodeEditorService { private readonly nzConfigService; private document; private firstEditorInitialized; private option; private config; option$: BehaviorSubject; constructor(); private _updateDefaultOption; requestToInit(): Observable; private loadMonacoScript; private onLoad; private onInit; private getLatestOption; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { NzCodeEditorComponent, NzCodeEditorLoadingStatus, NzCodeEditorModule, NzCodeEditorService }; export type { DiffEditorOptions, EditorOptions, JoinedEditorOptions, NzEditorMode };