@cloudflare/workers-types 4.20240620.0 → 4.20240701.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -2986,6 +2987,53 @@ declare interface gpuGPUOrigin3DDict {
2986
2987
  y?: number;
2987
2988
  z?: number;
2988
2989
  }
2990
+ declare class EventSource {
2991
+ constructor(url: string, init?: EventSourceEventSourceInit);
2992
+ /**
2993
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
2994
+ *
2995
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
2996
+ */
2997
+ close(): void;
2998
+ /**
2999
+ * Returns the URL providing the event stream.
3000
+ *
3001
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3002
+ */
3003
+ get url(): string;
3004
+ /**
3005
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3006
+ *
3007
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3008
+ */
3009
+ get withCredentials(): boolean;
3010
+ /**
3011
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3012
+ *
3013
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3014
+ */
3015
+ get readyState(): number;
3016
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3017
+ get onopen(): any | null;
3018
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3019
+ set onopen(value: any | null);
3020
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3021
+ get onmessage(): any | null;
3022
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3023
+ set onmessage(value: any | null);
3024
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3025
+ get onerror(): any | null;
3026
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3027
+ set onerror(value: any | null);
3028
+ static readonly CONNECTING: number;
3029
+ static readonly OPEN: number;
3030
+ static readonly CLOSED: number;
3031
+ static from(stream: ReadableStream): EventSource;
3032
+ }
3033
+ declare interface EventSourceEventSourceInit {
3034
+ withCredentials?: boolean;
3035
+ fetcher?: Fetcher;
3036
+ }
2989
3037
  declare type AiImageClassificationInput = {
2990
3038
  image: number[];
2991
3039
  };
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -2991,6 +2992,53 @@ export interface gpuGPUOrigin3DDict {
2991
2992
  y?: number;
2992
2993
  z?: number;
2993
2994
  }
2995
+ export declare class EventSource {
2996
+ constructor(url: string, init?: EventSourceEventSourceInit);
2997
+ /**
2998
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
2999
+ *
3000
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3001
+ */
3002
+ close(): void;
3003
+ /**
3004
+ * Returns the URL providing the event stream.
3005
+ *
3006
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3007
+ */
3008
+ get url(): string;
3009
+ /**
3010
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3011
+ *
3012
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3013
+ */
3014
+ get withCredentials(): boolean;
3015
+ /**
3016
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3017
+ *
3018
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3019
+ */
3020
+ get readyState(): number;
3021
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3022
+ get onopen(): any | null;
3023
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3024
+ set onopen(value: any | null);
3025
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3026
+ get onmessage(): any | null;
3027
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3028
+ set onmessage(value: any | null);
3029
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3030
+ get onerror(): any | null;
3031
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3032
+ set onerror(value: any | null);
3033
+ static readonly CONNECTING: number;
3034
+ static readonly OPEN: number;
3035
+ static readonly CLOSED: number;
3036
+ static from(stream: ReadableStream): EventSource;
3037
+ }
3038
+ export interface EventSourceEventSourceInit {
3039
+ withCredentials?: boolean;
3040
+ fetcher?: Fetcher;
3041
+ }
2994
3042
  export type AiImageClassificationInput = {
2995
3043
  image: number[];
2996
3044
  };
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3012,6 +3013,53 @@ declare interface gpuGPUOrigin3DDict {
3012
3013
  y?: number;
3013
3014
  z?: number;
3014
3015
  }
