google-spreadsheet 5.0.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,621 +1,6 @@
1
1
  import * as stream_web from 'stream/web';
2
2
  import { ReadableStream as ReadableStream$1 } from 'stream/web';
3
- import { Headers } from 'google-auth-library/build/src/auth/oauth2client';
4
-
5
- type Primitive = null | undefined | string | number | boolean | symbol | bigint;
6
- type LiteralUnion<LiteralType extends BaseType, BaseType extends Primitive> = LiteralType | (BaseType & {
7
- _?: never;
8
- });
9
-
10
- type KyResponse<T = unknown> = {
11
- json: <J = T>() => Promise<J>;
12
- } & Response;
13
-
14
- /**
15
- Returns a `Response` object with `Body` methods added for convenience. So you can, for example, call `ky.get(input).json()` directly without having to await the `Response` first. When called like that, an appropriate `Accept` header will be set depending on the body method used. Unlike the `Body` methods of `window.Fetch`; these will throw an `HTTPError` if the response status is not in the range of `200...299`. Also, `.json()` will return an empty string if body is empty or the response status is `204` instead of throwing a parse error due to an empty body.
16
- */
17
-
18
- type ResponsePromise<T = unknown> = {
19
- arrayBuffer: () => Promise<ArrayBuffer>;
20
- blob: () => Promise<Blob>;
21
- formData: () => Promise<FormData>;
22
- /**
23
- Get the response body as JSON.
24
-
25
- @example
26
- ```
27
- import ky from 'ky';
28
-
29
- const json = await ky(…).json();
30
- ```
31
-
32
- @example
33
- ```
34
- import ky from 'ky';
35
-
36
- interface Result {
37
- value: number;
38
- }
39
-
40
- const result1 = await ky(…).json<Result>();
41
- // or
42
- const result2 = await ky<Result>(…).json();
43
- ```
44
- */
45
- json: <J = T>() => Promise<J>;
46
- text: () => Promise<string>;
47
- } & Promise<KyResponse<T>>;
48
-
49
- type KyRequest<T = unknown> = {
50
- json: <J = T>() => Promise<J>;
51
- } & Request;
52
-
53
- declare class HTTPError<T = unknown> extends Error {
54
- response: KyResponse<T>;
55
- request: KyRequest;
56
- options: NormalizedOptions;
57
- constructor(response: Response, request: Request, options: NormalizedOptions);
58
- }
59
-
60
- type BeforeRequestHook = (request: KyRequest, options: NormalizedOptions) => Request | Response | void | Promise<Request | Response | void>;
61
- type BeforeRetryState = {
62
- request: KyRequest;
63
- options: NormalizedOptions;
64
- error: Error;
65
- retryCount: number;
66
- };
67
- type BeforeRetryHook = (options: BeforeRetryState) => typeof stop | void | Promise<typeof stop | void>;
68
- type AfterResponseHook = (request: KyRequest, options: NormalizedOptions, response: KyResponse) => Response | void | Promise<Response | void>;
69
- type BeforeErrorHook = (error: HTTPError) => HTTPError | Promise<HTTPError>;
70
- type Hooks = {
71
- /**
72
- This hook enables you to modify the request right before it is sent. Ky will make no further changes to the request after this. The hook function receives normalized input and options as arguments. You could, for example, modify `options.headers` here.
73
-
74
- A [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) can be returned from this hook to completely avoid making a HTTP request. This can be used to mock a request, check an internal cache, etc. An **important** consideration when returning a `Response` from this hook is that all the following hooks will be skipped, so **ensure you only return a `Response` from the last hook**.
75
-
76
- @default []
77
- */
78
- beforeRequest?: BeforeRequestHook[];
79
- /**
80
- This hook enables you to modify the request right before retry. Ky will make no further changes to the request after this. The hook function receives an object with the normalized request and options, an error instance, and the retry count. You could, for example, modify `request.headers` here.
81
-
82
- If the request received a response, the error will be of type `HTTPError` and the `Response` object will be available at `error.response`. Be aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will not be an instance of `HTTPError`.
83
-
84
- You can prevent Ky from retrying the request by throwing an error. Ky will not handle it in any way and the error will be propagated to the request initiator. The rest of the `beforeRetry` hooks will not be called in this case. Alternatively, you can return the [`ky.stop`](#ky.stop) symbol to do the same thing but without propagating an error (this has some limitations, see `ky.stop` docs for details).
85
-
86
- @example
87
- ```
88
- import ky from 'ky';
89
-
90
- const response = await ky('https://example.com', {
91
- hooks: {
92
- beforeRetry: [
93
- async ({request, options, error, retryCount}) => {
94
- const token = await ky('https://example.com/refresh-token');
95
- options.headers.set('Authorization', `token ${token}`);
96
- }
97
- ]
98
- }
99
- });
100
- ```
101
-
102
- @default []
103
- */
104
- beforeRetry?: BeforeRetryHook[];
105
- /**
106
- This hook enables you to read and optionally modify the response. The hook function receives normalized input, options, and a clone of the response as arguments. The return value of the hook function will be used by Ky as the response object if it's an instance of [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).
107
-
108
- @default []
109
-
110
- @example
111
- ```
112
- import ky from 'ky';
113
-
114
- const response = await ky('https://example.com', {
115
- hooks: {
116
- afterResponse: [
117
- (_input, _options, response) => {
118
- // You could do something with the response, for example, logging.
119
- log(response);
120
-
121
- // Or return a `Response` instance to overwrite the response.
122
- return new Response('A different response', {status: 200});
123
- },
124
-
125
- // Or retry with a fresh token on a 403 error
126
- async (input, options, response) => {
127
- if (response.status === 403) {
128
- // Get a fresh token
129
- const token = await ky('https://example.com/token').text();
130
-
131
- // Retry with the token
132
- options.headers.set('Authorization', `token ${token}`);
133
-
134
- return ky(input, options);
135
- }
136
- }
137
- ]
138
- }
139
- });
140
- ```
141
- */
142
- afterResponse?: AfterResponseHook[];
143
- /**
144
- This hook enables you to modify the `HTTPError` right before it is thrown. The hook function receives a `HTTPError` as an argument and should return an instance of `HTTPError`.
145
-
146
- @default []
147
-
148
- @example
149
- ```
150
- import ky from 'ky';
151
-
152
- await ky('https://example.com', {
153
- hooks: {
154
- beforeError: [
155
- error => {
156
- const {response} = error;
157
- if (response && response.body) {
158
- error.name = 'GitHubError';
159
- error.message = `${response.body.message} (${response.status})`;
160
- }
161
-
162
- return error;
163
- }
164
- ]
165
- }
166
- });
167
- ```
168
- */
169
- beforeError?: BeforeErrorHook[];
170
- };
171
-
172
- type RetryOptions = {
173
- /**
174
- The number of times to retry failed requests.
175
-
176
- @default 2
177
- */
178
- limit?: number;
179
- /**
180
- The HTTP methods allowed to retry.
181
-
182
- @default ['get', 'put', 'head', 'delete', 'options', 'trace']
183
- */
184
- methods?: string[];
185
- /**
186
- The HTTP status codes allowed to retry.
187
-
188
- @default [408, 413, 429, 500, 502, 503, 504]
189
- */
190
- statusCodes?: number[];
191
- /**
192
- The HTTP status codes allowed to retry with a `Retry-After` header.
193
-
194
- @default [413, 429, 503]
195
- */
196
- afterStatusCodes?: number[];
197
- /**
198
- If the `Retry-After` header is greater than `maxRetryAfter`, the request will be canceled.
199
-
200
- @default Infinity
201
- */
202
- maxRetryAfter?: number;
203
- /**
204
- The upper limit of the delay per retry in milliseconds.
205
- To clamp the delay, set `backoffLimit` to 1000, for example.
206
-
207
- By default, the delay is calculated in the following way:
208
-
209
- ```
210
- 0.3 * (2 ** (attemptCount - 1)) * 1000
211
- ```
212
-
213
- The delay increases exponentially.
214
-
215
- @default Infinity
216
- */
217
- backoffLimit?: number;
218
- /**
219
- A function to calculate the delay between retries given `attemptCount` (starts from 1).
220
-
221
- @default attemptCount => 0.3 * (2 ** (attemptCount - 1)) * 1000
222
- */
223
- delay?: (attemptCount: number) => number;
224
- };
225
-
226
- type SearchParamsInit = string | string[][] | Record<string, string> | URLSearchParams | undefined;
227
- type SearchParamsOption = SearchParamsInit | Record<string, string | number | boolean> | Array<Array<string | number | boolean>>;
228
- type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'head' | 'delete';
229
- type Input = string | URL | Request;
230
- type Progress = {
231
- percent: number;
232
- transferredBytes: number;
233
- /**
234
- Note: If it's not possible to retrieve the body size, it will be `0`.
235
- */
236
- totalBytes: number;
237
- };
238
- type KyHeadersInit = NonNullable<RequestInit['headers']> | Record<string, string | undefined>;
239
- /**
240
- Custom Ky options
241
- */
242
- type KyOptions = {
243
- /**
244
- Shortcut for sending JSON. Use this instead of the `body` option.
245
-
246
- Accepts any plain object or value, which will be `JSON.stringify()`'d and sent in the body with the correct header set.
247
- */
248
- json?: unknown;
249
- /**
250
- User-defined JSON-parsing function.
251
-
252
- Use-cases:
253
- 1. Parse JSON via the [`bourne` package](https://github.com/hapijs/bourne) to protect from prototype pollution.
254
- 2. Parse JSON with [`reviver` option of `JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
255
-
256
- @default JSON.parse()
257
-
258
- @example
259
- ```
260
- import ky from 'ky';
261
- import bourne from '@hapijs/bourne';
262
-
263
- const json = await ky('https://example.com', {
264
- parseJson: text => bourne(text)
265
- }).json();
266
- ```
267
- */
268
- parseJson?: (text: string) => unknown;
269
- /**
270
- User-defined JSON-stringifying function.
271
-
272
- Use-cases:
273
- 1. Stringify JSON with a custom `replacer` function.
274
-
275
- @default JSON.stringify()
276
-
277
- @example
278
- ```
279
- import ky from 'ky';
280
- import {DateTime} from 'luxon';
281
-
282
- const json = await ky('https://example.com', {
283
- stringifyJson: data => JSON.stringify(data, (key, value) => {
284
- if (key.endsWith('_at')) {
285
- return DateTime.fromISO(value).toSeconds();
286
- }
287
-
288
- return value;
289
- })
290
- }).json();
291
- ```
292
- */
293
- stringifyJson?: (data: unknown) => string;
294
- /**
295
- Search parameters to include in the request URL. Setting this will override all existing search parameters in the input URL.
296
-
297
- Accepts any value supported by [`URLSearchParams()`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams).
298
- */
299
- searchParams?: SearchParamsOption;
300
- /**
301
- A prefix to prepend to the `input` URL when making the request. It can be any valid URL, either relative or absolute. A trailing slash `/` is optional and will be added automatically, if needed, when it is joined with `input`. Only takes effect when `input` is a string. The `input` argument cannot start with a slash `/` when using this option.
302
-
303
- Useful when used with [`ky.extend()`](#kyextenddefaultoptions) to create niche-specific Ky-instances.
304
-
305
- Notes:
306
- - After `prefixUrl` and `input` are joined, the result is resolved against the [base URL](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI) of the page (if any).
307
- - Leading slashes in `input` are disallowed when using this option to enforce consistency and avoid confusion about how the `input` URL is handled, given that `input` will not follow the normal URL resolution rules when `prefixUrl` is being used, which changes the meaning of a leading slash.
308
-
309
- @example
310
- ```
311
- import ky from 'ky';
312
-
313
- // On https://example.com
314
-
315
- const response = await ky('unicorn', {prefixUrl: '/api'});
316
- //=> 'https://example.com/api/unicorn'
317
-
318
- const response = await ky('unicorn', {prefixUrl: 'https://cats.com'});
319
- //=> 'https://cats.com/unicorn'
320
- ```
321
- */
322
- prefixUrl?: URL | string;
323
- /**
324
- An object representing `limit`, `methods`, `statusCodes`, `afterStatusCodes`, and `maxRetryAfter` fields for maximum retry count, allowed methods, allowed status codes, status codes allowed to use the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time, and maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time.
325
-
326
- If `retry` is a number, it will be used as `limit` and other defaults will remain in place.
327
-
328
- If the response provides an HTTP status contained in `afterStatusCodes`, Ky will wait until the date or timeout given in the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header has passed to retry the request. If `Retry-After` is missing, the non-standard [`RateLimit-Reset`](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-02.html#section-3.3) header is used in its place as a fallback. If the provided status code is not in the list, the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header will be ignored.
329
-
330
- If `maxRetryAfter` is set to `undefined`, it will use `options.timeout`. If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will cancel the request.
331
-
332
- By default, delays between retries are calculated with the function `0.3 * (2 ** (attemptCount - 1)) * 1000`, where `attemptCount` is the attempt number (starts from 1), however this can be changed by passing a `delay` function.
333
-
334
- Retries are not triggered following a timeout.
335
-
336
- @example
337
- ```
338
- import ky from 'ky';
339
-
340
- const json = await ky('https://example.com', {
341
- retry: {
342
- limit: 10,
343
- methods: ['get'],
344
- statusCodes: [413]
345
- }
346
- }).json();
347
- ```
348
- */
349
- retry?: RetryOptions | number;
350
- /**
351
- Timeout in milliseconds for getting a response, including any retries. Can not be greater than 2147483647.
352
- If set to `false`, there will be no timeout.
353
-
354
- @default 10000
355
- */
356
- timeout?: number | false;
357
- /**
358
- Hooks allow modifications during the request lifecycle. Hook functions may be async and are run serially.
359
- */
360
- hooks?: Hooks;
361
- /**
362
- Throw an `HTTPError` when, after following redirects, the response has a non-2xx status code. To also throw for redirects instead of following them, set the [`redirect`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) option to `'manual'`.
363
-
364
- Setting this to `false` may be useful if you are checking for resource availability and are expecting error responses.
365
-
366
- Note: If `false`, error responses are considered successful and the request will not be retried.
367
-
368
- @default true
369
- */
370
- throwHttpErrors?: boolean;
371
- /**
372
- Download progress event handler.
373
-
374
- @param progress - Object containing download progress information.
375
- @param chunk - Data that was received. Note: It's empty for the first call.
376
-
377
- @example
378
- ```
379
- import ky from 'ky';
380
-
381
- const response = await ky('https://example.com', {
382
- onDownloadProgress: (progress, chunk) => {
383
- // Example output:
384
- // `0% - 0 of 1271 bytes`
385
- // `100% - 1271 of 1271 bytes`
386
- console.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);
387
- }
388
- });
389
- ```
390
- */
391
- onDownloadProgress?: (progress: Progress, chunk: Uint8Array) => void;
392
- /**
393
- Upload progress event handler.
394
-
395
- @param progress - Object containing upload progress information.
396
- @param chunk - Data that was sent. Note: It's empty for the last call.
397
-
398
- @example
399
- ```
400
- import ky from 'ky';
401
-
402
- const response = await ky.post('https://example.com/upload', {
403
- body: largeFile,
404
- onUploadProgress: (progress, chunk) => {
405
- // Example output:
406
- // `0% - 0 of 1271 bytes`
407
- // `100% - 1271 of 1271 bytes`
408
- console.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);
409
- }
410
- });
411
- ```
412
- */
413
- onUploadProgress?: (progress: Progress, chunk: Uint8Array) => void;
414
- /**
415
- User-defined `fetch` function.
416
- Has to be fully compatible with the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) standard.
417
-
418
- Use-cases:
419
- 1. Use custom `fetch` implementations like [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch).
420
- 2. Use the `fetch` wrapper function provided by some frameworks that use server-side rendering (SSR).
421
-
422
- @default fetch
423
-
424
- @example
425
- ```
426
- import ky from 'ky';
427
- import fetch from 'isomorphic-unfetch';
428
-
429
- const json = await ky('https://example.com', {fetch}).json();
430
- ```
431
- */
432
- fetch?: (input: Input, init?: RequestInit) => Promise<Response>;
433
- };
434
- /**
435
- Options are the same as `window.fetch`, except for the KyOptions
436
- */
437
- interface Options extends KyOptions, Omit<RequestInit, 'headers'> {
438
- /**
439
- HTTP method used to make the request.
440
-
441
- Internally, the standard methods (`GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`) are uppercased in order to avoid server errors due to case sensitivity.
442
- */
443
- method?: LiteralUnion<HttpMethod, string>;
444
- /**
445
- HTTP headers used to make the request.
446
-
447
- You can pass a `Headers` instance or a plain object.
448
-
449
- You can remove a header with `.extend()` by passing the header with an `undefined` value.
450
-
451
- @example
452
- ```
453
- import ky from 'ky';
454
-
455
- const url = 'https://sindresorhus.com';
456
-
457
- const original = ky.create({
458
- headers: {
459
- rainbow: 'rainbow',
460
- unicorn: 'unicorn'
461
- }
462
- });
463
-
464
- const extended = original.extend({
465
- headers: {
466
- rainbow: undefined
467
- }
468
- });
469
-
470
- const response = await extended(url).json();
471
-
472
- console.log('rainbow' in response);
473
- //=> false
474
-
475
- console.log('unicorn' in response);
476
- //=> true
477
- ```
478
- */
479
- headers?: KyHeadersInit;
480
- }
481
- /**
482
- Normalized options passed to the `fetch` call and the `beforeRequest` hooks.
483
- */
484
- interface NormalizedOptions extends RequestInit {
485
- method: NonNullable<RequestInit['method']>;
486
- credentials?: NonNullable<RequestInit['credentials']>;
487
- retry: RetryOptions;
488
- prefixUrl: string;
489
- onDownloadProgress: Options['onDownloadProgress'];
490
- onUploadProgress: Options['onUploadProgress'];
491
- }
492
-
493
- declare const stop: unique symbol;
494
-
495
- type KyInstance = {
496
- /**
497
- Fetch the given `url`.
498
-
499
- @param url - `Request` object, `URL` object, or URL string.
500
- @returns A promise with `Body` method added.
501
-
502
- @example
503
- ```
504
- import ky from 'ky';
505
-
506
- const json = await ky('https://example.com', {json: {foo: true}}).json();
507
-
508
- console.log(json);
509
- //=> `{data: '🦄'}`
510
- ```
511
- */
512
- <T>(url: Input, options?: Options): ResponsePromise<T>;
513
- /**
514
- Fetch the given `url` using the option `{method: 'get'}`.
515
-
516
- @param url - `Request` object, `URL` object, or URL string.
517
- @returns A promise with `Body` methods added.
518
- */
519
- get: <T>(url: Input, options?: Options) => ResponsePromise<T>;
520
- /**
521
- Fetch the given `url` using the option `{method: 'post'}`.
522
-
523
- @param url - `Request` object, `URL` object, or URL string.
524
- @returns A promise with `Body` methods added.
525
- */
526
- post: <T>(url: Input, options?: Options) => ResponsePromise<T>;
527
- /**
528
- Fetch the given `url` using the option `{method: 'put'}`.
529
-
530
- @param url - `Request` object, `URL` object, or URL string.
531
- @returns A promise with `Body` methods added.
532
- */
533
- put: <T>(url: Input, options?: Options) => ResponsePromise<T>;
534
- /**
535
- Fetch the given `url` using the option `{method: 'delete'}`.
536
-
537
- @param url - `Request` object, `URL` object, or URL string.
538
- @returns A promise with `Body` methods added.
539
- */
540
- delete: <T>(url: Input, options?: Options) => ResponsePromise<T>;
541
- /**
542
- Fetch the given `url` using the option `{method: 'patch'}`.
543
-
544
- @param url - `Request` object, `URL` object, or URL string.
545
- @returns A promise with `Body` methods added.
546
- */
547
- patch: <T>(url: Input, options?: Options) => ResponsePromise<T>;
548
- /**
549
- Fetch the given `url` using the option `{method: 'head'}`.
550
-
551
- @param url - `Request` object, `URL` object, or URL string.
552
- @returns A promise with `Body` methods added.
553
- */
554
- head: (url: Input, options?: Options) => ResponsePromise;
555
- /**
556
- Create a new Ky instance with complete new defaults.
557
-
558
- @returns A new Ky instance.
559
- */
560
- create: (defaultOptions?: Options) => KyInstance;
561
- /**
562
- Create a new Ky instance with some defaults overridden with your own.
563
-
564
- In contrast to `ky.create()`, `ky.extend()` inherits defaults from its parent.
565
-
566
- You can also refer to parent defaults by providing a function to `.extend()`.
567
-
568
- @example
569
- ```
570
- import ky from 'ky';
571
-
572
- const api = ky.create({prefixUrl: 'https://example.com/api'});
573
-
574
- const usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));
575
-
576
- const response = await usersApi.get('123');
577
- //=> 'https://example.com/api/users/123'
578
-
579
- const response = await api.get('version');
580
- //=> 'https://example.com/api/version'
581
- ```
582
-
583
- @returns A new Ky instance.
584
- */
585
- extend: (defaultOptions: Options | ((parentOptions: Options) => Options)) => KyInstance;
586
- /**
587
- A `Symbol` that can be returned by a `beforeRetry` hook to stop the retry. This will also short circuit the remaining `beforeRetry` hooks.
588
-
589
- Note: Returning this symbol makes Ky abort and return with an `undefined` response. Be sure to check for a response before accessing any properties on it or use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). It is also incompatible with body methods, such as `.json()` or `.text()`, because there is no response to parse. In general, we recommend throwing an error instead of returning this symbol, as that will cause Ky to abort and then throw, which avoids these limitations.
590
-
591
- A valid use-case for `ky.stop` is to prevent retries when making requests for side effects, where the returned data is not important. For example, logging client activity to the server.
592
-
593
- @example
594
- ```
595
- import ky from 'ky';
596
-
597
- const options = {
598
- hooks: {
599
- beforeRetry: [
600
- async ({request, options, error, retryCount}) => {
601
- const shouldStopRetry = await ky('https://example.com/api');
602
- if (shouldStopRetry) {
603
- return ky.stop;
604
- }
605
- }
606
- ]
607
- }
608
- };
609
-
610
- // Note that response will be `undefined` in case `ky.stop` is returned.
611
- const response = await ky.post('https://example.com', options);
612
-
613
- // Using `.text()` or other body methods is not supported.
614
- const text = await ky('https://example.com', options).text();
615
- ```
616
- */
617
- readonly stop: typeof stop;
618
- };
3
+ import { KyInstance, HTTPError } from 'ky';
619
4
 
620
5
  declare class GoogleSpreadsheetRow<T extends Record<string, any> = Record<string, any>> {
621
6
  /** parent GoogleSpreadsheetWorksheet instance */
@@ -1470,7 +855,7 @@ type PermissionsList = (PublicPermissionListEntry | UserOrGroupPermissionListEnt
1470
855
 
1471
856
  /** single type to handle all valid auth types */
1472
857
  type GoogleApiAuth = {
1473
- getRequestHeaders: () => Promise<Headers>;
858
+ getRequestHeaders: () => Promise<any>;
1474
859
  } | {
1475
860
  apiKey: string;
1476
861
  } | {