code-editor.component.d.ts 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * Use of this source code is governed by an MIT-style license that can be
  3. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  4. */
  5. import { Platform } from '@angular/cdk/platform';
  6. import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnDestroy, TemplateRef } from '@angular/core';
  7. import type { editor } from 'monaco-editor';
  8. import { NzSafeAny, OnChangeType, OnTouchedType } from 'ng-zorro-antd/core/types';
  9. import { NzCodeEditorService } from './code-editor.service';
  10. import { JoinedEditorOptions, NzEditorMode } from './typings';
  11. import * as i0 from "@angular/core";
  12. export declare class NzCodeEditorComponent implements OnDestroy, AfterViewInit {
  13. private nzCodeEditorService;
  14. private ngZone;
  15. private platform;
  16. nzEditorMode: NzEditorMode;
  17. nzOriginalText: string;
  18. nzLoading: boolean;
  19. nzFullControl: boolean;
  20. nzToolkit?: TemplateRef<void>;
  21. set nzEditorOption(value: JoinedEditorOptions);
  22. readonly nzEditorInitialized: EventEmitter<editor.IStandaloneCodeEditor | editor.IStandaloneDiffEditor>;
  23. editorOptionCached: JoinedEditorOptions;
  24. private readonly el;
  25. private destroy$;
  26. private resize$;
  27. private editorOption$;
  28. private editorInstance;
  29. private value;
  30. private modelSet;
  31. private onDidChangeContentDisposable;
  32. constructor(nzCodeEditorService: NzCodeEditorService, ngZone: NgZone, elementRef: ElementRef, platform: Platform);
  33. /**
  34. * Initialize a monaco editor instance.
  35. */
  36. ngAfterViewInit(): void;
  37. ngOnDestroy(): void;
  38. writeValue(value: string): void;
  39. registerOnChange(fn: OnChangeType): NzSafeAny;
  40. registerOnTouched(fn: OnTouchedType): void;
  41. onChange: OnChangeType;
  42. onTouch: OnTouchedType;
  43. layout(): void;
  44. private setup;
  45. private registerOptionChanges;
  46. private initMonacoEditorInstance;
  47. private registerResizeChange;
  48. private setValue;
  49. /**
  50. * {@link editor.ICodeEditor}#setValue resets the cursor position to the start of the document.
  51. * This helper memorizes the cursor position and selections and restores them after the given
  52. * function has been called.
  53. */
  54. private preservePositionAndSelections;
  55. private setValueEmitter;
  56. private emitValue;
  57. private updateOptionToMonaco;
  58. static ɵfac: i0.ɵɵFactoryDeclaration<NzCodeEditorComponent, never>;
  59. 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>;
  60. static ngAcceptInputType_nzLoading: unknown;
  61. static ngAcceptInputType_nzFullControl: unknown;
  62. }