3016
+ declare class EventSource {
3017
+ constructor(url: string, init?: EventSourceEventSourceInit);
3018
+ /**
3019
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3020
+ *
3021
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3022
+ */
3023
+ close(): void;
3024
+ /**
3025
+ * Returns the URL providing the event stream.
3026
+ *
3027
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3028
+ */
3029
+ get url(): string;
3030
+ /**
3031
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3032
+ *
3033
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3034
+ */
3035
+ get withCredentials(): boolean;
3036
+ /**
3037
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3038
+ *
3039
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3040
+ */
3041
+ get readyState(): number;
3042
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3043
+ get onopen(): any | null;
3044
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3045
+ set onopen(value: any | null);
3046
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3047
+ get onmessage(): any | null;
3048
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3049
+ set onmessage(value: any | null);
3050
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3051
+ get onerror(): any | null;
3052
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3053
+ set onerror(value: any | null);
3054
+ static readonly CONNECTING: number;
3055
+ static readonly OPEN: number;
3056
+ static readonly CLOSED: number;
3057
+ static from(stream: ReadableStream): EventSource;
3058
+ }
3059
+ declare interface EventSourceEventSourceInit {
3060
+ withCredentials?: boolean;
3061
+ fetcher?: Fetcher;
3062
+ }
3015
3063
  declare type AiImageClassificationInput = {
3016
3064
  image: number[];
3017
3065
  };
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3017,6 +3018,53 @@ export interface gpuGPUOrigin3DDict {
3017
3018
  y?: number;
3018
3019
  z?: number;
3019
3020
  }
3021
+ export declare class EventSource {
3022
+ constructor(url: string, init?: EventSourceEventSourceInit);
3023
+ /**
3024
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3025
+ *
3026
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3027
+ */
3028
+ close(): void;
3029
+ /**
3030
+ * Returns the URL providing the event stream.
3031
+ *
3032
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3033
+ */
3034
+ get url(): string;
3035
+ /**
3036
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3037
+ *
3038
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3039
+ */
3040
+ get withCredentials(): boolean;
3041
+ /**
3042
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3043
+ *
3044
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3045
+ */
3046
+ get readyState(): number;
3047
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3048
+ get onopen(): any | null;
3049
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3050
+ set onopen(value: any | null);
3051
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3052
+ get onmessage(): any | null;
3053
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3054
+ set onmessage(value: any | null);
3055
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3056
+ get onerror(): any | null;
3057
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3058
+ set onerror(value: any | null);
3059
+ static readonly CONNECTING: number;
3060
+ static readonly OPEN: number;
3061
+ static readonly CLOSED: number;
3062
+ static from(stream: ReadableStream): EventSource;
3063
+ }
3064
+ export interface EventSourceEventSourceInit {
3065
+ withCredentials?: boolean;
3066
+ fetcher?: Fetcher;
3067
+ }
3020
3068
  export type AiImageClassificationInput = {
3021
3069
  image: number[];
3022
3070
  };
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3038,6 +3039,53 @@ declare interface gpuGPUOrigin3DDict {
3038
3039
  y?: number;
3039
3040
  z?: number;
3040
3041
  }
3042
+ declare class EventSource {
3043
+ constructor(url: string, init?: EventSourceEventSourceInit);
3044
+ /**
3045
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3046
+ *
3047
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3048
+ */
3049
+ close(): void;
3050
+ /**
3051
+ * Returns the URL providing the event stream.
3052
+ *
3053
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3054
+ */
3055
+ get url(): string;
3056
+ /**
3057
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3058
+ *
3059
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3060
+ */
3061
+ get withCredentials(): boolean;
3062
+ /**
3063
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3064
+ *
3065
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3066
+ */
3067
+ get readyState(): number;
3068
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3069
+ get onopen(): any | null;
3070
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3071
+ set onopen(value: any | null);
3072
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3073
+ get onmessage(): any | null;
3074
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3075
+ set onmessage(value: any | null);
3076
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3077
+ get onerror(): any | null;
3078
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3079
+ set onerror(value: any | null);
3080
+ static readonly CONNECTING: number;
3081
+ static readonly OPEN: number;
3082
+ static readonly CLOSED: number;
3083
+ static from(stream: ReadableStream): EventSource;
3084
+ }
3085
+ declare interface EventSourceEventSourceInit {
3086
+ withCredentials?: boolean;
3087
+ fetcher?: Fetcher;
3088
+ }
3041
3089
  declare type AiImageClassificationInput = {
3042
3090
  image: number[];
3043
3091
  };
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3043,6 +3044,53 @@ export interface gpuGPUOrigin3DDict {
3043
3044
  y?: number;
3044
3045
  z?: number;
3045
3046
  }
