Skip to content

Commit

Permalink
fix: cache typings
Browse files Browse the repository at this point in the history
  • Loading branch information
felippepuhle authored and nodkz committed Jul 22, 2020
1 parent 5014fa5 commit 9afe3d5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ExecuteFunction } from "relay-runtime";
import { ExecuteFunction, QueryResponseCache } from "relay-runtime";

export { QueryResponseCache };

export type FetchResponse = Response;
export type Variables = { [name: string]: any };
Expand Down Expand Up @@ -84,11 +86,6 @@ export { RelayRequestBatch as RelayNetworkLayerRequestBatch };

export type RelayRequestAny = RelayRequest | RelayRequestBatch;

export type QueryResponseCache = {
size: number;
ttl: number;
};

export type MiddlewareNextFn = (req: RelayRequestAny) => Promise<RelayResponse>;
export type Middleware = (next: MiddlewareNextFn) => MiddlewareNextFn;

Expand Down Expand Up @@ -158,7 +155,7 @@ export function batchMiddleware(opts?: BatchMiddlewareOpts): Middleware;
export interface CacheMiddlewareOpts {
size?: number;
ttl?: number;
onInit?: (cache: QueryResponseCache) => any;
onInit?: (cache: QueryResponseCache) => void;
allowMutations?: boolean;
allowFormData?: boolean;
clearOnMutation?: boolean;
Expand Down

0 comments on commit 9afe3d5

Please sign in to comment.