@cloudflare/workers-types 4.20250402.0 → 4.20250404.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.
@@ -1253,7 +1253,7 @@ declare class DigestStream extends WritableStream<
1253
1253
  ArrayBuffer | ArrayBufferView
1254
1254
  > {
1255
1255
  constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1256
- readonly digest: Promise<ArrayBuffer | ArrayBufferView>;
1256
+ readonly digest: Promise<ArrayBuffer>;
1257
1257
  get bytesWritten(): number | bigint;
1258
1258
  }
1259
1259
  /**
@@ -1262,7 +1262,7 @@ declare class DigestStream extends WritableStream<
1262
1262
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1263
1263
  */
1264
1264
  declare class TextDecoder {
1265
- constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1265
+ constructor(label?: string, options?: TextDecoderConstructorOptions);
1266
1266
  /**
1267
1267
  * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1268
1268
  *
@@ -3072,7 +3072,7 @@ interface GPUCommandEncoder {
3072
3072
  destinationOffset: number | bigint,
3073
3073
  size: number | bigint,
3074
3074
  ): void;
3075
- finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
3075
+ finish(param1?: GPUCommandBufferDescriptor): GPUCommandBuffer;
3076
3076
  copyTextureToBuffer(
3077
3077
  source: GPUImageCopyTexture,
3078
3078
  destination: GPUImageCopyBuffer,
@@ -3491,6 +3491,28 @@ declare abstract class BaseAiImageToText {
3491
3491
  inputs: AiImageToTextInput;
3492
3492
  postProcessedOutputs: AiImageToTextOutput;
3493
3493
  }
3494
+ type AiImageTextToTextInput = {
3495
+ image: string;
3496
+ prompt?: string;
3497
+ max_tokens?: number;
3498
+ temperature?: number;
3499
+ ignore_eos?: boolean;
3500
+ top_p?: number;
3501
+ top_k?: number;
3502
+ seed?: number;
3503
+ repetition_penalty?: number;
3504
+ frequency_penalty?: number;
3505
+ presence_penalty?: number;
3506
+ raw?: boolean;
3507
+ messages?: RoleScopedChatInput[];
3508
+ };
3509
+ type AiImageTextToTextOutput = {
3510
+ description: string;
3511
+ };
3512
+ declare abstract class BaseAiImageTextToText {
3513
+ inputs: AiImageTextToTextInput;
3514
+ postProcessedOutputs: AiImageTextToTextOutput;
3515
+ }
3494
3516
  type AiObjectDetectionInput = {
3495
3517
  image: number[];
3496
3518
  };
@@ -3901,6 +3923,72 @@ declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3901
3923
  inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3902
3924
  postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3903
3925
  }
3926
+ type Ai_Cf_Baai_Bge_M3_Input = BGEM3InputQueryAndContexts | BGEM3InputEmbedding;
3927
+ interface BGEM3InputQueryAndContexts {
3928
+ /**
3929
+ * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3930
+ */
3931
+ query?: string;
3932
+ /**
3933
+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3934
+ */
3935
+ contexts: {
3936
+ /**
3937
+ * One of the provided context content
3938
+ */
3939
+ text?: string;
3940
+ }[];
3941
+ /**
3942
+ * When provided with too long context should the model error out or truncate the context to fit?
3943
+ */
3944
+ truncate_inputs?: boolean;
3945
+ }
3946
+ interface BGEM3InputEmbedding {
3947
+ text: string | string[];
3948
+ /**
3949
+ * When provided with too long context should the model error out or truncate the context to fit?
3950
+ */
3951
+ truncate_inputs?: boolean;
3952
+ }
3953
+ type Ai_Cf_Baai_Bge_M3_Output =
3954
+ | BGEM3OuputQuery
3955
+ | BGEM3OutputEmbeddingForContexts
3956
+ | BGEM3OuputEmbedding;
3957
+ interface BGEM3OuputQuery {
3958
+ response?: {
3959
+ /**
3960
+ * Index of the context in the request
3961
+ */
3962
+ id?: number;
3963
+ /**
3964
+ * Score of the context under the index.
3965
+ */
3966
+ score?: number;
3967
+ }[];
3968
+ }
3969
+ interface BGEM3OutputEmbeddingForContexts {
3970
+ response?: number[][];
3971
+ shape?: number[];
3972
+ /**
3973
+ * The pooling method used in the embedding process.
3974
+ */
3975
+ pooling?: "mean" | "cls";
3976
+ }
3977
+ interface BGEM3OuputEmbedding {
3978
+ shape?: number[];
3979
+ /**
3980
+ * Embeddings of the requested text values
3981
+ */
3982
+ data?: number[][];
3983
+ /**
3984
+ * The pooling method used in the embedding process.
3985
+ */
3986
+ pooling?: "mean" | "cls";
3987
+ }
3988
+ declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
3989
+ inputs: Ai_Cf_Baai_Bge_M3_Input;
3990
+ postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;
3991
+ }
3904
3992
  interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3905
