/** * @license * Copyright Datorama. All Rights Reserved. * * Use of this source code is governed by an Apache License 2.0 license that can be * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE */ import { ElementRef, OnDestroy, AfterViewInit } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { Observable } from 'rxjs'; import { AceAutoCompleteHTML, AceAutoCompleteJSObject } from './auto-complete'; import { HttpClient } from '@angular/common/http'; import { AceService } from './ace.service'; import { CoreConfig } from '../config'; import { HashMap } from '@datorama/akita'; declare global { interface Window { ace: any; js_beautify: any; } } export declare class DatoAceDirective implements OnDestroy, ControlValueAccessor, AfterViewInit { private host; private http; private aceService; private config; disabled: boolean; private editor; private onChange; private defaultOptions; private _options; private BASE_PATH; private _lang; set theme(theme: string); set lang(lang: string); set options(options: HashMap); set HTMLCompletions(attributesMap: AceAutoCompleteHTML); set JSObjectCompletions(objectMap: AceAutoCompleteJSObject); private get langTools(); private get ace(); constructor(host: ElementRef, http: HttpClient, aceService: AceService, config: CoreConfig); /** * We have three states: * 1. We didn't fetch Ace (should be invoked only on the first directive initialization). * 2. We're already in the process of fetching Ace, so we're invoking a `timer` waiting for Ace to be defined. * 3. Ace is on the window, return. */ waitForAce(): Observable; private waitForBeauitify; getEditor(): any; prettier(): void; setTheme(theme: string): void; ngAfterViewInit(): void; private runBeautify; private getBaseCompletors; private createRequests; private loadAceWorkers; private loadAceScripts; private loadBeautifier; private initializeEditor; private loadAce; private setValue; private setOptions; private setLang; ngOnDestroy(): void; writeValue(value: string): void; registerOnChange(fn: Function): void; registerOnTouched(fn: Function): void; setDisabledState(isDisabled: boolean): void; }