import { Source } from "./source"; import { Mapper } from "./mapper"; import { DatabaseSessionRegistry } from "./database-session-registry"; export interface CacheOptions { ttl: number; store?: "memory" | "redis" | "db"; prefix?: string; enabled?: boolean; } export interface CacheManager { readonly options: CacheOptions; isEnabled(): boolean; get(key: string): Promise; set(key: string, value: T, ttl?: number): Promise; delete(key: string): Promise; clear(prefix?: string): Promise; generateKey(operation: string, query: any): string; } export interface DataContext { source: Source; mapper: Mapper; } export interface NonDatabaseSource { aggregate(...args: unknown[]): any; insert(...args: unknown[]): any; remove(...args: unknown[]): any; find(...args: unknown[]): any; update(...args: unknown[]): any; count(...args: unknown[]): any; } export declare class DatabaseContext { static isDatabaseContext(value: any): value is DatabaseContext; readonly isDatabaseContext: boolean; source: Source; sessions: DatabaseSessionRegistry; mapper: Mapper; cache?: CacheManager; constructor(source: Source, mapper: Mapper, sessions: DatabaseSessionRegistry, cache?: CacheManager); isCacheEnabled(): boolean; getCacheKey(operation: string, query: any): string; } export declare class WebContext { static isWebContext(value: any): value is WebContext; readonly isWebContext: boolean; baseUrl: string; source: NonDatabaseSource; mapper: Mapper; constructor(baseUrl: string, source: NonDatabaseSource, mapper: Mapper); } export declare class SocketContext { static isSocketContext(value: any): value is SocketContext; readonly isSocketContext: boolean; endpoint: string; source: NonDatabaseSource; mapper: Mapper; constructor(endpoint: string, source: NonDatabaseSource, mapper: Mapper); } export declare class BlockchainContext { static isBlockchainContext(value: any): value is BlockchainContext; readonly isBlockchainContext: boolean; network: string; source: NonDatabaseSource; mapper: Mapper; constructor(network: string, source: NonDatabaseSource, mapper: Mapper); } export declare class AnyContext { static isAnyContext(value: any): value is AnyContext; readonly isAnyContext: boolean; source: NonDatabaseSource; mapper: Mapper; constructor(source: NonDatabaseSource, mapper: Mapper); }