import { EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
import { TemplateEntity, TemplateContentEntity } from '@memberjunction/core-entities';
import { MJNotificationService } from '@memberjunction/ng-notifications';
import { LanguageDescription } from '@codemirror/language';
import { CodeEditorComponent } from '@memberjunction/ng-code-editor';
import { SystemPlaceholder, SystemPlaceholderCategory } from '@memberjunction/ai-core-plus';
import * as i0 from "@angular/core";
export interface TemplateEditorConfig {
    allowEdit?: boolean;
    showRunButton?: boolean;
    compactMode?: boolean;
}
export declare class TemplateEditorComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {
    private notificationService;
    template: TemplateEntity | null;
    config: TemplateEditorConfig;
    contentChange: EventEmitter<TemplateContentEntity[]>;
    runTemplate: EventEmitter<TemplateEntity>;
    templateContents: TemplateContentEntity[];
    selectedContentIndex: number;
    isAddingNewContent: boolean;
    newTemplateContent: TemplateContentEntity | null;
    hasUnsavedChanges: boolean;
    contentTypeOptions: Array<{
        text: string;
        value: string;
    }>;
    supportedLanguages: LanguageDescription[];
    isRunningTemplate: boolean;
    activeHelpTab: 'syntax' | 'placeholders';
    activePlaceholderCategory: string;
    placeholderCategories: Array<{
        category: SystemPlaceholderCategory;
        placeholders: SystemPlaceholder[];
    }>;
    codeEditor: CodeEditorComponent | null;
    private isUpdatingEditorValue;
    private destroy$;
    private _metadata;
    private activeTimeouts;
    constructor(notificationService: MJNotificationService);
    ngOnInit(): Promise<void>;
    ngOnChanges(changes: SimpleChanges): Promise<void>;
    private organizePlaceholdersByCategory;
    /**
     * Copies a placeholder to the clipboard
     */
    copyPlaceholder(placeholderName: string): Promise<void>;
    ngOnDestroy(): void;
    ngAfterViewInit(): void;
    loadTemplateContents(): Promise<void>;
    /**
     * Public method to refresh the template editor and discard unsaved changes
     * This should be called when canceling edits to restore the original state
     */
    refreshAndDiscardChanges(): Promise<void>;
    createDefaultTemplateContent(): Promise<void>;
    selectTemplateContent(index: number, confirmSwitch?: boolean): void;
    loadContentTypes(): void;
    addNewTemplateContent(): Promise<void>;
    deleteTemplateContent(index: number): Promise<void>;
    get currentTemplateContent(): TemplateContentEntity | null;
    get hasMultipleContents(): boolean;
    onContentTypeChange(): void;
    onContentChange(): void;
    /**
     * Updates the hasUnsavedChanges flag based on entity dirty states
     */
    private updateUnsavedChangesFlag;
    onTemplateTextChange(event: any): void;
    /**
     * Helper method to track setTimeout calls for cleanup
     */
    private setTrackedTimeout;
    /**
     * Manually sync the editor value without triggering change events
     */
    private syncEditorValue;
    saveTemplateContents(): Promise<boolean>;
    getContentTypeDisplayText(typeId: string): string;
    getEditorLanguage(): string;
    /**
     * Test run the current template using the parameter dialog
     */
    onRunTemplate(): Promise<void>;
    getContentTypeOptionsForContent(): Array<{
        text: string;
        value: string;
    }>;
    static ɵfac: i0.ɵɵFactoryDeclaration<TemplateEditorComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TemplateEditorComponent, "mj-template-editor", never, { "template": { "alias": "template"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "contentChange": "contentChange"; "runTemplate": "runTemplate"; }, never, never, false, never>;
}
//# sourceMappingURL=template-editor.component.d.ts.map