import { BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core";
import { MJUserViewEntityExtended } from "../custom/MJUserViewEntityExtended.js";
/**
 * UserViewEngine is a singleton engine that provides centralized access to User Views.
 * It caches all views and provides efficient lookup methods for retrieving views by various criteria.
 *
 * This engine consolidates view loading into a single batched operation, improving performance
 * and enabling local caching for faster subsequent access.
 *
 * Usage:
 * ```typescript
 * // Initialize the engine on-demand before first use
 * await UserViewEngine.Instance.Config(false);
 *
 * // Then access views
 * const myViews = engine.GetViewsForCurrentUser();
 * const entityViews = engine.GetViewsForEntity('entityId');
 * const view = engine.GetViewById('viewId');
 * ```
 *
 * Note: This engine is NOT auto-started at application startup. You must call Config() before use.
 * Views are cached globally. Use the filtering methods to get views for specific users or entities.
 */
export declare class UserViewEngine extends BaseEngine<UserViewEngine> {
    /**
     * Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application.
     * Do not directly create new instances of it, always use this method to get the instance.
     */
    static get Instance(): UserViewEngine;
    private _views;
    private _contextUserId;
    /**
     * Configures the engine by loading all User Views from the database.
     * Views are cached locally for performance.
     *
     * @param forceRefresh - If true, forces a refresh from the server even if data is cached
     * @param contextUser - The user context (required for server-side, auto-detected on client)
     * @param provider - Optional custom metadata provider
     */
    Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
    /**
     * Get all views in the cache (unfiltered)
     */
    get AllViews(): MJUserViewEntityExtended[];
    /**
     * Get a view by its ID
     * @param viewId - The view ID to find
     * @returns The view entity or undefined if not found
     */
    GetViewById(viewId: string): MJUserViewEntityExtended | undefined;
    /**
     * Get a view by its name
     * @param viewName - The view name to find
     * @returns The view entity or undefined if not found
     */
    GetViewByName(viewName: string): MJUserViewEntityExtended | undefined;
    /**
     * Get all views for a specific entity
     * @param entityId - The entity ID to filter by
     * @returns Array of views for the entity
     */
    GetViewsForEntity(entityId: string): MJUserViewEntityExtended[];
    /**
     * Get all views for a specific entity by entity name
     * @param entityName - The entity name to filter by
     * @returns Array of views for the entity
     */
    GetViewsForEntityByName(entityName: string): MJUserViewEntityExtended[];
    /**
     * Get all views owned by the current user (based on context user)
     * @returns Array of views owned by the current user
     */
    GetViewsForCurrentUser(): MJUserViewEntityExtended[];
    /**
     * Get all views owned by a specific user
     * @param userId - The user ID to filter by
     * @returns Array of views owned by the user
     */
    GetViewsForUser(userId: string): MJUserViewEntityExtended[];
    /**
     * Get all shared views (views marked as shared that the user doesn't own)
     * @returns Array of shared views
     */
    GetSharedViews(): MJUserViewEntityExtended[];
    /**
     * Get all views accessible to the current user for a specific entity
     * (includes owned views and shared views)
     * @param entityId - The entity ID to filter by
     * @returns Array of accessible views for the entity
     */
    GetAccessibleViewsForEntity(entityId: string): MJUserViewEntityExtended[];
    /**
     * Get views for a specific entity owned by the current user
     * @param entityId - The entity ID to filter by
     * @returns Array of views for the entity owned by the current user
     */
    GetMyViewsForEntity(entityId: string): MJUserViewEntityExtended[];
    /**
     * Get shared views for a specific entity (not owned by current user)
     * @param entityId - The entity ID to filter by
     * @returns Array of shared views for the entity
     */
    GetSharedViewsForEntity(entityId: string): MJUserViewEntityExtended[];
    /**
     * Get the default view for an entity for the current user
     * @param entityId - The entity ID to find default view for
     * @returns The default view or undefined if none exists
     */
    GetDefaultViewForEntity(entityId: string): MJUserViewEntityExtended | undefined;
    /**
     * Check if a view exists by ID
     * @param viewId - The view ID to check
     * @returns True if the view exists
     */
    ViewExists(viewId: string): boolean;
    /**
     * Check if a view with the given name exists for an entity
     * @param entityId - The entity ID
     * @param viewName - The view name to check
     * @returns True if a view with that name exists for the entity
     */
    ViewNameExistsForEntity(entityId: string, viewName: string): boolean;
    /**
     * Force refresh the view cache
     * Useful after creating, updating, or deleting a view
     */
    RefreshCache(contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
    /**
     * Get the current context user ID
     */
    get ContextUserId(): string | null;
}
//# sourceMappingURL=UserViewEngine.d.ts.map