Skip to content

Conversation

@johnnyreilly
Copy link
Contributor

@johnnyreilly johnnyreilly commented Nov 24, 2025

This PR follows on from #5032 which migrated NSwag TypeScript generated clients to use globalThis.

It does two things:

  • replaces usage of window with globalThis in the constructor
  • replaces use of url: RequestInfo in the definition of fetch with input: string | URL | Request. This is because RequestInfo is a DOM / browser specific type in TypeScript's lib.dom.d.ts file.

The result of these changes migrate the TypeScript generated clients to be both browser compatible (which they already are) and Node.js compatible as well.

You can see details of fetch in Node.js: https://nodejs.org/api/globals.html#fetch

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant