import { BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core";
import { MJFileStorageAccountEntity, MJFileStorageProviderEntity } from "../generated/entity_subclasses.js";
/**
 * Represents a storage account with its associated provider details
 */
export interface StorageAccountWithProvider {
    account: MJFileStorageAccountEntity;
    provider: MJFileStorageProviderEntity;
}
/**
 * FileStorageEngineBase provides centralized, cached access to file storage accounts and providers.
 * This engine eliminates redundant database calls by caching the data and making it available
 * across the application. It is safe to use on both client and server — it only deals with
 * cached metadata, not file I/O.
 *
 * For server-side file operations (upload, download, driver initialization), use the
 * `FileStorageEngine` class from `@memberjunction/storage` which wraps this base via containment.
 *
 * Usage:
 * ```typescript
 * const engine = FileStorageEngineBase.Instance;
 * await engine.Config(false);  // Use cached data if available
 * const accounts = engine.AccountsWithProviders;
 * ```
 */
export declare class FileStorageEngineBase extends BaseEngine<FileStorageEngineBase> {
    /**
     * 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(): FileStorageEngineBase;
    private _accounts;
    private _providers;
    /**
     * Configures the engine by loading file storage accounts and providers.
     * @param forceRefresh - If true, forces a refresh from the database even if data is cached
     * @param contextUser - Optional user context for server-side operations
     * @param provider - Optional metadata provider
     */
    Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
    /**
     * Gets all file storage accounts
     */
    get Accounts(): MJFileStorageAccountEntity[];
    /**
     * Gets all file storage providers.
     * Consumers should filter by IsActive if needed.
     */
    get Providers(): MJFileStorageProviderEntity[];
    /**
     * Gets all storage accounts combined with their provider details.
     * Consumers should filter/sort as needed (e.g., by provider.IsActive).
     */
    get AccountsWithProviders(): StorageAccountWithProvider[];
    /**
     * Gets a file storage account by its ID
     * @param accountId - The ID of the account to find
     * @returns The account entity or undefined if not found
     */
    GetAccountById(accountId: string): MJFileStorageAccountEntity | undefined;
    /**
     * Gets a file storage provider by its ID
     * @param providerId - The ID of the provider to find
     * @returns The provider entity or undefined if not found
     */
    GetProviderById(providerId: string): MJFileStorageProviderEntity | undefined;
    /**
     * Gets a file storage account by its name (case-insensitive).
     * @param name - The name of the account to find
     * @returns The account entity or undefined if not found
     */
    GetAccountByName(name: string): MJFileStorageAccountEntity | undefined;
    /**
     * Gets file storage accounts linked to a given provider ID.
     * @param providerId - The provider ID to match against account.ProviderID
     * @returns Array of matching accounts (may be empty)
     */
    GetAccountsByProviderID(providerId: string): MJFileStorageAccountEntity[];
    /**
     * Gets a storage account with its provider details by account ID
     * @param accountId - The ID of the account to find
     * @returns The account with provider or null if not found or provider is inactive
     */
    GetAccountWithProvider(accountId: string): StorageAccountWithProvider | null;
}
//# sourceMappingURL=FileStorageEngine.d.ts.map