Skip to content

Commit 284397e

Browse files
authored
🤖 Merge PR DefinitelyTyped#66944 Update types for [email protected] by @wenfw
1 parent 7577684 commit 284397e

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

types/koa-favicon/index.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ declare function favicon(path: string, options?: {
2424
* cache-control max-age directive in ms, defaulting to 1 day.
2525
*/
2626
maxage?: number | undefined;
27+
/**
28+
* MIME type of the file at path, defaulting to image/x-icon.
29+
*/
30+
mime?: string | undefined;
2731
}): Koa.Middleware;
2832

2933
declare namespace favicon {}

types/koa-favicon/koa-favicon-tests.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,15 @@ import favicon = require("koa-favicon");
44
const app = new Koa();
55

66
app.use(favicon(__dirname + "/public/favicon.ico"));
7+
app.use(favicon(__dirname + "/public/favicon.ico", {
8+
maxage: 1000,
9+
mime: "image/svg+xml",
10+
}));
11+
app.use(favicon(__dirname + "/public/favicon.ico", {
12+
maxage: 1000,
13+
}));
14+
app.use(favicon(__dirname + "/public/favicon.ico", {
15+
mime: "image/svg+xml",
16+
}));
717

818
app.listen(80);

0 commit comments

Comments
 (0)