@@ -10,17 +10,70 @@ import { type HeadersLike } from './headers';
1010export type FinalRequestOptions = RequestOptions & { method : HTTPMethod ; path : string } ;
1111
1212export type RequestOptions = {
13+ /**
14+ * The HTTP method for the request (e.g., 'get', 'post', 'put', 'delete').
15+ */
1316 method ?: HTTPMethod ;
17+
18+ /**
19+ * The URL path for the request.
20+ *
21+ * @example "/v1/foo"
22+ */
1423 path ?: string ;
24+
25+ /**
26+ * Query parameters to include in the request URL.
27+ */
1528 query ?: object | undefined | null ;
29+
30+ /**
31+ * The request body. Can be a string, JSON object, FormData, or other supported types.
32+ */
1633 body ?: unknown ;
34+
35+ /**
36+ * HTTP headers to include with the request. Can be a Headers object, plain object, or array of tuples.
37+ */
1738 headers ?: HeadersLike ;
39+
40+ /**
41+ * The maximum number of times that the client will retry a request in case of a
42+ * temporary failure, like a network error or a 5XX error from the server.
43+ *
44+ * @default 2
45+ */
1846 maxRetries ?: number ;
47+
1948 stream ?: boolean | undefined ;
49+
50+ /**
51+ * The maximum amount of time (in milliseconds) that the client should wait for a response
52+ * from the server before timing out a single request.
53+ *
54+ * @unit milliseconds
55+ */
2056 timeout ?: number ;
57+
58+ /**
59+ * Additional `RequestInit` options to be passed to the underlying `fetch` call.
60+ * These options will be merged with the client's default fetch options.
61+ */
2162 fetchOptions ?: MergedRequestInit ;
63+
64+ /**
65+ * An AbortSignal that can be used to cancel the request.
66+ */
2267 signal ?: AbortSignal | undefined | null ;
68+
69+ /**
70+ * A unique key for this request to enable idempotency.
71+ */
2372 idempotencyKey ?: string ;
73+
74+ /**
75+ * Override the default base URL for this specific request.
76+ */
2477 defaultBaseURL ?: string | undefined ;
2578
2679 __binaryResponse ?: boolean | undefined ;
0 commit comments