@workers-community/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.
Files changed (3) hide show
  1. package/index.d.ts +45 -48
  2. package/index.ts +45 -48
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -530,17 +530,7 @@ interface StructuredSerializeOptions {
530
530
  transfer?: any[];
531
531
  }
532
532
  declare abstract class Navigator {
533
- sendBeacon(
534
- url: string,
535
- body?:
536
- | ReadableStream
537
- | string
538
- | (ArrayBuffer | ArrayBufferView)
539
- | Blob
540
- | FormData
541
- | URLSearchParams
542
- | URLSearchParams,
543
- ): boolean;
533
+ sendBeacon(url: string, body?: BodyInit): boolean;
544
534
  readonly userAgent: string;
545
535
  readonly hardwareConcurrency: number;
546
536
  }
@@ -7443,24 +7433,12 @@ declare abstract class Ai<AiModelList extends AiModelListType = AiModels> {
7443
7433
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7444
7434
  toMarkdown(): ToMarkdownService;
7445
7435
  toMarkdown(
7446
- files: {
7447
- name: string;
7448
- blob: Blob;
7449
- }[],
7450
- options?: {
7451
- gateway?: GatewayOptions;
7452
- extraHeaders?: object;
7453
- },
7436
+ files: MarkdownDocument[],
7437
+ options?: ConversionRequestOptions,
7454
7438
  ): Promise<ConversionResponse[]>;
7455
7439
  toMarkdown(
7456
- files: {
7457
- name: string;
7458
- blob: Blob;
7459
- },
7460
- options?: {
7461
- gateway?: GatewayOptions;
7462
- extraHeaders?: object;
7463
- },
7440
+ files: MarkdownDocument,
7441
+ options?: ConversionRequestOptions,
7464
7442
  ): Promise<ConversionResponse>;
7465
7443
  }
7466
7444
  type GatewayRetries = {
@@ -9671,44 +9649,63 @@ declare module "cloudflare:sockets" {
9671
9649
  ): Socket;
9672
9650
  export { _connect as connect };
9673
9651
  }
9674
- type ConversionResponse = {
9652
+ type MarkdownDocument = {
9675
9653
  name: string;
9676
- mimeType: string;
9677
- } & (
9654
+ blob: Blob;
9655
+ };
9656
+ type ConversionResponse =
9678
9657
  | {
9658
+ name: string;
9659
+ mimeType: string;
9679
9660
  format: "markdown";
9680
9661
  tokens: number;
9681
9662
  data: string;
9682
9663
  }
9683
9664
  | {
9665
+ name: string;
9666
+ mimeType: string;
9684
9667
  format: "error";
9685
9668
  error: string;
9686
- }
9687
- );
9669
+ };
9670
+ type ImageConversionOptions = {
9671
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9672
+ };
9673
+ type EmbeddedImageConversionOptions = ImageConversionOptions & {
9674
+ convert?: boolean;
9675
+ maxConvertedImages?: number;
9676
+ };
9677
+ type ConversionOptions = {
9678
+ html?: {
9679
+ images?: EmbeddedImageConversionOptions & {
9680
+ convertOGImage?: boolean;
9681
+ };
9682
+ };
9683
+ docx?: {
9684
+ images?: EmbeddedImageConversionOptions;
9685
+ };
9686
+ image?: ImageConversionOptions;
9687
+ pdf?: {
9688
+ images?: EmbeddedImageConversionOptions;
9689
+ metadata?: boolean;
9690
+ };
9691
+ };
9692
+ type ConversionRequestOptions = {
9693
+ gateway?: GatewayOptions;
9694
+ extraHeaders?: object;
9695
+ conversionOptions?: ConversionOptions;
9696
+ };
9688
9697
  type SupportedFileFormat = {
9689
9698
  mimeType: string;
9690
9699
  extension: string;
9691
9700
  };
9692
9701
  declare abstract class ToMarkdownService {
9693
9702
  transform(
9694
- files: {
9695
- name: string;
9696
- blob: Blob;
9697
- }[],
9698
- options?: {
9699
- gateway?: GatewayOptions;
9700
- extraHeaders?: object;
9701
- },
9703
+ files: MarkdownDocument[],
9704
+ options?: ConversionRequestOptions,
9702
9705
  ): Promise<ConversionResponse[]>;
9703
9706
  transform(
9704
- files: {
9705
- name: string;
9706
- blob: Blob;
9707
- },
9708
- options?: {
9709
- gateway?: GatewayOptions;
9710
- extraHeaders?: object;
9711
- },
9707
+ files: MarkdownDocument,
9708
+ options?: ConversionRequestOptions,
9712
9709
  ): Promise<ConversionResponse>;
9713
9710
  supported(): Promise<SupportedFileFormat[]>;
9714
9711
  }