3047
+ export declare class EventSource {
3048
+ constructor(url: string, init?: EventSourceEventSourceInit);
3049
+ /**
3050
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3051
+ *
3052
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3053
+ */
3054
+ close(): void;
3055
+ /**
3056
+ * Returns the URL providing the event stream.
3057
+ *
3058
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3059
+ */
3060
+ get url(): string;
3061
+ /**
3062
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3063
+ *
3064
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3065
+ */
3066
+ get withCredentials(): boolean;
3067
+ /**
3068
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3069
+ *
3070
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3071
+ */
3072
+ get readyState(): number;
3073
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3074
+ get onopen(): any | null;
3075
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3076
+ set onopen(value: any | null);
3077
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3078
+ get onmessage(): any | null;
3079
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3080
+ set onmessage(value: any | null);
3081
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3082
+ get onerror(): any | null;
3083
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3084
+ set onerror(value: any | null);
3085
+ static readonly CONNECTING: number;
3086
+ static readonly OPEN: number;
3087
+ static readonly CLOSED: number;
3088
+ static from(stream: ReadableStream): EventSource;
3089
+ }
3090
+ export interface EventSourceEventSourceInit {
3091
+ withCredentials?: boolean;
3092
+ fetcher?: Fetcher;
3093
+ }
3046
3094
  export type AiImageClassificationInput = {
3047
3095
  image: number[];
3048
3096
  };
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3039,6 +3040,53 @@ declare interface gpuGPUOrigin3DDict {
3039
3040
  y?: number;
3040
3041
  z?: number;
3041
3042
  }
3043
+ declare class EventSource {
3044
+ constructor(url: string, init?: EventSourceEventSourceInit);
3045
+ /**
3046
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3047
+ *
3048
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3049
+ */
3050
+ close(): void;
3051
+ /**
3052
+ * Returns the URL providing the event stream.
3053
+ *
3054
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3055
+ */
3056
+ get url(): string;
3057
+ /**
3058
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3059
+ *
3060
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3061
+ */
3062
+ get withCredentials(): boolean;
3063
+ /**
3064
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3065
+ *
3066
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3067
+ */
3068
+ get readyState(): number;
3069
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3070
+ get onopen(): any | null;
3071
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3072
+ set onopen(value: any | null);
3073
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3074
+ get onmessage(): any | null;
3075
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3076
+ set onmessage(value: any | null);
3077
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3078
+ get onerror(): any | null;
3079
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3080
+ set onerror(value: any | null);
3081
+ static readonly CONNECTING: number;
3082
+ static readonly OPEN: number;
3083
+ static readonly CLOSED: number;
3084
+ static from(stream: ReadableStream): EventSource;
3085
+ }
3086
+ declare interface EventSourceEventSourceInit {
3087
+ withCredentials?: boolean;
3088
+ fetcher?: Fetcher;
3089
+ }
3042
3090
  declare type AiImageClassificationInput = {
3043
3091
  image: number[];
3044
3092
  };
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3044,6 +3045,53 @@ export interface gpuGPUOrigin3DDict {
3044
3045
  y?: number;
3045
3046
  z?: number;
3046
3047
  }
3048
+ export declare class EventSource {
3049
+ constructor(url: string, init?: EventSourceEventSourceInit);
3050
+ /**
3051
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3052
+ *
3053
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3054
+ */
3055
+ close(): void;
3056
+ /**
3057
+ * Returns the URL providing the event stream.
3058
+ *
3059
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3060
+ */
3061
+ get url(): string;
3062
+ /**
3063
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3064
+ *
3065
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3066
+ */
3067
+ get withCredentials(): boolean;
3068
+ /**
3069
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3070
+ *
3071
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3072
+ */
3073
+ get readyState(): number;
3074
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3075
+ get onopen(): any | null;
3076
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3077
+ set onopen(value: any | null);
3078
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3079
+ get onmessage(): any | null;
3080
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3081
+ set onmessage(value: any | null);
3082
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3083
+ get onerror(): any | null;
3084
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3085
+ set onerror(value: any | null);
3086
+ static readonly CONNECTING: number;
3087
+ static readonly OPEN: number;
3088
+ static readonly CLOSED: number;
3089
+ static from(stream: ReadableStream): EventSource;
3090
+ }
3091
+ export interface EventSourceEventSourceInit {
3092
+ withCredentials?: boolean;
3093
+ fetcher?: Fetcher;
3094
+ }
3047
3095
  export type AiImageClassificationInput = {
3048
3096
  image: number[];
3049
3097
  };
