Skip to content

covenix / FileResponseOptions

Interface: FileResponseOptions

Defined in: src/file-response.ts:10

Options for a FileResponse. Inherits status/headers/cookies from ResponseBaseOptions; the inherited headers are applied last, so they override the headers covenix derives from contentType/filename/disposition.

Extends

Properties

contentType?

optional contentType?: string

Defined in: src/file-response.ts:12

Content-Type for the response (e.g. 'application/pdf').


cookies?

optional cookies?: ResponseCookie[]

Defined in: src/response.ts:44

Cookies to set, each emitted as its own Set-Cookie header. Express formats them (encoding, Max-Age, SameSite, signing, …) — so you don't build the header string yourself.

Inherited from

ResponseBaseOptions.cookies


disposition?

optional disposition?: "inline" | "attachment"

Defined in: src/file-response.ts:20

Content-Disposition type. Defaults to 'attachment' when a filename is set (a download), otherwise unset. Use 'inline' to render in the browser (e.g. images, PDFs) while still suggesting filename.


filename?

optional filename?: string

Defined in: src/file-response.ts:14

Filename for Content-Disposition (RFC 5987 / UTF-8 encoded).


headers?

optional headers?: Record<string, HeaderValue>

Defined in: src/response.ts:38

Extra response headers. Values may be strings, numbers, or arrays of them (an array repeats the header). A header that matches a @Returns(..., { headers }) schema is validated against it; undeclared headers are allowed.

Inherited from

ResponseBaseOptions.headers


status?

optional status?: number

Defined in: src/response.ts:31

Explicit HTTP status. Defaults to the route's declared success status (the first 2xx @Returns, or 200). When set, it must match one of the route's declared @Returns statuses.

Inherited from

ResponseBaseOptions.status