Skip to content

Commit 5fb2e23

Browse files
committed
Rename FetchRequestInit to FetchRequestOptions
1 parent 0587385 commit 5fb2e23

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ interface FetchResponse {
7979
arrayBuffer(): Promise<ArrayBuffer>;
8080
}
8181

82-
interface FetchRequestInit {
82+
interface FetchRequestOptions {
8383
method?: string;
8484
headers?: StringKeyWithStringValue;
8585
body?: any;
8686
}
8787

88-
type Fetcher = (input: string | URL, init?: FetchRequestInit) => Promise<FetchResponse>;
88+
type Fetcher = (input: string | URL, options?: FetchRequestOptions) => Promise<FetchResponse>;
8989

9090
export class ApiClient {
9191
public requestAsync(options: ApiRequestOptions): Promise<ApiResult> {
@@ -97,7 +97,7 @@ export class ApiClient {
9797

9898
const responseEncoding: BufferEncoding | null = options.encoding === null ? null : options.encoding || 'utf-8';
9999

100-
const requestOptions: FetchRequestInit = {
100+
const requestOptions: FetchRequestOptions = {
101101
method: options.method || 'GET',
102102
headers: options.headers,
103103
};
@@ -136,7 +136,7 @@ export class ApiClient {
136136

137137
private async doFetchRequest(
138138
url: URL,
139-
requestOptions: FetchRequestInit,
139+
requestOptions: FetchRequestOptions,
140140
responseEncoding: BufferEncoding | null
141141
): Promise<ApiResult> {
142142
const fetcher = this.getFetch();

0 commit comments

Comments
 (0)