Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e0ae4e1

Browse files
committed
Test TS types for addition of referrer and referrerPolicy
1 parent 7e28137 commit e0ae4e1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

@types/index.d.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ interface RequestInit {
7474
* An AbortSignal to set request's signal.
7575
*/
7676
signal?: AbortSignal | null;
77+
/**
78+
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request’s referrer.
79+
*/
80+
referrer?: string;
81+
/**
82+
* A referrer policy to set request’s referrerPolicy.
83+
*/
84+
referrerPolicy?: ReferrerPolicy;
7785

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

117125
type RequestRedirect = 'error' | 'follow' | 'manual';
126+
type ReferrerPolicy = '' | 'no-referrer' | 'no-referrer-when-downgrade' | 'same-origin' | 'origin' | 'strict-origin' | 'origin-when-cross-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
118127
type RequestInfo = string | Body;
119128
declare class Request extends Body {
120129
constructor(input: RequestInfo, init?: RequestInit);
@@ -139,6 +148,14 @@ declare class Request extends Body {
139148
* Returns the URL of request as a string.
140149
*/
141150
readonly url: string;
151+
/**
152+
* A string whose value is a same-origin URL, "about:client", or the empty string, to set request’s referrer.
153+
*/
154+
readonly referrer: string;
155+
/**
156+
* A referrer policy to set request’s referrerPolicy.
157+
*/
158+
readonly referrerPolicy: ReferrerPolicy;
142159
clone(): Request;
143160
}
144161

0 commit comments

Comments
 (0)