import { Observable } from 'rxjs';
import { DataExplorerState, RecentItem, FavoriteItem, BreadcrumbItem, DataExplorerFilter, RecentRecordAccess, FavoriteRecord, DataExplorerViewMode } from '../models/explorer-state.interface';
import * as i0 from "@angular/core";
export declare class ExplorerStateService {
    private state$;
    private metadata;
    private saveTimeout;
    /** Current context filter (determines which settings key to use) */
    private currentFilter;
    /** Computed breadcrumbs based on current state */
    private breadcrumbs$;
    /** Recent records loaded from User Record Logs */
    private recentRecords$;
    /** Favorite records loaded from User Favorites (non-entity favorites) */
    private favoriteRecords$;
    /** Application entities with DefaultForNewUser info (loaded once per context) */
    private applicationEntities;
    /** Set of entity IDs that have DefaultForNewUser=true */
    private defaultEntityIds;
    constructor();
    /**
     * Set the context filter and load context-specific state.
     * Call this before using the service to ensure proper context isolation.
     */
    setContext(filter: DataExplorerFilter | null): Promise<void>;
    /**
     * Get the storage key based on current context.
     * Uses application ID if available for context-specific storage.
     */
    private getSettingKey;
    /**
     * Get observable of current state
     */
    get State(): Observable<DataExplorerState>;
    /**
     * Get current state value
     */
    get CurrentState(): DataExplorerState;
    /**
     * Observable of current breadcrumbs
     */
    get Breadcrumbs(): Observable<BreadcrumbItem[]>;
    /**
     * Get current breadcrumbs value
     */
    get CurrentBreadcrumbs(): BreadcrumbItem[];
    /**
     * Get the current context filter
     */
    get CurrentFilter(): DataExplorerFilter | null;
    /**
     * Observable of recent records (from User Record Logs)
     */
    get RecentRecords(): Observable<RecentRecordAccess[]>;
    /**
     * Get current recent records value
     */
    get CurrentRecentRecords(): RecentRecordAccess[];
    /**
     * Observable of favorite records (from User Favorites, non-entity)
     */
    get FavoriteRecords(): Observable<FavoriteRecord[]>;
    /**
     * Get current favorite records value
     */
    get CurrentFavoriteRecords(): FavoriteRecord[];
    /**
     * Get the set of entity IDs with DefaultForNewUser=true
     */
    get DefaultEntityIds(): Set<string>;
    /**
     * Update state partially
     */
    updateState(partial: Partial<DataExplorerState>): void;
    /**
     * Set selected entity
     * Caches current entity's filter before switching, restores new entity's cached filter
     */
    selectEntity(entityName: string | null): void;
    /**
     * Evict oldest cache entries if over limit (LRU eviction)
     */
    private evictOldCacheEntries;
    /**
     * Set selected view
     */
    selectView(viewId: string | null): void;
    /**
     * Mark the current view as modified (has unsaved changes)
     */
    setViewModified(modified: boolean): void;
    /**
     * Toggle the view configuration panel
     */
    toggleViewConfigPanel(): void;
    /**
     * Open the view configuration panel
     */
    openViewConfigPanel(): void;
    /**
     * Close the view configuration panel
     */
    closeViewConfigPanel(): void;
    /**
     * Set view mode
     */
    setViewMode(mode: DataExplorerViewMode): void;
    /**
     * Set smart filter prompt
     * Also updates the entity cache for the current entity
     */
    setSmartFilterPrompt(prompt: string): void;
    /**
     * Select a record and open detail panel
     * @param recordId The composite key string for the record
     * @param recordName Optional display name for the record (for breadcrumbs)
     */
    selectRecord(recordId: string | null, recordName?: string): void;
    /**
     * Close detail panel
     */
    closeDetailPanel(): void;
    /**
     * Toggle navigation panel collapsed state
     */
    toggleNavigationPanel(): void;
    /**
     * Expand navigation panel and ensure a specific section is expanded
     */
    expandAndFocusSection(section: 'favorites' | 'recent' | 'entities'): void;
    /**
     * Add item to recent history
     */
    addRecentItem(item: Omit<RecentItem, 'timestamp'>): void;
    /**
     * Add item to favorites
     */
    addFavorite(item: FavoriteItem): void;
    /**
     * Remove item from favorites
     */
    removeFavorite(item: FavoriteItem): void;
    /**
     * Toggle section expanded state
     */
    toggleSection(section: 'favorites' | 'recent' | 'entities' | 'views'): void;
    /**
     * Load state from UserSetting using UserInfoEngine for cached access
     */
    private loadState;
    /**
     * Update breadcrumbs based on current state and filter
     */
    private updateBreadcrumbs;
    /**
     * Format entity icon to ensure proper Font Awesome class format
     */
    private formatEntityIcon;
    /**
     * Debounced save to avoid too many writes
     */
    private debouncedSave;
    /**
     * Save state to UserSetting using UserInfoEngine for cached lookup
     */
    private saveState;
    /**
     * Navigate to a specific breadcrumb level.
     * Clears any selection deeper than the clicked breadcrumb.
     */
    navigateToBreadcrumb(breadcrumb: BreadcrumbItem): void;
    /**
     * Toggle between showing all entities or just common (DefaultForNewUser) entities
     */
    toggleShowAllEntities(): void;
    /**
     * Toggle the quick access (right) panel open/closed
     */
    toggleQuickAccessPanel(): void;
    /**
     * Toggle a quick access section's expanded state
     */
    toggleQuickAccessSection(sectionId: string): void;
    /**
     * Toggle an application group's expanded/collapsed state
     */
    toggleAppGroupExpanded(appId: string): void;
    /**
     * Set the home view mode (all vs favorites)
     */
    setHomeViewMode(mode: 'all' | 'favorites'): void;
    /**
     * Track entity access - called when user navigates to an entity
     */
    trackEntityAccess(entityName: string, entityId: string): void;
    /**
     * Add entity to favorites using User Favorites entity
     */
    addEntityToFavorites(entityName: string, entityId: string): Promise<boolean>;
    /**
     * Remove entity from favorites
     */
    removeEntityFromFavorites(entityId: string): Promise<boolean>;
    /**
     * Check if an entity is favorited
     */
    isEntityFavorited(entityId: string): boolean;
    /**
     * Load application entities with DefaultForNewUser information
     */
    private loadApplicationEntities;
    /**
     * Load favorite entities from User Favorites using UserInfoEngine
     */
    private loadFavoriteEntities;
    /**
     * Load recent records from User Record Logs with batch record name lookup using UserInfoEngine
     */
    private loadRecentRecords;
    /**
     * Build a CompositeKey for a record. RecordID may be stored as either:
     * - Concatenated format: "FieldName|Value" or "Field1|Val1||Field2|Val2"
     * - Plain value: just the raw value (e.g. a GUID)
     * Detects the format and constructs the key accordingly.
     */
    private buildCompositeKeyForRecord;
    /**
     * Refresh recent records (call after navigating to a record)
     */
    refreshRecentRecords(): Promise<void>;
    /**
     * Add or update a recent record locally (without DB refresh).
     * Call this when a record is selected to provide instant UI feedback.
     * The DB write happens separately via RecentAccessService.logAccess().
     *
     * @param entityName The entity name
     * @param entityId The entity ID
     * @param recordId The record ID (primary key value)
     * @param recordName Optional display name for the record
     */
    addLocalRecentRecord(entityName: string, entityId: string, recordId: string, recordName?: string): void;
    /**
     * Load favorite records from User Favorites (non-entity favorites) with batch record name lookup using UserInfoEngine.
     * Filters to only include records from entities in the current application context.
     */
    private loadFavoriteRecords;
    static ɵfac: i0.ɵɵFactoryDeclaration<ExplorerStateService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<ExplorerStateService>;
}
//# sourceMappingURL=explorer-state.service.d.ts.map