Skip to content

Commit

Permalink
[Type] Allow this.passthrough for repsonse param
Browse files Browse the repository at this point in the history
  • Loading branch information
xg-wang committed Apr 5, 2019
1 parent a7386aa commit 49e60c2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import FakeXMLHttpRequest from "fake-xml-http-request";
import { Params, QueryParams } from "route-recognizer";
import FakeXMLHttpRequest from 'fake-xml-http-request';
import { Params, QueryParams } from 'route-recognizer';

type SetupCallback = (this: Server) => void;
interface SetupConfig {
forcePassthrough: boolean;
}
export type Config = SetupCallback | SetupConfig;
export class Server {
public passthrough: RequestHandler;

constructor(config?: Config);
// HTTP request verbs
public get: RequestHandler;
public put: RequestHandler;
Expand All @@ -14,15 +18,14 @@ export class Server {
public delete: RequestHandler;
public options: RequestHandler;
public head: RequestHandler;
constructor(setup?: SetupCallback);

public shutdown(): void;
}

export type RequestHandler = (
urlExpression: string,
response: ResponseHandler,
async?: boolean | number
asyncOrDelay?: boolean | number
) => void;

export type ResponseData = [number, { [k: string]: string }, string];
Expand Down

0 comments on commit 49e60c2

Please sign in to comment.