@cloudflare/workers-types 5.20261112.1 → 5.20261114.1
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/experimental/index.d.ts +272 -165
- package/experimental/index.ts +272 -165
- package/index.d.ts +265 -164
- package/index.ts +265 -164
- package/package.json +1 -1
package/experimental/index.ts
CHANGED
|
@@ -15,60 +15,6 @@ and limitations under the License.
|
|
|
15
15
|
/* eslint-disable */
|
|
16
16
|
// noinspection JSUnusedGlobalSymbols
|
|
17
17
|
export declare var onmessage: never;
|
|
18
|
-
/**
|
|
19
|
-
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
|
20
|
-
*
|
|
21
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
|
22
|
-
*/
|
|
23
|
-
export declare class DOMException extends Error {
|
|
24
|
-
constructor(message?: string, name?: string);
|
|
25
|
-
/**
|
|
26
|
-
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
|
27
|
-
*
|
|
28
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
|
29
|
-
*/
|
|
30
|
-
readonly message: string;
|
|
31
|
-
/**
|
|
32
|
-
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
|
33
|
-
*
|
|
34
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
|
35
|
-
*/
|
|
36
|
-
readonly name: string;
|
|
37
|
-
/**
|
|
38
|
-
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
|
39
|
-
* @deprecated
|
|
40
|
-
*
|
|
41
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
42
|
-
*/
|
|
43
|
-
readonly code: number;
|
|
44
|
-
static readonly INDEX_SIZE_ERR: number;
|
|
45
|
-
static readonly DOMSTRING_SIZE_ERR: number;
|
|
46
|
-
static readonly HIERARCHY_REQUEST_ERR: number;
|
|
47
|
-
static readonly WRONG_DOCUMENT_ERR: number;
|
|
48
|
-
static readonly INVALID_CHARACTER_ERR: number;
|
|
49
|
-
static readonly NO_DATA_ALLOWED_ERR: number;
|
|
50
|
-
static readonly NO_MODIFICATION_ALLOWED_ERR: number;
|
|
51
|
-
static readonly NOT_FOUND_ERR: number;
|
|
52
|
-
static readonly NOT_SUPPORTED_ERR: number;
|
|
53
|
-
static readonly INUSE_ATTRIBUTE_ERR: number;
|
|
54
|
-
static readonly INVALID_STATE_ERR: number;
|
|
55
|
-
static readonly SYNTAX_ERR: number;
|
|
56
|
-
static readonly INVALID_MODIFICATION_ERR: number;
|
|
57
|
-
static readonly NAMESPACE_ERR: number;
|
|
58
|
-
static readonly INVALID_ACCESS_ERR: number;
|
|
59
|
-
static readonly VALIDATION_ERR: number;
|
|
60
|
-
static readonly TYPE_MISMATCH_ERR: number;
|
|
61
|
-
static readonly SECURITY_ERR: number;
|
|
62
|
-
static readonly NETWORK_ERR: number;
|
|
63
|
-
static readonly ABORT_ERR: number;
|
|
64
|
-
static readonly URL_MISMATCH_ERR: number;
|
|
65
|
-
static readonly QUOTA_EXCEEDED_ERR: number;
|
|
66
|
-
static readonly TIMEOUT_ERR: number;
|
|
67
|
-
static readonly INVALID_NODE_TYPE_ERR: number;
|
|
68
|
-
static readonly DATA_CLONE_ERR: number;
|
|
69
|
-
get stack(): any;
|
|
70
|
-
set stack(value: any);
|
|
71
|
-
}
|
|
72
18
|
export type WorkerGlobalScopeEventMap = {
|
|
73
19
|
fetch: FetchEvent;
|
|
74
20
|
scheduled: ScheduledEvent;
|
|
@@ -813,7 +759,10 @@ export interface DurableObjectStorage {
|
|
|
813
759
|
snapshot(
|
|
814
760
|
options?: DurableObjectSnapshotOptions,
|
|
815
761
|
): Promise<DurableObjectSnapshot>;
|
|
816
|
-
onNextSessionRestore(
|
|
762
|
+
onNextSessionRestore(
|
|
763
|
+
target: DurableObjectSnapshot | string,
|
|
764
|
+
options?: DurableObjectRestoreOptions,
|
|
765
|
+
): Promise<string>;
|
|
817
766
|
/** @deprecated Use `ctx.configureReadReplication()` instead. */
|
|
818
767
|
ensureReplicas(): void;
|
|
819
768
|
/** @deprecated Use `ctx.configureReadReplication()` instead. */
|
|
@@ -828,6 +777,9 @@ export interface DurableObjectReadReplicationOptions {
|
|
|
828
777
|
export interface DurableObjectSnapshotOptions {
|
|
829
778
|
bookmark?: string;
|
|
830
779
|
}
|
|
780
|
+
export interface DurableObjectRestoreOptions {
|
|
781
|
+
kvData?: Record<string, any>;
|
|
782
|
+
}
|
|
831
783
|
export interface DurableObjectListOptions {
|
|
832
784
|
start?: string;
|
|
833
785
|
startAfter?: string;
|
|
@@ -3574,116 +3526,6 @@ export interface TraceMetrics {
|
|
|
3574
3526
|
export interface UnsafeTraceMetrics {
|
|
3575
3527
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
3576
3528
|
}
|
|
3577
|
-
/**
|
|
3578
|
-
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
3579
|
-
*
|
|
3580
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
3581
|
-
*/
|
|
3582
|
-
export declare class URLPattern {
|
|
3583
|
-
constructor(
|
|
3584
|
-
input?: string | URLPatternInit,
|
|
3585
|
-
baseURL?: string | URLPatternOptions,
|
|
3586
|
-
patternOptions?: URLPatternOptions,
|
|
3587
|
-
);
|
|
3588
|
-
/**
|
|
3589
|
-
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
3590
|
-
*
|
|
3591
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
3592
|
-
*/
|
|
3593
|
-
get protocol(): string;
|
|
3594
|
-
/**
|
|
3595
|
-
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
3596
|
-
*
|
|
3597
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
3598
|
-
*/
|
|
3599
|
-
get username(): string;
|
|
3600
|
-
/**
|
|
3601
|
-
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
3602
|
-
*
|
|
3603
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
3604
|
-
*/
|
|
3605
|
-
get password(): string;
|
|
3606
|
-
/**
|
|
3607
|
-
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
3608
|
-
*
|
|
3609
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
3610
|
-
*/
|
|
3611
|
-
get hostname(): string;
|
|
3612
|
-
/**
|
|
3613
|
-
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
3614
|
-
*
|
|
3615
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
3616
|
-
*/
|
|
3617
|
-
get port(): string;
|
|
3618
|
-
/**
|
|
3619
|
-
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
3620
|
-
*
|
|
3621
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
3622
|
-
*/
|
|
3623
|
-
get pathname(): string;
|
|
3624
|
-
/**
|
|
3625
|
-
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
3626
|
-
*
|
|
3627
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
3628
|
-
*/
|
|
3629
|
-
get search(): string;
|
|
3630
|
-
/**
|
|
3631
|
-
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
3632
|
-
*
|
|
3633
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
3634
|
-
*/
|
|
3635
|
-
get hash(): string;
|
|
3636
|
-
/**
|
|
3637
|
-
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
3638
|
-
*
|
|
3639
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
3640
|
-
*/
|
|
3641
|
-
get hasRegExpGroups(): boolean;
|
|
3642
|
-
/**
|
|
3643
|
-
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
3644
|
-
*
|
|
3645
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
3646
|
-
*/
|
|
3647
|
-
test(input?: string | URLPatternInit, baseURL?: string): boolean;
|
|
3648
|
-
/**
|
|
3649
|
-
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
3650
|
-
*
|
|
3651
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
3652
|
-
*/
|
|
3653
|
-
exec(
|
|
3654
|
-
input?: string | URLPatternInit,
|
|
3655
|
-
baseURL?: string,
|
|
3656
|
-
): URLPatternResult | null;
|
|
3657
|
-
}
|
|
3658
|
-
export interface URLPatternInit {
|
|
3659
|
-
protocol?: string;
|
|
3660
|
-
username?: string;
|
|
3661
|
-
password?: string;
|
|
3662
|
-
hostname?: string;
|
|
3663
|
-
port?: string;
|
|
3664
|
-
pathname?: string;
|
|
3665
|
-
search?: string;
|
|
3666
|
-
hash?: string;
|
|
3667
|
-
baseURL?: string;
|
|
3668
|
-
}
|
|
3669
|
-
export interface URLPatternComponentResult {
|
|
3670
|
-
input: string;
|
|
3671
|
-
groups: Record<string, string>;
|
|
3672
|
-
}
|
|
3673
|
-
export interface URLPatternResult {
|
|
3674
|
-
inputs: (string | URLPatternInit)[];
|
|
3675
|
-
protocol: URLPatternComponentResult;
|
|
3676
|
-
username: URLPatternComponentResult;
|
|
3677
|
-
password: URLPatternComponentResult;
|
|
3678
|
-
hostname: URLPatternComponentResult;
|
|
3679
|
-
port: URLPatternComponentResult;
|
|
3680
|
-
pathname: URLPatternComponentResult;
|
|
3681
|
-
search: URLPatternComponentResult;
|
|
3682
|
-
hash: URLPatternComponentResult;
|
|
3683
|
-
}
|
|
3684
|
-
export interface URLPatternOptions {
|
|
3685
|
-
ignoreCase?: boolean;
|
|
3686
|
-
}
|
|
3687
3529
|
export type WebSocketEventMap = {
|
|
3688
3530
|
close: CloseEvent;
|
|
3689
3531
|
message: MessageEvent;
|
|
@@ -13689,6 +13531,49 @@ export type BrowserRunDevtools = {
|
|
|
13689
13531
|
export type BrowserRunCloseSessionResult = {
|
|
13690
13532
|
status: "closing" | "closed";
|
|
13691
13533
|
};
|
|
13534
|
+
/** Library the script runs against. Omit it to receive a raw CDP client. */
|
|
13535
|
+
export type BrowserRunScriptLibrary = "playwright" | "puppeteer";
|
|
13536
|
+
/** Options for `script()`. */
|
|
13537
|
+
export type BrowserRunScriptOptions = {
|
|
13538
|
+
/** Library whose objects are passed to the script. Omit it for raw CDP. */
|
|
13539
|
+
library?: BrowserRunScriptLibrary;
|
|
13540
|
+
/** Maximum run time of the script in milliseconds, not counting browser
|
|
13541
|
+
* acquisition. Between 1 and 120000.
|
|
13542
|
+
* @default 60000
|
|
13543
|
+
*/
|
|
13544
|
+
timeout?: number;
|
|
13545
|
+
/** How long the session stays open without activity after the run, in
|
|
13546
|
+
* milliseconds. Between 10000 and 1200000.
|
|
13547
|
+
* @default 60000
|
|
13548
|
+
*/
|
|
13549
|
+
keepAlive?: number;
|
|
13550
|
+
/** Use the experimental pool, whose browsers enable Chrome features before
|
|
13551
|
+
* they reach stable Chrome.
|
|
13552
|
+
* @default false
|
|
13553
|
+
*/
|
|
13554
|
+
lab?: boolean;
|
|
13555
|
+
/** Record the browser session. @default false */
|
|
13556
|
+
recording?: boolean;
|
|
13557
|
+
};
|
|
13558
|
+
/** Options for `scriptInSession()`. */
|
|
13559
|
+
export type BrowserRunScriptSessionOptions = {
|
|
13560
|
+
/** Library whose objects are passed to the script. Omit it for raw CDP. */
|
|
13561
|
+
library?: BrowserRunScriptLibrary;
|
|
13562
|
+
/** Maximum run time of the script in milliseconds. Between 1 and 120000.
|
|
13563
|
+
* @default 60000
|
|
13564
|
+
*/
|
|
13565
|
+
timeout?: number;
|
|
13566
|
+
/** Page target the script attaches to, such as the `cf-browser-target-id`
|
|
13567
|
+
* header returned by `script()`. Defaults to the session's first page.
|
|
13568
|
+
*/
|
|
13569
|
+
targetId?: string;
|
|
13570
|
+
};
|
|
13571
|
+
/** JSON success body of `script()` and `scriptInSession()`. */
|
|
13572
|
+
export type BrowserRunScriptSuccessResponse = {
|
|
13573
|
+
success: true;
|
|
13574
|
+
/** The script's return value, or `null` when it returned nothing. */
|
|
13575
|
+
result: unknown;
|
|
13576
|
+
};
|
|
13692
13577
|
/**
|
|
13693
13578
|
* Browser Run API binding for automating headless browsers.
|
|
13694
13579
|
* @see https://developers.cloudflare.com/browser-run/
|
|
@@ -13903,6 +13788,57 @@ export declare abstract class BrowserRun {
|
|
|
13903
13788
|
getSession(sessionId: string): Promise<BrowserRunSession | null>;
|
|
13904
13789
|
/** Close a browser session. */
|
|
13905
13790
|
closeSession(sessionId: string): Promise<BrowserRunCloseSessionResult>;
|
|
13791
|
+
/**
|
|
13792
|
+
* Run a script against a new browser session.
|
|
13793
|
+
* @param code - Source of an async function. It receives the selected
|
|
13794
|
+
* library's objects (Playwright `{ page, context, browser }`, Puppeteer
|
|
13795
|
+
* `{ page, browser }`) or, without `library`, a CDP client.
|
|
13796
|
+
* @param options - Library, timeout and session launch options.
|
|
13797
|
+
* @returns A `Response` containing one of:
|
|
13798
|
+
*
|
|
13799
|
+
* **Success (HTTP 200):**
|
|
13800
|
+
* - `BrowserRunScriptSuccessResponse` JSON with `Content-Type: application/json`
|
|
13801
|
+
* when the script returns a JSON-serializable value or nothing
|
|
13802
|
+
* - The raw body and content type when the script returns binary or other
|
|
13803
|
+
* non-JSON output
|
|
13804
|
+
*
|
|
13805
|
+
* **Error:**
|
|
13806
|
+
* - JSON error body with an HTTP status code (400, 404, 408, 422, 429, 500, 503)
|
|
13807
|
+
* - HTTP 408 when the script exceeds `timeout`
|
|
13808
|
+
* - HTTP 422 when the script fails to compile or throws
|
|
13809
|
+
* - HTTP errors are returned as a `Response`, not thrown. Invalid `options`
|
|
13810
|
+
* throw before any request is made.
|
|
13811
|
+
*
|
|
13812
|
+
* **Headers:**
|
|
13813
|
+
* - `cf-browser-session-id`: Session kept open for `scriptInSession()`
|
|
13814
|
+
* - `cf-browser-target-id`: Page target the script ran on
|
|
13815
|
+
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds
|
|
13816
|
+
*/
|
|
13817
|
+
script(code: string, options?: BrowserRunScriptOptions): Promise<Response>;
|
|
13818
|
+
/**
|
|
13819
|
+
* Run a script against an existing browser session, such as one kept open by
|
|
13820
|
+
* `script()`.
|
|
13821
|
+
* @param sessionId - Session to run in, such as the `cf-browser-session-id`
|
|
13822
|
+
* header returned by `script()`.
|
|
13823
|
+
* @param code - Source of an async function, as for `script()`.
|
|
13824
|
+
* @param options - Library, timeout and page target options.
|
|
13825
|
+
* @returns A `Response` with the same success bodies as `script()`.
|
|
13826
|
+
*
|
|
13827
|
+
* **Error:**
|
|
13828
|
+
* - JSON error body with an HTTP status code (400, 401, 404, 408, 410, 422, 500)
|
|
13829
|
+
* - HTTP 404 when the session or `targetId` does not exist
|
|
13830
|
+
* - HTTP 410 when the session is already closed
|
|
13831
|
+
* - HTTP errors are returned as a `Response`, not thrown. Invalid `options`
|
|
13832
|
+
* throw before any request is made.
|
|
13833
|
+
*
|
|
13834
|
+
* **Headers:**
|
|
13835
|
+
* - `X-Browser-Ms-Used`: Browser time consumed in milliseconds
|
|
13836
|
+
*/
|
|
13837
|
+
scriptInSession(
|
|
13838
|
+
sessionId: string,
|
|
13839
|
+
code: string,
|
|
13840
|
+
options?: BrowserRunScriptSessionOptions,
|
|
13841
|
+
): Promise<Response>;
|
|
13906
13842
|
/** DevTools JSON methods exposed through one nested binding target. */
|
|
13907
13843
|
get devtools(): BrowserRunDevtools;
|
|
13908
13844
|
}
|
|
@@ -15226,6 +15162,60 @@ export declare abstract class D1PreparedStatement {
|
|
|
15226
15162
|
// TypeScript's interface merging will ensure our empty interface is effectively
|
|
15227
15163
|
// ignored when `Disposable` is included in the standard lib.
|
|
15228
15164
|
export interface Disposable {}
|
|
15165
|
+
/**
|
|
15166
|
+
* The **`DOMException`** interface represents an abnormal event (called an exception) that occurs as a result of calling a method or accessing a property of a web API. This is how error conditions are described in web APIs.
|
|
15167
|
+
*
|
|
15168
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
|
|
15169
|
+
*/
|
|
15170
|
+
export declare class DOMException extends Error {
|
|
15171
|
+
constructor(message?: string, name?: string);
|
|
15172
|
+
/**
|
|
15173
|
+
* The **`message`** read-only property of the DOMException interface returns a string representing a message or description associated with the given error name.
|
|
15174
|
+
*
|
|
15175
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
|
|
15176
|
+
*/
|
|
15177
|
+
readonly message: string;
|
|
15178
|
+
/**
|
|
15179
|
+
* The **`name`** read-only property of the DOMException interface returns a string that contains one of the strings associated with an error name.
|
|
15180
|
+
*
|
|
15181
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
|
|
15182
|
+
*/
|
|
15183
|
+
readonly name: string;
|
|
15184
|
+
/**
|
|
15185
|
+
* The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or 0 if none match.
|
|
15186
|
+
* @deprecated
|
|
15187
|
+
*
|
|
15188
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
|
|
15189
|
+
*/
|
|
15190
|
+
readonly code: number;
|
|
15191
|
+
static readonly INDEX_SIZE_ERR: number;
|
|
15192
|
+
static readonly DOMSTRING_SIZE_ERR: number;
|
|
15193
|
+
static readonly HIERARCHY_REQUEST_ERR: number;
|
|
15194
|
+
static readonly WRONG_DOCUMENT_ERR: number;
|
|
15195
|
+
static readonly INVALID_CHARACTER_ERR: number;
|
|
15196
|
+
static readonly NO_DATA_ALLOWED_ERR: number;
|
|
15197
|
+
static readonly NO_MODIFICATION_ALLOWED_ERR: number;
|
|
15198
|
+
static readonly NOT_FOUND_ERR: number;
|
|
15199
|
+
static readonly NOT_SUPPORTED_ERR: number;
|
|
15200
|
+
static readonly INUSE_ATTRIBUTE_ERR: number;
|
|
15201
|
+
static readonly INVALID_STATE_ERR: number;
|
|
15202
|
+
static readonly SYNTAX_ERR: number;
|
|
15203
|
+
static readonly INVALID_MODIFICATION_ERR: number;
|
|
15204
|
+
static readonly NAMESPACE_ERR: number;
|
|
15205
|
+
static readonly INVALID_ACCESS_ERR: number;
|
|
15206
|
+
static readonly VALIDATION_ERR: number;
|
|
15207
|
+
static readonly TYPE_MISMATCH_ERR: number;
|
|
15208
|
+
static readonly SECURITY_ERR: number;
|
|
15209
|
+
static readonly NETWORK_ERR: number;
|
|
15210
|
+
static readonly ABORT_ERR: number;
|
|
15211
|
+
static readonly URL_MISMATCH_ERR: number;
|
|
15212
|
+
static readonly QUOTA_EXCEEDED_ERR: number;
|
|
15213
|
+
static readonly TIMEOUT_ERR: number;
|
|
15214
|
+
static readonly INVALID_NODE_TYPE_ERR: number;
|
|
15215
|
+
static readonly DATA_CLONE_ERR: number;
|
|
15216
|
+
get stack(): any;
|
|
15217
|
+
set stack(value: any);
|
|
15218
|
+
}
|
|
15229
15219
|
/**
|
|
15230
15220
|
* The returned data after sending an email
|
|
15231
15221
|
*/
|
|
@@ -15264,6 +15254,10 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
15264
15254
|
* Size of the email message content.
|
|
15265
15255
|
*/
|
|
15266
15256
|
readonly rawSize: number;
|
|
15257
|
+
/**
|
|
15258
|
+
* Whether this email message can be forwarded with `forward()`.
|
|
15259
|
+
*/
|
|
15260
|
+
readonly canBeForwarded: boolean;
|
|
15267
15261
|
/**
|
|
15268
15262
|
* Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.
|
|
15269
15263
|
* @param reason The reject reason.
|
|
@@ -18073,6 +18067,119 @@ export declare class URLSearchParams {
|
|
|
18073
18067
|
toString(): string;
|
|
18074
18068
|
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
18075
18069
|
}
|
|
18070
|
+
// URLPattern, as the URLPattern standard declares it, for both parsers.
|
|
18071
|
+
// The legacy parser (the urlpattern_original compatibility flag, the
|
|
18072
|
+
// default before 2025-05-01) has no hasRegExpGroups.
|
|
18073
|
+
/**
|
|
18074
|
+
* The **`URLPattern`** interface of the URL Pattern API matches URLs or parts of URLs against a pattern. The pattern can contain capturing groups that extract parts of the matched URL.
|
|
18075
|
+
*
|
|
18076
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
18077
|
+
*/
|
|
18078
|
+
export declare class URLPattern {
|
|
18079
|
+
constructor(
|
|
18080
|
+
input?: string | URLPatternInit,
|
|
18081
|
+
baseURL?: string | URLPatternOptions,
|
|
18082
|
+
patternOptions?: URLPatternOptions,
|
|
18083
|
+
);
|
|
18084
|
+
/**
|
|
18085
|
+
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
18086
|
+
*
|
|
18087
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
18088
|
+
*/
|
|
18089
|
+
get protocol(): string;
|
|
18090
|
+
/**
|
|
18091
|
+
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
18092
|
+
*
|
|
18093
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
18094
|
+
*/
|
|
18095
|
+
get username(): string;
|
|
18096
|
+
/**
|
|
18097
|
+
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
18098
|
+
*
|
|
18099
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
18100
|
+
*/
|
|
18101
|
+
get password(): string;
|
|
18102
|
+
/**
|
|
18103
|
+
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
18104
|
+
*
|
|
18105
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
18106
|
+
*/
|
|
18107
|
+
get hostname(): string;
|
|
18108
|
+
/**
|
|
18109
|
+
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
18110
|
+
*
|
|
18111
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
18112
|
+
*/
|
|
18113
|
+
get port(): string;
|
|
18114
|
+
/**
|
|
18115
|
+
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
18116
|
+
*
|
|
18117
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
18118
|
+
*/
|
|
18119
|
+
get pathname(): string;
|
|
18120
|
+
/**
|
|
18121
|
+
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
18122
|
+
*
|
|
18123
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
18124
|
+
*/
|
|
18125
|
+
get search(): string;
|
|
18126
|
+
/**
|
|
18127
|
+
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
18128
|
+
*
|
|
18129
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
18130
|
+
*/
|
|
18131
|
+
get hash(): string;
|
|
18132
|
+
/**
|
|
18133
|
+
* The **`hasRegExpGroups`** read-only property of the URLPattern interface is a boolean indicating whether or not any of the URLPattern components contain regular expression capturing groups.
|
|
18134
|
+
*
|
|
18135
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
18136
|
+
*/
|
|
18137
|
+
get hasRegExpGroups(): boolean;
|
|
18138
|
+
/**
|
|
18139
|
+
* The **`test()`** method of the URLPattern interface takes a URL string or object of URL parts, and returns a boolean indicating if the given input matches the current pattern.
|
|
18140
|
+
*
|
|
18141
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
18142
|
+
*/
|
|
18143
|
+
test(input?: string | URLPatternInit, baseURL?: string): boolean;
|
|
18144
|
+
/**
|
|
18145
|
+
* The **`exec()`** method of the URLPattern interface takes a URL or object of URL parts, and returns either an object containing the results of matching the URL to the pattern, or null if the URL does not match the pattern.
|
|
18146
|
+
*
|
|
18147
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
18148
|
+
*/
|
|
18149
|
+
exec(
|
|
18150
|
+
input?: string | URLPatternInit,
|
|
18151
|
+
baseURL?: string,
|
|
18152
|
+
): URLPatternResult | null;
|
|
18153
|
+
}
|
|
18154
|
+
export interface URLPatternInit {
|
|
18155
|
+
protocol?: string;
|
|
18156
|
+
username?: string;
|
|
18157
|
+
password?: string;
|
|
18158
|
+
hostname?: string;
|
|
18159
|
+
port?: string;
|
|
18160
|
+
pathname?: string;
|
|
18161
|
+
search?: string;
|
|
18162
|
+
hash?: string;
|
|
18163
|
+
baseURL?: string;
|
|
18164
|
+
}
|
|
18165
|
+
export interface URLPatternComponentResult {
|
|
18166
|
+
input: string;
|
|
18167
|
+
groups: Record<string, string | undefined>;
|
|
18168
|
+
}
|
|
18169
|
+
export interface URLPatternResult {
|
|
18170
|
+
inputs: (string | URLPatternInit)[];
|
|
18171
|
+
protocol: URLPatternComponentResult;
|
|
18172
|
+
username: URLPatternComponentResult;
|
|
18173
|
+
password: URLPatternComponentResult;
|
|
18174
|
+
hostname: URLPatternComponentResult;
|
|
18175
|
+
port: URLPatternComponentResult;
|
|
18176
|
+
pathname: URLPatternComponentResult;
|
|
18177
|
+
search: URLPatternComponentResult;
|
|
18178
|
+
hash: URLPatternComponentResult;
|
|
18179
|
+
}
|
|
18180
|
+
export interface URLPatternOptions {
|
|
18181
|
+
ignoreCase?: boolean;
|
|
18182
|
+
}
|
|
18076
18183
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
18077
18184
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
18078
18185
|
// https://opensource.org/licenses/Apache-2.0
|