import * as i0 from '@angular/core';
import { InjectionToken } from '@angular/core';
import { Observable } from 'rxjs';

interface SdCacheOption<T = any> {
    type?: 'memory' | 'session' | 'local';
    hours?: number;
    default?: T;
    args?: Record<string, any>;
}
interface SdCache<T = any> {
    get: () => T;
    set: (data: T) => void;
    has: () => boolean;
    remove: () => void;
    destroy: () => void;
    observer: Observable<T | undefined>;
    load: (callback: () => Promise<T>) => Promise<T>;
}
interface ISdCacheConfiguration {
    convertKey?: (key: string) => string;
    set?: (key: string, value: {
        data: any;
        createdOn: Date;
    }, option?: SdCacheOption) => Promise<void>;
    get?: (key: string, option?: SdCacheOption) => Promise<{
        data: any;
        createdOn: Date;
    }>;
    remove?: (key: string, option?: SdCacheOption) => Promise<void>;
}
declare const SD_CACHE_CONFIG: InjectionToken<ISdCacheConfiguration>;

declare class SdCacheService {
    #private;
    constructor();
    create<T = any>(key: string | object, option?: SdCacheOption<T>): SdCache<T>;
    static ɵfac: i0.ɵɵFactoryDeclaration<SdCacheService, never>;
    static ɵprov: i0.ɵɵInjectableDeclaration<SdCacheService>;
}

export { SD_CACHE_CONFIG, SdCacheService };
export type { ISdCacheConfiguration, SdCache, SdCacheOption };
