import { Service } from "../service"; import { MongodbService } from "./mongodbService"; import * as Leaf from "leaf-ts"; export declare type Callback = (e?: E, result?: T) => void; export declare const Errors: { UnknownError: Leaf.CustomErrorConstructor<{}>; NotFound: Leaf.CustomErrorConstructor<{}>; }; export declare class TTLSessionStorage extends Service { name: string; dependencies: string[]; services: { MongodbService: MongodbService; }; constructor(); initialize(): void; defaultTTL: number; private collectionName; private ttlCollection; createTTLSession(option: { id?: string; data: any; ttl?: number; }, callback: Callback): void; getOrCreateTTLSession(option: { id: string; data: T; ttl: number; }, callback: Callback<{ id: string; data: T; expire: Date; }>): void; deleteTTLSession(option: { id: string; }, callback: Callback): void; updateTTLSession(option: { id: string; data: any; refreshTTL?: number; }, callback: Callback): void; getTTLSessionDataById(option: { id: string; }, callback: Callback): void; } export interface TTLSessionData { id: string; data: any; expire: Date; }