UNPKG

1.02 kBTypeScriptView Raw
1// Type definitions for serve-favicon 2.5
2// Project: https://github.com/expressjs/serve-favicon
3// Definitions by: Uros Smolnik <https://github.com/urossmolnik>
4// Piotr Błażejewicz <https://github.com/peterblazejewicz>
5// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
6
7/* =================== USAGE ===================
8
9 import serveFavicon = require('serve-favicon');
10 app.use(serveFavicon(__dirname + '/public/favicon.ico'));
11
12 =============================================== */
13
14import express = require('express');
15
16/**
17 * Node.js middleware for serving a favicon.
18 */
19declare function serveFavicon(
20 path: string | Buffer,
21 options?: serveFavicon.Options
22): express.RequestHandler;
23
24declare namespace serveFavicon {
25 interface Options {
26 /**
27 * The cache-control max-age directive in ms, defaulting to 1 day.
28 * This can also be a string accepted by the `ms` module.
29 */
30 maxAge?: number | string;
31 }
32}
33
34export = serveFavicon;