The raw response shape of a single page or chunk.
Callback that fetches a single entry given its numeric key.
Reads the "more data available" flag from a fetched entry.
The 1-based page number to start from.
Hard cap on entries fetched, guarding against unbounded loops.
Maximum number of requests kept in flight at once.
Optionalsignal: AbortSignal
Optional AbortSignal to cancel the traversal.
OptionalextractBound: (response: TEntry) => number | undefined
Optional reader for the terminal page bound a fetched entry reports (AniList's pageInfo.lastPage); omit it for chunk-style traversals whose entries carry no page numbers.
The responses in entry order, how many were fetched, and whether the guard or a reported bound truncated the run.
Numeric-mode look-ahead driver: keys are computable without any response, so a window of at most
concurrencylaunched-but-unconsumed requests overlaps round-trip latency while results are appended strictly in entry order. The window steps up instead of filling cold: the first entry launches alone, and the window steps to the fullconcurrencyonly after a consumed entry confirms more data exists, so a traversal that ends at its first entry costs one request instead ofconcurrencyrequests' worth of rate-limit quota. Scheduling stops as soon as an entry reports "no more data" or themaxEntriesguard fires; already-launched stragglers are drained and discarded. WhenextractBoundis supplied (AniList page traversals pass extractLastPageBound), scheduling also never launches an entry numbered beyond the smallest positive bound a received entry reported: those requests were going to be drained and discarded anyway, so skipping them keeps their quota spend off the wire. A traversal the bound ends while the last consumed entry still reports more data returnstruncated: trueso the short read is not mistaken for a clean end. Traversals whose entries carry no page numbers (chunks) omitextractBoundand leave the existing guards in charge. An abort settles in-flight requests and returns the collected prefix as a partial result withtruncated: false.