3993
  /**
3906
3994
  * A text description of the image you want to generate.
@@ -4211,6 +4299,40 @@ declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
4211
4299
  inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;
4212
4300
  postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;
4213
4301
  }
4302
+ interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4303
+ /**
4304
+ * A query you wish to perform against the provided contexts.
4305
+ */
4306
+ /**
4307
+ * Number of returned results starting with the best score.
4308
+ */
4309
+ top_k?: number;
4310
+ /**
4311
+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
4312
+ */
4313
+ contexts: {
4314
+ /**
4315
+ * One of the provided context content
4316
+ */
4317
+ text?: string;
4318
+ }[];
4319
+ }
4320
+ interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
4321
+ response?: {
4322
+ /**
4323
+ * Index of the context in the request
4324
+ */
4325
+ id?: number;
4326
+ /**
4327
+ * Score of the context under the index.
4328
+ */
4329
+ score?: number;
4330
+ }[];
4331
+ }
4332
+ declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
4333
+ inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
4334
+ postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
4335
+ }
4214
4336
  interface AiModels {
4215
4337
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
4216
4338
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -4218,6 +4340,7 @@ interface AiModels {
4218
4340
  "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
4219
4341
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
4220
4342
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
4343
+ "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
4221
4344
  "@cf/baai/bge-base-en-v1.5": BaseAiTextEmbeddings;
4222
4345
  "@cf/baai/bge-small-en-v1.5": BaseAiTextEmbeddings;
4223
4346
  "@cf/baai/bge-large-en-v1.5": BaseAiTextEmbeddings;
@@ -4271,9 +4394,11 @@ interface AiModels {
4271
4394
  "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
4272
4395
  "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
4273
4396
  "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
4397
+ "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
4274
4398
  "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
4275
4399
  "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
4276
4400
  "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
4401
+ "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
4277
4402
  }
4278
4403
  type AiOptions = {
4279
4404
  gateway?: GatewayOptions;
@@ -4331,8 +4456,8 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
4331
4456
  ? Response
4332
4457
  : AiModelList[Name]["postProcessedOutputs"]
4333
4458
  >;
4334
- public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
4335
- public toMarkdown(
4459
+ models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
4460
+ toMarkdown(
4336
4461
  files: {
4337
4462
  name: string;
4338
4463
  blob: Blob;
@@ -4342,7 +4467,7 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
4342
4467
  extraHeaders?: object;
4343
4468
  },
4344
4469
  ): Promise<ConversionResponse[]>;
4345
- public toMarkdown(
4470
+ toMarkdown(
4346
4471
  files: {
4347
4472
  name: string;
4348
4473
  blob: Blob;
@@ -6022,19 +6147,7 @@ declare namespace Rpc {
6022
6147
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
6023
6148
  type Serializable<T> =
6024
6149
  // Structured cloneables
6025
- | void
6026
- | undefined
6027
- | null
6028
- | boolean
6029
- | number
6030
- | bigint
6031
- | string
6032
- | TypedArray
6033
- | ArrayBuffer
6034
- | DataView
6035
- | Date
6036
- | Error
6037
- | RegExp
6150
+ | BaseType
6038
6151
  // Structured cloneable composites
6039
6152
  | Map<
6040
6153
  T extends Map<infer U, unknown> ? Serializable<U> : never,
@@ -6046,11 +6159,6 @@ declare namespace Rpc {
6046
6159
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
6047
6160
  }
6048
6161
  // Special types
6049
- | ReadableStream<Uint8Array>
6050
- | WritableStream<Uint8Array>
6051
- | Request
6052
- | Response
6053
- | Headers
6054
6162
  | Stub<Stubable>
6055
6163
  // Serialized as stubs, see `Stubify`
6056
6164
  | Stubable;
@@ -6061,6 +6169,26 @@ declare namespace Rpc {
6061
6169
  dup(): this;
6062
6170
  }
6063
6171
  export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
6172
+ // This represents all the types that can be sent as-is over an RPC boundary
6173
+ type BaseType =
6174
+ | void
6175
+ | undefined
6176
+ | null
6177
+ | boolean
6178
+ | number
6179
+ | bigint
6180
+ | string
6181
+ | TypedArray
6182
+ | ArrayBuffer
6183
+ | DataView
6184
+ | Date
6185
+ | Error
6186
+ | RegExp
6187
+ | ReadableStream<Uint8Array>
6188
+ | WritableStream<Uint8Array>
6189
+ | Request
6190
+ | Response
6191
+ | Headers;
6064
6192
  // Recursively rewrite all `Stubable` types with `Stub`s
6065
6193
  type Stubify<T> = T extends Stubable
6066
6194
  ? Stub<T>
@@ -6072,13 +6200,15 @@ declare namespace Rpc {
6072
6200
  ? Array<Stubify<V>>
6073
6201
  : T extends ReadonlyArray<infer V>
6074
6202
  ? ReadonlyArray<Stubify<V>>
6075
- : T extends {
6076
- [key: string | number]: any;
6077
- }
6078
- ? {
6079
- [K in keyof T]: Stubify<T[K]>;
6080
- }
6081
- : T;
6203
+ : T extends BaseType
6204
+ ? T
6205
+ : T extends {
6206
+ [key: string | number]: any;
6207
+ }
6208
+ ? {
6209
+ [K in keyof T]: Stubify<T[K]>;
6210
+ }
6211
+ : T;
6082
6212
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
6083
6213
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
6084
6214
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -6093,13 +6223,15 @@ declare namespace Rpc {
6093
6223
  ? Array<Unstubify<V>>
6094
6224
  : T extends ReadonlyArray<infer V>
6095
6225
  ? ReadonlyArray<Unstubify<V>>
6096
- : T extends {
6097
- [key: string | number]: unknown;
6098
- }
6099
- ? {
6100
- [K in keyof T]: Unstubify<T[K]>;
6101
- }
6102
- : T;
6226
+ : T extends BaseType
6227
+ ? T
6228
+ : T extends {
6229
+ [key: string | number]: unknown;
6230
+ }
6231
+ ? {
6232
+ [K in keyof T]: Unstubify<T[K]>;
6233
+ }
6234
+ : T;
6103
6235
  type UnstubifyAll<A extends any[]> = {
6104
6236
  [I in keyof A]: Unstubify<A[I]>;
6105
6237
  };
@@ -1258,7 +1258,7 @@ export declare class DigestStream extends WritableStream<
1258
1258
  ArrayBuffer | ArrayBufferView
1259
1259
  > {
1260
1260
  constructor(algorithm: string | SubtleCryptoHashAlgorithm);
1261
- readonly digest: Promise<ArrayBuffer | ArrayBufferView>;
1261
+ readonly digest: Promise<ArrayBuffer>;
1262
1262
  get bytesWritten(): number | bigint;
1263
1263
  }
1264
1264
  /**
@@ -1267,7 +1267,7 @@ export declare class DigestStream extends WritableStream<
1267
1267
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/TextDecoder)
1268
1268
  */
1269
1269
  export declare class TextDecoder {
1270
- constructor(decoder?: string, options?: TextDecoderConstructorOptions);
1270
+ constructor(label?: string, options?: TextDecoderConstructorOptions);
1271
1271
  /**
1272
1272
  * Returns the result of running encoding's decoder. The method can be invoked zero or more times with options's stream set to true, and then once without options's stream (or set to false), to process a fragmented input. If the invocation without options's stream (or set to false) has no input, it's clearest to omit both arguments.
1273
1273
  *
@@ -3084,7 +3084,7 @@ export interface GPUCommandEncoder {
3084
3084
  destinationOffset: number | bigint,
3085
3085
  size: number | bigint,
3086
3086
  ): void;
3087
- finish(param0?: GPUCommandBufferDescriptor): GPUCommandBuffer;
3087
+ finish(param1?: GPUCommandBufferDescriptor): GPUCommandBuffer;
3088
3088
  copyTextureToBuffer(
3089
3089
  source: GPUImageCopyTexture,
3090
3090
  destination: GPUImageCopyBuffer,
@@ -3503,6 +3503,28 @@ export declare abstract class BaseAiImageToText {
3503
3503
  inputs: AiImageToTextInput;
3504
3504
  postProcessedOutputs: AiImageToTextOutput;
3505
3505
  }
3506
+ export type AiImageTextToTextInput = {
3507
+ image: string;
3508
+ prompt?: string;
3509
+ max_tokens?: number;
3510
+ temperature?: number;
3511
+ ignore_eos?: boolean;
3512
+ top_p?: number;
3513
+ top_k?: number;
3514
+ seed?: number;
3515
+ repetition_penalty?: number;
3516
+ frequency_penalty?: number;
3517
+ presence_penalty?: number;
3518
+ raw?: boolean;
3519
+ messages?: RoleScopedChatInput[];
3520
+ };
3521
+ export type AiImageTextToTextOutput = {
3522
+ description: string;
3523
+ };
3524
+ export declare abstract class BaseAiImageTextToText {
3525
+ inputs: AiImageTextToTextInput;
3526
+ postProcessedOutputs: AiImageTextToTextOutput;
3527
+ }
3506
3528
  export type AiObjectDetectionInput = {
3507
3529
  image: number[];
3508
3530
  };
@@ -3913,6 +3935,74 @@ export declare abstract class Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo {
3913
3935
  inputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Input;
3914
3936
  postProcessedOutputs: Ai_Cf_Openai_Whisper_Large_V3_Turbo_Output;
3915
3937
  }
3938
+ export type Ai_Cf_Baai_Bge_M3_Input =
3939
+ | BGEM3InputQueryAndContexts
3940
+ | BGEM3InputEmbedding;
3941
+ export interface BGEM3InputQueryAndContexts {
3942
+ /**
3943
+ * A query you wish to perform against the provided contexts. If no query is provided the model with respond with embeddings for contexts
3944
+ */
3945
+ query?: string;
3946
+ /**
3947
+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
3948
+ */
3949
+ contexts: {
3950
+ /**
3951
+ * One of the provided context content
3952
+ */
3953
+ text?: string;
3954
+ }[];
3955
+ /**
3956
+ * When provided with too long context should the model error out or truncate the context to fit?
3957
+ */
3958
+ truncate_inputs?: boolean;
3959
+ }
3960
+ export interface BGEM3InputEmbedding {
3961
+ text: string | string[];
3962
+ /**
3963
+ * When provided with too long context should the model error out or truncate the context to fit?
3964
+ */
3965
+ truncate_inputs?: boolean;
3966
+ }
3967
+ export type Ai_Cf_Baai_Bge_M3_Output =
3968
+ | BGEM3OuputQuery
3969
+ | BGEM3OutputEmbeddingForContexts
3970
+ | BGEM3OuputEmbedding;
3971
+ export interface BGEM3OuputQuery {
3972
+ response?: {
3973
+ /**
3974
+ * Index of the context in the request
3975
+ */
3976
+ id?: number;
3977
+ /**
3978
+ * Score of the context under the index.
3979
+ */
3980
+ score?: number;
3981
+ }[];
3982
+ }
3983
+ export interface BGEM3OutputEmbeddingForContexts {
3984
+ response?: number[][];
3985
+ shape?: number[];
3986
+ /**
3987
+ * The pooling method used in the embedding process.
3988
+ */
3989
+ pooling?: "mean" | "cls";
3990
+ }
3991
+ export interface BGEM3OuputEmbedding {
3992
+ shape?: number[];
3993
+ /**
3994
+ * Embeddings of the requested text values
3995
+ */
3996
+ data?: number[][];
3997
+ /**
3998
+ * The pooling method used in the embedding process.
3999
+ */
4000
+ pooling?: "mean" | "cls";
4001
+ }
4002
+ export declare abstract class Base_Ai_Cf_Baai_Bge_M3 {
4003
+ inputs: Ai_Cf_Baai_Bge_M3_Input;
4004
+ postProcessedOutputs: Ai_Cf_Baai_Bge_M3_Output;
4005
+ }
3916
4006
  export interface Ai_Cf_Black_Forest_Labs_Flux_1_Schnell_Input {
3917
4007
  /**
3918
4008
  * A text description of the image you want to generate.
@@ -4223,6 +4313,40 @@ export declare abstract class Base_Ai_Cf_Meta_Llama_Guard_3_8B {
4223
4313
  inputs: Ai_Cf_Meta_Llama_Guard_3_8B_Input;
4224
4314
  postProcessedOutputs: Ai_Cf_Meta_Llama_Guard_3_8B_Output;
4225
4315
  }
4316
+ export interface Ai_Cf_Baai_Bge_Reranker_Base_Input {
4317
+ /**
4318
+ * A query you wish to perform against the provided contexts.
4319
+ */
4320
+ /**
4321
+ * Number of returned results starting with the best score.
4322
+ */
4323
+ top_k?: number;
4324
+ /**
4325
+ * List of provided contexts. Note that the index in this array is important, as the response will refer to it.
4326
+ */
4327
+ contexts: {
4328
+ /**
4329
+ * One of the provided context content
4330
+ */
4331
+ text?: string;
4332
+ }[];
4333
+ }
4334
+ export interface Ai_Cf_Baai_Bge_Reranker_Base_Output {
4335
+ response?: {
4336
+ /**
4337
+ * Index of the context in the request
4338
+ */
4339
+ id?: number;
4340
+ /**
4341
+ * Score of the context under the index.
4342
+ */
4343
+ score?: number;
4344
+ }[];
4345
+ }
4346
+ export declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
4347
+ inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
4348
+ postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
4349
+ }
4226
4350
  export interface AiModels {
4227
4351
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
4228
4352
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -4230,6 +4354,7 @@ export interface AiModels {
4230
4354
  "@cf/runwayml/stable-diffusion-v1-5-img2img": BaseAiTextToImage;
4231
4355
  "@cf/lykon/dreamshaper-8-lcm": BaseAiTextToImage;
4232
4356
  "@cf/bytedance/stable-diffusion-xl-lightning": BaseAiTextToImage;
4357
+ "@cf/myshell-ai/melotts": BaseAiTextToSpeech;
4233
4358
  "@cf/baai/bge-base-en-v1.5": BaseAiTextEmbeddings;
4234
4359
  "@cf/baai/bge-small-en-v1.5": BaseAiTextEmbeddings;
4235
4360
  "@cf/baai/bge-large-en-v1.5": BaseAiTextEmbeddings;
@@ -4283,9 +4408,11 @@ export interface AiModels {
4283
4408
  "@cf/unum/uform-gen2-qwen-500m": Base_Ai_Cf_Unum_Uform_Gen2_Qwen_500M;
4284
4409
  "@cf/openai/whisper-tiny-en": Base_Ai_Cf_Openai_Whisper_Tiny_En;
4285
4410
  "@cf/openai/whisper-large-v3-turbo": Base_Ai_Cf_Openai_Whisper_Large_V3_Turbo;
4411
+ "@cf/baai/bge-m3": Base_Ai_Cf_Baai_Bge_M3;
4286
4412
  "@cf/black-forest-labs/flux-1-schnell": Base_Ai_Cf_Black_Forest_Labs_Flux_1_Schnell;
4287
4413
  "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
4288
4414
  "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
4415
+ "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
4289
4416
  }
4290
4417
  export type AiOptions = {
4291
4418
  gateway?: GatewayOptions;
@@ -4345,8 +4472,8 @@ export declare abstract class Ai<
4345
4472
  ? Response
4346
4473
  : AiModelList[Name]["postProcessedOutputs"]
4347
4474
  >;
4348
- public models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
4349
- public toMarkdown(
4475
+ models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
4476
+ toMarkdown(
4350
4477
  files: {
4351
4478
  name: string;
4352
4479
  blob: Blob;
@@ -4356,7 +4483,7 @@ export declare abstract class Ai<
4356
4483
  extraHeaders?: object;
4357
4484
  },
4358
4485
  ): Promise<ConversionResponse[]>;
4359
- public toMarkdown(
4486
+ toMarkdown(
4360
4487
  files: {
4361
4488
  name: string;
4362
4489
  blob: Blob;
@@ -6003,19 +6130,7 @@ export declare namespace Rpc {
6003
6130
  // serializable check as well. Otherwise, only types defined with the "type" keyword would pass.
6004
6131
  type Serializable<T> =
6005
6132
  // Structured cloneables
6006
- | void
6007
- | undefined
6008
- | null
6009
- | boolean
6010
- | number
6011
- | bigint
6012
- | string
6013
- | TypedArray
6014
- | ArrayBuffer
6015
- | DataView
6016
- | Date
6017
- | Error
6018
- | RegExp
6133
+ | BaseType
6019
6134
  // Structured cloneable composites
6020
6135
  | Map<
6021
6136
  T extends Map<infer U, unknown> ? Serializable<U> : never,
@@ -6027,11 +6142,6 @@ export declare namespace Rpc {
6027
6142
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
6028
6143
  }
6029
6144
  // Special types
6030
- | ReadableStream<Uint8Array>
6031
- | WritableStream<Uint8Array>
6032
- | Request
6033
- | Response
6034
- | Headers
6035
6145
  | Stub<Stubable>
6036
6146
  // Serialized as stubs, see `Stubify`
6037
6147
  | Stubable;
@@ -6042,6 +6152,26 @@ export declare namespace Rpc {
6042
6152
  dup(): this;
6043
6153
  }
6044
6154
  export type Stub<T extends Stubable> = Provider<T> & StubBase<T>;
6155
+ // This represents all the types that can be sent as-is over an RPC boundary
6156
+ type BaseType =
6157
+ | void
6158
+ | undefined
6159
+ | null
6160
+ | boolean
6161
+ | number
6162
+ | bigint
6163
+ | string
6164
+ | TypedArray
6165
+ | ArrayBuffer
6166
+ | DataView
6167
+ | Date
6168
+ | Error
6169
+ | RegExp
6170
+ | ReadableStream<Uint8Array>
6171
+ | WritableStream<Uint8Array>
6172
+ | Request
6173
+ | Response
6174
+ | Headers;
6045
6175
  // Recursively rewrite all `Stubable` types with `Stub`s
6046
6176
  type Stubify<T> = T extends Stubable
6047
6177
  ? Stub<T>
@@ -6053,13 +6183,15 @@ export declare namespace Rpc {
6053
6183
  ? Array<Stubify<V>>
6054
6184
  : T extends ReadonlyArray<infer V>
6055
6185
  ? ReadonlyArray<Stubify<V>>
6056
- : T extends {
6057
- [key: string | number]: any;
6058
- }
6059
- ? {
6060
- [K in keyof T]: Stubify<T[K]>;
6061
- }
6062
- : T;
6186
+ : T extends BaseType
6187
+ ? T
6188
+ : T extends {
6189
+ [key: string | number]: any;
6190
+ }
6191
+ ? {
6192
+ [K in keyof T]: Stubify<T[K]>;
6193
+ }
6194
+ : T;
6063
6195
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
6064
6196
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
6065
6197
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -6074,13 +6206,15 @@ export declare namespace Rpc {
6074
6206
  ? Array<Unstubify<V>>
6075
6207
  : T extends ReadonlyArray<infer V>
6076
6208
  ? ReadonlyArray<Unstubify<V>>
6077
- : T extends {
6078
- [key: string | number]: unknown;
6079
- }
6080
- ? {
6081
- [K in keyof T]: Unstubify<T[K]>;
6082
- }
6083
- : T;
6209
+ : T extends BaseType
6210
+ ? T
6211
+ : T extends {
6212
+ [key: string | number]: unknown;
6213
+ }
6214
+ ? {
6215
+ [K in keyof T]: Unstubify<T[K]>;
6216
+ }
6217
+ : T;
6084
6218
  type UnstubifyAll<A extends any[]> = {
6085
6219
  [I in keyof A]: Unstubify<A[I]>;
6086
6220
  };