Skip to content

Commit

Permalink
fix: update TypeScript definition of RelayResponse to match Flow de…
Browse files Browse the repository at this point in the history
…finition
  • Loading branch information
nirvdrum authored and nodkz committed Jan 28, 2020
1 parent 20c6eeb commit c22806a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ export type FetchResponse = Response;
export type Variables = { [name: string]: any };

declare class RelayResponse {
_res: any;

data?: PayloadData;
errors?: any[];

ok: any;
status: number;
statusText?: string;
headers?: Headers;
url?: string;
text?: string;
json: unknown;

static createFromFetch(res: FetchResponse): Promise<RelayResponse>;

static createFromGraphQL(res: { errors?: any; data?: any }): Promise<RelayResponse>;

processJsonData(json: any): void;
processJsonData(json: unknown): void;
clone(): RelayResponse;
toString(): string;
}
export { RelayResponse as RelayNetworkLayerResponse };

Expand Down

0 comments on commit c22806a

Please sign in to comment.