import { Request as ERequest, Response as EResponse } from "express"; import AsyncResponse from "./async.response"; /** * This interface defines the currently available options for files. */ export interface FileOptions { width: number; height?: number; } /** * Generation of a File response. */ export default class FileResponse extends AsyncResponse { private readonly path; private _contentType?; private _fileName; private _options?; constructor(path: string); /** * Set the content type of the response. * @param value the content type */ contentType: string; /** * Set the name of the file to download * @param value the name of the file */ fileName: string; /** * Set the file options, to correctly generate the response. * @param value the FileOptions */ options: FileOptions; private download; /** * Generation of the response. * This method can eventually perform some transformation on output if a * FileOptions was specified. */ asyncResponse(_: ERequest, res: EResponse): Promise; }