import { WebDriver } from 'selenium-webdriver'; /** * The ClientFetch call interface */ export interface ClientFetch { fetch(driver: WebDriver, requestInfo: MarshalableRequestInfo, responseInfo: MarshalableResponseInfo, init?: MarshalableRequestInit): Promise; } export type BodyAs = 'json' | 'text'; export interface MarshalableBodyAsJSON { kind: 'json'; body: any; } export interface MarshalableBodyAsText { kind: 'text'; body: string; } export type MarshalableBody = MarshalableBodyAsJSON | MarshalableBodyAsText; export type MarshalableHeaders = Record; export interface MarshalableResponseInfo { responseBodyAs: BodyAs; } export type MarshalableRequestInfo = string; /** * An interface used to describe the Request for * a browser fetch call. The headers and json fields are json objects. */ export interface MarshalableRequestInit { body?: MarshalableBody | null; cache?: RequestCache; credentials?: RequestCredentials; headers?: MarshalableHeaders; integrity?: string; keepalive?: boolean; method?: string; mode?: RequestMode; redirect?: RequestRedirect; referrer?: string; referrerPolicy?: ReferrerPolicy; } /** * An interface used to describe the summary results of a Response object from * a browser fetch call. The headers and json fields are json objects. */ export interface MarshaledResponse { readonly body: Readonly; readonly headers: Readonly; readonly ok: boolean; readonly redirected: boolean; readonly status: number; readonly statusText: string; readonly type: ResponseType; readonly url: string; } export declare class OjFetch implements ClientFetch { fetch(driver: WebDriver, requestInfo: MarshalableRequestInfo, responseInfo: MarshalableResponseInfo, init?: MarshalableRequestInit): Promise; }