namespace Receptacle { export interface Options { id?: number|string; max?: number; items?: Items[]; lastModified?: Date; } export interface Export { id: number|string; max: number|undefined; items: (Items & InternalItemData)[]; lastModified: Date; } export interface SetOptions { ttl?: number; refresh?: boolean; meta?: X; } export interface InternalItemData { meta: X|undefined; refresh: number|undefined; expires: number|undefined; } export interface Items { key: string; value: T; } } class Receptacle { constructor(options?: Receptacle.Options); public id: number|string; public max: number; public items: Receptacle.Items[]; public size: number; public has(key: string): boolean; public get(key: string): T|null; public meta(key: string): X|undefined; public set(key: string, value: T, options?: Receptacle.SetOptions): Receptacle; public delete(key: string): void; public expire(key: string, ms: number = 0): void; public clear(): void; public toJSON(): Receptacle.Export; } export = Receptacle;