Skip to content

How to set a custom type for context in v1.13? #782

@fcsha

Description

@fcsha

In ky v1.12, this worked fine:

declare module 'ky' {
  interface Options {
    context?: MyContext;
  }
  interface NormalizedOptions {
    context?: MyContext;
  }
}

After upgrading to v1.13, I get this error:

Subsequent property declarations must have the same type. Property ‘context’ must be of type ‘Record<string, unknown>’, but here has type ‘MyContext | undefined’.ts(2717)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions