import LazilyLoadedRoute from './LazilyLoadedRoute.ts'; import type { KittenRequest, KittenResponse } from '../types/index.ts'; /** We convert the file upload metadata returned by Busboy to a leaner format that’s more ergonomic when authoring so we do a little bit of gymlastics with types so our intent is clear and the type checker is happy. */ type BusboyFileUploadMetadata = { uuid: string; filename: string; file: string; mimetype: string; field: string; encoding: string; truncated: boolean; done: boolean; }; type OriginalRequest = KittenRequest & { files?: Record; }; export declare class Upload { id: string; fileName: string; filePath: string; mimetype: string; field: string; encoding: string; truncated: boolean; done: boolean; constructor(parameters: { id: string; fileName: string; filePath: string; mimetype: string; field: string; encoding: string; truncated: boolean; done: boolean; }); /** Returns absolute resource path for accessing this upload via a GET request (content-disposition: inline). */ get resourcePath(): string; /** Returns the absolute download path (content-disposition: attachment). */ get downloadPath(): string; /** Deletes this uploaded file from the file system and also from the internal database. */ delete(): Promise; } export default class PostRoute extends LazilyLoadedRoute { _handler: Function | undefined; initialise(): Promise; /** Concrete overload that lazily loads the POST route handler if necessary and handles requests. */ lazilyLoadedHandler(request: OriginalRequest, response: KittenResponse): Promise; } export {};