Deno: Expose fetch related types in the global scope

Created on 12 Feb 2020  路  4Comments  路  Source: denoland/deno

It'd be nice to have the following types from __domTypes exposed in the global scope:

  • HeadersInit
  • RequestMode
  • RequestInit

(I'm sure there's more types, but these are the ones that I ran into that weren't exposed like they are in TypeScript.)

good first issue

Most helpful comment

I just found myself in the need of this as well.

At the moment, when somebody wants to make a client library - meaning for both deno and the browser - this person can't use one universally compatible type because deno uses __domTypes.RequestInit and TypeScript uses RequestInit.

If there is another simpler way of doing this, please let me know.

All 4 comments

Makes sense, this will require changes to cli/js/lib.deno.shared_global.d.ts. A test case presenting those types are exposed is highly desired

I just found myself in the need of this as well.

At the moment, when somebody wants to make a client library - meaning for both deno and the browser - this person can't use one universally compatible type because deno uses __domTypes.RequestInit and TypeScript uses RequestInit.

If there is another simpler way of doing this, please let me know.

No, there isn't a simpler way. These just need to be exposed like some other ones already are.

I believe this can be closed! Looks like it was fixed in https://github.com/denoland/deno/pull/4687

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyeotic picture kyeotic  路  3Comments

CruxCv picture CruxCv  路  3Comments

doutchnugget picture doutchnugget  路  3Comments

somombo picture somombo  路  3Comments

benjamingr picture benjamingr  路  3Comments