react-relay-network-modern
react-relay-network-modern copied to clipboard
Incorrect types in index.d.ts
Hey,
I've just started migrating my project to typescript and I noticed that im getting a typescript errors when I try to pass a function to fetchTimeout. I looked in retry.js and everything looks fine - the param can be a function:
export type RetryMiddlewareOpts = {|
fetchTimeout?: number | TimeoutAfterFn,
retryDelays?: number[] | RetryAfterFn,
statusCodes?: number[] | false | StatusCheckFn,
logger?: Function | false,
allowMutations?: boolean,
allowFormData?: boolean,
forceRetry?: ForceRetryFn | false, // DEPRECATED in favor `beforeRetry`
beforeRetry?: BeforeRetryCb | false,
|};
But in index.d.ts the parameters arent the same:
export interface RetryMiddlewareOpts {
fetchTimeout?: number;
retryDelays?: number[] | RetryAfterFn;
statusCodes?: number[] | false | StatusCheckFn;
logger?: Function | false;
allowMutations?: boolean;
allowFormData?: boolean;
forceRetry?: ForceRetryFn | false; // DEPRECATED in favor `beforeRetry`
beforeRetry?: BeforeRetryCb | false;
}
I think maybe you need to clean up this file? Im unsure why its like this. I assume this is some legacy type def
I don't have the bandwidth to fix these typesdefs. I will be very happy if somebody opens PR with fixes.
Thanks.