request-mocking-protocol
Version:
A protocol for declarative mocking of HTTP requests
22 lines • 760 B
TypeScript
/**
* RequestMatcher class.
* The same as URLPattern, but for matching the whole HTTP request.
* See: https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API
* See: https://developer.chrome.com/docs/web-platform/urlpattern
*
* todo: move to a separate package.
*/
import { MockRequestSchema } from '../protocol';
export declare class RequestMatcher {
schema: MockRequestSchema;
private debug?;
private methodMatcher;
private urlMatcher;
private queryMatcher;
private headersMatcher;
private bodyMatcher;
constructor(schema: MockRequestSchema, debug?: boolean | undefined);
match(req: Request): Promise<Record<string, string> | null>;
private ensureSingleQuerySource;
}
//# sourceMappingURL=index.d.ts.map