import { IncomingMessage, ServerResponse } from 'http'; interface SourceData { mtime?: Date; maxAge?: number; getData: () => Promise; } declare type Source = (src: string) => Promise; declare type SourceFactory = (options?: any) => Source; interface ImageMeta { width: number; height: number; type: string; mimeType: string; } interface IPXInputOptions { source?: string; modifiers?: Record; } interface IPXCTX { sources: Record; } declare type IPX = (id: string, opts?: IPXInputOptions) => { src: () => Promise; data: () => Promise<{ data: Buffer; meta: ImageMeta; format: string; }>; }; interface IPXOptions { dir?: false | string; domains?: false | string[]; alias: Record; sharp?: { [key: string]: any; }; } declare function createIPX(userOptions: Partial): IPX; interface IPXHRequest { url: string; headers?: Record; } interface IPXHResponse { statusCode: number; statusMessage: string; headers: Record; data: any; } declare function handleRequest(req: IPXHRequest, ipx: IPX): Promise; declare function createIPXMiddleware(ipx: IPX): (req: IncomingMessage, res: ServerResponse) => void; export { IPX, IPXCTX, IPXHRequest, IPXHResponse, IPXInputOptions, IPXOptions, ImageMeta, Source, SourceData, SourceFactory, createIPX, createIPXMiddleware, handleRequest };