package/index.ts CHANGED
@@ -535,17 +535,7 @@ export interface StructuredSerializeOptions {
535
535
  transfer?: any[];
536
536
  }
537
537
  export declare abstract class Navigator {
538
- sendBeacon(
539
- url: string,
540
- body?:
541
- | ReadableStream
542
- | string
543
- | (ArrayBuffer | ArrayBufferView)
544
- | Blob
545
- | FormData
546
- | URLSearchParams
547
- | URLSearchParams,
548
- ): boolean;
538
+ sendBeacon(url: string, body?: BodyInit): boolean;
549
539
  readonly userAgent: string;
550
540
  readonly hardwareConcurrency: number;
551
541
  }
@@ -7462,24 +7452,12 @@ export declare abstract class Ai<
7462
7452
  models(params?: AiModelsSearchParams): Promise<AiModelsSearchObject[]>;
7463
7453
  toMarkdown(): ToMarkdownService;
7464
7454
  toMarkdown(
7465
- files: {
7466
- name: string;
7467
- blob: Blob;
7468
- }[],
7469
- options?: {
7470
- gateway?: GatewayOptions;
7471
- extraHeaders?: object;
7472
- },
7455
+ files: MarkdownDocument[],
7456
+ options?: ConversionRequestOptions,
7473
7457
  ): Promise<ConversionResponse[]>;
7474
7458
  toMarkdown(
7475
- files: {
7476
- name: string;
7477
- blob: Blob;
7478
- },
7479
- options?: {
7480
- gateway?: GatewayOptions;
7481
- extraHeaders?: object;
7482
- },
7459
+ files: MarkdownDocument,
7460
+ options?: ConversionRequestOptions,
7483
7461
  ): Promise<ConversionResponse>;
7484
7462
  }
7485
7463
  export type GatewayRetries = {
@@ -9636,44 +9614,63 @@ export interface SecretsStoreSecret {
9636
9614
  */
9637
9615
  get(): Promise<string>;
9638
9616
  }
9639
- export type ConversionResponse = {
9617
+ export type MarkdownDocument = {
9640
9618
  name: string;
9641
- mimeType: string;
9642
- } & (
9619
+ blob: Blob;
9620
+ };
9621
+ export type ConversionResponse =
9643
9622
  | {
9623
+ name: string;
9624
+ mimeType: string;
9644
9625
  format: "markdown";
9645
9626
  tokens: number;
9646
9627
  data: string;
9647
9628
  }
9648
9629
  | {
9630
+ name: string;
9631
+ mimeType: string;
9649
9632
  format: "error";
9650
9633
  error: string;
9651
- }
9652
- );
9634
+ };
9635
+ export type ImageConversionOptions = {
9636
+ descriptionLanguage?: "en" | "es" | "fr" | "it" | "pt" | "de";
9637
+ };
9638
+ export type EmbeddedImageConversionOptions = ImageConversionOptions & {
9639
+ convert?: boolean;
9640
+ maxConvertedImages?: number;
9641
+ };
9642
+ export type ConversionOptions = {
9643
+ html?: {
9644
+ images?: EmbeddedImageConversionOptions & {
9645
+ convertOGImage?: boolean;
9646
+ };
9647
+ };
9648
+ docx?: {
9649
+ images?: EmbeddedImageConversionOptions;
9650
+ };
9651
+ image?: ImageConversionOptions;
9652
+ pdf?: {
9653
+ images?: EmbeddedImageConversionOptions;
9654
+ metadata?: boolean;
9655
+ };
9656
+ };
9657
+ export type ConversionRequestOptions = {
9658
+ gateway?: GatewayOptions;
9659
+ extraHeaders?: object;
9660
+ conversionOptions?: ConversionOptions;
9661
+ };
9653
9662
  export type SupportedFileFormat = {
9654
9663
  mimeType: string;
9655
9664
  extension: string;
9656
9665
  };
9657
9666
  export declare abstract class ToMarkdownService {
9658
9667
  transform(
9659
- files: {
9660
- name: string;
9661
- blob: Blob;
9662
- }[],
9663
- options?: {
9664
- gateway?: GatewayOptions;
9665
- extraHeaders?: object;
9666
- },
9668
+ files: MarkdownDocument[],
9669
+ options?: ConversionRequestOptions,
9667
9670
  ): Promise<ConversionResponse[]>;
9668
9671
  transform(
9669
- files: {
9670
- name: string;
9671
- blob: Blob;
9672
- },
9673
- options?: {
9674
- gateway?: GatewayOptions;
9675
- extraHeaders?: object;
9676
- },
9672
+ files: MarkdownDocument,
9673
+ options?: ConversionRequestOptions,
9677
9674
  ): Promise<ConversionResponse>;
9678
9675
  supported(): Promise<SupportedFileFormat[]>;
9679
9676
  }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20251113.0",
10
+ "version": "4.20251117.0",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",