@cloudflare/workers-types 3.18.0 → 3.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/index.d.ts +75 -82
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
# Cloudflare Workers Types
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
:stop_sign: This repository was for `@cloudflare/workers-types` versions ≤ 3 and is no longer maintained.
|
|
4
|
+
|
|
5
|
+
Since version 4, types are automatically generated from and in the [`workerd`](https://github.com/cloudflare/workerd) repository.
|
|
6
|
+
|
|
7
|
+
Find the [new `README` here](https://github.com/cloudflare/workerd/tree/main/npm/workers-types) and the [new auto-generation scripts here](https://github.com/cloudflare/workerd/tree/main/types).
|
|
8
|
+
|
|
9
|
+
Please raise issues with type definitions [in the `workerd` repository](https://github.com/cloudflare/workerd/issues/new/choose), tagging `@cloudflare/workers-types` in your report.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
<details>
|
|
14
|
+
<summary>Legacy Documentation</summary>
|
|
5
15
|
|
|
6
16
|
## Install
|
|
7
17
|
|
|
@@ -13,6 +23,9 @@ yarn add -D @cloudflare/workers-types
|
|
|
13
23
|
|
|
14
24
|
## Usage
|
|
15
25
|
|
|
26
|
+
> :warning: If you're upgrading from version 2, make sure to remove `webworker` from the `lib` array in your
|
|
27
|
+
> `tsconfig.json`. These types are now included in `@cloudflare/workers-types`.
|
|
28
|
+
|
|
16
29
|
The following is a minimal `tsconfig.json` for use alongside this package:
|
|
17
30
|
|
|
18
31
|
**`tsconfig.json`**
|
|
@@ -74,3 +87,5 @@ headings correspond to JSDoc sections for members:
|
|
|
74
87
|
- `#### Returns`: contents will be copied as-is to the `@returns` tag
|
|
75
88
|
- `#### Examples`: fenced code blocks with the language set to `js`, `ts`, `javascript` or `typescript` will be copied
|
|
76
89
|
to `@example` tags
|
|
90
|
+
|
|
91
|
+
</details>
|
package/index.d.ts
CHANGED
|
@@ -2270,88 +2270,81 @@ interface IncomingRequestCfPropertiesExportedAuthenticatorMetadata {
|
|
|
2270
2270
|
/**
|
|
2271
2271
|
* Geographic data about the request's origin.
|
|
2272
2272
|
*/
|
|
2273
|
-
type IncomingRequestCfPropertiesGeographicInformation =
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
/**
|
|
2349
|
-
* Metro code (DMA) of the incoming request
|
|
2350
|
-
*
|
|
2351
|
-
* @example "635"
|
|
2352
|
-
*/
|
|
2353
|
-
metroCode?: string;
|
|
2354
|
-
};
|
|
2273
|
+
type IncomingRequestCfPropertiesGeographicInformation = Partial<{
|
|
2274
|
+
/**
|
|
2275
|
+
* The [ISO 3166-1 Alpha 2](https://www.iso.org/iso-3166-country-codes.html) country code the request originated from.
|
|
2276
|
+
*
|
|
2277
|
+
* If your worker is [configured to accept TOR connections](https://support.cloudflare.com/hc/en-us/articles/203306930-Understanding-Cloudflare-Tor-support-and-Onion-Routing), this may also be `"T1"`, indicating a request that originated over TOR.
|
|
2278
|
+
*
|
|
2279
|
+
* If Cloudflare is unable to determine where the request originated this property is omitted.
|
|
2280
|
+
*
|
|
2281
|
+
* @example "GB"
|
|
2282
|
+
*
|
|
2283
|
+
*/
|
|
2284
|
+
country: Iso3166Alpha2Code | "T1";
|
|
2285
|
+
/**
|
|
2286
|
+
* If present, this property indicates that the request originated in the EU
|
|
2287
|
+
*
|
|
2288
|
+
* @example "1"
|
|
2289
|
+
*/
|
|
2290
|
+
isEUCountry?: "1";
|
|
2291
|
+
/**
|
|
2292
|
+
* A two-letter code indicating the continent the request originated from.
|
|
2293
|
+
*
|
|
2294
|
+
* @example "AN"
|
|
2295
|
+
*/
|
|
2296
|
+
continent: ContinentCode;
|
|
2297
|
+
/**
|
|
2298
|
+
* The city the request originated from
|
|
2299
|
+
*
|
|
2300
|
+
* @example "Austin"
|
|
2301
|
+
*/
|
|
2302
|
+
city?: string;
|
|
2303
|
+
/**
|
|
2304
|
+
* Postal code of the incoming request
|
|
2305
|
+
*
|
|
2306
|
+
* @example "78701"
|
|
2307
|
+
*/
|
|
2308
|
+
postalCode?: string;
|
|
2309
|
+
/**
|
|
2310
|
+
* Latitude of the incoming request
|
|
2311
|
+
*
|
|
2312
|
+
* @example "30.27130"
|
|
2313
|
+
*/
|
|
2314
|
+
latitude?: string;
|
|
2315
|
+
/**
|
|
2316
|
+
* Longitude of the incoming request
|
|
2317
|
+
*
|
|
2318
|
+
* @example "-97.74260"
|
|
2319
|
+
*/
|
|
2320
|
+
longitude?: string;
|
|
2321
|
+
/**
|
|
2322
|
+
* Timezone of the incoming request
|
|
2323
|
+
*
|
|
2324
|
+
* @example "America/Chicago"
|
|
2325
|
+
*/
|
|
2326
|
+
timezone?: string;
|
|
2327
|
+
/**
|
|
2328
|
+
* If known, the ISO 3166-2 name for the first level region associated with
|
|
2329
|
+
* the IP address of the incoming request
|
|
2330
|
+
*
|
|
2331
|
+
* @example "Texas"
|
|
2332
|
+
*/
|
|
2333
|
+
region?: string;
|
|
2334
|
+
/**
|
|
2335
|
+
* If known, the ISO 3166-2 code for the first-level region associated with
|
|
2336
|
+
* the IP address of the incoming request
|
|
2337
|
+
*
|
|
2338
|
+
* @example "TX"
|
|
2339
|
+
*/
|
|
2340
|
+
regionCode?: string;
|
|
2341
|
+
/**
|
|
2342
|
+
* Metro code (DMA) of the incoming request
|
|
2343
|
+
*
|
|
2344
|
+
* @example "635"
|
|
2345
|
+
*/
|
|
2346
|
+
metroCode?: string;
|
|
2347
|
+
}>;
|
|
2355
2348
|
|
|
2356
2349
|
/** Data about the incoming request's TLS certificate */
|
|
2357
2350
|
interface IncomingRequestCfPropertiesTLSClientAuth {
|