import { OnInit, OnDestroy, ChangeDetectorRef } from '@angular/core';
import { BaseResourceComponent } from '@memberjunction/ng-shared';
import { ResourceData } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
/**
 * Represents an application's role assignment for display in the grid.
 */
interface ApplicationRoleRow {
    ID: string;
    ApplicationID: string;
    ApplicationName: string;
    RoleID: string;
    RoleName: string;
    CanAccess: boolean;
    CanAdmin: boolean;
    IsDirty: boolean;
    IsNew: boolean;
}
/**
 * Represents an application with its role assignments grouped.
 */
interface ApplicationGroup {
    ApplicationID: string;
    ApplicationName: string;
    Roles: ApplicationRoleRow[];
    Expanded: boolean;
}
/**
 * Admin dashboard for managing Application Role assignments.
 * Shows which roles can access and administer each application.
 */
export declare class ApplicationRolesResourceComponent extends BaseResourceComponent implements OnInit, OnDestroy {
    private cdr;
    ApplicationGroups: ApplicationGroup[];
    AvailableRoles: {
        ID: string;
        Name: string;
    }[];
    IsLoading: boolean;
    IsSaving: boolean;
    HasUnsavedChanges: boolean;
    ErrorMessage: string | null;
    SuccessMessage: string | null;
    SelectedRoleIdToAdd: Map<string, string>;
    constructor(cdr: ChangeDetectorRef);
    GetResourceDisplayName(_data: ResourceData): Promise<string>;
    GetResourceIconClass(_data: ResourceData): Promise<string>;
    ngOnInit(): Promise<void>;
    ngOnDestroy(): void;
    /**
     * Load all application role data and available roles.
     */
    loadData(): Promise<void>;
    /**
     * Toggle the expanded/collapsed state of an application group.
     */
    ToggleGroup(group: ApplicationGroup): void;
    /**
     * Toggle CanAccess for a specific role assignment.
     */
    ToggleCanAccess(row: ApplicationRoleRow): void;
    /**
     * Toggle CanAdmin for a specific role assignment.
     */
    ToggleCanAdmin(row: ApplicationRoleRow): void;
    /**
     * Get roles not yet assigned to a specific application (for the "Add Role" dropdown).
     */
    GetUnassignedRoles(group: ApplicationGroup): {
        ID: string;
        Name: string;
    }[];
    /**
     * Add a new role assignment to an application group.
     */
    AddRole(group: ApplicationGroup): void;
    /**
     * Remove a role assignment (marks for deletion on save; removes immediately if new).
     */
    RemoveRole(group: ApplicationGroup, row: ApplicationRoleRow): void;
    private _pendingDeletes;
    /**
     * Save all unsaved changes (new records, modified records, deleted records).
     */
    SaveChanges(): Promise<void>;
    /**
     * Discard all unsaved changes and reload data.
     */
    DiscardChanges(): Promise<void>;
    /**
     * Track by function for application groups.
     */
    TrackByAppId(_index: number, group: ApplicationGroup): string;
    /**
     * Track by function for role rows.
     */
    TrackByRoleRow(_index: number, row: ApplicationRoleRow): string;
    /**
     * Get the role count label for an application.
     */
    GetRoleCountLabel(group: ApplicationGroup): string;
    /**
     * Handle dropdown selection for adding roles.
     */
    OnAddRoleSelect(group: ApplicationGroup, roleId: string): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationRolesResourceComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<ApplicationRolesResourceComponent, "mj-application-roles-resource", never, {}, {}, never, never, false, never>;
}
/** Tree-shaking prevention */
export declare function LoadApplicationRolesResource(): void;
export {};
//# sourceMappingURL=application-roles-resource.component.d.ts.map