import { Files } from 'formidable'; import { UploadedFile } from './uploaded-file.js'; import { FileBag as FileBagContract } from '@supercharge/contracts'; interface UploadedFileType { [name: string]: UploadedFile | UploadedFile[]; } export declare class FileBag implements FileBagContract { /** * Stores the files on the request. */ private readonly files; /** * Create a new instance. */ constructor(files?: UploadedFileType); /** * Convert the given `files` to Supercharge uploaded file instances. */ static createFromBase(files?: Files): FileBag; /** * Returns an object of all uploaded files. */ all(...keys: string[] | string[][]): { [name: string]: UploadedFile | UploadedFile[] | undefined; }; /** * Returns the uploaded file or file array for the given `name`. Returns * `undefined` if no file exists on the request for the given `name`. */ get(name: string): UploadedFile | UploadedFile[] | undefined; /** * A a file header for the given `name` and assign the `value`. * This will override an existing header for the given `name`. */ add(name: string, value: UploadedFile | UploadedFile[]): this; /** * Determine whether the HTTP header for the given `name` exists. */ has(name: string): boolean; /** * Determine whether files were uploaded on the request. */ isEmpty(): boolean; /** * Returns an object containing all files in the bag. */ toJSON(): UploadedFileType; } export {};