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<void>;
    set nzEditorOption(value: JoinedEditorOptions);
    readonly nzEditorInitialized: EventEmitter<editor.IStandaloneCodeEditor | editor.IStandaloneDiffEditor>;
    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<NzCodeEditorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<NzCodeEditorComponent, "nz-code-editor", ["nzCodeEditor"], { "nzEditorMode": { "alias": "nzEditorMode"; "required": false; }; "nzOriginalText": { "alias": "nzOriginalText"; "required": false; }; "nzLoading": { "alias": "nzLoading"; "required": false; }; "nzFullControl": { "alias": "nzFullControl"; "required": false; }; "nzToolkit": { "alias": "nzToolkit"; "required": false; }; "nzEditorOption": { "alias": "nzEditorOption"; "required": false; }; }, { "nzEditorInitialized": "nzEditorInitialized"; }, never, never, true, never>;
    static ngAcceptInputType_nzLoading: unknown;
    static ngAcceptInputType_nzFullControl: unknown;
}

declare class NzCodeEditorModule {
    static ɵfac: i0.ɵɵFactoryDeclaration<NzCodeEditorModule, never>;
    static ɵmod: i0.ɵɵNgModuleDeclaration<NzCodeEditorModule, never, [typeof NzCodeEditorComponent], [typeof NzCodeEditorComponent]>;
    static ɵinj: i0.ɵɵInjectorDeclaration<NzCodeEditorModule>;
}

declare class NzCodeEditorService {
    private readonly nzConfigService;
    private document;
    private firstEditorInitialized;
    private option;
    private config;
    option$: BehaviorSubject<JoinedEditorOptions>;
    constructor();
    private _updateDefaultOption;
    requestToInit(): Observable<JoinedEditorOptions>;
    private loadMonacoScript;
    private onLoad;
    private onInit;
    private getLatestOption;
    static ɵfac: i0.ɵɵFactoryDeclaration<NzCodeEditorService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<NzCodeEditorService>;
}

export { NzCodeEditorComponent, NzCodeEditorLoadingStatus, NzCodeEditorModule, NzCodeEditorService };
export type { DiffEditorOptions, EditorOptions, JoinedEditorOptions, NzEditorMode };
