1 | declare module 'send' {
|
2 | import {IncomingMessage, ServerResponse} from 'http';
|
3 | import * as mime from 'mime';
|
4 | module send {
|
5 | interface SendError extends Error {
|
6 | status: number;
|
7 | }
|
8 | interface SendOptions {
|
9 | cacheControl? :boolean,
|
10 | dotfiles?: string,
|
11 | end?: number,
|
12 | etag?: boolean,
|
13 | extensions?: boolean | Array<string>,
|
14 | hidden?: boolean,
|
15 | index?: boolean | string,
|
16 | lastModified?: boolean,
|
17 | maxAge?: number | string,
|
18 | root?: string,
|
19 | start?: number,
|
20 |
|
21 | }
|
22 | }
|
23 | interface SendStream extends NodeJS.EventEmitter{
|
24 | pipe(response: ServerResponse): SendStream;
|
25 | type(path: string): SendStream;
|
26 | isFresh(): boolean;
|
27 | }
|
28 | interface Charsets {
|
29 | lookup(mime: string): string;
|
30 | }
|
31 | interface Mime {
|
32 | lookup(path: string): string;
|
33 | extension(mime: string): string;
|
34 | load(filepath: string): void;
|
35 | define(mimes: Object): void;
|
36 |
|
37 | charsets: Charsets;
|
38 | default_type: string;
|
39 | }
|
40 | interface Send {
|
41 | (req: IncomingMessage, path: string, options?: send.SendOptions): SendStream;
|
42 | mime: Mime;
|
43 | }
|
44 | var send: Send;
|
45 | export = send;
|
46 | }
|