1 | # Installation
|
2 | > `npm install --save @types/serve-favicon`
|
3 |
|
4 | # Summary
|
5 | This package contains type definitions for serve-favicon (https://github.com/expressjs/serve-favicon).
|
6 |
|
7 | # Details
|
8 | Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-favicon.
|
9 | ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/serve-favicon/index.d.ts)
|
10 | ````ts
|
11 | // Type definitions for serve-favicon 2.5
|
12 | // Project: https://github.com/expressjs/serve-favicon
|
13 | // Definitions by: Uros Smolnik <https://github.com/urossmolnik>
|
14 | // Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
15 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
16 |
|
17 | /* =================== USAGE ===================
|
18 |
|
19 | import serveFavicon = require('serve-favicon');
|
20 | app.use(serveFavicon(__dirname + '/public/favicon.ico'));
|
21 |
|
22 | =============================================== */
|
23 |
|
24 | import express = require('express');
|
25 |
|
26 | /**
|
27 | * Node.js middleware for serving a favicon.
|
28 | */
|
29 | declare function serveFavicon(
|
30 | path: string | Buffer,
|
31 | options?: serveFavicon.Options
|
32 | ): express.RequestHandler;
|
33 |
|
34 | declare namespace serveFavicon {
|
35 | interface Options {
|
36 | /**
|
37 | * The cache-control max-age directive in ms, defaulting to 1 day.
|
38 | * This can also be a string accepted by the `ms` module.
|
39 | */
|
40 | maxAge?: number | string | undefined;
|
41 | }
|
42 | }
|
43 |
|
44 | export = serveFavicon;
|
45 |
|
46 | ````
|
47 |
|
48 | ### Additional Details
|
49 | * Last updated: Tue, 06 Jul 2021 16:34:37 GMT
|
50 | * Dependencies: [@types/express](https://npmjs.com/package/@types/express)
|
51 | * Global values: none
|
52 |
|
53 | # Credits
|
54 | These definitions were written by [Uros Smolnik](https://github.com/urossmolnik), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
55 |
|
\ | No newline at end of file |