@types/koa-send
- Version 4.1.6
- Published
- 6.81 kB
- 1 dependency
- MIT license
Install
npm i @types/koa-send
yarn add @types/koa-send
pnpm add @types/koa-send
Overview
TypeScript definitions for koa-send
Index
Functions
Interfaces
Type Aliases
Functions
function send
send: ( ctx: ParameterizedContext, path: string, opts?: send.SendOptions) => Promise<string>;
Interfaces
interface SendOptions
interface SendOptions {}
property brotli
brotli?: boolean | undefined;
Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists. (defaults to true).
property extensions
extensions?: string[] | false | undefined;
Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to false)
property format
format?: boolean | undefined;
If not false (defaults to true), format the path to serve static file servers and not require a trailing slash for directories, so that you can do both /directory and /directory/.
property gzip
gzip?: boolean | undefined;
Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. (defaults to true).
property hidden
hidden?: boolean | undefined;
Allow transfer of hidden files. (defaults to false)
property immutable
immutable?: boolean | undefined;
Tell the browser the resource is immutable and can be cached indefinitely. (defaults to false)
property index
index?: string | false | undefined;
Name of the index file to serve automatically when visiting the root location. (defaults to none)
property maxage
maxage?: number | undefined;
Browser cache max-age in milliseconds. (defaults to 0)
property maxAge
maxAge?: SendOptions['maxage'] | undefined;
property root
root?: string | undefined;
Root directory to restrict file access. (defaults to '')
property setHeaders
setHeaders?: SetHeaders | undefined;
Function to set custom headers on response.
Type Aliases
type SetHeaders
type SetHeaders = ( res: ParameterizedContext['res'], path: string, stats: Stats) => any;
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/koa-send
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/koa-send)
- HTML<a href="https://www.jsdocs.io/package/@types/koa-send"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 3597 ms. - Missing or incorrect documentation? Open an issue for this package.