From 7bdeee8997bde0efe40bcec41c0706bdab58893b Mon Sep 17 00:00:00 2001 From: Kurt Mackey Date: Tue, 11 Jun 2019 20:32:49 -0500 Subject: makes global request type an interface (#2503) --- js/dom_types.ts | 5 +++++ js/globals.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/js/dom_types.ts b/js/dom_types.ts index 2f855aeaa..07f7d7898 100644 --- a/js/dom_types.ts +++ b/js/dom_types.ts @@ -444,6 +444,11 @@ export interface ResponseInit { statusText?: string; } +export interface RequestConstructor { + new (input: RequestInfo, init?: RequestInit): Request; + prototype: Request; +} + export interface Request extends Body { /** Returns the cache mode associated with request, which is a string * indicating how the the request will interact with the browser's cache when diff --git a/js/globals.ts b/js/globals.ts index 5fc264a59..4f2d53147 100644 --- a/js/globals.ts +++ b/js/globals.ts @@ -117,8 +117,8 @@ export type TextEncoder = textEncoding.TextEncoder; window.TextDecoder = textEncoding.TextDecoder; export type TextDecoder = textEncoding.TextDecoder; -window.Request = request.Request; -export type Request = request.Request; +window.Request = request.Request as domTypes.RequestConstructor; +export type Request = domTypes.Request; //window.Response = response.Response; //export type Response = response.Response; -- cgit v1.2.3