1 | import superagent = require("superagent");
|
2 | import stAgent = require("./lib/agent");
|
3 | import STest = require("./lib/test");
|
4 | import { AgentOptions as STAgentOptions, App } from "./types";
|
5 |
|
6 | declare const supertest: supertest.SuperTestStatic;
|
7 |
|
8 | declare namespace supertest {
|
9 | type Response = superagent.Response;
|
10 |
|
11 | type Request = superagent.SuperAgentRequest;
|
12 |
|
13 | type CallbackHandler = superagent.CallbackHandler;
|
14 |
|
15 |
|
16 | interface Test extends STest {}
|
17 |
|
18 |
|
19 | interface Agent extends stAgent {}
|
20 |
|
21 | interface Options {
|
22 | http2?: boolean;
|
23 | }
|
24 |
|
25 | type AgentOptions = STAgentOptions;
|
26 |
|
27 | type SuperTest<Req extends Test = Test> = superagent.SuperAgent<Req>;
|
28 |
|
29 | type SuperAgentTest = SuperTest<Test>;
|
30 |
|
31 | interface SuperTestStatic {
|
32 | (app: App, options?: STAgentOptions): stAgent;
|
33 | Test: typeof STest;
|
34 | agent: typeof stAgent & ((app?: App, options?: STAgentOptions) => InstanceType<typeof stAgent>);
|
35 | }
|
36 | }
|
37 |
|
38 | export = supertest;
|
39 |
|
\ | No newline at end of file |