@workers-community/workers-types 4.20250718.0 → 4.20250722.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 +17 -5
  2. package/index.ts +17 -5
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -7420,6 +7420,9 @@ type ImageDrawOptions = {
7420
7420
  bottom?: number;
7421
7421
  right?: number;
7422
7422
  };
7423
+ type ImageInputOptions = {
7424
+ encoding?: "base64";
7425
+ };
7423
7426
  type ImageOutputOptions = {
7424
7427
  format:
7425
7428
  | "image/jpeg"
@@ -7438,13 +7441,19 @@ interface ImagesBinding {
7438
7441
  * @throws {@link ImagesError} with code 9412 if input is not an image
7439
7442
  * @param stream The image bytes
7440
7443
  */
7441
- info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
7444
+ info(
7445
+ stream: ReadableStream<Uint8Array>,
7446
+ options?: ImageInputOptions,
7447
+ ): Promise<ImageInfoResponse>;
7442
7448
  /**
7443
7449
  * Begin applying a series of transformations to an image
7444
7450
  * @param stream The image bytes
7445
7451
  * @returns A transform handle
7446
7452
  */
7447
- input(stream: ReadableStream<Uint8Array>): ImageTransformer;
7453
+ input(
7454
+ stream: ReadableStream<Uint8Array>,
7455
+ options?: ImageInputOptions,
7456
+ ): ImageTransformer;
7448
7457
  }
7449
7458
  interface ImageTransformer {
7450
7459
  /**
@@ -7470,6 +7479,9 @@ interface ImageTransformer {
7470
7479
  */
7471
7480
  output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
7472
7481
  }
7482
+ type ImageTransformationOutputOptions = {
7483
+ encoding?: "base64";
7484
+ };
7473
7485
  interface ImageTransformationResult {
7474
7486
  /**
7475
7487
  * The image as a response, ready to store in cache or return to users
@@ -7482,7 +7494,7 @@ interface ImageTransformationResult {
7482
7494
  /**
7483
7495
  * The bytes of the response
7484
7496
  */
7485
- image(): ReadableStream<Uint8Array>;
7497
+ image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;
7486
7498
  }
7487
7499
  interface ImagesError extends Error {
7488
7500
  readonly code: number;
@@ -7924,7 +7936,7 @@ declare namespace TailStream {
7924
7936
  readonly type: "fetch";
7925
7937
  readonly method: string;
7926
7938
  readonly url: string;
7927
- readonly cfJson: string;
7939
+ readonly cfJson?: object;
7928
7940
  readonly headers: Header[];
7929
7941
  }
7930
7942
  interface JsRpcEventInfo {
@@ -8059,7 +8071,7 @@ declare namespace TailStream {
8059
8071
  interface Log {
8060
8072
  readonly type: "log";
8061
8073
  readonly level: "debug" | "error" | "info" | "log" | "warn";
8062
- readonly message: string;
8074
+ readonly message: object;
8063
8075
  }
8064
8076
  interface Return {
8065
8077
  readonly type: "return";
package/index.ts CHANGED
@@ -7441,6 +7441,9 @@ export type ImageDrawOptions = {
7441
7441
  bottom?: number;
7442
7442
  right?: number;
7443
7443
  };
7444
+ export type ImageInputOptions = {
7445
+ encoding?: "base64";
7446
+ };
7444
7447
  export type ImageOutputOptions = {
7445
7448
  format:
7446
7449
  | "image/jpeg"
@@ -7459,13 +7462,19 @@ export interface ImagesBinding {
7459
7462
  * @throws {@link ImagesError} with code 9412 if input is not an image
7460
7463
  * @param stream The image bytes
7461
7464
  */
7462
- info(stream: ReadableStream<Uint8Array>): Promise<ImageInfoResponse>;
7465
+ info(
7466
+ stream: ReadableStream<Uint8Array>,
7467
+ options?: ImageInputOptions,
7468
+ ): Promise<ImageInfoResponse>;
7463
7469
  /**
7464
7470
  * Begin applying a series of transformations to an image
7465
7471
  * @param stream The image bytes
7466
7472
  * @returns A transform handle
7467
7473
  */
7468
- input(stream: ReadableStream<Uint8Array>): ImageTransformer;
7474
+ input(
7475
+ stream: ReadableStream<Uint8Array>,
7476
+ options?: ImageInputOptions,
7477
+ ): ImageTransformer;
7469
7478
  }
7470
7479
  export interface ImageTransformer {
7471
7480
  /**
@@ -7491,6 +7500,9 @@ export interface ImageTransformer {
7491
7500
  */
7492
7501
  output(options: ImageOutputOptions): Promise<ImageTransformationResult>;
7493
7502
  }
7503
+ export type ImageTransformationOutputOptions = {
7504
+ encoding?: "base64";
7505
+ };
7494
7506
  export interface ImageTransformationResult {
7495
7507
  /**
7496
7508
  * The image as a response, ready to store in cache or return to users
@@ -7503,7 +7515,7 @@ export interface ImageTransformationResult {
7503
7515
  /**
7504
7516
  * The bytes of the response
7505
7517
  */
7506
- image(): ReadableStream<Uint8Array>;
7518
+ image(options?: ImageTransformationOutputOptions): ReadableStream<Uint8Array>;
7507
7519
  }
7508
7520
  export interface ImagesError extends Error {
7509
7521
  readonly code: number;
@@ -7787,7 +7799,7 @@ export declare namespace TailStream {
7787
7799
  readonly type: "fetch";
7788
7800
  readonly method: string;
7789
7801
  readonly url: string;
7790
- readonly cfJson: string;
7802
+ readonly cfJson?: object;
7791
7803
  readonly headers: Header[];
7792
7804
  }
7793
7805
  interface JsRpcEventInfo {
@@ -7922,7 +7934,7 @@ export declare namespace TailStream {
7922
7934
  interface Log {
7923
7935
  readonly type: "log";
7924
7936
  readonly level: "debug" | "error" | "info" | "log" | "warn";
7925
- readonly message: string;
7937
+ readonly message: object;
7926
7938
  }
7927
7939
  interface Return {
7928
7940
  readonly type: "return";
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.20250718.0",
10
+ "version": "4.20250722.0",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",