import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
import { MJTemplateEntity, MJTemplateParamEntity } from '@memberjunction/core-entities';
import { ColDef, GridReadyEvent, GetRowIdParams, RowEditingStoppedEvent, ICellRendererParams, type Theme } from 'ag-grid-community';
import * as i0 from "@angular/core";
/** Valid parameter type values, matching the entity's union type */
type ParamType = 'Array' | 'Entity' | 'Object' | 'Record' | 'Scalar';
/** Row data shape for the grid (flattened from the entity for editing) */
interface ParamRowData {
    /** Entity reference for save/delete operations */
    Entity: MJTemplateParamEntity;
    /** Used as row ID; empty string for unsaved new rows */
    ID: string;
    Name: string;
    Type: ParamType;
    IsRequired: boolean;
    Description: string;
    DefaultValue: string;
    LinkedParameterName: string;
    LinkedParameterField: string;
    /** Tracks whether this row is brand-new (not yet persisted) */
    IsNew: boolean;
}
export declare class TemplateParamsGridComponent implements OnInit, OnChanges {
    template: MJTemplateEntity | null;
    editMode: boolean;
    templateParams: ParamRowData[];
    isLoading: boolean;
    typeOptions: string[];
    ColumnDefs: ColDef[];
    DefaultColDef: ColDef;
    GridTheme: Theme;
    private gridApi;
    /** Row currently being edited (for cancel/revert) */
    private editingRowBackup;
    private editingRowId;
    noRowsTemplate: string;
    getRowId: (params: GetRowIdParams<ParamRowData>) => string;
    ngOnInit(): void;
    ngOnChanges(changes: SimpleChanges): void;
    onGridReady(event: GridReadyEvent): void;
    loadTemplateParams(): Promise<void>;
    addNewParam(): Promise<void>;
    startEditRow(params: ICellRendererParams): void;
    cancelEditRow(): void;
    saveEditRow(): void;
    onRowEditingStopped(event: RowEditingStoppedEvent): Promise<void>;
    deleteRow(params: ICellRendererParams): Promise<void>;
    getTypeIcon(type: string): string;
    private entityToRowData;
    private saveParamRow;
    private createNewParamEntity;
    private cancelCurrentEdit;
    private revertRow;
    private clearEditState;
    private buildColumnDefs;
    static ɵfac: i0.ɵɵFactoryDeclaration<TemplateParamsGridComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<TemplateParamsGridComponent, "mj-template-params-grid", never, { "template": { "alias": "template"; "required": false; }; "editMode": { "alias": "editMode"; "required": false; }; }, {}, never, never, false, never>;
}
export {};
//# sourceMappingURL=template-params-grid.component.d.ts.map