Skip to content

README pagination example doesn't compile: transcripts.list() doesn't accept null #209

Open

Description

@poojagosika

The "paginate over all pages" example in the README fails to type check with strict: true:

let previousPageUrl: string | null = null;
do {
  const page = await client.transcripts.list(previousPageUrl);
  previousPageUrl = page.page_details.prev_url;
} while (previousPageUrl !== null);
error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string | ListTranscriptParams | undefined'.

page_details.prev_url became string | null in 4.3.4, and the README example was updated to match, but list() still takes params?: ListTranscriptParams | string. At runtime list(null) already returns the first page (else if (params) skips it), so only the signature is out of step. Allowing null in list() makes the documented loop type check.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions