@cloudflare/workers-types 4.20251113.0 → 4.20251117.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.
@@ -7326,24 +7326,12 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
7326
7326
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7327
7327
  toMarkdown(): ToMarkdownService;
7328
7328
  toMarkdown(
7329
- files: {
7330
- name: string;
7331
- blob: Blob;
7332
- }[],
7333
- options?: {
7334
- gateway?: GatewayOptions;
7335
- extraHeaders?: object;
7336
- },
7329
+ files: MarkdownDocument[],
7330
+ options?: ConversionRequestOptions,
7337
7331
  ): Promise<ConversionResponse[]>;
7338
7332
  toMarkdown(
7339
- files: {
7340
- name: string;
7341
- blob: Blob;
7342
- },
7343
- options?: {
7344
- gateway?: GatewayOptions;
7345
- extraHeaders?: object;
7346
- },
7333
+ files: MarkdownDocument,
7334
+ options?: ConversionRequestOptions,
7347
7335
  ): Promise<ConversionResponse>;
7348
7336
  }
7349
7337
  type GatewayRetries = {
@@ -9554,44 +9542,63 @@ declare module "cloudflare:sockets" {
9554
9542
  ): Socket;
9555
9543
  export { _connect as connect };
9556
9544
  }
9557
- type ConversionResponse = {
9545
+ type MarkdownDocument = {
9558
9546
  name: string;
9559
- mimeType: string;
9560
- } & (
9547
+ blob: Blob;
9548
+ };
9549
+ type ConversionResponse =
9561
9550
  | {
9551
+ name: string;
9552
+ mimeType: string;
9562
9553
  format: "markdown";
9563
9554
  tokens: number;
9564
9555
  data: string;
9565
9556
  }
9566
9557
  | {
9558
+ name: string;
9559
+ mimeType: string;
9567
9560
  format: "error";
9568
9561
  error: string;
9569
- }
9570
- );
9562
+ };
9563
+ type ImageConversionOptions = {
9564
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9565
+ };
9566
+ type EmbeddedImageConversionOptions = ImageConversionOptions & {
9567
+ convert?: boolean;
9568
+ maxConvertedImages?: number;
9569
+ };
9570
+ type ConversionOptions = {
9571
+ html?: {
9572
+ images?: EmbeddedImageConversionOptions & {
9573
+ convertOGImage?: boolean;
9574
+ };
9575
+ };
9576
+ docx?: {
9577
+ images?: EmbeddedImageConversionOptions;
9578
+ };
9579
+ image?: ImageConversionOptions;
9580
+ pdf?: {
9581
+ images?: EmbeddedImageConversionOptions;
9582
+ metadata?: boolean;
9583
+ };
9584
+ };
9585
+ type ConversionRequestOptions = {
9586
+ gateway?: GatewayOptions;
9587
+ extraHeaders?: object;
9588
+ conversionOptions?: ConversionOptions;
9589
+ };
9571
9590
  type SupportedFileFormat = {
9572
9591
  mimeType: string;
9573
9592
  extension: string;
9574
9593
  };
9575
9594
  declare abstract class ToMarkdownService {
9576
9595
  transform(
9577
- files: {
9578
- name: string;
9579
- blob: Blob;
9580
- }[],
9581
- options?: {
9582
- gateway?: GatewayOptions;
9583
- extraHeaders?: object;
9584
- },
9596
+ files: MarkdownDocument[],
9597
+ options?: ConversionRequestOptions,
9585
9598
  ): Promise<ConversionResponse[]>;
9586
9599
  transform(
9587
- files: {
9588
- name: string;
9589
- blob: Blob;
9590
- },
9591
- options?: {
9592
- gateway?: GatewayOptions;
9593
- extraHeaders?: object;
9594
- },
9600
+ files: MarkdownDocument,
9601
+ options?: ConversionRequestOptions,
9595
9602
  ): Promise<ConversionResponse>;
9596
9603
  supported(): Promise<SupportedFileFormat[]>;
9597
9604
  }
@@ -7345,24 +7345,12 @@ export declare abstract class Ai<
7345
7345
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7346
7346
  toMarkdown(): ToMarkdownService;
7347
7347
  toMarkdown(
7348
- files: {
7349
- name: string;
7350
- blob: Blob;
7351
- }[],
7352
- options?: {
7353
- gateway?: GatewayOptions;
7354
- extraHeaders?: object;
7355
- },
7348
+ files: MarkdownDocument[],
7349
+ options?: ConversionRequestOptions,
7356
7350
  ): Promise<ConversionResponse[]>;
7357
7351
  toMarkdown(
7358
- files: {
7359
- name: string;
7360
- blob: Blob;
7361
- },
7362
- options?: {
7363
- gateway?: GatewayOptions;
7364
- extraHeaders?: object;
7365
- },
7352
+ files: MarkdownDocument,
7353
+ options?: ConversionRequestOptions,
7366
7354
  ): Promise<ConversionResponse>;
7367
7355
  }
7368
7356
  export type GatewayRetries = {
@@ -9519,44 +9507,63 @@ export interface SecretsStoreSecret {
9519
9507
  */
9520
9508
  get(): Promise<string>;
9521
9509
  }
9522
- export type ConversionResponse = {
9510
+ export type MarkdownDocument = {
9523
9511
  name: string;
9524
- mimeType: string;
9525
- } & (
9512
+ blob: Blob;
9513
+ };
9514
+ export type ConversionResponse =
9526
9515
  | {
9516
+ name: string;
9517
+ mimeType: string;
9527
9518
  format: "markdown";
9528
9519
  tokens: number;
9529
9520
  data: string;
9530
9521
  }
9531
9522
  | {
9523
+ name: string;
9524
+ mimeType: string;
9532
9525
  format: "error";
9533
9526
  error: string;
9534
- }
9535
- );
9527
+ };
9528
+ export type ImageConversionOptions = {
9529
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9530
+ };
9531
+ export type EmbeddedImageConversionOptions = ImageConversionOptions & {
9532
+ convert?: boolean;
9533
+ maxConvertedImages?: number;
9534
+ };
9535
+ export type ConversionOptions = {
9536
+ html?: {
9537
+ images?: EmbeddedImageConversionOptions & {
9538
+ convertOGImage?: boolean;
9539
+ };
9540
+ };
9541
+ docx?: {
9542
+ images?: EmbeddedImageConversionOptions;
9543
+ };
9544
+ image?: ImageConversionOptions;
9545
+ pdf?: {
9546
+ images?: EmbeddedImageConversionOptions;
9547
+ metadata?: boolean;
9548
+ };
9549
+ };
9550
+ export type ConversionRequestOptions = {
9551
+ gateway?: GatewayOptions;
9552
+ extraHeaders?: object;
9553
+ conversionOptions?: ConversionOptions;
9554
+ };
9536
9555
  export type SupportedFileFormat = {
9537
9556
  mimeType: string;
9538
9557
  extension: string;
9539
9558
  };
9540
9559
  export declare abstract class ToMarkdownService {
9541
9560
  transform(
9542
- files: {
9543
- name: string;
9544
- blob: Blob;
9545
- }[],
9546
- options?: {
9547
- gateway?: GatewayOptions;
9548
- extraHeaders?: object;
9549
- },
9561
+ files: MarkdownDocument[],
9562
+ options?: ConversionRequestOptions,
9550
9563
  ): Promise<ConversionResponse[]>;
9551
9564
  transform(
9552
- files: {
9553
- name: string;
9554
- blob: Blob;
9555
- },
9556
- options?: {
9557
- gateway?: GatewayOptions;
9558
- extraHeaders?: object;
9559
- },
9565
+ files: MarkdownDocument,
9566
+ options?: ConversionRequestOptions,
9560
9567
  ): Promise<ConversionResponse>;
9561
9568
  supported(): Promise<SupportedFileFormat[]>;
9562
9569
  }
@@ -7393,24 +7393,12 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
7393
7393
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7394
7394
  toMarkdown(): ToMarkdownService;
7395
7395
  toMarkdown(
7396
- files: {
7397
- name: string;
7398
- blob: Blob;
7399
- }[],
7400
- options?: {
7401
- gateway?: GatewayOptions;
7402
- extraHeaders?: object;
7403
- },
7396
+ files: MarkdownDocument[],
7397
+ options?: ConversionRequestOptions,
7404
7398
  ): Promise<ConversionResponse[]>;
7405
7399
  toMarkdown(
7406
- files: {
7407
- name: string;
7408
- blob: Blob;
7409
- },
7410
- options?: {
7411
- gateway?: GatewayOptions;
7412
- extraHeaders?: object;
7413
- },
7400
+ files: MarkdownDocument,
7401
+ options?: ConversionRequestOptions,
7414
7402
  ): Promise<ConversionResponse>;
7415
7403
  }
7416
7404
  type GatewayRetries = {
@@ -9621,44 +9609,63 @@ declare module "cloudflare:sockets" {
9621
9609
  ): Socket;
9622
9610
  export { _connect as connect };
9623
9611
  }
9624
- type ConversionResponse = {
9612
+ type MarkdownDocument = {
9625
9613
  name: string;
9626
- mimeType: string;
9627
- } & (
9614
+ blob: Blob;
9615
+ };
9616
+ type ConversionResponse =
9628
9617
  | {
9618
+ name: string;
9619
+ mimeType: string;
9629
9620
  format: "markdown";
9630
9621
  tokens: number;
9631
9622
  data: string;
9632
9623
  }
9633
9624
  | {
9625
+ name: string;
9626
+ mimeType: string;
9634
9627
  format: "error";
9635
9628
  error: string;
9636
- }
9637
- );
9629
+ };
9630
+ type ImageConversionOptions = {
9631
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9632
+ };
9633
+ type EmbeddedImageConversionOptions = ImageConversionOptions & {
9634
+ convert?: boolean;
9635
+ maxConvertedImages?: number;
9636
+ };
9637
+ type ConversionOptions = {
9638
+ html?: {
9639
+ images?: EmbeddedImageConversionOptions & {
9640
+ convertOGImage?: boolean;
9641
+ };
9642
+ };
9643
+ docx?: {
9644
+ images?: EmbeddedImageConversionOptions;
9645
+ };
9646
+ image?: ImageConversionOptions;
9647
+ pdf?: {
9648
+ images?: EmbeddedImageConversionOptions;
9649
+ metadata?: boolean;
9650
+ };
9651
+ };
9652
+ type ConversionRequestOptions = {
9653
+ gateway?: GatewayOptions;
9654
+ extraHeaders?: object;
9655
+ conversionOptions?: ConversionOptions;
9656
+ };
9638
9657
  type SupportedFileFormat = {
9639
9658
  mimeType: string;
9640
9659
  extension: string;
9641
9660
  };
9642
9661
  declare abstract class ToMarkdownService {
9643
9662
  transform(
9644
- files: {
9645
- name: string;
9646
- blob: Blob;
9647
- }[],
9648
- options?: {
9649
- gateway?: GatewayOptions;
9650
- extraHeaders?: object;
9651
- },
9663
+ files: MarkdownDocument[],
9664
+ options?: ConversionRequestOptions,
9652
9665
  ): Promise<ConversionResponse[]>;
9653
9666
  transform(
9654
- files: {
9655
- name: string;
9656
- blob: Blob;
9657
- },
9658
- options?: {
9659
- gateway?: GatewayOptions;
9660
- extraHeaders?: object;
9661
- },
9667
+ files: MarkdownDocument,
9668
+ options?: ConversionRequestOptions,
9662
9669
  ): Promise<ConversionResponse>;
9663
9670
  supported(): Promise<SupportedFileFormat[]>;
9664
9671
  }
@@ -7412,24 +7412,12 @@ export declare abstract class Ai<
7412
7412
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7413
7413
  toMarkdown(): ToMarkdownService;
7414
7414
  toMarkdown(
7415
- files: {
7416
- name: string;
7417
- blob: Blob;
7418
- }[],
7419
- options?: {
7420
- gateway?: GatewayOptions;
7421
- extraHeaders?: object;
7422
- },
7415
+ files: MarkdownDocument[],
7416
+ options?: ConversionRequestOptions,
7423
7417
  ): Promise<ConversionResponse[]>;
7424
7418
  toMarkdown(
7425
- files: {
7426
- name: string;
7427
- blob: Blob;
7428
- },
7429
- options?: {
7430
- gateway?: GatewayOptions;
7431
- extraHeaders?: object;
7432
- },
7419
+ files: MarkdownDocument,
7420
+ options?: ConversionRequestOptions,
7433
7421
  ): Promise<ConversionResponse>;
7434
7422
  }
7435
7423
  export type GatewayRetries = {
@@ -9586,44 +9574,63 @@ export interface SecretsStoreSecret {
9586
9574
  */
9587
9575
  get(): Promise<string>;
9588
9576
  }
9589
- export type ConversionResponse = {
9577
+ export type MarkdownDocument = {
9590
9578
  name: string;
9591
- mimeType: string;
9592
- } & (
9579
+ blob: Blob;
9580
+ };
9581
+ export type ConversionResponse =
9593
9582
  | {
9583
+ name: string;
9584
+ mimeType: string;
9594
9585
  format: "markdown";
9595
9586
  tokens: number;
9596
9587
  data: string;
9597
9588
  }
9598
9589
  | {
9590
+ name: string;
9591
+ mimeType: string;
9599
9592
  format: "error";
9600
9593
  error: string;
9601
- }
9602
- );
9594
+ };
9595
+ export type ImageConversionOptions = {
9596
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9597
+ };
9598
+ export type EmbeddedImageConversionOptions = ImageConversionOptions & {
9599
+ convert?: boolean;
9600
+ maxConvertedImages?: number;
9601
+ };
9602
+ export type ConversionOptions = {
9603
+ html?: {
9604
+ images?: EmbeddedImageConversionOptions & {
9605
+ convertOGImage?: boolean;
9606
+ };
9607
+ };
9608
+ docx?: {
9609
+ images?: EmbeddedImageConversionOptions;
9610
+ };
9611
+ image?: ImageConversionOptions;
9612
+ pdf?: {
9613
+ images?: EmbeddedImageConversionOptions;
9614
+ metadata?: boolean;
9615
+ };
9616
+ };
9617
+ export type ConversionRequestOptions = {
9618
+ gateway?: GatewayOptions;
9619
+ extraHeaders?: object;
9620
+ conversionOptions?: ConversionOptions;
9621
+ };
9603
9622
  export type SupportedFileFormat = {
9604
9623
  mimeType: string;
9605
9624
  extension: string;
9606
9625
  };
9607
9626
  export declare abstract class ToMarkdownService {
9608
9627
  transform(
9609
- files: {
9610
- name: string;
9611
- blob: Blob;
9612
- }[],
9613
- options?: {
9614
- gateway?: GatewayOptions;
9615
- extraHeaders?: object;
9616
- },
9628
+ files: MarkdownDocument[],
9629
+ options?: ConversionRequestOptions,
9617
9630
  ): Promise<ConversionResponse[]>;
9618
9631
  transform(
9619
- files: {
9620
- name: string;
9621
- blob: Blob;
9622
- },
9623
- options?: {
9624
- gateway?: GatewayOptions;
9625
- extraHeaders?: object;
9626
- },
9632
+ files: MarkdownDocument,
9633
+ options?: ConversionRequestOptions,
9627
9634
  ): Promise<ConversionResponse>;
9628
9635
  supported(): Promise<SupportedFileFormat[]>;
9629
9636
  }
@@ -525,17 +525,7 @@ interface StructuredSerializeOptions {
525
525
  transfer?: any[];
526
526
  }
527
527
  declare abstract class Navigator {
528
- sendBeacon(
529
- url: string,
530
- body?:
531
- | ReadableStream
532
- | string
533
- | (ArrayBuffer | ArrayBufferView)
534
- | Blob
535
- | FormData
536
- | URLSearchParams
537
- | URLSearchParams,
538
- ): boolean;
528
+ sendBeacon(url: string, body?: BodyInit): boolean;
539
529
  readonly userAgent: string;
540
530
  readonly hardwareConcurrency: number;
541
531
  }
@@ -7411,24 +7401,12 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
7411
7401
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7412
7402
  toMarkdown(): ToMarkdownService;
7413
7403
  toMarkdown(
7414
- files: {
7415
- name: string;
7416
- blob: Blob;
7417
- }[],
7418
- options?: {
7419
- gateway?: GatewayOptions;
7420
- extraHeaders?: object;
7421
- },
7404
+ files: MarkdownDocument[],
7405
+ options?: ConversionRequestOptions,
7422
7406
  ): Promise<ConversionResponse[]>;
7423
7407
  toMarkdown(
7424
- files: {
7425
- name: string;
7426
- blob: Blob;
7427
- },
7428
- options?: {
7429
- gateway?: GatewayOptions;
7430
- extraHeaders?: object;
7431
- },
7408
+ files: MarkdownDocument,
7409
+ options?: ConversionRequestOptions,
7432
7410
  ): Promise<ConversionResponse>;
7433
7411
  }
7434
7412
  type GatewayRetries = {
@@ -9639,44 +9617,63 @@ declare module "cloudflare:sockets" {
9639
9617
  ): Socket;
9640
9618
  export { _connect as connect };
9641
9619
  }
9642
- type ConversionResponse = {
9620
+ type MarkdownDocument = {
9643
9621
  name: string;
9644
- mimeType: string;
9645
- } & (
9622
+ blob: Blob;
9623
+ };
9624
+ type ConversionResponse =
9646
9625
  | {
9626
+ name: string;
9627
+ mimeType: string;
9647
9628
  format: "markdown";
9648
9629
  tokens: number;
9649
9630
  data: string;
9650
9631
  }
9651
9632
  | {
9633
+ name: string;
9634
+ mimeType: string;
9652
9635
  format: "error";
9653
9636
  error: string;
9654
- }
9655
- );
9637
+ };
9638
+ type ImageConversionOptions = {
9639
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9640
+ };
9641
+ type EmbeddedImageConversionOptions = ImageConversionOptions & {
9642
+ convert?: boolean;
9643
+ maxConvertedImages?: number;
9644
+ };
9645
+ type ConversionOptions = {
9646
+ html?: {
9647
+ images?: EmbeddedImageConversionOptions & {
9648
+ convertOGImage?: boolean;
9649
+ };
9650
+ };
9651
+ docx?: {
9652
+ images?: EmbeddedImageConversionOptions;
9653
+ };
9654
+ image?: ImageConversionOptions;
9655
+ pdf?: {
9656
+ images?: EmbeddedImageConversionOptions;
9657
+ metadata?: boolean;
9658
+ };
9659
+ };
9660
+ type ConversionRequestOptions = {
9661
+ gateway?: GatewayOptions;
9662
+ extraHeaders?: object;
9663
+ conversionOptions?: ConversionOptions;
9664
+ };
9656
9665
  type SupportedFileFormat = {
9657
9666
  mimeType: string;
9658
9667
  extension: string;
9659
9668
  };
9660
9669
  declare abstract class ToMarkdownService {
9661
9670
  transform(
9662
- files: {
9663
- name: string;
9664
- blob: Blob;
9665
- }[],
9666
- options?: {
9667
- gateway?: GatewayOptions;
9668
- extraHeaders?: object;
9669
- },
9671
+ files: MarkdownDocument[],
9672
+ options?: ConversionRequestOptions,
9670
9673
  ): Promise<ConversionResponse[]>;
9671
9674
  transform(
9672
- files: {
9673
- name: string;
9674
- blob: Blob;
9675
- },
9676
- options?: {
9677
- gateway?: GatewayOptions;
9678
- extraHeaders?: object;
9679
- },
9675
+ files: MarkdownDocument,
9676
+ options?: ConversionRequestOptions,
9680
9677
  ): Promise<ConversionResponse>;
9681
9678
  supported(): Promise<SupportedFileFormat[]>;
9682
9679
  }