import { OnInit, OnDestroy, AfterViewInit } from '@angular/core';
import { MJQueryEntity, MJQueryParameterEntity, MJQueryCategoryEntity, MJQueryFieldEntity, MJQueryEntityEntity, MJQueryPermissionEntity } from '@memberjunction/core-entities';
import { FormToolbarConfig } from '@memberjunction/ng-base-forms';
import { MJQueryFormComponent } from '../../generated/Entities/MJQuery/mjquery.form.component';
import { QueryInfo, QueryDependencyInfo } from '@memberjunction/core';
import { CodeEditorComponent, CompositionTokenClickEvent } from '@memberjunction/ng-code-editor';
import * as i0 from "@angular/core";
interface CategoryTreeNode {
    id: string;
    name: string;
    items?: CategoryTreeNode[];
}
export declare class MJQueryFormComponentExtended extends MJQueryFormComponent implements OnInit, OnDestroy, AfterViewInit {
    record: MJQueryEntity;
    queryParameters: MJQueryParameterEntity[];
    queryFields: MJQueryFieldEntity[];
    queryEntities: MJQueryEntityEntity[];
    queryPermissions: MJQueryPermissionEntity[];
    isLoadingParameters: boolean;
    isLoadingFields: boolean;
    isLoadingEntities: boolean;
    isLoadingPermissions: boolean;
    hasUnsavedChanges: boolean;
    showFiltersHelp: boolean;
    showRunDialog: boolean;
    showCategoryDialog: boolean;
    categoryPathDisplay: string;
    sqlPanelExpanded: boolean;
    parametersPanelExpanded: boolean;
    fieldsPanelExpanded: boolean;
    entitiesPanelExpanded: boolean;
    technicalDescriptionPanelExpanded: boolean;
    detailsPanelExpanded: boolean;
    permissionsPanelExpanded: boolean;
    dependentsPanelExpanded: boolean;
    categoryOptions: Array<{
        text: string;
        value: string;
    }>;
    categories: MJQueryCategoryEntity[];
    categoryTreeData: CategoryTreeNode[];
    statusOptions: {
        text: string;
        value: string;
    }[];
    readonly ToolbarConfig: FormToolbarConfig;
    sqlEditor: CodeEditorComponent | null;
    sqlFilters: import("@memberjunction/core").RunQuerySQLFilter[];
    private navigationService;
    private destroy$;
    /**
     * Gets the QueryInfo metadata object for the current record, used to access Dependents.
     */
    get CurrentQueryInfo(): QueryInfo | undefined;
    /**
     * Gets queries that depend on (reference) this query via composition.
     */
    get DependentQueries(): QueryDependencyInfo[];
    private isUpdatingEditorValue;
    private isInitialLoad;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    ngAfterViewInit(): void;
    EndEditMode(): void;
    StartEditMode(): void;
    CancelEdit(): void;
    private updateEditorValue;
    isFormReadOnly(): boolean;
    loadQueryParameters(): Promise<void>;
    loadQueryFields(): Promise<void>;
    loadQueryEntities(): Promise<void>;
    loadQueryPermissions(): Promise<void>;
    loadCategories(): Promise<void>;
    private buildCategoryTree;
    getCategoryPath(): string;
    private updateCategoryPathDisplay;
    onCategoryChange(value: string): Promise<void>;
    private isDuplicateCategory;
    /**
     * Updates the hasUnsavedChanges flag based on entity dirty states
     */
    private updateUnsavedChangesFlag;
    toggleFiltersHelp(): void;
    /**
     * Run the query with parameter dialog
     */
    runQuery(): Promise<void>;
    /**
     * Handle run dialog close
     */
    onRunDialogClose(): void;
    /**
     * Add a new parameter
     */
    addParameter(): Promise<void>;
    /**
     * Edit a parameter
     */
    editParameter(param: MJQueryParameterEntity): Promise<void>;
    /**
     * Delete a parameter
     */
    deleteParameter(param: MJQueryParameterEntity): Promise<void>;
    /**
     * Handle category creation from dialog
     */
    onCategoryCreated(newCategory: MJQueryCategoryEntity): Promise<void>;
    /**
     * Format date for display
     */
    formatDate(date: Date | string | null): string;
    SaveRecord(StopEditModeAfterSave?: boolean): Promise<boolean>;
    getStatusBadgeColor(): string;
    getStatusBannerIcon(): string;
    getStatusBannerMessage(): string;
    /**
     * Handle composition token click — navigate to the referenced query
     */
    onCompositionTokenClick(event: CompositionTokenClickEvent): void;
    /**
     * Navigate to a dependent query's record
     */
    onDependentQueryClick(dep: QueryDependencyInfo): void;
    /**
     * Handle SQL value changes from the code editor
     */
    onSQLChange(value: string): void;
    /**
     * Add a new field
     */
    addField(): Promise<void>;
    /**
     * Delete a field
     */
    deleteField(field: MJQueryFieldEntity): Promise<void>;
    /**
     * Add a new entity
     */
    addEntity(): Promise<void>;
    /**
     * Delete an entity
     */
    deleteEntity(entity: MJQueryEntityEntity): Promise<void>;
    /**
     * Get entity options for dropdown
     */
    getEntityOptions(): Array<{
        text: string;
        id: string;
    }>;
    /**
     * Get the grid edit mode based on component edit mode
     */
    GridEditMode(): "None" | "Save" | "Queue";
    static ɵfac: i0.ɵɵFactoryDeclaration<MJQueryFormComponentExtended, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<MJQueryFormComponentExtended, "mj-query-form", never, {}, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=query-form.component.d.ts.map