All references are to origin/main = d5611fde. Companion to the README fix in #507 — same defect, but in source, so out of a README-only PR.
The docstring examples for the pagination helpers use bare r.json() callbacks:
typescript/src/client.ts:1166-1168 (fetchAllPages)
typescript/src/client.ts:1211 (paginateAll)
The parse-callback parameter type is (response: Response) => Promise<T[]> (client.ts:1173, :1218), and under the repo's own strict/NodeNext config with Node fetch types, Response.json() is Promise<unknown> — so a user copying the docstring example into a project configured like this repo gets a type error. Proven while preparing #507: the README's identical example failed tsc --noEmit until the callback was written as (r) => r.json() as Promise<any[]>.
The docstrings only typecheck under DOM lib (Body.json(): Promise<any>), which is why they've survived — the SDK's own typecheck doesn't compile docstring fences.
Fix: mirror #507's README form ((r) => r.json() as Promise<any[]>) in both docstrings, or type the examples' callbacks explicitly.
All references are to
origin/main=d5611fde. Companion to the README fix in #507 — same defect, but in source, so out of a README-only PR.The docstring examples for the pagination helpers use bare
r.json()callbacks:typescript/src/client.ts:1166-1168(fetchAllPages)typescript/src/client.ts:1211(paginateAll)The parse-callback parameter type is
(response: Response) => Promise<T[]>(client.ts:1173,:1218), and under the repo's own strict/NodeNext config with Node fetch types,Response.json()isPromise<unknown>— so a user copying the docstring example into a project configured like this repo gets a type error. Proven while preparing #507: the README's identical example failedtsc --noEmituntil the callback was written as(r) => r.json() as Promise<any[]>.The docstrings only typecheck under DOM lib (
Body.json(): Promise<any>), which is why they've survived — the SDK's own typecheck doesn't compile docstring fences.Fix: mirror #507's README form (
(r) => r.json() as Promise<any[]>) in both docstrings, or type the examples' callbacks explicitly.