@cloudflare/workers-types 5.20261110.1 → 5.20261113.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 +1541 -1527
- package/experimental/index.ts +1541 -1527
- package/index.d.ts +939 -931
- package/index.ts +939 -931
- package/package.json +1 -1
package/experimental/index.ts
CHANGED
|
@@ -813,7 +813,10 @@ export interface DurableObjectStorage {
|
|
|
813
813
|
snapshot(
|
|
814
814
|
options?: DurableObjectSnapshotOptions,
|
|
815
815
|
): Promise<DurableObjectSnapshot>;
|
|
816
|
-
onNextSessionRestore(
|
|
816
|
+
onNextSessionRestore(
|
|
817
|
+
target: DurableObjectSnapshot | string,
|
|
818
|
+
options?: DurableObjectRestoreOptions,
|
|
819
|
+
): Promise<string>;
|
|
817
820
|
/** @deprecated Use `ctx.configureReadReplication()` instead. */
|
|
818
821
|
ensureReplicas(): void;
|
|
819
822
|
/** @deprecated Use `ctx.configureReadReplication()` instead. */
|
|
@@ -828,6 +831,9 @@ export interface DurableObjectReadReplicationOptions {
|
|
|
828
831
|
export interface DurableObjectSnapshotOptions {
|
|
829
832
|
bookmark?: string;
|
|
830
833
|
}
|
|
834
|
+
export interface DurableObjectRestoreOptions {
|
|
835
|
+
kvData?: Record<string, any>;
|
|
836
|
+
}
|
|
831
837
|
export interface DurableObjectListOptions {
|
|
832
838
|
start?: string;
|
|
833
839
|
startAfter?: string;
|
|
@@ -3574,1812 +3580,1457 @@ export interface TraceMetrics {
|
|
|
3574
3580
|
export interface UnsafeTraceMetrics {
|
|
3575
3581
|
fromTrace(item: TraceItem): TraceMetrics;
|
|
3576
3582
|
}
|
|
3583
|
+
export type WebSocketEventMap = {
|
|
3584
|
+
close: CloseEvent;
|
|
3585
|
+
message: MessageEvent;
|
|
3586
|
+
open: Event;
|
|
3587
|
+
error: ErrorEvent;
|
|
3588
|
+
};
|
|
3577
3589
|
/**
|
|
3578
|
-
* The **`
|
|
3590
|
+
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
3579
3591
|
*
|
|
3580
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3592
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
3581
3593
|
*/
|
|
3582
|
-
export declare
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
set href(value: string);
|
|
3602
|
-
/**
|
|
3603
|
-
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
|
3604
|
-
*
|
|
3605
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
|
3606
|
-
*/
|
|
3607
|
-
get protocol(): string;
|
|
3608
|
-
/**
|
|
3609
|
-
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
|
3610
|
-
*
|
|
3611
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
|
3612
|
-
*/
|
|
3613
|
-
set protocol(value: string);
|
|
3614
|
-
/**
|
|
3615
|
-
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
|
3616
|
-
*
|
|
3617
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
|
3618
|
-
*/
|
|
3619
|
-
get username(): string;
|
|
3620
|
-
/**
|
|
3621
|
-
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
|
3622
|
-
*
|
|
3623
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
|
3624
|
-
*/
|
|
3625
|
-
set username(value: string);
|
|
3626
|
-
/**
|
|
3627
|
-
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
|
3628
|
-
*
|
|
3629
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
|
3630
|
-
*/
|
|
3631
|
-
get password(): string;
|
|
3632
|
-
/**
|
|
3633
|
-
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
|
3634
|
-
*
|
|
3635
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
|
3636
|
-
*/
|
|
3637
|
-
set password(value: string);
|
|
3638
|
-
/**
|
|
3639
|
-
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
|
3640
|
-
*
|
|
3641
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
|
3642
|
-
*/
|
|
3643
|
-
get host(): string;
|
|
3644
|
-
/**
|
|
3645
|
-
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
|
3646
|
-
*
|
|
3647
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
|
3648
|
-
*/
|
|
3649
|
-
set host(value: string);
|
|
3594
|
+
export declare var WebSocket: {
|
|
3595
|
+
prototype: WebSocket;
|
|
3596
|
+
new (url: string, protocols?: string[] | string): WebSocket;
|
|
3597
|
+
readonly READY_STATE_CONNECTING: number;
|
|
3598
|
+
readonly CONNECTING: number;
|
|
3599
|
+
readonly READY_STATE_OPEN: number;
|
|
3600
|
+
readonly OPEN: number;
|
|
3601
|
+
readonly READY_STATE_CLOSING: number;
|
|
3602
|
+
readonly CLOSING: number;
|
|
3603
|
+
readonly READY_STATE_CLOSED: number;
|
|
3604
|
+
readonly CLOSED: number;
|
|
3605
|
+
};
|
|
3606
|
+
/**
|
|
3607
|
+
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
3608
|
+
*
|
|
3609
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
3610
|
+
*/
|
|
3611
|
+
export interface WebSocket extends EventTarget<WebSocketEventMap> {
|
|
3612
|
+
accept(options?: WebSocketAcceptOptions): void;
|
|
3650
3613
|
/**
|
|
3651
|
-
* The **`
|
|
3614
|
+
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
|
3652
3615
|
*
|
|
3653
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3616
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
3654
3617
|
*/
|
|
3655
|
-
|
|
3618
|
+
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
3656
3619
|
/**
|
|
3657
|
-
* The **`
|
|
3620
|
+
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
|
3658
3621
|
*
|
|
3659
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3622
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
3660
3623
|
*/
|
|
3661
|
-
|
|
3624
|
+
close(code?: number, reason?: string): void;
|
|
3625
|
+
serializeAttachment(attachment: any): void;
|
|
3626
|
+
deserializeAttachment(): any | null;
|
|
3662
3627
|
/**
|
|
3663
|
-
* The **`
|
|
3628
|
+
* The **`WebSocket.readyState`** read-only property returns the current state of the WebSocket connection.
|
|
3664
3629
|
*
|
|
3665
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3630
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/readyState)
|
|
3666
3631
|
*/
|
|
3667
|
-
|
|
3632
|
+
readyState: number;
|
|
3668
3633
|
/**
|
|
3669
|
-
* The **`
|
|
3634
|
+
* The **`WebSocket.url`** read-only property returns the absolute URL of the WebSocket as resolved by the constructor.
|
|
3670
3635
|
*
|
|
3671
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3636
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/url)
|
|
3672
3637
|
*/
|
|
3673
|
-
|
|
3638
|
+
url: string | null;
|
|
3674
3639
|
/**
|
|
3675
|
-
* The **`
|
|
3640
|
+
* The **`WebSocket.protocol`** read-only property returns the name of the sub-protocol the server selected; this will be one of the strings specified in the protocols parameter when creating the WebSocket object, or the empty string if no connection is established.
|
|
3676
3641
|
*
|
|
3677
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3642
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/protocol)
|
|
3678
3643
|
*/
|
|
3679
|
-
|
|
3644
|
+
protocol: string | null;
|
|
3680
3645
|
/**
|
|
3681
|
-
* The **`
|
|
3646
|
+
* The **`WebSocket.extensions`** read-only property returns the extensions selected by the server. This is currently only the empty string or a list of extensions as negotiated by the connection.
|
|
3682
3647
|
*
|
|
3683
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3648
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/extensions)
|
|
3684
3649
|
*/
|
|
3685
|
-
|
|
3650
|
+
extensions: string | null;
|
|
3686
3651
|
/**
|
|
3687
|
-
* The **`
|
|
3652
|
+
* The **`WebSocket.binaryType`** property controls the type of binary data being received over the WebSocket connection.
|
|
3688
3653
|
*
|
|
3689
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3654
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/binaryType)
|
|
3690
3655
|
*/
|
|
3691
|
-
|
|
3656
|
+
binaryType: "blob" | "arraybuffer";
|
|
3657
|
+
}
|
|
3658
|
+
export interface WebSocketAcceptOptions {
|
|
3692
3659
|
/**
|
|
3693
|
-
*
|
|
3694
|
-
*
|
|
3695
|
-
*
|
|
3660
|
+
* When set to `true`, receiving a server-initiated WebSocket Close frame will not
|
|
3661
|
+
* automatically send a reciprocal Close frame, leaving the connection in a half-open
|
|
3662
|
+
* state. This is useful for proxying scenarios where you need to coordinate closing
|
|
3663
|
+
* both sides independently. Defaults to `false` when the
|
|
3664
|
+
* `no_web_socket_half_open_by_default` compatibility flag is enabled.
|
|
3696
3665
|
*/
|
|
3697
|
-
|
|
3666
|
+
allowHalfOpen?: boolean;
|
|
3667
|
+
}
|
|
3668
|
+
export declare const WebSocketPair: {
|
|
3669
|
+
new (): {
|
|
3670
|
+
0: WebSocket;
|
|
3671
|
+
1: WebSocket;
|
|
3672
|
+
};
|
|
3673
|
+
};
|
|
3674
|
+
export interface SqlStorage {
|
|
3675
|
+
exec<T extends Record<string, SqlStorageValue>>(
|
|
3676
|
+
query: string,
|
|
3677
|
+
...bindings: any[]
|
|
3678
|
+
): SqlStorageCursor<T>;
|
|
3679
|
+
prepare(query: string): SqlStorageStatement;
|
|
3680
|
+
ingest(query: string): SqlStorageIngestResult;
|
|
3681
|
+
setMaxPageCountForTest(count: number): void;
|
|
3682
|
+
get databaseSize(): number;
|
|
3683
|
+
Cursor: typeof SqlStorageCursor;
|
|
3684
|
+
Statement: typeof SqlStorageStatement;
|
|
3685
|
+
}
|
|
3686
|
+
export declare abstract class SqlStorageStatement {}
|
|
3687
|
+
export type SqlStorageValue = ArrayBuffer | string | number | null;
|
|
3688
|
+
export declare abstract class SqlStorageCursor<
|
|
3689
|
+
T extends Record<string, SqlStorageValue>,
|
|
3690
|
+
> {
|
|
3691
|
+
next(): IteratorResult<T, undefined>;
|
|
3692
|
+
toArray(): T[];
|
|
3693
|
+
one(): T;
|
|
3694
|
+
raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
|
|
3695
|
+
columnNames: string[];
|
|
3696
|
+
get rowsRead(): number;
|
|
3697
|
+
get rowsWritten(): number;
|
|
3698
|
+
get reusedCachedQueryForTest(): boolean;
|
|
3699
|
+
[Symbol.iterator](): IterableIterator<T>;
|
|
3700
|
+
}
|
|
3701
|
+
export interface SqlStorageIngestResult {
|
|
3702
|
+
remainder: string;
|
|
3703
|
+
rowsRead: number;
|
|
3704
|
+
rowsWritten: number;
|
|
3705
|
+
statementCount: number;
|
|
3706
|
+
}
|
|
3707
|
+
export interface Socket {
|
|
3708
|
+
get readable(): ReadableStream;
|
|
3709
|
+
get writable(): WritableStream;
|
|
3710
|
+
get closed(): Promise<void>;
|
|
3711
|
+
get opened(): Promise<SocketInfo>;
|
|
3712
|
+
get upgraded(): boolean;
|
|
3713
|
+
get secureTransport(): "on" | "off" | "starttls";
|
|
3714
|
+
get protocol(): "tcp" | "udp";
|
|
3715
|
+
close(): Promise<void>;
|
|
3716
|
+
startTls(options?: TlsOptions): Socket;
|
|
3717
|
+
proxyTo(sock: Socket, options?: StreamPipeOptions): Promise<void>;
|
|
3718
|
+
}
|
|
3719
|
+
export interface SocketOptions {
|
|
3720
|
+
secureTransport?: string;
|
|
3721
|
+
allowHalfOpen: boolean;
|
|
3722
|
+
highWaterMark?: number | bigint;
|
|
3723
|
+
}
|
|
3724
|
+
export interface SocketAddress {
|
|
3725
|
+
hostname: string;
|
|
3726
|
+
port: number;
|
|
3727
|
+
}
|
|
3728
|
+
export interface TlsOptions {
|
|
3729
|
+
expectedServerHostname?: string;
|
|
3730
|
+
}
|
|
3731
|
+
export interface SocketInfo {
|
|
3732
|
+
remoteAddress?: string;
|
|
3733
|
+
localAddress?: string;
|
|
3734
|
+
}
|
|
3735
|
+
export declare class Datagram {
|
|
3736
|
+
constructor(data: Uint8Array);
|
|
3737
|
+
get data(): Uint8Array;
|
|
3738
|
+
}
|
|
3739
|
+
/**
|
|
3740
|
+
* The **`EventSource`** interface is web content's interface to server-sent events.
|
|
3741
|
+
*
|
|
3742
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource)
|
|
3743
|
+
*/
|
|
3744
|
+
export declare class EventSource extends EventTarget {
|
|
3745
|
+
constructor(url: string, init?: EventSourceEventSourceInit);
|
|
3698
3746
|
/**
|
|
3699
|
-
* The **`
|
|
3747
|
+
* The **`close()`** method of the EventSource interface closes the connection, if one is made, and sets the EventSource.readyState attribute to 2 (closed).
|
|
3700
3748
|
*
|
|
3701
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3749
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
|
|
3702
3750
|
*/
|
|
3703
|
-
|
|
3751
|
+
close(): void;
|
|
3704
3752
|
/**
|
|
3705
|
-
* The **`
|
|
3753
|
+
* The **`url`** read-only property of the EventSource interface returns a string representing the URL of the source.
|
|
3706
3754
|
*
|
|
3707
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3755
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
|
|
3708
3756
|
*/
|
|
3709
|
-
|
|
3757
|
+
get url(): string;
|
|
3710
3758
|
/**
|
|
3711
|
-
* The **`
|
|
3759
|
+
* The **`withCredentials`** read-only property of the EventSource interface returns a boolean value indicating whether the EventSource object was instantiated with CORS credentials set.
|
|
3712
3760
|
*
|
|
3713
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3761
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
|
|
3714
3762
|
*/
|
|
3715
|
-
get
|
|
3763
|
+
get withCredentials(): boolean;
|
|
3716
3764
|
/**
|
|
3717
|
-
* The **`
|
|
3765
|
+
* The **`readyState`** read-only property of the EventSource interface returns a number representing the state of the connection.
|
|
3718
3766
|
*
|
|
3719
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3767
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
|
|
3720
3768
|
*/
|
|
3721
|
-
|
|
3722
|
-
/*
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3769
|
+
get readyState(): number;
|
|
3770
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3771
|
+
get onopen(): any | null;
|
|
3772
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
|
|
3773
|
+
set onopen(value: any | null);
|
|
3774
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3775
|
+
get onmessage(): any | null;
|
|
3776
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
|
|
3777
|
+
set onmessage(value: any | null);
|
|
3778
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3779
|
+
get onerror(): any | null;
|
|
3780
|
+
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
|
|
3781
|
+
set onerror(value: any | null);
|
|
3782
|
+
static readonly CONNECTING: number;
|
|
3783
|
+
static readonly OPEN: number;
|
|
3784
|
+
static readonly CLOSED: number;
|
|
3785
|
+
static from(stream: ReadableStream): EventSource;
|
|
3786
|
+
}
|
|
3787
|
+
export interface EventSourceEventSourceInit {
|
|
3788
|
+
withCredentials?: boolean;
|
|
3789
|
+
fetcher?: Fetcher;
|
|
3790
|
+
}
|
|
3791
|
+
export interface ExecOutput {
|
|
3792
|
+
readonly stdout: ArrayBuffer;
|
|
3793
|
+
readonly stderr: ArrayBuffer;
|
|
3794
|
+
readonly exitCode: number;
|
|
3795
|
+
}
|
|
3796
|
+
export interface ContainerExecOptions {
|
|
3797
|
+
cwd?: string;
|
|
3798
|
+
env?: Record<string, string>;
|
|
3799
|
+
user?: string;
|
|
3800
|
+
signal?: AbortSignal;
|
|
3801
|
+
pty?: boolean | ContainerExecPtyOptions;
|
|
3802
|
+
stdin?: ReadableStream | "pipe";
|
|
3803
|
+
stdout?: "pipe" | "ignore";
|
|
3804
|
+
stderr?: "pipe" | "ignore" | "combined";
|
|
3805
|
+
}
|
|
3806
|
+
export interface ContainerExecPtyOptions {
|
|
3807
|
+
cols?: number;
|
|
3808
|
+
rows?: number;
|
|
3809
|
+
}
|
|
3810
|
+
export interface ExecProcess {
|
|
3811
|
+
readonly stdin: WritableStream | null;
|
|
3812
|
+
readonly stdout: ReadableStream | null;
|
|
3813
|
+
readonly stderr: ReadableStream | null;
|
|
3814
|
+
readonly pid: number;
|
|
3815
|
+
readonly isPty: boolean;
|
|
3816
|
+
readonly exitCode: Promise<number>;
|
|
3817
|
+
output(): Promise<ExecOutput>;
|
|
3818
|
+
kill(signal?: number): void;
|
|
3819
|
+
resize(cols: number, rows: number): void;
|
|
3820
|
+
}
|
|
3821
|
+
export interface Container {
|
|
3822
|
+
get running(): boolean;
|
|
3823
|
+
get images(): Record<string, string>;
|
|
3824
|
+
start(options?: ContainerStartupOptions): void;
|
|
3825
|
+
monitor(): Promise<void>;
|
|
3826
|
+
destroy(error?: any): Promise<void>;
|
|
3827
|
+
signal(signo: number): void;
|
|
3828
|
+
getTcpPort(port: number): Fetcher;
|
|
3829
|
+
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
3830
|
+
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
3831
|
+
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
3832
|
+
snapshotContainer(
|
|
3833
|
+
options?: ContainerSnapshotOptions,
|
|
3834
|
+
): Promise<ContainerSnapshot>;
|
|
3835
|
+
interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
|
|
3836
|
+
exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
|
|
3837
|
+
inspect(): Promise<ContainerInfo | null>;
|
|
3838
|
+
interceptOutboundTcp(addr: string, binding: Fetcher): Promise<void>;
|
|
3839
|
+
snapshotDirectory(
|
|
3840
|
+
options: ContainerDirectorySnapshotOptions,
|
|
3841
|
+
): Promise<ContainerDirectorySnapshot>;
|
|
3842
|
+
setLabels(labels: Record<string, string>): Promise<void>;
|
|
3843
|
+
}
|
|
3844
|
+
export interface ContainerDirectorySnapshot {
|
|
3845
|
+
id: string;
|
|
3846
|
+
size: number;
|
|
3847
|
+
dir: string;
|
|
3848
|
+
name?: string;
|
|
3849
|
+
}
|
|
3850
|
+
export interface ContainerDirectorySnapshotOptions {
|
|
3851
|
+
dir: string;
|
|
3852
|
+
name?: string;
|
|
3853
|
+
}
|
|
3854
|
+
export type ContainerDirectorySnapshotRestoreParams =
|
|
3855
|
+
| {
|
|
3856
|
+
snapshot: ContainerDirectorySnapshot;
|
|
3857
|
+
mountPoint?: string;
|
|
3858
|
+
}
|
|
3859
|
+
| {
|
|
3860
|
+
snapshot?: undefined;
|
|
3861
|
+
mountPoint: string;
|
|
3862
|
+
};
|
|
3863
|
+
export interface ContainerSnapshot {
|
|
3864
|
+
id: string;
|
|
3865
|
+
size: number;
|
|
3866
|
+
name?: string;
|
|
3867
|
+
}
|
|
3868
|
+
export interface ContainerSnapshotRestoreParams {
|
|
3869
|
+
id: string;
|
|
3870
|
+
}
|
|
3871
|
+
export interface ContainerSnapshotOptions {
|
|
3872
|
+
name?: string;
|
|
3873
|
+
}
|
|
3874
|
+
export type ContainerStartupOptions = {
|
|
3875
|
+
entrypoint?: string[];
|
|
3876
|
+
enableInternet?: boolean;
|
|
3877
|
+
env?: Record<string, string>;
|
|
3878
|
+
hardTimeout?: number | bigint;
|
|
3879
|
+
instance?:
|
|
3880
|
+
| "lite"
|
|
3881
|
+
| "basic"
|
|
3882
|
+
| "standard-1"
|
|
3883
|
+
| "standard-2"
|
|
3884
|
+
| "standard-3"
|
|
3885
|
+
| "standard-4"
|
|
3886
|
+
| ContainerStartResources;
|
|
3887
|
+
labels?: Record<string, string>;
|
|
3888
|
+
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
|
3889
|
+
} & (
|
|
3890
|
+
| {
|
|
3891
|
+
image: string;
|
|
3892
|
+
containerSnapshot?: never;
|
|
3893
|
+
}
|
|
3894
|
+
| {
|
|
3895
|
+
image?: never;
|
|
3896
|
+
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
3897
|
+
}
|
|
3898
|
+
);
|
|
3899
|
+
export interface ContainerInfo {
|
|
3900
|
+
labels: Record<string, string>;
|
|
3901
|
+
image: string;
|
|
3902
|
+
}
|
|
3903
|
+
export interface ContainerStartResources {
|
|
3904
|
+
vcpu: number;
|
|
3905
|
+
memoryMib: number;
|
|
3906
|
+
diskMb: number;
|
|
3907
|
+
}
|
|
3908
|
+
/**
|
|
3909
|
+
* The **`FileSystemHandle`** interface of the File System API is an object which represents a file or directory entry. Multiple handles can represent the same entry. For the most part you do not work with FileSystemHandle directly but rather its child interfaces FileSystemFileHandle and FileSystemDirectoryHandle.
|
|
3910
|
+
* Available only in secure contexts.
|
|
3911
|
+
*
|
|
3912
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle)
|
|
3913
|
+
*/
|
|
3914
|
+
export declare abstract class FileSystemHandle {
|
|
3730
3915
|
/**
|
|
3731
|
-
* The **`
|
|
3916
|
+
* The **`kind`** read-only property of the FileSystemHandle interface returns the type of entry. This is 'file' if the associated entry is a file or 'directory'. It is used to distinguish files from directories when iterating over the contents of a directory.
|
|
3732
3917
|
*
|
|
3733
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3918
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/kind)
|
|
3734
3919
|
*/
|
|
3735
|
-
|
|
3920
|
+
get kind(): string;
|
|
3736
3921
|
/**
|
|
3737
|
-
* The **`
|
|
3922
|
+
* The **`name`** read-only property of the FileSystemHandle interface returns the name of the entry represented by handle.
|
|
3738
3923
|
*
|
|
3739
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3924
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/name)
|
|
3740
3925
|
*/
|
|
3741
|
-
|
|
3926
|
+
get name(): string;
|
|
3742
3927
|
/**
|
|
3743
|
-
* The **`
|
|
3928
|
+
* The **`isSameEntry()`** method of the FileSystemHandle interface compares two handles to see if the associated entries (either a file or directory) match.
|
|
3744
3929
|
*
|
|
3745
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3930
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemHandle/isSameEntry)
|
|
3746
3931
|
*/
|
|
3747
|
-
|
|
3932
|
+
isSameEntry(other: FileSystemHandle): Promise<boolean>;
|
|
3933
|
+
getUniqueId(): Promise<string>;
|
|
3934
|
+
remove(options?: FileSystemHandleRemoveOptions): Promise<void>;
|
|
3748
3935
|
}
|
|
3749
3936
|
/**
|
|
3750
|
-
* The **`
|
|
3937
|
+
* The **`FileSystemFileHandle`** interface of the File System API represents a handle to a file system entry. The interface is accessed through the window.showOpenFilePicker() method.
|
|
3938
|
+
* Available only in secure contexts.
|
|
3751
3939
|
*
|
|
3752
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3940
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle)
|
|
3753
3941
|
*/
|
|
3754
|
-
export declare class
|
|
3755
|
-
constructor(
|
|
3756
|
-
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
3757
|
-
);
|
|
3758
|
-
/**
|
|
3759
|
-
* The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries.
|
|
3760
|
-
*
|
|
3761
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size)
|
|
3762
|
-
*/
|
|
3763
|
-
get size(): number;
|
|
3764
|
-
/**
|
|
3765
|
-
* The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.
|
|
3766
|
-
*
|
|
3767
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
3768
|
-
*/
|
|
3769
|
-
append(name: string, value: string): void;
|
|
3942
|
+
export declare abstract class FileSystemFileHandle extends FileSystemHandle {
|
|
3770
3943
|
/**
|
|
3771
|
-
* The **`
|
|
3944
|
+
* The **`getFile()`** method of the FileSystemFileHandle interface returns a Promise which resolves to a File object representing the state on disk of the entry represented by the handle.
|
|
3772
3945
|
*
|
|
3773
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3946
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/getFile)
|
|
3774
3947
|
*/
|
|
3775
|
-
|
|
3948
|
+
getFile(): Promise<File>;
|
|
3776
3949
|
/**
|
|
3777
|
-
* The **`
|
|
3950
|
+
* The **`createWritable()`** method of the FileSystemFileHandle interface creates a FileSystemWritableFileStream that can be used to write to a file. The method returns a Promise which resolves to this created stream.
|
|
3778
3951
|
*
|
|
3779
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3952
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemFileHandle/createWritable)
|
|
3780
3953
|
*/
|
|
3781
|
-
|
|
3954
|
+
createWritable(
|
|
3955
|
+
options?: FileSystemFileHandleFileSystemCreateWritableOptions,
|
|
3956
|
+
): Promise<FileSystemWritableFileStream>;
|
|
3957
|
+
}
|
|
3958
|
+
/**
|
|
3959
|
+
* The **`FileSystemDirectoryHandle`** interface of the File System API provides a handle to a file system directory.
|
|
3960
|
+
* Available only in secure contexts.
|
|
3961
|
+
*
|
|
3962
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle)
|
|
3963
|
+
*/
|
|
3964
|
+
export declare abstract class FileSystemDirectoryHandle extends FileSystemHandle {
|
|
3782
3965
|
/**
|
|
3783
|
-
* The **`
|
|
3966
|
+
* The **`getFileHandle()`** method of the FileSystemDirectoryHandle interface returns a FileSystemFileHandle for a file with the specified name, within the directory the method is called.
|
|
3784
3967
|
*
|
|
3785
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3968
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getFileHandle)
|
|
3786
3969
|
*/
|
|
3787
|
-
|
|
3970
|
+
getFileHandle(
|
|
3971
|
+
name: string,
|
|
3972
|
+
options?: FileSystemDirectoryHandleFileSystemGetFileOptions,
|
|
3973
|
+
): Promise<FileSystemFileHandle>;
|
|
3788
3974
|
/**
|
|
3789
|
-
* The **`
|
|
3975
|
+
* The **`getDirectoryHandle()`** method of the FileSystemDirectoryHandle interface returns a FileSystemDirectoryHandle for a subdirectory with the specified name within the directory handle on which the method is called.
|
|
3790
3976
|
*
|
|
3791
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3977
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/getDirectoryHandle)
|
|
3792
3978
|
*/
|
|
3793
|
-
|
|
3979
|
+
getDirectoryHandle(
|
|
3980
|
+
name: string,
|
|
3981
|
+
options?: FileSystemDirectoryHandleFileSystemGetDirectoryOptions,
|
|
3982
|
+
): Promise<FileSystemDirectoryHandle>;
|
|
3794
3983
|
/**
|
|
3795
|
-
* The **`
|
|
3984
|
+
* The **`removeEntry()`** method of the FileSystemDirectoryHandle interface attempts to remove an entry if the directory handle contains a file or directory called the name specified.
|
|
3796
3985
|
*
|
|
3797
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3986
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/removeEntry)
|
|
3798
3987
|
*/
|
|
3799
|
-
|
|
3988
|
+
removeEntry(
|
|
3989
|
+
name: string,
|
|
3990
|
+
options?: FileSystemDirectoryHandleFileSystemRemoveOptions,
|
|
3991
|
+
): Promise<void>;
|
|
3800
3992
|
/**
|
|
3801
|
-
* The **`
|
|
3993
|
+
* The **`resolve()`** method of the FileSystemDirectoryHandle interface returns an Array of directory names from the parent handle to the specified child entry, with the name of the child entry as the last array item.
|
|
3802
3994
|
*
|
|
3803
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
3995
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryHandle/resolve)
|
|
3804
3996
|
*/
|
|
3805
|
-
|
|
3806
|
-
entries():
|
|
3807
|
-
keys():
|
|
3808
|
-
values():
|
|
3809
|
-
forEach
|
|
3810
|
-
callback: (
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
parent: URLSearchParams,
|
|
3997
|
+
resolve(possibleDescendant: FileSystemHandle): Promise<string[]>;
|
|
3998
|
+
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
|
|
3999
|
+
keys(): AsyncIterableIterator<string>;
|
|
4000
|
+
values(): AsyncIterableIterator<FileSystemHandle>;
|
|
4001
|
+
forEach(
|
|
4002
|
+
callback: (
|
|
4003
|
+
param0: string,
|
|
4004
|
+
param1: FileSystemHandle,
|
|
4005
|
+
param2: FileSystemDirectoryHandle,
|
|
3815
4006
|
) => void,
|
|
3816
|
-
thisArg?:
|
|
4007
|
+
thisArg?: any,
|
|
3817
4008
|
): void;
|
|
3818
|
-
|
|
3819
|
-
toString(): string;
|
|
3820
|
-
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
4009
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
|
|
3821
4010
|
}
|
|
3822
4011
|
/**
|
|
3823
|
-
* The **`
|
|
4012
|
+
* The **`FileSystemWritableFileStream`** interface of the File System API is a WritableStream object with additional convenience methods, which operates on a single file on disk. The interface is accessed through the FileSystemFileHandle.createWritable() method.
|
|
4013
|
+
* Available only in secure contexts.
|
|
3824
4014
|
*
|
|
3825
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4015
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream)
|
|
3826
4016
|
*/
|
|
3827
|
-
export declare class
|
|
3828
|
-
constructor(
|
|
3829
|
-
input?: string | URLPatternInit,
|
|
3830
|
-
baseURL?: string | URLPatternOptions,
|
|
3831
|
-
patternOptions?: URLPatternOptions,
|
|
3832
|
-
);
|
|
3833
|
-
/**
|
|
3834
|
-
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
3835
|
-
*
|
|
3836
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
3837
|
-
*/
|
|
3838
|
-
get protocol(): string;
|
|
3839
|
-
/**
|
|
3840
|
-
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
3841
|
-
*
|
|
3842
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
3843
|
-
*/
|
|
3844
|
-
get username(): string;
|
|
3845
|
-
/**
|
|
3846
|
-
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
3847
|
-
*
|
|
3848
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
3849
|
-
*/
|
|
3850
|
-
get password(): string;
|
|
3851
|
-
/**
|
|
3852
|
-
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
3853
|
-
*
|
|
3854
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
3855
|
-
*/
|
|
3856
|
-
get hostname(): string;
|
|
3857
|
-
/**
|
|
3858
|
-
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
3859
|
-
*
|
|
3860
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
3861
|
-
*/
|
|
3862
|
-
get port(): string;
|
|
3863
|
-
/**
|
|
3864
|
-
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
3865
|
-
*
|
|
3866
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
3867
|
-
*/
|
|
3868
|
-
get pathname(): string;
|
|
3869
|
-
/**
|
|
3870
|
-
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
3871
|
-
*
|
|
3872
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
3873
|
-
*/
|
|
3874
|
-
get search(): string;
|
|
4017
|
+
export declare abstract class FileSystemWritableFileStream extends WritableStream {
|
|
3875
4018
|
/**
|
|
3876
|
-
* The **`
|
|
4019
|
+
* The **`write()`** method of the FileSystemWritableFileStream interface writes content into the file the method is called on, at the current file cursor offset.
|
|
3877
4020
|
*
|
|
3878
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4021
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/write)
|
|
3879
4022
|
*/
|
|
3880
|
-
|
|
4023
|
+
write(
|
|
4024
|
+
data:
|
|
4025
|
+
| Blob
|
|
4026
|
+
| (ArrayBuffer | ArrayBufferView)
|
|
4027
|
+
| string
|
|
4028
|
+
| FileSystemFileWriteParams,
|
|
4029
|
+
): Promise<void>;
|
|
3881
4030
|
/**
|
|
3882
|
-
* The **`
|
|
4031
|
+
* The **`seek()`** method of the FileSystemWritableFileStream interface updates the current file cursor offset to the position (in bytes) specified when calling the method.
|
|
3883
4032
|
*
|
|
3884
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4033
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/seek)
|
|
3885
4034
|
*/
|
|
3886
|
-
|
|
4035
|
+
seek(position: number): Promise<void>;
|
|
3887
4036
|
/**
|
|
3888
|
-
* The **`
|
|
4037
|
+
* The **`truncate()`** method of the FileSystemWritableFileStream interface resizes the file associated with the stream to the specified size in bytes.
|
|
3889
4038
|
*
|
|
3890
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4039
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream/truncate)
|
|
3891
4040
|
*/
|
|
3892
|
-
|
|
4041
|
+
truncate(size: number): Promise<void>;
|
|
4042
|
+
}
|
|
4043
|
+
/**
|
|
4044
|
+
* The **`StorageManager`** interface of the Storage API provides an interface for managing persistence permissions and estimating available storage. You can get a reference to this interface using either navigator.storage or WorkerNavigator.storage.
|
|
4045
|
+
* Available only in secure contexts.
|
|
4046
|
+
*
|
|
4047
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/StorageManager)
|
|
4048
|
+
*/
|
|
4049
|
+
export declare abstract class StorageManager {
|
|
3893
4050
|
/**
|
|
3894
|
-
* The **`
|
|
4051
|
+
* The **`getDirectory()`** method of the StorageManager interface is used to obtain a reference to a FileSystemDirectoryHandle object allowing access to a directory and its contents, stored in the origin private file system (OPFS).
|
|
3895
4052
|
*
|
|
3896
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4053
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/StorageManager/getDirectory)
|
|
3897
4054
|
*/
|
|
3898
|
-
|
|
3899
|
-
input?: string | URLPatternInit,
|
|
3900
|
-
baseURL?: string,
|
|
3901
|
-
): URLPatternResult | null;
|
|
4055
|
+
getDirectory(): Promise<FileSystemDirectoryHandle>;
|
|
3902
4056
|
}
|
|
3903
|
-
export interface
|
|
3904
|
-
|
|
3905
|
-
username?: string;
|
|
3906
|
-
password?: string;
|
|
3907
|
-
hostname?: string;
|
|
3908
|
-
port?: string;
|
|
3909
|
-
pathname?: string;
|
|
3910
|
-
search?: string;
|
|
3911
|
-
hash?: string;
|
|
3912
|
-
baseURL?: string;
|
|
4057
|
+
export interface FileSystemFileHandleFileSystemCreateWritableOptions {
|
|
4058
|
+
keepExistingData?: boolean;
|
|
3913
4059
|
}
|
|
3914
|
-
export interface
|
|
3915
|
-
|
|
3916
|
-
groups: Record<string, string>;
|
|
4060
|
+
export interface FileSystemDirectoryHandleFileSystemGetFileOptions {
|
|
4061
|
+
create: boolean;
|
|
3917
4062
|
}
|
|
3918
|
-
export interface
|
|
3919
|
-
|
|
3920
|
-
protocol: URLPatternComponentResult;
|
|
3921
|
-
username: URLPatternComponentResult;
|
|
3922
|
-
password: URLPatternComponentResult;
|
|
3923
|
-
hostname: URLPatternComponentResult;
|
|
3924
|
-
port: URLPatternComponentResult;
|
|
3925
|
-
pathname: URLPatternComponentResult;
|
|
3926
|
-
search: URLPatternComponentResult;
|
|
3927
|
-
hash: URLPatternComponentResult;
|
|
4063
|
+
export interface FileSystemDirectoryHandleFileSystemGetDirectoryOptions {
|
|
4064
|
+
create: boolean;
|
|
3928
4065
|
}
|
|
3929
|
-
export interface
|
|
3930
|
-
|
|
4066
|
+
export interface FileSystemDirectoryHandleFileSystemRemoveOptions {
|
|
4067
|
+
recursive: boolean;
|
|
4068
|
+
}
|
|
4069
|
+
export interface FileSystemFileWriteParams {
|
|
4070
|
+
type: string;
|
|
4071
|
+
size?: number;
|
|
4072
|
+
position?: number;
|
|
4073
|
+
data?: (Blob | (ArrayBuffer | ArrayBufferView) | string) | null;
|
|
4074
|
+
}
|
|
4075
|
+
export interface FileSystemHandleRemoveOptions {
|
|
4076
|
+
recursive?: boolean;
|
|
3931
4077
|
}
|
|
3932
|
-
export type WebSocketEventMap = {
|
|
3933
|
-
close: CloseEvent;
|
|
3934
|
-
message: MessageEvent;
|
|
3935
|
-
open: Event;
|
|
3936
|
-
error: ErrorEvent;
|
|
3937
|
-
};
|
|
3938
|
-
/**
|
|
3939
|
-
* The **`WebSocket`** object provides the API for creating and managing a WebSocket connection to a server, as well as for sending and receiving data on the connection.
|
|
3940
|
-
*
|
|
3941
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket)
|
|
3942
|
-
*/
|
|
3943
|
-
export declare var WebSocket: {
|
|
3944
|
-
prototype: WebSocket;
|
|
3945
|
-
new (url: string, protocols?: string[] | string): WebSocket;
|
|
3946
|
-
readonly READY_STATE_CONNECTING: number;
|
|
3947
|
-
readonly CONNECTING: number;
|
|
3948
|
-
readonly READY_STATE_OPEN: number;
|
|
3949
|
-
readonly OPEN: number;
|
|
3950
|
-
readonly READY_STATE_CLOSING: number;
|
|
3951
|
-
readonly CLOSING: number;
|
|
3952
|
-
readonly READY_STATE_CLOSED: number;
|
|
3953
|
-
readonly CLOSED: number;
|
|
3954
|
-
};
|
|
3955
4078
|
/**
|
|
3956
|
-
* The **`
|
|
4079
|
+
* The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
|
|
3957
4080
|
*
|
|
3958
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4081
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
|
|
3959
4082
|
*/
|
|
3960
|
-
export
|
|
3961
|
-
accept(options?: WebSocketAcceptOptions): void;
|
|
3962
|
-
/**
|
|
3963
|
-
* The **`WebSocket.send()`** method enqueues the specified data to be transmitted to the server over the WebSocket connection, increasing the value of bufferedAmount by the number of bytes needed to contain the data. If the data can't be sent (for example, because it needs to be buffered but the buffer is full), the socket is closed automatically. The browser will throw an exception if you call send() when the connection is in the CONNECTING state. If you call send() when the connection is in the CLOSING or CLOSED states, the browser will silently discard the data.
|
|
3964
|
-
*
|
|
3965
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/send)
|
|
3966
|
-
*/
|
|
3967
|
-
send(message: (ArrayBuffer | ArrayBufferView) | string): void;
|
|
3968
|
-
/**
|
|
3969
|
-
* The **`WebSocket.close()`** method closes the WebSocket connection or connection attempt, if any. If the connection is already CLOSED, this method does nothing.
|
|
3970
|
-
*
|
|
3971
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebSocket/close)
|
|
3972
|
-
*/
|
|
3973
|
-
close(code?: number, reason?: string): void;
|
|
3974
|
-
serializeAttachment(attachment: any): void;
|
|
3975
|
-
deserializeAttachment(): any | null;
|
|
4083
|
+
export declare abstract class MessagePort extends EventTarget {
|
|
3976
4084
|
/**
|
|
3977
|
-
* The **`
|
|
4085
|
+
* The **`postMessage()`** method of the MessagePort interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
|
|
3978
4086
|
*
|
|
3979
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4087
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/postMessage)
|
|
3980
4088
|
*/
|
|
3981
|
-
|
|
4089
|
+
postMessage(
|
|
4090
|
+
data?: any,
|
|
4091
|
+
options?: any[] | MessagePortPostMessageOptions,
|
|
4092
|
+
): void;
|
|
3982
4093
|
/**
|
|
3983
|
-
* The **`
|
|
4094
|
+
* The **`close()`** method of the MessagePort interface disconnects the port, so it is no longer active. This stops the flow of messages to that port.
|
|
3984
4095
|
*
|
|
3985
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4096
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/close)
|
|
3986
4097
|
*/
|
|
3987
|
-
|
|
4098
|
+
close(): void;
|
|
3988
4099
|
/**
|
|
3989
|
-
* The **`
|
|
4100
|
+
* The **`start()`** method of the MessagePort interface starts the sending of messages queued on the port. This method is only needed when using EventTarget.addEventListener; it is implied when using onmessage.
|
|
3990
4101
|
*
|
|
3991
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4102
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort/start)
|
|
3992
4103
|
*/
|
|
3993
|
-
|
|
4104
|
+
start(): void;
|
|
4105
|
+
get onmessage(): any | null;
|
|
4106
|
+
set onmessage(value: any | null);
|
|
4107
|
+
}
|
|
4108
|
+
/**
|
|
4109
|
+
* The **`MessageChannel`** interface of the Channel Messaging API allows us to create a new message channel and send data through it via its two MessagePort properties.
|
|
4110
|
+
*
|
|
4111
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel)
|
|
4112
|
+
*/
|
|
4113
|
+
export declare class MessageChannel {
|
|
4114
|
+
constructor();
|
|
3994
4115
|
/**
|
|
3995
|
-
* The **`
|
|
4116
|
+
* The **`port1`** read-only property of the MessageChannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
|
|
3996
4117
|
*
|
|
3997
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4118
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port1)
|
|
3998
4119
|
*/
|
|
3999
|
-
|
|
4120
|
+
readonly port1: MessagePort;
|
|
4000
4121
|
/**
|
|
4001
|
-
* The **`
|
|
4122
|
+
* The **`port2`** read-only property of the MessageChannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
|
|
4002
4123
|
*
|
|
4003
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4124
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageChannel/port2)
|
|
4004
4125
|
*/
|
|
4005
|
-
|
|
4126
|
+
readonly port2: MessagePort;
|
|
4006
4127
|
}
|
|
4007
|
-
export interface
|
|
4008
|
-
|
|
4009
|
-
* When set to `true`, receiving a server-initiated WebSocket Close frame will not
|
|
4010
|
-
* automatically send a reciprocal Close frame, leaving the connection in a half-open
|
|
4011
|
-
* state. This is useful for proxying scenarios where you need to coordinate closing
|
|
4012
|
-
* both sides independently. Defaults to `false` when the
|
|
4013
|
-
* `no_web_socket_half_open_by_default` compatibility flag is enabled.
|
|
4014
|
-
*/
|
|
4015
|
-
allowHalfOpen?: boolean;
|
|
4128
|
+
export interface MessagePortPostMessageOptions {
|
|
4129
|
+
transfer?: any[];
|
|
4016
4130
|
}
|
|
4017
|
-
export
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
4038
|
-
|
|
4039
|
-
|
|
4040
|
-
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4131
|
+
export type LoopbackForExport<
|
|
4132
|
+
T extends
|
|
4133
|
+
| (new (...args: any[]) => Rpc.EntrypointBranded)
|
|
4134
|
+
| ExportedHandler<any, any, any>
|
|
4135
|
+
| undefined = undefined,
|
|
4136
|
+
> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded
|
|
4137
|
+
? LoopbackServiceStub<InstanceType<T>>
|
|
4138
|
+
: T extends new (...args: any[]) => Rpc.DurableObjectBranded
|
|
4139
|
+
? LoopbackDurableObjectClass<InstanceType<T>>
|
|
4140
|
+
: T extends new (
|
|
4141
|
+
...args: any[]
|
|
4142
|
+
) => CloudflareWorkersModule.WorkflowEntrypoint<any, infer Params>
|
|
4143
|
+
? Workflow<Params>
|
|
4144
|
+
: T extends ExportedHandler<any, any, any>
|
|
4145
|
+
? LoopbackServiceStub<undefined>
|
|
4146
|
+
: undefined;
|
|
4147
|
+
export type LoopbackServiceStub<
|
|
4148
|
+
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
4149
|
+
> = Fetcher<T> &
|
|
4150
|
+
(T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props>
|
|
4151
|
+
? (opts: {
|
|
4152
|
+
props?: Props;
|
|
4153
|
+
version?: {
|
|
4154
|
+
cohort?: string | null;
|
|
4155
|
+
};
|
|
4156
|
+
}) => Fetcher<T>
|
|
4157
|
+
: (opts: {
|
|
4158
|
+
props?: any;
|
|
4159
|
+
version?: {
|
|
4160
|
+
cohort?: string | null;
|
|
4161
|
+
};
|
|
4162
|
+
}) => Fetcher<T>);
|
|
4163
|
+
export type LoopbackDurableObjectClass<
|
|
4164
|
+
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
4165
|
+
> = DurableObjectClass<T> &
|
|
4166
|
+
(T extends CloudflareWorkersModule.DurableObject<any, infer Props>
|
|
4167
|
+
? (opts: { props?: Props }) => DurableObjectClass<T>
|
|
4168
|
+
: (opts: { props?: any }) => DurableObjectClass<T>);
|
|
4169
|
+
export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
|
|
4170
|
+
export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
|
|
4171
|
+
export interface SyncKvStorage {
|
|
4172
|
+
get<T = unknown>(key: string): T | undefined;
|
|
4173
|
+
list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
|
|
4174
|
+
put<T>(key: string, value: T): void;
|
|
4175
|
+
delete(key: string): boolean;
|
|
4049
4176
|
}
|
|
4050
|
-
export interface
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4177
|
+
export interface SyncKvListOptions {
|
|
4178
|
+
start?: string;
|
|
4179
|
+
startAfter?: string;
|
|
4180
|
+
end?: string;
|
|
4181
|
+
prefix?: string;
|
|
4182
|
+
reverse?: boolean;
|
|
4183
|
+
limit?: number;
|
|
4055
4184
|
}
|
|
4056
|
-
export interface
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
startTls(options?: TlsOptions): Socket;
|
|
4066
|
-
proxyTo(sock: Socket, options?: StreamPipeOptions): Promise<void>;
|
|
4185
|
+
export interface WorkerStub {
|
|
4186
|
+
getEntrypoint<T extends Rpc.WorkerEntrypointBranded | undefined>(
|
|
4187
|
+
name?: string,
|
|
4188
|
+
options?: WorkerStubEntrypointOptions,
|
|
4189
|
+
): Fetcher<T>;
|
|
4190
|
+
getDurableObjectClass<T extends Rpc.DurableObjectBranded | undefined>(
|
|
4191
|
+
name?: string,
|
|
4192
|
+
options?: WorkerStubEntrypointOptions,
|
|
4193
|
+
): DurableObjectClass<T>;
|
|
4067
4194
|
}
|
|
4068
|
-
export interface
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
highWaterMark?: number | bigint;
|
|
4195
|
+
export interface WorkerStubEntrypointOptions {
|
|
4196
|
+
props?: any;
|
|
4197
|
+
limits?: workerdResourceLimits;
|
|
4072
4198
|
}
|
|
4073
|
-
export interface
|
|
4074
|
-
|
|
4075
|
-
|
|
4199
|
+
export interface WorkerLoader {
|
|
4200
|
+
get(
|
|
4201
|
+
name: string | null,
|
|
4202
|
+
getCode: () => WorkerLoaderWorkerCode | Promise<WorkerLoaderWorkerCode>,
|
|
4203
|
+
): WorkerStub;
|
|
4204
|
+
load(code: WorkerLoaderWorkerCode): WorkerStub;
|
|
4076
4205
|
}
|
|
4077
|
-
export interface
|
|
4078
|
-
|
|
4206
|
+
export interface WorkerLoaderModule {
|
|
4207
|
+
js?: string;
|
|
4208
|
+
cjs?: string;
|
|
4209
|
+
text?: string;
|
|
4210
|
+
data?: ArrayBuffer;
|
|
4211
|
+
json?: any;
|
|
4212
|
+
py?: string;
|
|
4213
|
+
wasm?: ArrayBuffer | ArrayBufferView | WebAssembly.Module;
|
|
4079
4214
|
}
|
|
4080
|
-
export interface
|
|
4081
|
-
|
|
4082
|
-
|
|
4215
|
+
export interface WorkerLoaderWorkerCode {
|
|
4216
|
+
compatibilityDate: string;
|
|
4217
|
+
compatibilityFlags?: string[];
|
|
4218
|
+
allowExperimental?: boolean;
|
|
4219
|
+
limits?: workerdResourceLimits;
|
|
4220
|
+
mainModule: string;
|
|
4221
|
+
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
|
4222
|
+
env?: any;
|
|
4223
|
+
globalOutbound?: Fetcher | null;
|
|
4224
|
+
tails?: Fetcher[];
|
|
4225
|
+
streamingTails?: Fetcher[];
|
|
4083
4226
|
}
|
|
4084
|
-
export
|
|
4085
|
-
|
|
4086
|
-
|
|
4227
|
+
export interface workerdResourceLimits {
|
|
4228
|
+
cpuMs?: number;
|
|
4229
|
+
subRequests?: number;
|
|
4087
4230
|
}
|
|
4088
4231
|
/**
|
|
4089
|
-
* The
|
|
4232
|
+
* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
|
|
4233
|
+
* as well as timing of subrequests and other operations.
|
|
4090
4234
|
*
|
|
4091
|
-
* [
|
|
4235
|
+
* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
|
|
4092
4236
|
*/
|
|
4093
|
-
export declare class
|
|
4094
|
-
|
|
4237
|
+
export declare abstract class Performance extends EventTarget {
|
|
4238
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
|
|
4239
|
+
get timeOrigin(): number;
|
|
4240
|
+
/* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
|
|
4241
|
+
now(): number;
|
|
4242
|
+
get eventCounts(): EventCounts;
|
|
4095
4243
|
/**
|
|
4096
|
-
* The **`
|
|
4244
|
+
* The **`clearMarks()`** method removes all or specific PerformanceMark objects from the browser's performance timeline.
|
|
4097
4245
|
*
|
|
4098
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4246
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMarks)
|
|
4099
4247
|
*/
|
|
4100
|
-
|
|
4248
|
+
clearMarks(name?: string): void;
|
|
4101
4249
|
/**
|
|
4102
|
-
* The **`
|
|
4250
|
+
* The **`clearMeasures()`** method removes all or specific PerformanceMeasure objects from the browser's performance timeline.
|
|
4103
4251
|
*
|
|
4104
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4252
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearMeasures)
|
|
4105
4253
|
*/
|
|
4106
|
-
|
|
4254
|
+
clearMeasures(name?: string): void;
|
|
4107
4255
|
/**
|
|
4108
|
-
* The **`
|
|
4256
|
+
* The **`clearResourceTimings()`** method removes all performance entries with an entryType of "resource" from the browser's performance timeline and sets the size of the performance resource data buffer to zero.
|
|
4109
4257
|
*
|
|
4110
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4258
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/clearResourceTimings)
|
|
4111
4259
|
*/
|
|
4112
|
-
|
|
4260
|
+
clearResourceTimings(): void;
|
|
4113
4261
|
/**
|
|
4114
|
-
* The **`
|
|
4262
|
+
* The **`getEntries()`** method returns an array of all PerformanceEntry objects currently present in the performance timeline.
|
|
4115
4263
|
*
|
|
4116
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4264
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntries)
|
|
4117
4265
|
*/
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4266
|
+
getEntries(): PerformanceEntry[];
|
|
4267
|
+
/**
|
|
4268
|
+
* The **`getEntriesByName()`** method returns an array of PerformanceEntry objects currently present in the performance timeline with the given name and type.
|
|
4269
|
+
*
|
|
4270
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByName)
|
|
4271
|
+
*/
|
|
4272
|
+
getEntriesByName(name: string, type?: string): PerformanceEntry[];
|
|
4273
|
+
/**
|
|
4274
|
+
* The **`getEntriesByType()`** method returns an array of PerformanceEntry objects currently present in the performance timeline for a given type.
|
|
4275
|
+
*
|
|
4276
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType)
|
|
4277
|
+
*/
|
|
4278
|
+
getEntriesByType(type: string): PerformanceEntry[];
|
|
4279
|
+
/**
|
|
4280
|
+
* The **`mark()`** method creates a named PerformanceMark object representing a high resolution timestamp marker in the browser's performance timeline.
|
|
4281
|
+
*
|
|
4282
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark)
|
|
4283
|
+
*/
|
|
4284
|
+
mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
|
|
4285
|
+
/**
|
|
4286
|
+
* The **`measure()`** method creates a named PerformanceMeasure object representing a time measurement between two marks in the browser's performance timeline.
|
|
4287
|
+
*
|
|
4288
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure)
|
|
4289
|
+
*/
|
|
4290
|
+
measure(
|
|
4291
|
+
measureName: string,
|
|
4292
|
+
measureOptionsOrStartMark?: PerformanceMeasureOptions | string,
|
|
4293
|
+
maybeEndMark?: string,
|
|
4294
|
+
): PerformanceMeasure;
|
|
4295
|
+
/**
|
|
4296
|
+
* The **`setResourceTimingBufferSize()`** method sets the desired size of the browser's resource timing buffer which stores the "resource" performance entries.
|
|
4297
|
+
*
|
|
4298
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize)
|
|
4299
|
+
*/
|
|
4300
|
+
setResourceTimingBufferSize(size: number): void;
|
|
4301
|
+
/**
|
|
4302
|
+
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
|
4303
|
+
*
|
|
4304
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
4305
|
+
*/
|
|
4306
|
+
toJSON(): object;
|
|
4307
|
+
get nodeTiming(): PerformanceNodeTiming;
|
|
4308
|
+
eventLoopUtilization(): PerformanceEventLoopUtilization;
|
|
4309
|
+
markResourceTiming(): void;
|
|
4310
|
+
timerify(fn: () => void): () => void;
|
|
4135
4311
|
}
|
|
4136
|
-
export interface
|
|
4137
|
-
|
|
4138
|
-
|
|
4312
|
+
export interface PerformanceEventLoopUtilization {
|
|
4313
|
+
idle: number;
|
|
4314
|
+
active: number;
|
|
4315
|
+
utilization: number;
|
|
4139
4316
|
}
|
|
4140
|
-
export interface
|
|
4141
|
-
readonly
|
|
4142
|
-
readonly
|
|
4143
|
-
readonly
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
pty?: boolean | ContainerExecPtyOptions;
|
|
4151
|
-
stdin?: ReadableStream | "pipe";
|
|
4152
|
-
stdout?: "pipe" | "ignore";
|
|
4153
|
-
stderr?: "pipe" | "ignore" | "combined";
|
|
4154
|
-
}
|
|
4155
|
-
export interface ContainerExecPtyOptions {
|
|
4156
|
-
cols?: number;
|
|
4157
|
-
rows?: number;
|
|
4158
|
-
}
|
|
4159
|
-
export interface ExecProcess {
|
|
4160
|
-
readonly stdin: WritableStream | null;
|
|
4161
|
-
readonly stdout: ReadableStream | null;
|
|
4162
|
-
readonly stderr: ReadableStream | null;
|
|
4163
|
-
readonly pid: number;
|
|
4164
|
-
readonly isPty: boolean;
|
|
4165
|
-
readonly exitCode: Promise<number>;
|
|
4166
|
-
output(): Promise<ExecOutput>;
|
|
4167
|
-
kill(signal?: number): void;
|
|
4168
|
-
resize(cols: number, rows: number): void;
|
|
4169
|
-
}
|
|
4170
|
-
export interface Container {
|
|
4171
|
-
get running(): boolean;
|
|
4172
|
-
get images(): Record<string, string>;
|
|
4173
|
-
start(options?: ContainerStartupOptions): void;
|
|
4174
|
-
monitor(): Promise<void>;
|
|
4175
|
-
destroy(error?: any): Promise<void>;
|
|
4176
|
-
signal(signo: number): void;
|
|
4177
|
-
getTcpPort(port: number): Fetcher;
|
|
4178
|
-
setInactivityTimeout(durationMs: number | bigint): Promise<void>;
|
|
4179
|
-
interceptOutboundHttp(addr: string, binding: Fetcher): Promise<void>;
|
|
4180
|
-
interceptAllOutboundHttp(binding: Fetcher): Promise<void>;
|
|
4181
|
-
snapshotContainer(
|
|
4182
|
-
options?: ContainerSnapshotOptions,
|
|
4183
|
-
): Promise<ContainerSnapshot>;
|
|
4184
|
-
interceptOutboundHttps(addr: string, binding: Fetcher): Promise<void>;
|
|
4185
|
-
exec(cmd: string[], options?: ContainerExecOptions): Promise<ExecProcess>;
|
|
4186
|
-
inspect(): Promise<ContainerInfo | null>;
|
|
4187
|
-
interceptOutboundTcp(addr: string, binding: Fetcher): Promise<void>;
|
|
4188
|
-
snapshotDirectory(
|
|
4189
|
-
options: ContainerDirectorySnapshotOptions,
|
|
4190
|
-
): Promise<ContainerDirectorySnapshot>;
|
|
4191
|
-
setLabels(labels: Record<string, string>): Promise<void>;
|
|
4192
|
-
}
|
|
4193
|
-
export interface ContainerDirectorySnapshot {
|
|
4194
|
-
id: string;
|
|
4195
|
-
size: number;
|
|
4196
|
-
dir: string;
|
|
4197
|
-
name?: string;
|
|
4198
|
-
}
|
|
4199
|
-
export interface ContainerDirectorySnapshotOptions {
|
|
4200
|
-
dir: string;
|
|
4201
|
-
name?: string;
|
|
4317
|
+
export interface PerformanceNodeTiming extends PerformanceEntry {
|
|
4318
|
+
readonly nodeStart: number;
|
|
4319
|
+
readonly v8Start: number;
|
|
4320
|
+
readonly bootstrapComplete: number;
|
|
4321
|
+
readonly environment: number;
|
|
4322
|
+
readonly loopStart: number;
|
|
4323
|
+
readonly loopExit: number;
|
|
4324
|
+
readonly idleTime: number;
|
|
4325
|
+
readonly uvMetricsInfo: UvMetricsInfo;
|
|
4326
|
+
toJSON(): object;
|
|
4202
4327
|
}
|
|
4203
|
-
export
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
}
|
|
4208
|
-
| {
|
|
4209
|
-
snapshot?: undefined;
|
|
4210
|
-
mountPoint: string;
|
|
4211
|
-
};
|
|
4212
|
-
export interface ContainerSnapshot {
|
|
4213
|
-
id: string;
|
|
4214
|
-
size: number;
|
|
4215
|
-
name?: string;
|
|
4328
|
+
export interface UvMetricsInfo {
|
|
4329
|
+
loopCount: number;
|
|
4330
|
+
events: number;
|
|
4331
|
+
eventsWaiting: number;
|
|
4216
4332
|
}
|
|
4217
|
-
|
|
4218
|
-
|
|
4333
|
+
/**
|
|
4334
|
+
* **`PerformanceMark`** is an interface for PerformanceEntry objects with an entryType of "mark".
|
|
4335
|
+
*
|
|
4336
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark)
|
|
4337
|
+
*/
|
|
4338
|
+
export declare class PerformanceMark extends PerformanceEntry {
|
|
4339
|
+
constructor(name: string, maybeOptions?: PerformanceMarkOptions);
|
|
4340
|
+
/**
|
|
4341
|
+
* The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (either when using performance.mark() or the PerformanceMark() constructor).
|
|
4342
|
+
*
|
|
4343
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMark/detail)
|
|
4344
|
+
*/
|
|
4345
|
+
get detail(): any;
|
|
4346
|
+
toJSON(): object;
|
|
4219
4347
|
}
|
|
4220
|
-
|
|
4221
|
-
|
|
4348
|
+
/**
|
|
4349
|
+
* **`PerformanceMeasure`** is an abstract interface for PerformanceEntry objects with an entryType of "measure". Entries of this type are created by calling performance.measure() to add a named DOMHighResTimeStamp (the measure) between two marks to the browser's performance timeline.
|
|
4350
|
+
*
|
|
4351
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure)
|
|
4352
|
+
*/
|
|
4353
|
+
export declare abstract class PerformanceMeasure extends PerformanceEntry {
|
|
4354
|
+
/**
|
|
4355
|
+
* The read-only **`detail`** property returns arbitrary metadata that was included in the mark upon construction (when using performance.measure().
|
|
4356
|
+
*
|
|
4357
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceMeasure/detail)
|
|
4358
|
+
*/
|
|
4359
|
+
get detail(): any;
|
|
4360
|
+
toJSON(): object;
|
|
4222
4361
|
}
|
|
4223
|
-
export
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
env?: Record<string, string>;
|
|
4227
|
-
hardTimeout?: number | bigint;
|
|
4228
|
-
instance?:
|
|
4229
|
-
| "lite"
|
|
4230
|
-
| "basic"
|
|
4231
|
-
| "standard-1"
|
|
4232
|
-
| "standard-2"
|
|
4233
|
-
| "standard-3"
|
|
4234
|
-
| "standard-4"
|
|
4235
|
-
| ContainerStartResources;
|
|
4236
|
-
labels?: Record<string, string>;
|
|
4237
|
-
directorySnapshots?: ContainerDirectorySnapshotRestoreParams[];
|
|
4238
|
-
} & (
|
|
4239
|
-
| {
|
|
4240
|
-
image: string;
|
|
4241
|
-
containerSnapshot?: never;
|
|
4242
|
-
}
|
|
4243
|
-
| {
|
|
4244
|
-
image?: never;
|
|
4245
|
-
containerSnapshot?: ContainerSnapshotRestoreParams;
|
|
4246
|
-
}
|
|
4247
|
-
);
|
|
4248
|
-
export interface ContainerInfo {
|
|
4249
|
-
labels: Record<string, string>;
|
|
4250
|
-
image: string;
|
|
4362
|
+
export interface PerformanceMarkOptions {
|
|
4363
|
+
detail?: any;
|
|
4364
|
+
startTime?: number;
|
|
4251
4365
|
}
|
|
4252
|
-
export interface
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4366
|
+
export interface PerformanceMeasureOptions {
|
|
4367
|
+
detail?: any;
|
|
4368
|
+
start?: number;
|
|
4369
|
+
duration?: number;
|
|
4370
|
+
end?: number;
|
|
4256
4371
|
}
|
|
4257
4372
|
/**
|
|
4258
|
-
* The **`
|
|
4259
|
-
* Available only in secure contexts.
|
|
4373
|
+
* The **`PerformanceObserverEntryList`** interface is a list of performance events that were explicitly observed via the observe() method.
|
|
4260
4374
|
*
|
|
4261
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4375
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList)
|
|
4262
4376
|
*/
|
|
4263
|
-
export declare abstract class
|
|
4377
|
+
export declare abstract class PerformanceObserverEntryList {
|
|
4264
4378
|
/**
|
|
4265
|
-
* The **`
|
|
4379
|
+
* The **`getEntries()`** method of the PerformanceObserverEntryList interface returns a list of explicitly observed performance entry objects. The list's members are determined by the set of entry types specified in the call to the observe() method. The list is available in the observer's callback function (as the first parameter in the callback).
|
|
4266
4380
|
*
|
|
4267
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4381
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntries)
|
|
4268
4382
|
*/
|
|
4269
|
-
|
|
4383
|
+
getEntries(): PerformanceEntry[];
|
|
4270
4384
|
/**
|
|
4271
|
-
* The **`
|
|
4385
|
+
* The **`getEntriesByType()`** method of the PerformanceObserverEntryList returns a list of explicitly observed performance entry objects for a given performance entry type. The list's members are determined by the set of entry types specified in the call to the observe() method. The list is available in the observer's callback function (as the first parameter in the callback).
|
|
4272
4386
|
*
|
|
4273
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4387
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByType)
|
|
4274
4388
|
*/
|
|
4275
|
-
|
|
4389
|
+
getEntriesByType(type: string): PerformanceEntry[];
|
|
4276
4390
|
/**
|
|
4277
|
-
* The **`
|
|
4391
|
+
* The **`getEntriesByName()`** method of the PerformanceObserverEntryList interface returns a list of explicitly observed PerformanceEntry objects for a given name and entryType. The list's members are determined by the set of entry types specified in the call to the observe() method. The list is available in the observer's callback function (as the first parameter in the callback).
|
|
4278
4392
|
*
|
|
4279
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4393
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserverEntryList/getEntriesByName)
|
|
4280
4394
|
*/
|
|
4281
|
-
|
|
4282
|
-
getUniqueId(): Promise<string>;
|
|
4283
|
-
remove(options?: FileSystemHandleRemoveOptions): Promise<void>;
|
|
4395
|
+
getEntriesByName(name: string, type?: string): PerformanceEntry[];
|
|
4284
4396
|
}
|
|
4285
4397
|
/**
|
|
4286
|
-
* The **`
|
|
4287
|
-
* Available only in secure contexts.
|
|
4398
|
+
* The **`PerformanceEntry`** object encapsulates a single performance metric that is part of the browser's performance timeline.
|
|
4288
4399
|
*
|
|
4289
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4400
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
|
|
4290
4401
|
*/
|
|
4291
|
-
export declare abstract class
|
|
4402
|
+
export declare abstract class PerformanceEntry {
|
|
4292
4403
|
/**
|
|
4293
|
-
* The **`
|
|
4404
|
+
* The read-only **`name`** property of the PerformanceEntry interface is a string representing the name for a performance entry. It acts as an identifier, but it does not have to be unique. The value depends on the subclass.
|
|
4294
4405
|
*
|
|
4295
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4406
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/name)
|
|
4296
4407
|
*/
|
|
4297
|
-
|
|
4408
|
+
get name(): string;
|
|
4298
4409
|
/**
|
|
4299
|
-
* The **`
|
|
4410
|
+
* The read-only **`entryType`** property returns a string representing the type of performance metric that this entry represents.
|
|
4300
4411
|
*
|
|
4301
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4412
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/entryType)
|
|
4302
4413
|
*/
|
|
4303
|
-
|
|
4304
|
-
|
|
4305
|
-
|
|
4414
|
+
get entryType(): string;
|
|
4415
|
+
/**
|
|
4416
|
+
* The read-only **`startTime`** property returns the first timestamp recorded for this PerformanceEntry. The meaning of this property depends on the value of this entry's entryType.
|
|
4417
|
+
*
|
|
4418
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/startTime)
|
|
4419
|
+
*/
|
|
4420
|
+
get startTime(): number;
|
|
4421
|
+
/**
|
|
4422
|
+
* The read-only **`duration`** property returns a timestamp that is the duration of the performance entry. The meaning of this property depends on the value of this entry's entryType.
|
|
4423
|
+
*
|
|
4424
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/duration)
|
|
4425
|
+
*/
|
|
4426
|
+
get duration(): number;
|
|
4427
|
+
/**
|
|
4428
|
+
* The **`toJSON()`** method is a serializer; it returns a JSON representation of the PerformanceEntry object.
|
|
4429
|
+
*
|
|
4430
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry/toJSON)
|
|
4431
|
+
*/
|
|
4432
|
+
toJSON(): object;
|
|
4306
4433
|
}
|
|
4307
4434
|
/**
|
|
4308
|
-
* The **`
|
|
4309
|
-
* Available only in secure contexts.
|
|
4435
|
+
* The **`PerformanceResourceTiming`** interface enables retrieval and analysis of detailed network timing data regarding the loading of an application's resources. An application can use the timing metrics to determine, for example, the length of time it takes to fetch a specific resource, such as an XMLHttpRequest, <SVG>, image, or script.
|
|
4310
4436
|
*
|
|
4311
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4437
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming)
|
|
4312
4438
|
*/
|
|
4313
|
-
export declare abstract class
|
|
4439
|
+
export declare abstract class PerformanceResourceTiming extends PerformanceEntry {
|
|
4314
4440
|
/**
|
|
4315
|
-
* The **`
|
|
4441
|
+
* The **`connectEnd`** read-only property returns the timestamp immediately after the browser finishes establishing the connection to the server to retrieve the resource. The timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as TLS handshake and SOCKS authentication.
|
|
4316
4442
|
*
|
|
4317
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4443
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd)
|
|
4318
4444
|
*/
|
|
4319
|
-
|
|
4320
|
-
name: string,
|
|
4321
|
-
options?: FileSystemDirectoryHandleFileSystemGetFileOptions,
|
|
4322
|
-
): Promise<FileSystemFileHandle>;
|
|
4445
|
+
get connectEnd(): number;
|
|
4323
4446
|
/**
|
|
4324
|
-
* The **`
|
|
4447
|
+
* The **`connectStart`** read-only property returns the timestamp immediately before the user agent starts establishing the connection to the server to retrieve the resource.
|
|
4325
4448
|
*
|
|
4326
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4449
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart)
|
|
4327
4450
|
*/
|
|
4328
|
-
|
|
4329
|
-
name: string,
|
|
4330
|
-
options?: FileSystemDirectoryHandleFileSystemGetDirectoryOptions,
|
|
4331
|
-
): Promise<FileSystemDirectoryHandle>;
|
|
4451
|
+
get connectStart(): number;
|
|
4332
4452
|
/**
|
|
4333
|
-
* The **`
|
|
4453
|
+
* The **`decodedBodySize`** read-only property returns the size (in octets) received from the fetch (HTTP or cache) of the message body after removing any applied content encoding (like gzip or Brotli). If the resource is retrieved from an application cache or local resources, it returns the size of the payload after removing any applied content encoding.
|
|
4334
4454
|
*
|
|
4335
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4455
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize)
|
|
4336
4456
|
*/
|
|
4337
|
-
|
|
4338
|
-
name: string,
|
|
4339
|
-
options?: FileSystemDirectoryHandleFileSystemRemoveOptions,
|
|
4340
|
-
): Promise<void>;
|
|
4457
|
+
get decodedBodySize(): number;
|
|
4341
4458
|
/**
|
|
4342
|
-
* The **`
|
|
4459
|
+
* The **`domainLookupEnd`** read-only property returns the timestamp immediately after the browser finishes the domain-name lookup for the resource.
|
|
4343
4460
|
*
|
|
4344
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4461
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupEnd)
|
|
4345
4462
|
*/
|
|
4346
|
-
|
|
4347
|
-
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
|
|
4348
|
-
keys(): AsyncIterableIterator<string>;
|
|
4349
|
-
values(): AsyncIterableIterator<FileSystemHandle>;
|
|
4350
|
-
forEach(
|
|
4351
|
-
callback: (
|
|
4352
|
-
param0: string,
|
|
4353
|
-
param1: FileSystemHandle,
|
|
4354
|
-
param2: FileSystemDirectoryHandle,
|
|
4355
|
-
) => void,
|
|
4356
|
-
thisArg?: any,
|
|
4357
|
-
): void;
|
|
4358
|
-
[Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
|
|
4359
|
-
}
|
|
4360
|
-
/**
|
|
4361
|
-
* The **`FileSystemWritableFileStream`** interface of the File System API is a WritableStream object with additional convenience methods, which operates on a single file on disk. The interface is accessed through the FileSystemFileHandle.createWritable() method.
|
|
4362
|
-
* Available only in secure contexts.
|
|
4363
|
-
*
|
|
4364
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/FileSystemWritableFileStream)
|
|
4365
|
-
*/
|
|
4366
|
-
export declare abstract class FileSystemWritableFileStream extends WritableStream {
|
|
4463
|
+
get domainLookupEnd(): number;
|
|
4367
4464
|
/**
|
|
4368
|
-
* The **`
|
|
4465
|
+
* The **`domainLookupStart`** read-only property returns the timestamp immediately before the browser starts the domain name lookup for the resource.
|
|
4369
4466
|
*
|
|
4370
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4467
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/domainLookupStart)
|
|
4371
4468
|
*/
|
|
4372
|
-
|
|
4373
|
-
data:
|
|
4374
|
-
| Blob
|
|
4375
|
-
| (ArrayBuffer | ArrayBufferView)
|
|
4376
|
-
| string
|
|
4377
|
-
| FileSystemFileWriteParams,
|
|
4378
|
-
): Promise<void>;
|
|
4469
|
+
get domainLookupStart(): number;
|
|
4379
4470
|
/**
|
|
4380
|
-
* The **`
|
|
4471
|
+
* The **`encodedBodySize`** read-only property represents the size (in octets) received from the fetch (HTTP or cache) of the payload body before removing any applied content encodings (like gzip or Brotli). If the resource is retrieved from an application cache or a local resource, it must return the size of the payload body before removing any applied content encoding.
|
|
4381
4472
|
*
|
|
4382
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4473
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize)
|
|
4383
4474
|
*/
|
|
4384
|
-
|
|
4475
|
+
get encodedBodySize(): number;
|
|
4385
4476
|
/**
|
|
4386
|
-
* The **`
|
|
4477
|
+
* The **`fetchStart`** read-only property represents a timestamp immediately before the browser starts to fetch the resource.
|
|
4387
4478
|
*
|
|
4388
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4479
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart)
|
|
4389
4480
|
*/
|
|
4390
|
-
|
|
4391
|
-
}
|
|
4392
|
-
/**
|
|
4393
|
-
* The **`StorageManager`** interface of the Storage API provides an interface for managing persistence permissions and estimating available storage. You can get a reference to this interface using either navigator.storage or WorkerNavigator.storage.
|
|
4394
|
-
* Available only in secure contexts.
|
|
4395
|
-
*
|
|
4396
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/StorageManager)
|
|
4397
|
-
*/
|
|
4398
|
-
export declare abstract class StorageManager {
|
|
4481
|
+
get fetchStart(): number;
|
|
4399
4482
|
/**
|
|
4400
|
-
* The **`
|
|
4483
|
+
* The **`initiatorType`** read-only property is a string representing web platform feature that initiated the resource load.
|
|
4401
4484
|
*
|
|
4402
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4485
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType)
|
|
4403
4486
|
*/
|
|
4404
|
-
|
|
4405
|
-
}
|
|
4406
|
-
export interface FileSystemFileHandleFileSystemCreateWritableOptions {
|
|
4407
|
-
keepExistingData?: boolean;
|
|
4408
|
-
}
|
|
4409
|
-
export interface FileSystemDirectoryHandleFileSystemGetFileOptions {
|
|
4410
|
-
create: boolean;
|
|
4411
|
-
}
|
|
4412
|
-
export interface FileSystemDirectoryHandleFileSystemGetDirectoryOptions {
|
|
4413
|
-
create: boolean;
|
|
4414
|
-
}
|
|
4415
|
-
export interface FileSystemDirectoryHandleFileSystemRemoveOptions {
|
|
4416
|
-
recursive: boolean;
|
|
4417
|
-
}
|
|
4418
|
-
export interface FileSystemFileWriteParams {
|
|
4419
|
-
type: string;
|
|
4420
|
-
size?: number;
|
|
4421
|
-
position?: number;
|
|
4422
|
-
data?: (Blob | (ArrayBuffer | ArrayBufferView) | string) | null;
|
|
4423
|
-
}
|
|
4424
|
-
export interface FileSystemHandleRemoveOptions {
|
|
4425
|
-
recursive?: boolean;
|
|
4426
|
-
}
|
|
4427
|
-
/**
|
|
4428
|
-
* The **`MessagePort`** interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
|
|
4429
|
-
*
|
|
4430
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessagePort)
|
|
4431
|
-
*/
|
|
4432
|
-
export declare abstract class MessagePort extends EventTarget {
|
|
4487
|
+
get initiatorType(): string;
|
|
4433
4488
|
/**
|
|
4434
|
-
* The **`
|
|
4489
|
+
* The **`nextHopProtocol`** read-only property is a string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
|
|
4435
4490
|
*
|
|
4436
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4491
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol)
|
|
4437
4492
|
*/
|
|
4438
|
-
|
|
4439
|
-
data?: any,
|
|
4440
|
-
options?: any[] | MessagePortPostMessageOptions,
|
|
4441
|
-
): void;
|
|
4493
|
+
get nextHopProtocol(): string;
|
|
4442
4494
|
/**
|
|
4443
|
-
* The **`
|
|
4495
|
+
* The **`redirectEnd`** read-only property returns a timestamp immediately after receiving the last byte of the response of the last redirect.
|
|
4444
4496
|
*
|
|
4445
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4497
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd)
|
|
4446
4498
|
*/
|
|
4447
|
-
|
|
4499
|
+
get redirectEnd(): number;
|
|
4448
4500
|
/**
|
|
4449
|
-
* The **`
|
|
4501
|
+
* The **`redirectStart`** read-only property returns a timestamp representing the start time of the fetch which that initiates the redirect.
|
|
4450
4502
|
*
|
|
4451
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4503
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart)
|
|
4452
4504
|
*/
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4505
|
+
get redirectStart(): number;
|
|
4506
|
+
/**
|
|
4507
|
+
* The **`requestStart`** read-only property returns a timestamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retries the request, the value returned will be the start of the retry request.
|
|
4508
|
+
*
|
|
4509
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart)
|
|
4510
|
+
*/
|
|
4511
|
+
get requestStart(): number;
|
|
4512
|
+
/**
|
|
4513
|
+
* The **`responseEnd`** read-only property returns a timestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
|
|
4514
|
+
*
|
|
4515
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd)
|
|
4516
|
+
*/
|
|
4517
|
+
get responseEnd(): number;
|
|
4518
|
+
/**
|
|
4519
|
+
* The **`responseStart`** read-only property returns a timestamp immediately after the browser receives the first byte of the response from the server, cache, or local resource.
|
|
4520
|
+
*
|
|
4521
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart)
|
|
4522
|
+
*/
|
|
4523
|
+
get responseStart(): number;
|
|
4524
|
+
/**
|
|
4525
|
+
* The **`responseStatus`** read-only property represents the HTTP response status code returned when fetching the resource.
|
|
4526
|
+
*
|
|
4527
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus)
|
|
4528
|
+
*/
|
|
4529
|
+
get responseStatus(): number;
|
|
4530
|
+
/**
|
|
4531
|
+
* The **`secureConnectionStart`** read-only property returns a timestamp immediately before the browser starts the handshake process to secure the current connection. If a secure connection is not used, the property returns zero.
|
|
4532
|
+
*
|
|
4533
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart)
|
|
4534
|
+
*/
|
|
4535
|
+
get secureConnectionStart(): number | undefined;
|
|
4536
|
+
/**
|
|
4537
|
+
* The **`transferSize`** read-only property represents the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (as defined by RFC7230).
|
|
4538
|
+
*
|
|
4539
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize)
|
|
4540
|
+
*/
|
|
4541
|
+
get transferSize(): number;
|
|
4542
|
+
/**
|
|
4543
|
+
* The **`workerStart`** read-only property of the PerformanceResourceTiming interface returns a DOMHighResTimeStamp immediately before dispatching the FetchEvent if a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running. If the resource is not intercepted by a Service Worker the property will always return 0.
|
|
4544
|
+
*
|
|
4545
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart)
|
|
4546
|
+
*/
|
|
4547
|
+
get workerStart(): number;
|
|
4456
4548
|
}
|
|
4457
4549
|
/**
|
|
4458
|
-
* The **`
|
|
4550
|
+
* The **`PerformanceObserver`** interface is used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline.
|
|
4459
4551
|
*
|
|
4460
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4552
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver)
|
|
4461
4553
|
*/
|
|
4462
|
-
export declare class
|
|
4463
|
-
constructor();
|
|
4554
|
+
export declare class PerformanceObserver {
|
|
4555
|
+
constructor(callback: any);
|
|
4464
4556
|
/**
|
|
4465
|
-
* The **`
|
|
4557
|
+
* The **`disconnect()`** method of the PerformanceObserver interface is used to stop the performance observer from receiving any performance entry events.
|
|
4466
4558
|
*
|
|
4467
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4559
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect)
|
|
4468
4560
|
*/
|
|
4469
|
-
|
|
4561
|
+
disconnect(): void;
|
|
4470
4562
|
/**
|
|
4471
|
-
* The **`
|
|
4563
|
+
* The **`observe()`** method of the PerformanceObserver interface is used to specify the set of performance entry types to observe.
|
|
4472
4564
|
*
|
|
4473
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/
|
|
4565
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe)
|
|
4474
4566
|
*/
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4567
|
+
observe(options?: PerformanceObserverObserveOptions): void;
|
|
4568
|
+
/**
|
|
4569
|
+
* The **`takeRecords()`** method of the PerformanceObserver interface returns the current list of PerformanceEntry objects stored in the performance observer, emptying it out.
|
|
4570
|
+
*
|
|
4571
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords)
|
|
4572
|
+
*/
|
|
4573
|
+
takeRecords(): PerformanceEntry[];
|
|
4574
|
+
readonly supportedEntryTypes: string[];
|
|
4479
4575
|
}
|
|
4480
|
-
export
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
> = T extends new (...args: any[]) => Rpc.WorkerEntrypointBranded
|
|
4486
|
-
? LoopbackServiceStub<InstanceType<T>>
|
|
4487
|
-
: T extends new (...args: any[]) => Rpc.DurableObjectBranded
|
|
4488
|
-
? LoopbackDurableObjectClass<InstanceType<T>>
|
|
4489
|
-
: T extends new (
|
|
4490
|
-
...args: any[]
|
|
4491
|
-
) => CloudflareWorkersModule.WorkflowEntrypoint<any, infer Params>
|
|
4492
|
-
? Workflow<Params>
|
|
4493
|
-
: T extends ExportedHandler<any, any, any>
|
|
4494
|
-
? LoopbackServiceStub<undefined>
|
|
4495
|
-
: undefined;
|
|
4496
|
-
export type LoopbackServiceStub<
|
|
4497
|
-
T extends Rpc.WorkerEntrypointBranded | undefined = undefined,
|
|
4498
|
-
> = Fetcher<T> &
|
|
4499
|
-
(T extends CloudflareWorkersModule.WorkerEntrypoint<any, infer Props>
|
|
4500
|
-
? (opts: {
|
|
4501
|
-
props?: Props;
|
|
4502
|
-
version?: {
|
|
4503
|
-
cohort?: string | null;
|
|
4504
|
-
};
|
|
4505
|
-
}) => Fetcher<T>
|
|
4506
|
-
: (opts: {
|
|
4507
|
-
props?: any;
|
|
4508
|
-
version?: {
|
|
4509
|
-
cohort?: string | null;
|
|
4510
|
-
};
|
|
4511
|
-
}) => Fetcher<T>);
|
|
4512
|
-
export type LoopbackDurableObjectClass<
|
|
4513
|
-
T extends Rpc.DurableObjectBranded | undefined = undefined,
|
|
4514
|
-
> = DurableObjectClass<T> &
|
|
4515
|
-
(T extends CloudflareWorkersModule.DurableObject<any, infer Props>
|
|
4516
|
-
? (opts: { props?: Props }) => DurableObjectClass<T>
|
|
4517
|
-
: (opts: { props?: any }) => DurableObjectClass<T>);
|
|
4518
|
-
export interface LoopbackDurableObjectNamespace extends DurableObjectNamespace {}
|
|
4519
|
-
export interface LoopbackColoLocalActorNamespace extends ColoLocalActorNamespace {}
|
|
4520
|
-
export interface SyncKvStorage {
|
|
4521
|
-
get<T = unknown>(key: string): T | undefined;
|
|
4522
|
-
list<T = unknown>(options?: SyncKvListOptions): Iterable<[string, T]>;
|
|
4523
|
-
put<T>(key: string, value: T): void;
|
|
4524
|
-
delete(key: string): boolean;
|
|
4576
|
+
export interface PerformanceObserverObserveOptions {
|
|
4577
|
+
buffered?: boolean;
|
|
4578
|
+
durationThreshold?: number;
|
|
4579
|
+
entryTypes?: string[];
|
|
4580
|
+
type?: string;
|
|
4525
4581
|
}
|
|
4526
|
-
export interface
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4582
|
+
export interface EventCounts {
|
|
4583
|
+
get size(): number;
|
|
4584
|
+
get(eventType: string): number | undefined;
|
|
4585
|
+
has(eventType: string): boolean;
|
|
4586
|
+
entries(): IterableIterator<string[]>;
|
|
4587
|
+
keys(): IterableIterator<string>;
|
|
4588
|
+
values(): IterableIterator<number>;
|
|
4589
|
+
forEach(
|
|
4590
|
+
param1: (param0: number, param1: string, param2: EventCounts) => void,
|
|
4591
|
+
param2?: any,
|
|
4592
|
+
): void;
|
|
4593
|
+
[Symbol.iterator](): IterableIterator<string[]>;
|
|
4533
4594
|
}
|
|
4534
|
-
export interface
|
|
4535
|
-
|
|
4536
|
-
name
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
load(code: WorkerLoaderWorkerCode): WorkerStub;
|
|
4595
|
+
export interface Tracing {
|
|
4596
|
+
enterSpan<T, A extends unknown[]>(
|
|
4597
|
+
name: string,
|
|
4598
|
+
callback: (span: Span, ...args: A) => T,
|
|
4599
|
+
...args: A
|
|
4600
|
+
): T;
|
|
4601
|
+
startActiveSpan<T, A extends unknown[]>(
|
|
4602
|
+
name: string,
|
|
4603
|
+
callback: (span: Span, ...args: A) => T,
|
|
4604
|
+
...args: A
|
|
4605
|
+
): T;
|
|
4606
|
+
startSpan(name: string): Span;
|
|
4607
|
+
getActiveSpan(): Span | undefined;
|
|
4608
|
+
withActiveSpan<T, A extends unknown[]>(
|
|
4609
|
+
span: Span,
|
|
4610
|
+
callback: (...args: A) => T,
|
|
4611
|
+
...args: A
|
|
4612
|
+
): T;
|
|
4613
|
+
Span: typeof Span;
|
|
4554
4614
|
}
|
|
4555
|
-
export
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4615
|
+
export declare abstract class Span {
|
|
4616
|
+
get isTraced(): boolean;
|
|
4617
|
+
spanContext(): TracingSpanContext;
|
|
4618
|
+
setAttribute(key: string, value: boolean | number | string): this;
|
|
4619
|
+
setAttributes(
|
|
4620
|
+
attributes: Record<string, boolean | number | string | undefined>,
|
|
4621
|
+
): this;
|
|
4622
|
+
recordException(
|
|
4623
|
+
exception:
|
|
4624
|
+
| string
|
|
4625
|
+
| {
|
|
4626
|
+
code: string | number;
|
|
4627
|
+
name?: string;
|
|
4628
|
+
message?: string;
|
|
4629
|
+
stack?: string;
|
|
4630
|
+
}
|
|
4631
|
+
| {
|
|
4632
|
+
code?: string | number;
|
|
4633
|
+
name: string;
|
|
4634
|
+
message?: string;
|
|
4635
|
+
stack?: string;
|
|
4636
|
+
}
|
|
4637
|
+
| {
|
|
4638
|
+
code?: string | number;
|
|
4639
|
+
name?: string;
|
|
4640
|
+
message: string;
|
|
4641
|
+
stack?: string;
|
|
4642
|
+
},
|
|
4643
|
+
): void;
|
|
4644
|
+
updateName(name: string): this;
|
|
4645
|
+
setStatus(status: TracingSpanStatus): this;
|
|
4646
|
+
end(): void;
|
|
4563
4647
|
}
|
|
4564
|
-
export
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
limits?: workerdResourceLimits;
|
|
4569
|
-
mainModule: string;
|
|
4570
|
-
modules: Record<string, string | WebAssembly.Module | WorkerLoaderModule>;
|
|
4571
|
-
env?: any;
|
|
4572
|
-
globalOutbound?: Fetcher | null;
|
|
4573
|
-
tails?: Fetcher[];
|
|
4574
|
-
streamingTails?: Fetcher[];
|
|
4648
|
+
export type TracingSpanStatusCode = "unset" | "ok" | "error";
|
|
4649
|
+
export interface TracingSpanStatus {
|
|
4650
|
+
code: TracingSpanStatusCode;
|
|
4651
|
+
message?: string;
|
|
4575
4652
|
}
|
|
4576
|
-
export interface
|
|
4577
|
-
|
|
4578
|
-
|
|
4653
|
+
export interface TracingSpanContext {
|
|
4654
|
+
traceId: string;
|
|
4655
|
+
spanId: string;
|
|
4656
|
+
traceFlags: number;
|
|
4579
4657
|
}
|
|
4580
4658
|
/**
|
|
4581
|
-
*
|
|
4582
|
-
*
|
|
4659
|
+
* Represents the identity of a user authenticated via Cloudflare Access.
|
|
4660
|
+
* This matches the result of calling /cdn-cgi/access/get-identity.
|
|
4583
4661
|
*
|
|
4584
|
-
*
|
|
4662
|
+
* The exact structure of the returned object depends on the identity provider
|
|
4663
|
+
* configuration for the Access application. The fields below represent commonly
|
|
4664
|
+
* available properties, but additional provider-specific fields may be present.
|
|
4585
4665
|
*/
|
|
4586
|
-
export
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
/**
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
/**
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
/**
|
|
4623
|
-
* The **`getEntriesByType()`** method returns an array of PerformanceEntry objects currently present in the performance timeline for a given type.
|
|
4624
|
-
*
|
|
4625
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/getEntriesByType)
|
|
4626
|
-
*/
|
|
4627
|
-
getEntriesByType(type: string): PerformanceEntry[];
|
|
4628
|
-
/**
|
|
4629
|
-
* The **`mark()`** method creates a named PerformanceMark object representing a high resolution timestamp marker in the browser's performance timeline.
|
|
4630
|
-
*
|
|
4631
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/mark)
|
|
4632
|
-
*/
|
|
4633
|
-
mark(name: string, options?: PerformanceMarkOptions): PerformanceMark;
|
|
4634
|
-
/**
|
|
4635
|
-
* The **`measure()`** method creates a named PerformanceMeasure object representing a time measurement between two marks in the browser's performance timeline.
|
|
4636
|
-
*
|
|
4637
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/measure)
|
|
4638
|
-
*/
|
|
4639
|
-
measure(
|
|
4640
|
-
measureName: string,
|
|
4641
|
-
measureOptionsOrStartMark?: PerformanceMeasureOptions | string,
|
|
4642
|
-
maybeEndMark?: string,
|
|
4643
|
-
): PerformanceMeasure;
|
|
4644
|
-
/**
|
|
4645
|
-
* The **`setResourceTimingBufferSize()`** method sets the desired size of the browser's resource timing buffer which stores the "resource" performance entries.
|
|
4646
|
-
*
|
|
4647
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/setResourceTimingBufferSize)
|
|
4648
|
-
*/
|
|
4649
|
-
setResourceTimingBufferSize(size: number): void;
|
|
4650
|
-
/**
|
|
4651
|
-
* The **`toJSON()`** method of the Performance interface is a serializer; it returns a JSON representation of the Performance object.
|
|
4652
|
-
*
|
|
4653
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Performance/toJSON)
|
|
4654
|
-
*/
|
|
4655
|
-
toJSON(): object;
|
|
4656
|
-
get nodeTiming(): PerformanceNodeTiming;
|
|
4657
|
-
eventLoopUtilization(): PerformanceEventLoopUtilization;
|
|
4658
|
-
markResourceTiming(): void;
|
|
4659
|
-
timerify(fn: () => void): () => void;
|
|
4666
|
+
export interface CloudflareAccessIdentity extends Record<string, unknown> {
|
|
4667
|
+
/** The user's email address, if available from the identity provider. */
|
|
4668
|
+
email?: string;
|
|
4669
|
+
/** The user's display name. */
|
|
4670
|
+
name?: string;
|
|
4671
|
+
/** The user's unique identifier. */
|
|
4672
|
+
user_uuid?: string;
|
|
4673
|
+
/** The Cloudflare account ID. */
|
|
4674
|
+
account_id?: string;
|
|
4675
|
+
/** Login timestamp (Unix epoch seconds). */
|
|
4676
|
+
iat?: number;
|
|
4677
|
+
/** The user's IP address at authentication time. */
|
|
4678
|
+
ip?: string;
|
|
4679
|
+
/** Authentication methods used (e.g., "pwd"). */
|
|
4680
|
+
amr?: string[];
|
|
4681
|
+
/** Identity provider information. */
|
|
4682
|
+
idp?: {
|
|
4683
|
+
id: string;
|
|
4684
|
+
type: string;
|
|
4685
|
+
};
|
|
4686
|
+
/** Geographic information about where the user authenticated. */
|
|
4687
|
+
geo?: {
|
|
4688
|
+
country: string;
|
|
4689
|
+
};
|
|
4690
|
+
/** Group memberships from the identity provider. */
|
|
4691
|
+
groups?: Array<{
|
|
4692
|
+
id: string;
|
|
4693
|
+
name: string;
|
|
4694
|
+
email?: string;
|
|
4695
|
+
}>;
|
|
4696
|
+
/** Device posture check results, keyed by check ID. */
|
|
4697
|
+
devicePosture?: Record<string, unknown>;
|
|
4698
|
+
/** True if the user connected via Cloudflare WARP. */
|
|
4699
|
+
is_warp?: boolean;
|
|
4700
|
+
/** True if the user is authenticated via Cloudflare Gateway. */
|
|
4701
|
+
is_gateway?: boolean;
|
|
4660
4702
|
}
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4703
|
+
// ============================================================================
|
|
4704
|
+
// Agent Memory
|
|
4705
|
+
//
|
|
4706
|
+
// Public type surface for user Workers binding to an Agent Memory namespace.
|
|
4707
|
+
// ============================================================================
|
|
4708
|
+
/** Memory type — every memory is classified into exactly one. */
|
|
4709
|
+
export type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
4710
|
+
/** Search intensity for recall. */
|
|
4711
|
+
export type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
4712
|
+
/** Response verbosity for recall. */
|
|
4713
|
+
export type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
4714
|
+
/** A conversation message passed to ingest(). */
|
|
4715
|
+
export interface AgentMemoryMessage {
|
|
4716
|
+
role: "system" | "user" | "assistant";
|
|
4717
|
+
content: string;
|
|
4718
|
+
/** Optional message timestamp. */
|
|
4719
|
+
timestamp?: Date;
|
|
4665
4720
|
}
|
|
4666
|
-
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
readonly loopExit: number;
|
|
4673
|
-
readonly idleTime: number;
|
|
4674
|
-
readonly uvMetricsInfo: UvMetricsInfo;
|
|
4675
|
-
toJSON(): object;
|
|
4721
|
+
/** Raw memory content passed to remember(). */
|
|
4722
|
+
export interface AgentMemoryIncomingMemory {
|
|
4723
|
+
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
4724
|
+
content: string;
|
|
4725
|
+
/** Optional session identifier to associate with this memory. */
|
|
4726
|
+
sessionId?: string | null | undefined;
|
|
4676
4727
|
}
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4728
|
+
/** A stored memory returned from remember(), get(), and delete(). */
|
|
4729
|
+
export interface AgentMemoryMemory {
|
|
4730
|
+
/** Memory ID. */
|
|
4731
|
+
id: string;
|
|
4732
|
+
/** Memory type. */
|
|
4733
|
+
type: AgentMemoryMemoryType;
|
|
4734
|
+
/** Text summary. */
|
|
4735
|
+
summary: string;
|
|
4736
|
+
/** Memory text. */
|
|
4737
|
+
content: string;
|
|
4738
|
+
/** Session that created this memory. */
|
|
4739
|
+
sessionId: string | null;
|
|
4740
|
+
/** Memory creation time. */
|
|
4741
|
+
createdAt: Date;
|
|
4742
|
+
/** Memory last-update time. */
|
|
4743
|
+
updatedAt: Date;
|
|
4744
|
+
}
|
|
4745
|
+
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
4746
|
+
export type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
4747
|
+
/** A scored memory candidate in a recall result. */
|
|
4748
|
+
export interface AgentMemoryScoredCandidate {
|
|
4749
|
+
/** Candidate ID. */
|
|
4750
|
+
id: string;
|
|
4751
|
+
/** Text summary. */
|
|
4752
|
+
summary: string;
|
|
4753
|
+
/** Session that created this candidate, when known. */
|
|
4754
|
+
sessionId: string | null;
|
|
4755
|
+
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
4756
|
+
score: number;
|
|
4757
|
+
}
|
|
4758
|
+
/** Options for the ingest() method. */
|
|
4759
|
+
export interface AgentMemoryIngestOptions {
|
|
4760
|
+
/** Session identifier to associate with memories created during ingestion. */
|
|
4761
|
+
sessionId?: string | null | undefined;
|
|
4762
|
+
}
|
|
4763
|
+
/** Options for the getSummary() method. */
|
|
4764
|
+
export interface AgentMemoryGetSummaryOptions {
|
|
4765
|
+
/** Session identifier to retrieve session summary for. */
|
|
4766
|
+
sessionId?: string | null | undefined;
|
|
4767
|
+
}
|
|
4768
|
+
/** Response from the getSummary() method. */
|
|
4769
|
+
export interface AgentMemoryGetSummaryResponse {
|
|
4770
|
+
/** Markdown summary. */
|
|
4771
|
+
summary: string;
|
|
4681
4772
|
}
|
|
4682
4773
|
/**
|
|
4683
|
-
*
|
|
4774
|
+
* Options for the recall() method.
|
|
4684
4775
|
*
|
|
4685
|
-
*
|
|
4776
|
+
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
4777
|
+
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
4778
|
+
* date is used as "today" for resolving relative time references
|
|
4779
|
+
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
4686
4780
|
*/
|
|
4687
|
-
export
|
|
4688
|
-
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4781
|
+
export interface AgentMemoryRecallOptions {
|
|
4782
|
+
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
4783
|
+
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
4784
|
+
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
4785
|
+
responseLength?: AgentMemoryResponseLength;
|
|
4786
|
+
/** Temporal anchor for date arithmetic. */
|
|
4787
|
+
referenceDate?: Date | string;
|
|
4788
|
+
}
|
|
4789
|
+
/** Response from the recall() method. */
|
|
4790
|
+
export interface AgentMemoryRecallResult {
|
|
4791
|
+
/** Number of memories retrieved. */
|
|
4792
|
+
count: number;
|
|
4793
|
+
/** LLM-generated answer synthesizing the matching memories. */
|
|
4794
|
+
answer: string;
|
|
4795
|
+
/** Matching memories ranked by relevance. */
|
|
4796
|
+
candidates: AgentMemoryScoredCandidate[];
|
|
4696
4797
|
}
|
|
4697
4798
|
/**
|
|
4698
|
-
*
|
|
4799
|
+
* Options for the list() method.
|
|
4699
4800
|
*
|
|
4700
|
-
*
|
|
4801
|
+
* `cursor` is the opaque continuation token returned by the previous page;
|
|
4802
|
+
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
4803
|
+
* are exact-match filters; combining them is allowed.
|
|
4701
4804
|
*/
|
|
4702
|
-
export
|
|
4703
|
-
/**
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
export interface PerformanceMarkOptions {
|
|
4712
|
-
detail?: any;
|
|
4713
|
-
startTime?: number;
|
|
4805
|
+
export interface AgentMemoryListMemoriesOptions {
|
|
4806
|
+
/** Maximum number of memories to return. Default 20, max 500. */
|
|
4807
|
+
limit?: number;
|
|
4808
|
+
/** Opaque cursor from a previous page. */
|
|
4809
|
+
cursor?: string;
|
|
4810
|
+
/** Exact-match session filter. */
|
|
4811
|
+
sessionId?: string;
|
|
4812
|
+
/** Exact-match memory-type filter. */
|
|
4813
|
+
type?: AgentMemoryMemoryType;
|
|
4714
4814
|
}
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4815
|
+
/** Response from the list() method. */
|
|
4816
|
+
export interface AgentMemoryListMemoriesResult {
|
|
4817
|
+
memories: AgentMemoryMemoryListEntry[];
|
|
4818
|
+
/** Continuation cursor; absent when this page exhausted the result set. */
|
|
4819
|
+
cursor?: string;
|
|
4720
4820
|
}
|
|
4721
4821
|
/**
|
|
4722
|
-
*
|
|
4822
|
+
* A single Agent Memory profile, scoped to a profile name.
|
|
4723
4823
|
*
|
|
4724
|
-
*
|
|
4824
|
+
* Returned by {@link AgentMemoryNamespace.getProfile}.
|
|
4725
4825
|
*/
|
|
4726
|
-
export declare abstract class
|
|
4826
|
+
export declare abstract class AgentMemoryProfile {
|
|
4727
4827
|
/**
|
|
4728
|
-
*
|
|
4828
|
+
* Retrieve a memory by ID.
|
|
4729
4829
|
*
|
|
4730
|
-
*
|
|
4830
|
+
* @param memoryId - ULID of the memory to retrieve.
|
|
4831
|
+
* @throws if the memory does not exist.
|
|
4731
4832
|
*/
|
|
4732
|
-
|
|
4833
|
+
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4733
4834
|
/**
|
|
4734
|
-
*
|
|
4835
|
+
* Delete a memory by ID.
|
|
4735
4836
|
*
|
|
4736
|
-
*
|
|
4837
|
+
* Removes the memory and any source messages linked by the memory's
|
|
4838
|
+
* source message IDs.
|
|
4839
|
+
*
|
|
4840
|
+
* @param memoryId - ULID of the memory to delete.
|
|
4841
|
+
* @throws if the memory does not exist.
|
|
4737
4842
|
*/
|
|
4738
|
-
|
|
4843
|
+
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
4739
4844
|
/**
|
|
4740
|
-
*
|
|
4845
|
+
* Store a memory in this profile. The content is automatically classified,
|
|
4846
|
+
* summarized, and indexed.
|
|
4741
4847
|
*
|
|
4742
|
-
*
|
|
4848
|
+
* @param memory - Raw memory content to persist.
|
|
4743
4849
|
*/
|
|
4744
|
-
|
|
4745
|
-
}
|
|
4746
|
-
/**
|
|
4747
|
-
* The **`PerformanceEntry`** object encapsulates a single performance metric that is part of the browser's performance timeline.
|
|
4748
|
-
*
|
|
4749
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceEntry)
|
|
4750
|
-
*/
|
|
4751
|
-
export declare abstract class PerformanceEntry {
|
|
4850
|
+
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
4752
4851
|
/**
|
|
4753
|
-
*
|
|
4852
|
+
* Extract memories from a conversation.
|
|
4754
4853
|
*
|
|
4755
|
-
*
|
|
4854
|
+
* @param messages - Conversation messages to extract memories from.
|
|
4855
|
+
* @param options - Optional ingest options.
|
|
4756
4856
|
*/
|
|
4757
|
-
|
|
4857
|
+
ingest(
|
|
4858
|
+
messages: Iterable<AgentMemoryMessage>,
|
|
4859
|
+
options?: AgentMemoryIngestOptions,
|
|
4860
|
+
): Promise<void>;
|
|
4758
4861
|
/**
|
|
4759
|
-
*
|
|
4862
|
+
* Get a profile summary.
|
|
4760
4863
|
*
|
|
4761
|
-
*
|
|
4864
|
+
* @param options - Optional getSummary options.
|
|
4762
4865
|
*/
|
|
4763
|
-
|
|
4866
|
+
getSummary(
|
|
4867
|
+
options?: AgentMemoryGetSummaryOptions,
|
|
4868
|
+
): Promise<AgentMemoryGetSummaryResponse>;
|
|
4764
4869
|
/**
|
|
4765
|
-
*
|
|
4870
|
+
* Recall memories in this profile.
|
|
4766
4871
|
*
|
|
4767
|
-
*
|
|
4872
|
+
* @param query - Recall query matched against memory content and keywords.
|
|
4873
|
+
* @param options - Optional recall parameters.
|
|
4874
|
+
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
4768
4875
|
*/
|
|
4769
|
-
|
|
4876
|
+
recall(
|
|
4877
|
+
query: string,
|
|
4878
|
+
options?: AgentMemoryRecallOptions,
|
|
4879
|
+
): Promise<AgentMemoryRecallResult>;
|
|
4770
4880
|
/**
|
|
4771
|
-
*
|
|
4881
|
+
* List active memories in this profile.
|
|
4772
4882
|
*
|
|
4773
|
-
*
|
|
4883
|
+
* Returns a paginated, filterable view of stored memories. Superseded
|
|
4884
|
+
* versions are excluded. Use the returned `cursor` (when present) to
|
|
4885
|
+
* fetch the next page.
|
|
4886
|
+
*
|
|
4887
|
+
* @param options - Optional pagination and filter options.
|
|
4774
4888
|
*/
|
|
4775
|
-
|
|
4889
|
+
list(
|
|
4890
|
+
options?: AgentMemoryListMemoriesOptions,
|
|
4891
|
+
): Promise<AgentMemoryListMemoriesResult>;
|
|
4776
4892
|
/**
|
|
4777
|
-
*
|
|
4893
|
+
* Soft-delete every memory and message in this profile that is tagged
|
|
4894
|
+
* with `sessionId`.
|
|
4778
4895
|
*
|
|
4779
|
-
*
|
|
4896
|
+
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
4897
|
+
*
|
|
4898
|
+
* @param sessionId - Session to delete.
|
|
4780
4899
|
*/
|
|
4781
|
-
|
|
4900
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
4782
4901
|
}
|
|
4783
4902
|
/**
|
|
4784
|
-
*
|
|
4903
|
+
* Namespace-level Agent Memory binding.
|
|
4785
4904
|
*
|
|
4786
|
-
*
|
|
4905
|
+
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
4906
|
+
* Memory product.
|
|
4907
|
+
*
|
|
4908
|
+
* @example
|
|
4909
|
+
* ```ts
|
|
4910
|
+
* export default {
|
|
4911
|
+
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
4912
|
+
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
4913
|
+
* const summary = await profile.getSummary();
|
|
4914
|
+
* return Response.json(summary);
|
|
4915
|
+
* },
|
|
4916
|
+
* };
|
|
4917
|
+
* ```
|
|
4787
4918
|
*/
|
|
4788
|
-
export declare abstract class
|
|
4789
|
-
/**
|
|
4790
|
-
* The **`connectEnd`** read-only property returns the timestamp immediately after the browser finishes establishing the connection to the server to retrieve the resource. The timestamp value includes the time interval to establish the transport connection, as well as other time intervals such as TLS handshake and SOCKS authentication.
|
|
4791
|
-
*
|
|
4792
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectEnd)
|
|
4793
|
-
*/
|
|
4794
|
-
get connectEnd(): number;
|
|
4795
|
-
/**
|
|
4796
|
-
* The **`connectStart`** read-only property returns the timestamp immediately before the user agent starts establishing the connection to the server to retrieve the resource.
|
|
4797
|
-
*
|
|
4798
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/connectStart)
|
|
4799
|
-
*/
|
|
4800
|
-
get connectStart(): number;
|
|
4801
|
-
/**
|
|
4802
|
-
* The **`decodedBodySize`** read-only property returns the size (in octets) received from the fetch (HTTP or cache) of the message body after removing any applied content encoding (like gzip or Brotli). If the resource is retrieved from an application cache or local resources, it returns the size of the payload after removing any applied content encoding.
|
|
4803
|
-
*
|
|
4804
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/decodedBodySize)
|
|
4805
|
-
*/
|
|
4806
|
-
get decodedBodySize(): number;
|
|
4919
|
+
export declare abstract class AgentMemoryNamespace {
|
|
4807
4920
|
/**
|
|
4808
|
-
*
|
|
4921
|
+
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
4922
|
+
* addressed by a compound key (namespaceId:profileName).
|
|
4809
4923
|
*
|
|
4810
|
-
*
|
|
4924
|
+
* @param profileName - Profile name (validated against naming rules).
|
|
4925
|
+
* @returns RPC target for interacting with the profile.
|
|
4811
4926
|
*/
|
|
4812
|
-
|
|
4927
|
+
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
4813
4928
|
/**
|
|
4814
|
-
*
|
|
4929
|
+
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
4930
|
+
* memories and messages as deleted.
|
|
4815
4931
|
*
|
|
4816
|
-
*
|
|
4932
|
+
* @param profileName - Name of the profile to delete.
|
|
4817
4933
|
*/
|
|
4818
|
-
|
|
4819
|
-
/**
|
|
4820
|
-
* The **`encodedBodySize`** read-only property represents the size (in octets) received from the fetch (HTTP or cache) of the payload body before removing any applied content encodings (like gzip or Brotli). If the resource is retrieved from an application cache or a local resource, it must return the size of the payload body before removing any applied content encoding.
|
|
4821
|
-
*
|
|
4822
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/encodedBodySize)
|
|
4823
|
-
*/
|
|
4824
|
-
get encodedBodySize(): number;
|
|
4825
|
-
/**
|
|
4826
|
-
* The **`fetchStart`** read-only property represents a timestamp immediately before the browser starts to fetch the resource.
|
|
4827
|
-
*
|
|
4828
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/fetchStart)
|
|
4829
|
-
*/
|
|
4830
|
-
get fetchStart(): number;
|
|
4831
|
-
/**
|
|
4832
|
-
* The **`initiatorType`** read-only property is a string representing web platform feature that initiated the resource load.
|
|
4833
|
-
*
|
|
4834
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/initiatorType)
|
|
4835
|
-
*/
|
|
4836
|
-
get initiatorType(): string;
|
|
4837
|
-
/**
|
|
4838
|
-
* The **`nextHopProtocol`** read-only property is a string representing the network protocol used to fetch the resource, as identified by the ALPN Protocol ID (RFC7301).
|
|
4839
|
-
*
|
|
4840
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/nextHopProtocol)
|
|
4841
|
-
*/
|
|
4842
|
-
get nextHopProtocol(): string;
|
|
4843
|
-
/**
|
|
4844
|
-
* The **`redirectEnd`** read-only property returns a timestamp immediately after receiving the last byte of the response of the last redirect.
|
|
4845
|
-
*
|
|
4846
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectEnd)
|
|
4847
|
-
*/
|
|
4848
|
-
get redirectEnd(): number;
|
|
4849
|
-
/**
|
|
4850
|
-
* The **`redirectStart`** read-only property returns a timestamp representing the start time of the fetch which that initiates the redirect.
|
|
4851
|
-
*
|
|
4852
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/redirectStart)
|
|
4853
|
-
*/
|
|
4854
|
-
get redirectStart(): number;
|
|
4855
|
-
/**
|
|
4856
|
-
* The **`requestStart`** read-only property returns a timestamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource. If the transport connection fails and the browser retries the request, the value returned will be the start of the retry request.
|
|
4857
|
-
*
|
|
4858
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/requestStart)
|
|
4859
|
-
*/
|
|
4860
|
-
get requestStart(): number;
|
|
4861
|
-
/**
|
|
4862
|
-
* The **`responseEnd`** read-only property returns a timestamp immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first.
|
|
4863
|
-
*
|
|
4864
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseEnd)
|
|
4865
|
-
*/
|
|
4866
|
-
get responseEnd(): number;
|
|
4867
|
-
/**
|
|
4868
|
-
* The **`responseStart`** read-only property returns a timestamp immediately after the browser receives the first byte of the response from the server, cache, or local resource.
|
|
4869
|
-
*
|
|
4870
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStart)
|
|
4871
|
-
*/
|
|
4872
|
-
get responseStart(): number;
|
|
4873
|
-
/**
|
|
4874
|
-
* The **`responseStatus`** read-only property represents the HTTP response status code returned when fetching the resource.
|
|
4875
|
-
*
|
|
4876
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/responseStatus)
|
|
4877
|
-
*/
|
|
4878
|
-
get responseStatus(): number;
|
|
4879
|
-
/**
|
|
4880
|
-
* The **`secureConnectionStart`** read-only property returns a timestamp immediately before the browser starts the handshake process to secure the current connection. If a secure connection is not used, the property returns zero.
|
|
4881
|
-
*
|
|
4882
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/secureConnectionStart)
|
|
4883
|
-
*/
|
|
4884
|
-
get secureConnectionStart(): number | undefined;
|
|
4885
|
-
/**
|
|
4886
|
-
* The **`transferSize`** read-only property represents the size (in octets) of the fetched resource. The size includes the response header fields plus the response payload body (as defined by RFC7230).
|
|
4887
|
-
*
|
|
4888
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/transferSize)
|
|
4889
|
-
*/
|
|
4890
|
-
get transferSize(): number;
|
|
4891
|
-
/**
|
|
4892
|
-
* The **`workerStart`** read-only property of the PerformanceResourceTiming interface returns a DOMHighResTimeStamp immediately before dispatching the FetchEvent if a Service Worker thread is already running, or immediately before starting the Service Worker thread if it is not already running. If the resource is not intercepted by a Service Worker the property will always return 0.
|
|
4893
|
-
*
|
|
4894
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceResourceTiming/workerStart)
|
|
4895
|
-
*/
|
|
4896
|
-
get workerStart(): number;
|
|
4897
|
-
}
|
|
4898
|
-
/**
|
|
4899
|
-
* The **`PerformanceObserver`** interface is used to observe performance measurement events and be notified of new performance entries as they are recorded in the browser's performance timeline.
|
|
4900
|
-
*
|
|
4901
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver)
|
|
4902
|
-
*/
|
|
4903
|
-
export declare class PerformanceObserver {
|
|
4904
|
-
constructor(callback: any);
|
|
4905
|
-
/**
|
|
4906
|
-
* The **`disconnect()`** method of the PerformanceObserver interface is used to stop the performance observer from receiving any performance entry events.
|
|
4907
|
-
*
|
|
4908
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/disconnect)
|
|
4909
|
-
*/
|
|
4910
|
-
disconnect(): void;
|
|
4911
|
-
/**
|
|
4912
|
-
* The **`observe()`** method of the PerformanceObserver interface is used to specify the set of performance entry types to observe.
|
|
4913
|
-
*
|
|
4914
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/observe)
|
|
4915
|
-
*/
|
|
4916
|
-
observe(options?: PerformanceObserverObserveOptions): void;
|
|
4917
|
-
/**
|
|
4918
|
-
* The **`takeRecords()`** method of the PerformanceObserver interface returns the current list of PerformanceEntry objects stored in the performance observer, emptying it out.
|
|
4919
|
-
*
|
|
4920
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PerformanceObserver/takeRecords)
|
|
4921
|
-
*/
|
|
4922
|
-
takeRecords(): PerformanceEntry[];
|
|
4923
|
-
readonly supportedEntryTypes: string[];
|
|
4924
|
-
}
|
|
4925
|
-
export interface PerformanceObserverObserveOptions {
|
|
4926
|
-
buffered?: boolean;
|
|
4927
|
-
durationThreshold?: number;
|
|
4928
|
-
entryTypes?: string[];
|
|
4929
|
-
type?: string;
|
|
4930
|
-
}
|
|
4931
|
-
export interface EventCounts {
|
|
4932
|
-
get size(): number;
|
|
4933
|
-
get(eventType: string): number | undefined;
|
|
4934
|
-
has(eventType: string): boolean;
|
|
4935
|
-
entries(): IterableIterator<string[]>;
|
|
4936
|
-
keys(): IterableIterator<string>;
|
|
4937
|
-
values(): IterableIterator<number>;
|
|
4938
|
-
forEach(
|
|
4939
|
-
param1: (param0: number, param1: string, param2: EventCounts) => void,
|
|
4940
|
-
param2?: any,
|
|
4941
|
-
): void;
|
|
4942
|
-
[Symbol.iterator](): IterableIterator<string[]>;
|
|
4943
|
-
}
|
|
4944
|
-
export interface Tracing {
|
|
4945
|
-
enterSpan<T, A extends unknown[]>(
|
|
4946
|
-
name: string,
|
|
4947
|
-
callback: (span: Span, ...args: A) => T,
|
|
4948
|
-
...args: A
|
|
4949
|
-
): T;
|
|
4950
|
-
startActiveSpan<T, A extends unknown[]>(
|
|
4951
|
-
name: string,
|
|
4952
|
-
callback: (span: Span, ...args: A) => T,
|
|
4953
|
-
...args: A
|
|
4954
|
-
): T;
|
|
4955
|
-
startSpan(name: string): Span;
|
|
4956
|
-
getActiveSpan(): Span | undefined;
|
|
4957
|
-
withActiveSpan<T, A extends unknown[]>(
|
|
4958
|
-
span: Span,
|
|
4959
|
-
callback: (...args: A) => T,
|
|
4960
|
-
...args: A
|
|
4961
|
-
): T;
|
|
4962
|
-
Span: typeof Span;
|
|
4963
|
-
}
|
|
4964
|
-
export declare abstract class Span {
|
|
4965
|
-
get isTraced(): boolean;
|
|
4966
|
-
spanContext(): TracingSpanContext;
|
|
4967
|
-
setAttribute(key: string, value: boolean | number | string): this;
|
|
4968
|
-
setAttributes(
|
|
4969
|
-
attributes: Record<string, boolean | number | string | undefined>,
|
|
4970
|
-
): this;
|
|
4971
|
-
recordException(
|
|
4972
|
-
exception:
|
|
4973
|
-
| string
|
|
4974
|
-
| {
|
|
4975
|
-
code: string | number;
|
|
4976
|
-
name?: string;
|
|
4977
|
-
message?: string;
|
|
4978
|
-
stack?: string;
|
|
4979
|
-
}
|
|
4980
|
-
| {
|
|
4981
|
-
code?: string | number;
|
|
4982
|
-
name: string;
|
|
4983
|
-
message?: string;
|
|
4984
|
-
stack?: string;
|
|
4985
|
-
}
|
|
4986
|
-
| {
|
|
4987
|
-
code?: string | number;
|
|
4988
|
-
name?: string;
|
|
4989
|
-
message: string;
|
|
4990
|
-
stack?: string;
|
|
4991
|
-
},
|
|
4992
|
-
): void;
|
|
4993
|
-
updateName(name: string): this;
|
|
4994
|
-
setStatus(status: TracingSpanStatus): this;
|
|
4995
|
-
end(): void;
|
|
4996
|
-
}
|
|
4997
|
-
export type TracingSpanStatusCode = "unset" | "ok" | "error";
|
|
4998
|
-
export interface TracingSpanStatus {
|
|
4999
|
-
code: TracingSpanStatusCode;
|
|
5000
|
-
message?: string;
|
|
5001
|
-
}
|
|
5002
|
-
export interface TracingSpanContext {
|
|
5003
|
-
traceId: string;
|
|
5004
|
-
spanId: string;
|
|
5005
|
-
traceFlags: number;
|
|
4934
|
+
deleteProfile(profileName: string): Promise<void>;
|
|
5006
4935
|
}
|
|
4936
|
+
// ============ AI Search Error Interfaces ============
|
|
4937
|
+
export interface AiSearchInternalError extends Error {}
|
|
4938
|
+
export interface AiSearchNotFoundError extends Error {}
|
|
4939
|
+
// ============ AI Search Common Types ============
|
|
4940
|
+
/** A single message in a conversation-style search or chat request. */
|
|
4941
|
+
export type AiSearchMessage = {
|
|
4942
|
+
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
4943
|
+
content: string | null;
|
|
4944
|
+
};
|
|
5007
4945
|
/**
|
|
5008
|
-
*
|
|
5009
|
-
*
|
|
5010
|
-
*
|
|
5011
|
-
* The exact structure of the returned object depends on the identity provider
|
|
5012
|
-
* configuration for the Access application. The fields below represent commonly
|
|
5013
|
-
* available properties, but additional provider-specific fields may be present.
|
|
4946
|
+
* Common shape for `ai_search_options` used by both single-instance and multi-instance requests.
|
|
4947
|
+
* Contains retrieval, query rewrite, reranking, and cache sub-options.
|
|
5014
4948
|
*/
|
|
5015
|
-
export
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
4949
|
+
export type AiSearchOptions = {
|
|
4950
|
+
retrieval?: {
|
|
4951
|
+
/** Which retrieval backend to use. Defaults to the instance's configured index_method. */
|
|
4952
|
+
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
4953
|
+
/** Fusion method for combining vector + keyword results. */
|
|
4954
|
+
fusion_method?: "max" | "rrf";
|
|
4955
|
+
/** How keyword terms are combined: "and" = all terms must match, "or" = any term matches. */
|
|
4956
|
+
keyword_match_mode?: "and" | "or";
|
|
4957
|
+
/** Minimum similarity score (0-1) for a result to be included. Default 0.4. */
|
|
4958
|
+
match_threshold?: number;
|
|
4959
|
+
/** Maximum number of results to return (1-50). Default 10. */
|
|
4960
|
+
max_num_results?: number;
|
|
4961
|
+
/** Vectorize metadata filters applied to the search. */
|
|
4962
|
+
filters?: VectorizeVectorMetadataFilter;
|
|
4963
|
+
/** Number of surrounding chunks to include for context (0-3). Default 0. */
|
|
4964
|
+
context_expansion?: number;
|
|
4965
|
+
/** If true, return only item metadata without chunk text. */
|
|
4966
|
+
metadata_only?: boolean;
|
|
4967
|
+
/** If true (default), return empty results on retrieval failure instead of throwing. */
|
|
4968
|
+
return_on_failure?: boolean;
|
|
4969
|
+
/** Boost results by metadata field values. Max 3 entries. */
|
|
4970
|
+
boost_by?: Array<{
|
|
4971
|
+
field: string;
|
|
4972
|
+
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
4973
|
+
}>;
|
|
4974
|
+
[key: string]: unknown;
|
|
5034
4975
|
};
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
4976
|
+
query_rewrite?: {
|
|
4977
|
+
enabled?: boolean;
|
|
4978
|
+
model?: string;
|
|
4979
|
+
rewrite_prompt?: string;
|
|
4980
|
+
[key: string]: unknown;
|
|
5038
4981
|
};
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
//
|
|
5057
|
-
/** Memory type — every memory is classified into exactly one. */
|
|
5058
|
-
export type AgentMemoryMemoryType = "fact" | "event" | "instruction" | "task";
|
|
5059
|
-
/** Search intensity for recall. */
|
|
5060
|
-
export type AgentMemoryThinkingLevel = "low" | "medium" | "high";
|
|
5061
|
-
/** Response verbosity for recall. */
|
|
5062
|
-
export type AgentMemoryResponseLength = "short" | "medium" | "long";
|
|
5063
|
-
/** A conversation message passed to ingest(). */
|
|
5064
|
-
export interface AgentMemoryMessage {
|
|
5065
|
-
role: "system" | "user" | "assistant";
|
|
5066
|
-
content: string;
|
|
5067
|
-
/** Optional message timestamp. */
|
|
5068
|
-
timestamp?: Date;
|
|
5069
|
-
}
|
|
5070
|
-
/** Raw memory content passed to remember(). */
|
|
5071
|
-
export interface AgentMemoryIncomingMemory {
|
|
5072
|
-
/** Raw memory content. The service classifies and summarizes automatically. */
|
|
5073
|
-
content: string;
|
|
5074
|
-
/** Optional session identifier to associate with this memory. */
|
|
5075
|
-
sessionId?: string | null | undefined;
|
|
5076
|
-
}
|
|
5077
|
-
/** A stored memory returned from remember(), get(), and delete(). */
|
|
5078
|
-
export interface AgentMemoryMemory {
|
|
5079
|
-
/** Memory ID. */
|
|
5080
|
-
id: string;
|
|
5081
|
-
/** Memory type. */
|
|
5082
|
-
type: AgentMemoryMemoryType;
|
|
5083
|
-
/** Text summary. */
|
|
5084
|
-
summary: string;
|
|
5085
|
-
/** Memory text. */
|
|
5086
|
-
content: string;
|
|
5087
|
-
/** Session that created this memory. */
|
|
5088
|
-
sessionId: string | null;
|
|
5089
|
-
/** Memory creation time. */
|
|
5090
|
-
createdAt: Date;
|
|
5091
|
-
/** Memory last-update time. */
|
|
5092
|
-
updatedAt: Date;
|
|
5093
|
-
}
|
|
5094
|
-
/** Single entry in a list() response. Same shape as Memory minus full content. */
|
|
5095
|
-
export type AgentMemoryMemoryListEntry = Omit<AgentMemoryMemory, "content">;
|
|
5096
|
-
/** A scored memory candidate in a recall result. */
|
|
5097
|
-
export interface AgentMemoryScoredCandidate {
|
|
5098
|
-
/** Candidate ID. */
|
|
5099
|
-
id: string;
|
|
5100
|
-
/** Text summary. */
|
|
5101
|
-
summary: string;
|
|
5102
|
-
/** Session that created this candidate, when known. */
|
|
5103
|
-
sessionId: string | null;
|
|
5104
|
-
/** Relevance score (higher is better). Comparable only within a single query. */
|
|
5105
|
-
score: number;
|
|
5106
|
-
}
|
|
5107
|
-
/** Options for the ingest() method. */
|
|
5108
|
-
export interface AgentMemoryIngestOptions {
|
|
5109
|
-
/** Session identifier to associate with memories created during ingestion. */
|
|
5110
|
-
sessionId?: string | null | undefined;
|
|
5111
|
-
}
|
|
5112
|
-
/** Options for the getSummary() method. */
|
|
5113
|
-
export interface AgentMemoryGetSummaryOptions {
|
|
5114
|
-
/** Session identifier to retrieve session summary for. */
|
|
5115
|
-
sessionId?: string | null | undefined;
|
|
5116
|
-
}
|
|
5117
|
-
/** Response from the getSummary() method. */
|
|
5118
|
-
export interface AgentMemoryGetSummaryResponse {
|
|
5119
|
-
/** Markdown summary. */
|
|
5120
|
-
summary: string;
|
|
5121
|
-
}
|
|
5122
|
-
/**
|
|
5123
|
-
* Options for the recall() method.
|
|
5124
|
-
*
|
|
5125
|
-
* `referenceDate` accepts a Date object, an ISO-8601 date string
|
|
5126
|
-
* (YYYY-MM-DD), or a full ISO-8601 datetime string. When provided, this
|
|
5127
|
-
* date is used as "today" for resolving relative time references
|
|
5128
|
-
* ("how many days ago", "last week") instead of the server's wall-clock time.
|
|
5129
|
-
*/
|
|
5130
|
-
export interface AgentMemoryRecallOptions {
|
|
5131
|
-
/** Recall intensity: "low" (default), "medium", or "high". */
|
|
5132
|
-
thinkingLevel?: AgentMemoryThinkingLevel;
|
|
5133
|
-
/** Response verbosity: "short", "medium" (default), or "long". */
|
|
5134
|
-
responseLength?: AgentMemoryResponseLength;
|
|
5135
|
-
/** Temporal anchor for date arithmetic. */
|
|
5136
|
-
referenceDate?: Date | string;
|
|
5137
|
-
}
|
|
5138
|
-
/** Response from the recall() method. */
|
|
5139
|
-
export interface AgentMemoryRecallResult {
|
|
5140
|
-
/** Number of memories retrieved. */
|
|
5141
|
-
count: number;
|
|
5142
|
-
/** LLM-generated answer synthesizing the matching memories. */
|
|
5143
|
-
answer: string;
|
|
5144
|
-
/** Matching memories ranked by relevance. */
|
|
5145
|
-
candidates: AgentMemoryScoredCandidate[];
|
|
5146
|
-
}
|
|
4982
|
+
reranking?: {
|
|
4983
|
+
enabled?: boolean;
|
|
4984
|
+
model?: string;
|
|
4985
|
+
/** Match threshold (0-1, default 0.4) */
|
|
4986
|
+
match_threshold?: number;
|
|
4987
|
+
[key: string]: unknown;
|
|
4988
|
+
};
|
|
4989
|
+
cache?: {
|
|
4990
|
+
enabled?: boolean;
|
|
4991
|
+
cache_threshold?:
|
|
4992
|
+
| "super_strict_match"
|
|
4993
|
+
| "close_enough"
|
|
4994
|
+
| "flexible_friend"
|
|
4995
|
+
| "anything_goes";
|
|
4996
|
+
};
|
|
4997
|
+
[key: string]: unknown;
|
|
4998
|
+
};
|
|
4999
|
+
// ============ AI Search Request Types ============
|
|
5147
5000
|
/**
|
|
5148
|
-
*
|
|
5149
|
-
*
|
|
5150
|
-
* `cursor` is the opaque continuation token returned by the previous page;
|
|
5151
|
-
* pass it back unchanged to fetch the next page. `sessionId` and `type`
|
|
5152
|
-
* are exact-match filters; combining them is allowed.
|
|
5001
|
+
* Request body for single-instance search.
|
|
5002
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
5153
5003
|
*/
|
|
5154
|
-
export
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5164
|
-
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5004
|
+
export type AiSearchSearchRequest =
|
|
5005
|
+
| {
|
|
5006
|
+
/** Simple query string. */
|
|
5007
|
+
query: string;
|
|
5008
|
+
messages?: never;
|
|
5009
|
+
ai_search_options?: AiSearchOptions;
|
|
5010
|
+
}
|
|
5011
|
+
| {
|
|
5012
|
+
query?: never;
|
|
5013
|
+
/** Conversation-style input. At least one user message with non-empty content is required. */
|
|
5014
|
+
messages: AiSearchMessage[];
|
|
5015
|
+
ai_search_options?: AiSearchOptions;
|
|
5016
|
+
};
|
|
5017
|
+
export type AiSearchChatCompletionsRequest = {
|
|
5018
|
+
messages: AiSearchMessage[];
|
|
5019
|
+
model?: string;
|
|
5020
|
+
stream?: boolean;
|
|
5021
|
+
ai_search_options?: AiSearchOptions;
|
|
5022
|
+
[key: string]: unknown;
|
|
5023
|
+
};
|
|
5024
|
+
// ============ AI Search Multi-Instance Types (Namespace-Scoped) ============
|
|
5025
|
+
/** `ai_search_options` shape for multi-instance requests — requires `instance_ids`. */
|
|
5026
|
+
export type AiSearchMultiSearchOptions = AiSearchOptions & {
|
|
5027
|
+
/** Instance IDs to search across (1-10). */
|
|
5028
|
+
instance_ids: string[];
|
|
5029
|
+
};
|
|
5170
5030
|
/**
|
|
5171
|
-
*
|
|
5172
|
-
*
|
|
5173
|
-
*
|
|
5174
|
-
*/
|
|
5175
|
-
export declare abstract class AgentMemoryProfile {
|
|
5176
|
-
/**
|
|
5177
|
-
* Retrieve a memory by ID.
|
|
5178
|
-
*
|
|
5179
|
-
* @param memoryId - ULID of the memory to retrieve.
|
|
5180
|
-
* @throws if the memory does not exist.
|
|
5181
|
-
*/
|
|
5182
|
-
get(memoryId: string): Promise<AgentMemoryMemory>;
|
|
5183
|
-
/**
|
|
5184
|
-
* Delete a memory by ID.
|
|
5185
|
-
*
|
|
5186
|
-
* Removes the memory and any source messages linked by the memory's
|
|
5187
|
-
* source message IDs.
|
|
5188
|
-
*
|
|
5189
|
-
* @param memoryId - ULID of the memory to delete.
|
|
5190
|
-
* @throws if the memory does not exist.
|
|
5191
|
-
*/
|
|
5192
|
-
delete(memoryId: string): Promise<AgentMemoryMemory>;
|
|
5193
|
-
/**
|
|
5194
|
-
* Store a memory in this profile. The content is automatically classified,
|
|
5195
|
-
* summarized, and indexed.
|
|
5196
|
-
*
|
|
5197
|
-
* @param memory - Raw memory content to persist.
|
|
5198
|
-
*/
|
|
5199
|
-
remember(memory: AgentMemoryIncomingMemory): Promise<AgentMemoryMemory>;
|
|
5200
|
-
/**
|
|
5201
|
-
* Extract memories from a conversation.
|
|
5202
|
-
*
|
|
5203
|
-
* @param messages - Conversation messages to extract memories from.
|
|
5204
|
-
* @param options - Optional ingest options.
|
|
5205
|
-
*/
|
|
5206
|
-
ingest(
|
|
5207
|
-
messages: Iterable<AgentMemoryMessage>,
|
|
5208
|
-
options?: AgentMemoryIngestOptions,
|
|
5209
|
-
): Promise<void>;
|
|
5210
|
-
/**
|
|
5211
|
-
* Get a profile summary.
|
|
5212
|
-
*
|
|
5213
|
-
* @param options - Optional getSummary options.
|
|
5214
|
-
*/
|
|
5215
|
-
getSummary(
|
|
5216
|
-
options?: AgentMemoryGetSummaryOptions,
|
|
5217
|
-
): Promise<AgentMemoryGetSummaryResponse>;
|
|
5218
|
-
/**
|
|
5219
|
-
* Recall memories in this profile.
|
|
5220
|
-
*
|
|
5221
|
-
* @param query - Recall query matched against memory content and keywords.
|
|
5222
|
-
* @param options - Optional recall parameters.
|
|
5223
|
-
* @returns Matching memories with relevance scores and a synthesized answer.
|
|
5224
|
-
*/
|
|
5225
|
-
recall(
|
|
5226
|
-
query: string,
|
|
5227
|
-
options?: AgentMemoryRecallOptions,
|
|
5228
|
-
): Promise<AgentMemoryRecallResult>;
|
|
5229
|
-
/**
|
|
5230
|
-
* List active memories in this profile.
|
|
5231
|
-
*
|
|
5232
|
-
* Returns a paginated, filterable view of stored memories. Superseded
|
|
5233
|
-
* versions are excluded. Use the returned `cursor` (when present) to
|
|
5234
|
-
* fetch the next page.
|
|
5235
|
-
*
|
|
5236
|
-
* @param options - Optional pagination and filter options.
|
|
5237
|
-
*/
|
|
5238
|
-
list(
|
|
5239
|
-
options?: AgentMemoryListMemoriesOptions,
|
|
5240
|
-
): Promise<AgentMemoryListMemoriesResult>;
|
|
5241
|
-
/**
|
|
5242
|
-
* Soft-delete every memory and message in this profile that is tagged
|
|
5243
|
-
* with `sessionId`.
|
|
5244
|
-
*
|
|
5245
|
-
* Idempotent: deleting a sessionId that has no rows is a no-op.
|
|
5246
|
-
*
|
|
5247
|
-
* @param sessionId - Session to delete.
|
|
5248
|
-
*/
|
|
5249
|
-
deleteSession(sessionId: string): Promise<void>;
|
|
5250
|
-
}
|
|
5251
|
-
/**
|
|
5252
|
-
* Namespace-level Agent Memory binding.
|
|
5253
|
-
*
|
|
5254
|
-
* Used as the type of an `env.MEMORY`-style binding backed by the Agent
|
|
5255
|
-
* Memory product.
|
|
5256
|
-
*
|
|
5257
|
-
* @example
|
|
5258
|
-
* ```ts
|
|
5259
|
-
* export default {
|
|
5260
|
-
* async fetch(_request: Request, env: Env): Promise<Response> {
|
|
5261
|
-
* const profile = await env.MEMORY.getProfile("wrangler-e2e");
|
|
5262
|
-
* const summary = await profile.getSummary();
|
|
5263
|
-
* return Response.json(summary);
|
|
5264
|
-
* },
|
|
5265
|
-
* };
|
|
5266
|
-
* ```
|
|
5267
|
-
*/
|
|
5268
|
-
export declare abstract class AgentMemoryNamespace {
|
|
5269
|
-
/**
|
|
5270
|
-
* Get a memory profile by name. Profiles are isolated by namespace and
|
|
5271
|
-
* addressed by a compound key (namespaceId:profileName).
|
|
5272
|
-
*
|
|
5273
|
-
* @param profileName - Profile name (validated against naming rules).
|
|
5274
|
-
* @returns RPC target for interacting with the profile.
|
|
5275
|
-
*/
|
|
5276
|
-
getProfile(profileName: string): Promise<AgentMemoryProfile>;
|
|
5277
|
-
/**
|
|
5278
|
-
* Soft-delete a profile and schedule deferred purge. Marks all
|
|
5279
|
-
* memories and messages as deleted.
|
|
5280
|
-
*
|
|
5281
|
-
* @param profileName - Name of the profile to delete.
|
|
5282
|
-
*/
|
|
5283
|
-
deleteProfile(profileName: string): Promise<void>;
|
|
5284
|
-
}
|
|
5285
|
-
// ============ AI Search Error Interfaces ============
|
|
5286
|
-
export interface AiSearchInternalError extends Error {}
|
|
5287
|
-
export interface AiSearchNotFoundError extends Error {}
|
|
5288
|
-
// ============ AI Search Common Types ============
|
|
5289
|
-
/** A single message in a conversation-style search or chat request. */
|
|
5290
|
-
export type AiSearchMessage = {
|
|
5291
|
-
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
5292
|
-
content: string | null;
|
|
5293
|
-
};
|
|
5294
|
-
/**
|
|
5295
|
-
* Common shape for `ai_search_options` used by both single-instance and multi-instance requests.
|
|
5296
|
-
* Contains retrieval, query rewrite, reranking, and cache sub-options.
|
|
5297
|
-
*/
|
|
5298
|
-
export type AiSearchOptions = {
|
|
5299
|
-
retrieval?: {
|
|
5300
|
-
/** Which retrieval backend to use. Defaults to the instance's configured index_method. */
|
|
5301
|
-
retrieval_type?: "vector" | "keyword" | "hybrid";
|
|
5302
|
-
/** Fusion method for combining vector + keyword results. */
|
|
5303
|
-
fusion_method?: "max" | "rrf";
|
|
5304
|
-
/** How keyword terms are combined: "and" = all terms must match, "or" = any term matches. */
|
|
5305
|
-
keyword_match_mode?: "and" | "or";
|
|
5306
|
-
/** Minimum similarity score (0-1) for a result to be included. Default 0.4. */
|
|
5307
|
-
match_threshold?: number;
|
|
5308
|
-
/** Maximum number of results to return (1-50). Default 10. */
|
|
5309
|
-
max_num_results?: number;
|
|
5310
|
-
/** Vectorize metadata filters applied to the search. */
|
|
5311
|
-
filters?: VectorizeVectorMetadataFilter;
|
|
5312
|
-
/** Number of surrounding chunks to include for context (0-3). Default 0. */
|
|
5313
|
-
context_expansion?: number;
|
|
5314
|
-
/** If true, return only item metadata without chunk text. */
|
|
5315
|
-
metadata_only?: boolean;
|
|
5316
|
-
/** If true (default), return empty results on retrieval failure instead of throwing. */
|
|
5317
|
-
return_on_failure?: boolean;
|
|
5318
|
-
/** Boost results by metadata field values. Max 3 entries. */
|
|
5319
|
-
boost_by?: Array<{
|
|
5320
|
-
field: string;
|
|
5321
|
-
direction?: "asc" | "desc" | "exists" | "not_exists";
|
|
5322
|
-
}>;
|
|
5323
|
-
[key: string]: unknown;
|
|
5324
|
-
};
|
|
5325
|
-
query_rewrite?: {
|
|
5326
|
-
enabled?: boolean;
|
|
5327
|
-
model?: string;
|
|
5328
|
-
rewrite_prompt?: string;
|
|
5329
|
-
[key: string]: unknown;
|
|
5330
|
-
};
|
|
5331
|
-
reranking?: {
|
|
5332
|
-
enabled?: boolean;
|
|
5333
|
-
model?: string;
|
|
5334
|
-
/** Match threshold (0-1, default 0.4) */
|
|
5335
|
-
match_threshold?: number;
|
|
5336
|
-
[key: string]: unknown;
|
|
5337
|
-
};
|
|
5338
|
-
cache?: {
|
|
5339
|
-
enabled?: boolean;
|
|
5340
|
-
cache_threshold?:
|
|
5341
|
-
| "super_strict_match"
|
|
5342
|
-
| "close_enough"
|
|
5343
|
-
| "flexible_friend"
|
|
5344
|
-
| "anything_goes";
|
|
5345
|
-
};
|
|
5346
|
-
[key: string]: unknown;
|
|
5347
|
-
};
|
|
5348
|
-
// ============ AI Search Request Types ============
|
|
5349
|
-
/**
|
|
5350
|
-
* Request body for single-instance search.
|
|
5351
|
-
* Exactly one of `query` or `messages` must be provided.
|
|
5352
|
-
*/
|
|
5353
|
-
export type AiSearchSearchRequest =
|
|
5354
|
-
| {
|
|
5355
|
-
/** Simple query string. */
|
|
5356
|
-
query: string;
|
|
5357
|
-
messages?: never;
|
|
5358
|
-
ai_search_options?: AiSearchOptions;
|
|
5359
|
-
}
|
|
5360
|
-
| {
|
|
5361
|
-
query?: never;
|
|
5362
|
-
/** Conversation-style input. At least one user message with non-empty content is required. */
|
|
5363
|
-
messages: AiSearchMessage[];
|
|
5364
|
-
ai_search_options?: AiSearchOptions;
|
|
5365
|
-
};
|
|
5366
|
-
export type AiSearchChatCompletionsRequest = {
|
|
5367
|
-
messages: AiSearchMessage[];
|
|
5368
|
-
model?: string;
|
|
5369
|
-
stream?: boolean;
|
|
5370
|
-
ai_search_options?: AiSearchOptions;
|
|
5371
|
-
[key: string]: unknown;
|
|
5372
|
-
};
|
|
5373
|
-
// ============ AI Search Multi-Instance Types (Namespace-Scoped) ============
|
|
5374
|
-
/** `ai_search_options` shape for multi-instance requests — requires `instance_ids`. */
|
|
5375
|
-
export type AiSearchMultiSearchOptions = AiSearchOptions & {
|
|
5376
|
-
/** Instance IDs to search across (1-10). */
|
|
5377
|
-
instance_ids: string[];
|
|
5378
|
-
};
|
|
5379
|
-
/**
|
|
5380
|
-
* Request for searching across multiple instances within a namespace.
|
|
5381
|
-
* `ai_search_options` is required and must include `instance_ids`.
|
|
5382
|
-
* Exactly one of `query` or `messages` must be provided.
|
|
5031
|
+
* Request for searching across multiple instances within a namespace.
|
|
5032
|
+
* `ai_search_options` is required and must include `instance_ids`.
|
|
5033
|
+
* Exactly one of `query` or `messages` must be provided.
|
|
5383
5034
|
*/
|
|
5384
5035
|
export type AiSearchMultiSearchRequest =
|
|
5385
5036
|
| {
|
|
@@ -15509,6 +15160,10 @@ export interface ForwardableEmailMessage extends EmailMessage {
|
|
|
15509
15160
|
* Size of the email message content.
|
|
15510
15161
|
*/
|
|
15511
15162
|
readonly rawSize: number;
|
|
15163
|
+
/**
|
|
15164
|
+
* Whether this email message can be forwarded with `forward()`.
|
|
15165
|
+
*/
|
|
15166
|
+
readonly canBeForwarded: boolean;
|
|
15512
15167
|
/**
|
|
15513
15168
|
* Reject this email message by returning a permanent SMTP error back to the connecting client including the given reason.
|
|
15514
15169
|
* @param reason The reject reason.
|
|
@@ -18072,6 +17727,365 @@ export declare namespace TailStream {
|
|
|
18072
17727
|
};
|
|
18073
17728
|
type TailEventHandlerType = TailEventHandler | TailEventHandlerObject;
|
|
18074
17729
|
}
|
|
17730
|
+
// URL and URLSearchParams, as WHATWG URL declares them, at every compatibility
|
|
17731
|
+
// date. Without the urlsearchparams_delete_has_value_arg compatibility flag
|
|
17732
|
+
// (the default from 2023-07-01), delete() and has() ignore `value`.
|
|
17733
|
+
/**
|
|
17734
|
+
* The **`URL`** interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.
|
|
17735
|
+
*
|
|
17736
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL)
|
|
17737
|
+
*/
|
|
17738
|
+
export declare class URL {
|
|
17739
|
+
constructor(url: string | URL, base?: string | URL);
|
|
17740
|
+
/**
|
|
17741
|
+
* The **`href`** property of the URL interface is a string containing the whole URL.
|
|
17742
|
+
*
|
|
17743
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
|
|
17744
|
+
*/
|
|
17745
|
+
get href(): string;
|
|
17746
|
+
/**
|
|
17747
|
+
* The **`href`** property of the URL interface is a string containing the whole URL.
|
|
17748
|
+
*
|
|
17749
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/href)
|
|
17750
|
+
*/
|
|
17751
|
+
set href(value: string);
|
|
17752
|
+
/**
|
|
17753
|
+
* The **`origin`** read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.
|
|
17754
|
+
*
|
|
17755
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/origin)
|
|
17756
|
+
*/
|
|
17757
|
+
get origin(): string;
|
|
17758
|
+
/**
|
|
17759
|
+
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
|
17760
|
+
*
|
|
17761
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
|
17762
|
+
*/
|
|
17763
|
+
get protocol(): string;
|
|
17764
|
+
/**
|
|
17765
|
+
* The **`protocol`** property of the URL interface is a string containing the protocol or scheme of the URL, including the final ":".
|
|
17766
|
+
*
|
|
17767
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/protocol)
|
|
17768
|
+
*/
|
|
17769
|
+
set protocol(value: string);
|
|
17770
|
+
/**
|
|
17771
|
+
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
|
17772
|
+
*
|
|
17773
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
|
17774
|
+
*/
|
|
17775
|
+
get username(): string;
|
|
17776
|
+
/**
|
|
17777
|
+
* The **`username`** property of the URL interface is a string containing the username component of the URL. If the URL does not have a username, this property contains an empty string, "".
|
|
17778
|
+
*
|
|
17779
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/username)
|
|
17780
|
+
*/
|
|
17781
|
+
set username(value: string);
|
|
17782
|
+
/**
|
|
17783
|
+
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
|
17784
|
+
*
|
|
17785
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
|
17786
|
+
*/
|
|
17787
|
+
get password(): string;
|
|
17788
|
+
/**
|
|
17789
|
+
* The **`password`** property of the URL interface is a string containing the password component of the URL. If the URL does not have a password, this property contains an empty string, "".
|
|
17790
|
+
*
|
|
17791
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/password)
|
|
17792
|
+
*/
|
|
17793
|
+
set password(value: string);
|
|
17794
|
+
/**
|
|
17795
|
+
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
|
17796
|
+
*
|
|
17797
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
|
17798
|
+
*/
|
|
17799
|
+
get host(): string;
|
|
17800
|
+
/**
|
|
17801
|
+
* The **`host`** property of the URL interface is a string containing the host, which is the hostname, and then, if the port of the URL is nonempty, a ":", followed by the port of the URL. If the URL does not have a hostname, this property contains an empty string, "".
|
|
17802
|
+
*
|
|
17803
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/host)
|
|
17804
|
+
*/
|
|
17805
|
+
set host(value: string);
|
|
17806
|
+
/**
|
|
17807
|
+
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
|
17808
|
+
*
|
|
17809
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
|
17810
|
+
*/
|
|
17811
|
+
get hostname(): string;
|
|
17812
|
+
/**
|
|
17813
|
+
* The **`hostname`** property of the URL interface is a string containing either the domain name or IP address of the URL. If the URL does not have a hostname, this property contains an empty string, "". IPv4 and IPv6 addresses are normalized, such as stripping leading zeros, and domain names are converted to IDN.
|
|
17814
|
+
*
|
|
17815
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hostname)
|
|
17816
|
+
*/
|
|
17817
|
+
set hostname(value: string);
|
|
17818
|
+
/**
|
|
17819
|
+
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
|
17820
|
+
*
|
|
17821
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
|
17822
|
+
*/
|
|
17823
|
+
get port(): string;
|
|
17824
|
+
/**
|
|
17825
|
+
* The **`port`** property of the URL interface is a string containing the port number of the URL. If the port is the default for the protocol (80 for ws: and http:, 443 for wss: and https:, and 21 for ftp:), this property contains an empty string, "".
|
|
17826
|
+
*
|
|
17827
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/port)
|
|
17828
|
+
*/
|
|
17829
|
+
set port(value: string);
|
|
17830
|
+
/**
|
|
17831
|
+
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
|
17832
|
+
*
|
|
17833
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
|
17834
|
+
*/
|
|
17835
|
+
get pathname(): string;
|
|
17836
|
+
/**
|
|
17837
|
+
* The **`pathname`** property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character.
|
|
17838
|
+
*
|
|
17839
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/pathname)
|
|
17840
|
+
*/
|
|
17841
|
+
set pathname(value: string);
|
|
17842
|
+
/**
|
|
17843
|
+
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
|
17844
|
+
*
|
|
17845
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
|
17846
|
+
*/
|
|
17847
|
+
get search(): string;
|
|
17848
|
+
/**
|
|
17849
|
+
* The **`search`** property of the URL interface is a search string, also called a query string, that is a string containing a "?" followed by the parameters of the URL. If the URL does not have a search query, this property contains an empty string, "".
|
|
17850
|
+
*
|
|
17851
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/search)
|
|
17852
|
+
*/
|
|
17853
|
+
set search(value: string);
|
|
17854
|
+
/**
|
|
17855
|
+
* The **`searchParams`** read-only property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.
|
|
17856
|
+
*
|
|
17857
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/searchParams)
|
|
17858
|
+
*/
|
|
17859
|
+
get searchParams(): URLSearchParams;
|
|
17860
|
+
/**
|
|
17861
|
+
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
|
17862
|
+
*
|
|
17863
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
|
17864
|
+
*/
|
|
17865
|
+
get hash(): string;
|
|
17866
|
+
/**
|
|
17867
|
+
* The **`hash`** property of the URL interface is a string containing a "#" followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this property contains an empty string, "".
|
|
17868
|
+
*
|
|
17869
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/hash)
|
|
17870
|
+
*/
|
|
17871
|
+
set hash(value: string);
|
|
17872
|
+
/**
|
|
17873
|
+
* The **`toJSON()`** method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().
|
|
17874
|
+
*
|
|
17875
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/toJSON)
|
|
17876
|
+
*/
|
|
17877
|
+
toJSON(): string;
|
|
17878
|
+
toString(): string;
|
|
17879
|
+
/**
|
|
17880
|
+
* The **`URL.canParse()`** static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.
|
|
17881
|
+
*
|
|
17882
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/canParse_static)
|
|
17883
|
+
*/
|
|
17884
|
+
static canParse(url: string | URL, base?: string | URL): boolean;
|
|
17885
|
+
/**
|
|
17886
|
+
* The **`URL.parse()`** static method of the URL interface returns a newly created URL object representing the URL defined by the parameters.
|
|
17887
|
+
*
|
|
17888
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/parse_static)
|
|
17889
|
+
*/
|
|
17890
|
+
static parse(url: string | URL, base?: string | URL): URL | null;
|
|
17891
|
+
/**
|
|
17892
|
+
* The **`createObjectURL()`** static method of the URL interface creates a string containing a blob URL pointing to the object given in the parameter.
|
|
17893
|
+
*
|
|
17894
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL_static)
|
|
17895
|
+
*/
|
|
17896
|
+
static createObjectURL(object: File | Blob): string;
|
|
17897
|
+
/**
|
|
17898
|
+
* The **`revokeObjectURL()`** static method of the URL interface releases an existing object URL which was previously created by calling URL.createObjectURL().
|
|
17899
|
+
*
|
|
17900
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URL/revokeObjectURL_static)
|
|
17901
|
+
*/
|
|
17902
|
+
static revokeObjectURL(object_url: string): void;
|
|
17903
|
+
}
|
|
17904
|
+
/**
|
|
17905
|
+
* The **`URLSearchParams`** interface defines utility methods to work with the query string of a URL.
|
|
17906
|
+
*
|
|
17907
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams)
|
|
17908
|
+
*/
|
|
17909
|
+
export declare class URLSearchParams {
|
|
17910
|
+
constructor(
|
|
17911
|
+
init?: Iterable<Iterable<string>> | Record<string, string> | string,
|
|
17912
|
+
);
|
|
17913
|
+
/**
|
|
17914
|
+
* The **`size`** read-only property of the URLSearchParams interface indicates the total number of search parameter entries.
|
|
17915
|
+
*
|
|
17916
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/size)
|
|
17917
|
+
*/
|
|
17918
|
+
get size(): number;
|
|
17919
|
+
/**
|
|
17920
|
+
* The **`append()`** method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.
|
|
17921
|
+
*
|
|
17922
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/append)
|
|
17923
|
+
*/
|
|
17924
|
+
append(name: string, value: string): void;
|
|
17925
|
+
/**
|
|
17926
|
+
* The **`delete()`** method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters.
|
|
17927
|
+
*
|
|
17928
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/delete)
|
|
17929
|
+
*/
|
|
17930
|
+
delete(name: string, value?: string): void;
|
|
17931
|
+
/**
|
|
17932
|
+
* The **`get()`** method of the URLSearchParams interface returns the first value associated to the given search parameter.
|
|
17933
|
+
*
|
|
17934
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/get)
|
|
17935
|
+
*/
|
|
17936
|
+
get(name: string): string | null;
|
|
17937
|
+
/**
|
|
17938
|
+
* The **`getAll()`** method of the URLSearchParams interface returns all the values associated with a given search parameter as an array.
|
|
17939
|
+
*
|
|
17940
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/getAll)
|
|
17941
|
+
*/
|
|
17942
|
+
getAll(name: string): string[];
|
|
17943
|
+
/**
|
|
17944
|
+
* The **`has()`** method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters.
|
|
17945
|
+
*
|
|
17946
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/has)
|
|
17947
|
+
*/
|
|
17948
|
+
has(name: string, value?: string): boolean;
|
|
17949
|
+
/**
|
|
17950
|
+
* The **`set()`** method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn't exist, this method creates it.
|
|
17951
|
+
*
|
|
17952
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/set)
|
|
17953
|
+
*/
|
|
17954
|
+
set(name: string, value: string): void;
|
|
17955
|
+
/**
|
|
17956
|
+
* The **`URLSearchParams.sort()`** method sorts all key/value pairs contained in this object in place and returns undefined. Key/value pairs are sorted by the values of the UTF-16 code units of the keys. This method uses a stable sorting algorithm (i.e., the relative order between key/value pairs with equal keys will be preserved).
|
|
17957
|
+
*
|
|
17958
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLSearchParams/sort)
|
|
17959
|
+
*/
|
|
17960
|
+
sort(): void;
|
|
17961
|
+
entries(): IterableIterator<[key: string, value: string]>;
|
|
17962
|
+
keys(): IterableIterator<string>;
|
|
17963
|
+
values(): IterableIterator<string>;
|
|
17964
|
+
forEach<This = unknown>(
|
|
17965
|
+
callback: (
|
|
17966
|
+
this: This,
|
|
17967
|
+
value: string,
|
|
17968
|
+
key: string,
|
|
17969
|
+
parent: URLSearchParams,
|
|
17970
|
+
) => void,
|
|
17971
|
+
thisArg?: This,
|
|
17972
|
+
): void;
|
|
17973
|
+
toString(): string;
|
|
17974
|
+
[Symbol.iterator](): IterableIterator<[key: string, value: string]>;
|
|
17975
|
+
}
|
|
17976
|
+
// URLPattern, as the URLPattern standard declares it, for both parsers.
|
|
17977
|
+
// The legacy parser (the urlpattern_original compatibility flag, the
|
|
17978
|
+
// default before 2025-05-01) has no hasRegExpGroups.
|
|
17979
|
+
/**
|
|
17980
|
+
* 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.
|
|
17981
|
+
*
|
|
17982
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern)
|
|
17983
|
+
*/
|
|
17984
|
+
export declare class URLPattern {
|
|
17985
|
+
constructor(
|
|
17986
|
+
input?: string | URLPatternInit,
|
|
17987
|
+
baseURL?: string | URLPatternOptions,
|
|
17988
|
+
patternOptions?: URLPatternOptions,
|
|
17989
|
+
);
|
|
17990
|
+
/**
|
|
17991
|
+
* The **`protocol`** read-only property of the URLPattern interface is a string containing the pattern used to match the protocol part of a URL.
|
|
17992
|
+
*
|
|
17993
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/protocol)
|
|
17994
|
+
*/
|
|
17995
|
+
get protocol(): string;
|
|
17996
|
+
/**
|
|
17997
|
+
* The **`username`** read-only property of the URLPattern interface is a string containing the pattern used to match the username part of a URL.
|
|
17998
|
+
*
|
|
17999
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/username)
|
|
18000
|
+
*/
|
|
18001
|
+
get username(): string;
|
|
18002
|
+
/**
|
|
18003
|
+
* The **`password`** read-only property of the URLPattern interface is a string containing the pattern used to match the password part of a URL.
|
|
18004
|
+
*
|
|
18005
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/password)
|
|
18006
|
+
*/
|
|
18007
|
+
get password(): string;
|
|
18008
|
+
/**
|
|
18009
|
+
* The **`hostname`** read-only property of the URLPattern interface is a string containing the pattern used to match the hostname part of a URL.
|
|
18010
|
+
*
|
|
18011
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hostname)
|
|
18012
|
+
*/
|
|
18013
|
+
get hostname(): string;
|
|
18014
|
+
/**
|
|
18015
|
+
* The **`port`** read-only property of the URLPattern interface is a string containing the pattern used to match the port part of a URL.
|
|
18016
|
+
*
|
|
18017
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/port)
|
|
18018
|
+
*/
|
|
18019
|
+
get port(): string;
|
|
18020
|
+
/**
|
|
18021
|
+
* The **`pathname`** read-only property of the URLPattern interface is a string containing the pattern used to match the pathname part of a URL.
|
|
18022
|
+
*
|
|
18023
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/pathname)
|
|
18024
|
+
*/
|
|
18025
|
+
get pathname(): string;
|
|
18026
|
+
/**
|
|
18027
|
+
* The **`search`** read-only property of the URLPattern interface is a string containing the pattern used to match the search part of a URL.
|
|
18028
|
+
*
|
|
18029
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/search)
|
|
18030
|
+
*/
|
|
18031
|
+
get search(): string;
|
|
18032
|
+
/**
|
|
18033
|
+
* The **`hash`** read-only property of the URLPattern interface is a string containing the pattern used to match the fragment part of a URL.
|
|
18034
|
+
*
|
|
18035
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hash)
|
|
18036
|
+
*/
|
|
18037
|
+
get hash(): string;
|
|
18038
|
+
/**
|
|
18039
|
+
* 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.
|
|
18040
|
+
*
|
|
18041
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/hasRegExpGroups)
|
|
18042
|
+
*/
|
|
18043
|
+
get hasRegExpGroups(): boolean;
|
|
18044
|
+
/**
|
|
18045
|
+
* 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.
|
|
18046
|
+
*
|
|
18047
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/test)
|
|
18048
|
+
*/
|
|
18049
|
+
test(input?: string | URLPatternInit, baseURL?: string): boolean;
|
|
18050
|
+
/**
|
|
18051
|
+
* 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.
|
|
18052
|
+
*
|
|
18053
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/URLPattern/exec)
|
|
18054
|
+
*/
|
|
18055
|
+
exec(
|
|
18056
|
+
input?: string | URLPatternInit,
|
|
18057
|
+
baseURL?: string,
|
|
18058
|
+
): URLPatternResult | null;
|
|
18059
|
+
}
|
|
18060
|
+
export interface URLPatternInit {
|
|
18061
|
+
protocol?: string;
|
|
18062
|
+
username?: string;
|
|
18063
|
+
password?: string;
|
|
18064
|
+
hostname?: string;
|
|
18065
|
+
port?: string;
|
|
18066
|
+
pathname?: string;
|
|
18067
|
+
search?: string;
|
|
18068
|
+
hash?: string;
|
|
18069
|
+
baseURL?: string;
|
|
18070
|
+
}
|
|
18071
|
+
export interface URLPatternComponentResult {
|
|
18072
|
+
input: string;
|
|
18073
|
+
groups: Record<string, string | undefined>;
|
|
18074
|
+
}
|
|
18075
|
+
export interface URLPatternResult {
|
|
18076
|
+
inputs: (string | URLPatternInit)[];
|
|
18077
|
+
protocol: URLPatternComponentResult;
|
|
18078
|
+
username: URLPatternComponentResult;
|
|
18079
|
+
password: URLPatternComponentResult;
|
|
18080
|
+
hostname: URLPatternComponentResult;
|
|
18081
|
+
port: URLPatternComponentResult;
|
|
18082
|
+
pathname: URLPatternComponentResult;
|
|
18083
|
+
search: URLPatternComponentResult;
|
|
18084
|
+
hash: URLPatternComponentResult;
|
|
18085
|
+
}
|
|
18086
|
+
export interface URLPatternOptions {
|
|
18087
|
+
ignoreCase?: boolean;
|
|
18088
|
+
}
|
|
18075
18089
|
// Copyright (c) 2022-2023 Cloudflare, Inc.
|
|
18076
18090
|
// Licensed under the Apache 2.0 license found in the LICENSE file or at:
|
|
18077
18091
|
// https://opensource.org/licenses/Apache-2.0
|