@@ -249,6 +249,7 @@ declare interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3038,6 +3039,53 @@ declare interface gpuGPUOrigin3DDict {
3038
3039
  y?: number;
3039
3040
  z?: number;
3040
3041
  }
3042
+ declare class EventSource {
3043
+ constructor(url: string, init?: EventSourceEventSourceInit);
3044
+ /**
3045
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3046
+ *
3047
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3048
+ */
3049
+ close(): void;
3050
+ /**
3051
+ * Returns the URL providing the event stream.
3052
+ *
3053
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3054
+ */
3055
+ get url(): string;
3056
+ /**
3057
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3058
+ *
3059
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3060
+ */
3061
+ get withCredentials(): boolean;
3062
+ /**
3063
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3064
+ *
3065
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3066
+ */
3067
+ get readyState(): number;
3068
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3069
+ get onopen(): any | null;
3070
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3071
+ set onopen(value: any | null);
3072
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3073
+ get onmessage(): any | null;
3074
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3075
+ set onmessage(value: any | null);
3076
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3077
+ get onerror(): any | null;
3078
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3079
+ set onerror(value: any | null);
3080
+ static readonly CONNECTING: number;
3081
+ static readonly OPEN: number;
3082
+ static readonly CLOSED: number;
3083
+ static from(stream: ReadableStream): EventSource;
3084
+ }
3085
+ declare interface EventSourceEventSourceInit {
3086
+ withCredentials?: boolean;
3087
+ fetcher?: Fetcher;
3088
+ }
3041
3089
  declare type AiImageClassificationInput = {
3042
3090
  image: number[];
3043
3091
  };
@@ -249,6 +249,7 @@ export interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
249
249
  ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
250
250
  CountQueuingStrategy: typeof CountQueuingStrategy;
251
251
  ErrorEvent: typeof ErrorEvent;
252
+ EventSource: typeof EventSource;
252
253
  CompressionStream: typeof CompressionStream;
253
254
  DecompressionStream: typeof DecompressionStream;
254
255
  TextEncoderStream: typeof TextEncoderStream;
@@ -3043,6 +3044,53 @@ export interface gpuGPUOrigin3DDict {
3043
3044
  y?: number;
3044
3045
  z?: number;
3045
3046
  }
3047
+ export declare class EventSource {
3048
+ constructor(url: string, init?: EventSourceEventSourceInit);
3049
+ /**
3050
+ * Aborts any instances of the fetch algorithm started for this EventSource object, and sets the readyState attribute to CLOSED.
3051
+ *
3052
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/close)
3053
+ */
3054
+ close(): void;
3055
+ /**
3056
+ * Returns the URL providing the event stream.
3057
+ *
3058
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/url)
3059
+ */
3060
+ get url(): string;
3061
+ /**
3062
+ * Returns true if the credentials mode for connection requests to the URL providing the event stream is set to "include", and false otherwise.
3063
+ *
3064
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/withCredentials)
3065
+ */
3066
+ get withCredentials(): boolean;
3067
+ /**
3068
+ * Returns the state of this EventSource object's connection. It can have the values described below.
3069
+ *
3070
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/readyState)
3071
+ */
3072
+ get readyState(): number;
3073
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3074
+ get onopen(): any | null;
3075
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/open_event) */
3076
+ set onopen(value: any | null);
3077
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3078
+ get onmessage(): any | null;
3079
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/message_event) */
3080
+ set onmessage(value: any | null);
3081
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3082
+ get onerror(): any | null;
3083
+ /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventSource/error_event) */
3084
+ set onerror(value: any | null);
3085
+ static readonly CONNECTING: number;
3086
+ static readonly OPEN: number;
3087
+ static readonly CLOSED: number;
3088
+ static from(stream: ReadableStream): EventSource;
3089
+ }
3090
+ export interface EventSourceEventSourceInit {
3091
+ withCredentials?: boolean;
3092
+ fetcher?: Fetcher;
3093
+ }
3046
3094
  export type AiImageClassificationInput = {
3047
3095
  image: number[];
3048
3096
  };