import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
import { MJAPIKeyEntity, MJAPIScopeEntity } from '@memberjunction/core-entities';
import * as i0 from "@angular/core";
/** Scope with selection state */
interface ScopeItem {
    scope: MJAPIScopeEntity;
    selected: boolean;
    originallySelected: boolean;
}
/** Grouped scopes by category */
interface ScopeCategory {
    name: string;
    icon: string;
    color: string;
    scopes: ScopeItem[];
    expanded: boolean;
    allSelected: boolean;
}
/** Usage log display item */
interface UsageLogItem {
    timestamp: Date;
    endpoint: string;
    method: string;
    statusCode: number;
    responseTime: number;
    ipAddress: string;
}
/**
 * Panel for viewing and editing existing API keys
 */
export declare class APIKeyEditPanelComponent implements OnChanges {
    Visible: boolean;
    KeyId: string | null;
    VisibleChange: EventEmitter<boolean>;
    Updated: EventEmitter<MJAPIKeyEntity>;
    Revoked: EventEmitter<MJAPIKeyEntity>;
    Closed: EventEmitter<void>;
    private md;
    APIKey: MJAPIKeyEntity | null;
    IsLoading: boolean;
    IsSaving: boolean;
    IsRevoking: boolean;
    IsEditing: boolean;
    EditLabel: string;
    EditDescription: string;
    EditExpiresAt: Date | null;
    ScopeCategories: ScopeCategory[];
    IsLoadingScopes: boolean;
    HasScopeChanges: boolean;
    UsageLogs: UsageLogItem[];
    IsLoadingLogs: boolean;
    ActiveTab: 'details' | 'scopes' | 'usage';
    ShowRevokeConfirm: boolean;
    RevokeConfirmText: string;
    SuccessMessage: string;
    ErrorMessage: string;
    private readonly defaultUIConfig;
    ngOnChanges(changes: SimpleChanges): Promise<void>;
    /**
     * Handle escape key to close panel
     */
    onEscapeKey(): void;
    /**
     * Load the API key and related data
     */
    private loadKey;
    /**
     * Load all scopes and mark assigned ones
     */
    private loadScopes;
    /**
     * Load usage logs for this key
     */
    private loadUsageLogs;
    /**
     * Reset component state
     */
    private resetState;
    /**
     * Toggle edit mode
     */
    toggleEdit(): void;
    /**
     * Save changes to the key
     */
    saveChanges(): Promise<void>;
    /**
     * Save scope changes
     */
    saveScopeChanges(): Promise<void>;
    /**
     * Check for scope changes and update category allSelected states
     */
    onScopeChange(): void;
    /**
     * Toggle category expansion
     */
    toggleCategory(category: ScopeCategory): void;
    /**
     * Toggle all scopes in a category on/off
     */
    toggleCategoryAll(category: ScopeCategory): void;
    /**
     * Start revoke flow
     */
    startRevoke(): void;
    /**
     * Cancel revoke
     */
    cancelRevoke(): void;
    /**
     * Confirm and execute revoke using GraphQL client
     */
    confirmRevoke(): Promise<void>;
    /**
     * Format date for display
     */
    formatDate(date: Date | null): string;
    /**
     * Format relative time
     */
    formatRelativeTime(date: Date): string;
    /**
     * Get status class for HTTP status code
     */
    getStatusClass(statusCode: number): string;
    /**
     * Get assigned scope count
     */
    getAssignedScopeCount(): number;
    /**
     * Get selected scope count for a category (for template use)
     */
    getSelectedCount(category: ScopeCategory): number;
    /**
     * Get minimum date for expiration (tomorrow)
     */
    getMinDate(): Date;
    /**
     * Close the panel
     */
    close(): void;
    static ɵfac: i0.ɵɵFactoryDeclaration<APIKeyEditPanelComponent, never>;
    static ɵcmp: i0.ɵɵComponentDeclaration<APIKeyEditPanelComponent, "mj-api-key-edit-panel", never, { "Visible": { "alias": "Visible"; "required": false; }; "KeyId": { "alias": "KeyId"; "required": false; }; }, { "VisibleChange": "VisibleChange"; "Updated": "Updated"; "Revoked": "Revoked"; "Closed": "Closed"; }, never, never, false, never>;
}
export {};
//# sourceMappingURL=api-key-edit-panel.component.d.ts.map