Add 'extensions' option.

This commit is contained in:
Peter Safranek
2017-01-09 20:03:41 -08:00
parent cf2512beb1
commit 1fe97bbf37
3 changed files with 3 additions and 28 deletions
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for koa-send v3.x
// Type definitions for koa-send v3.3
// Project: https://github.com/koajs/send
// Definitions by: Peter Safranek <https://github.com/pe8ter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -13,6 +13,7 @@ interface ISendOptions {
format?: boolean;
gzip?: boolean;
setHeaders?: Function;
extensions?: string[];
}
declare function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise<string>;
+1
View File
@@ -17,5 +17,6 @@ app.use(async (ctx: Koa.Context) => {
format: true,
gzip: true,
setHeaders: () => {},
extensions: ['shemp'],
});
});
-27
View File
@@ -1,27 +0,0 @@
// Type definitions for koa-send v3.x
// Project: https://github.com/koajs/send
// Definitions by: Peter Safranek <https://github.com/pe8ter>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../koa/koa.d.ts" />
declare module "koa-send" {
import * as Koa from "koa";
interface ISendOptions {
root?: string;
index?: string;
maxAge?: number;
hidden?: boolean;
format?: boolean;
gzip?: boolean;
setHeaders?: Function;
}
function send(ctx: Koa.Context, path: string, opts?: ISendOptions): Promise<string>;
namespace send {}
export = send;
}