Skip to content

Commit

Permalink
Test TS types for addition of referrer and referrerPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
tekwiz committed Jan 17, 2021
1 parent 6578a76 commit 7352791
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions @types/index.d.ts
Expand Up @@ -74,6 +74,14 @@ interface RequestInit {
* An AbortSignal to set request's signal.
*/
signal?: AbortSignal | null;
/**
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request’s referrer.
*/
referrer?: string;
/**
* A referrer policy to set request’s referrerPolicy.
*/
referrerPolicy?: ReferrerPolicy;

// Node-fetch extensions to the whatwg/fetch spec
agent?: Agent | ((parsedUrl: URL) => Agent);
Expand Down Expand Up @@ -115,6 +123,7 @@ declare class Body {
}

type RequestRedirect = 'error' | 'follow' | 'manual';
type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
type RequestInfo = string | Body;
declare class Request extends Body {
constructor(input: RequestInfo, init?: RequestInit);
Expand All @@ -139,6 +148,14 @@ declare class Request extends Body {
* Returns the URL of request as a string.
*/
readonly url: string;
/**
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request’s referrer.
*/
readonly referrer: string;
/**
* A referrer policy to set request’s referrerPolicy.
*/
readonly referrerPolicy: ReferrerPolicy;
clone(): Request;
}

Expand Down

0 comments on commit 7352791

Please sign in to comment.