@cloudflare/workers-types 5.20260819.1 → 5.20260820.1

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.
@@ -12710,10 +12710,30 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
12710
12710
  /** When true, exclude links pointing to external domains. @default false */
12711
12711
  excludeExternalLinks?: boolean;
12712
12712
  };
12713
+ type BrowserRunSnapshotFormat =
12714
+ "content" | "screenshot" | "markdown" | "accessibilityTree";
12713
12715
  type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
12716
+ /** Which representations of the page to return. At least two distinct formats
12717
+ * are required; request a single format from its dedicated action instead.
12718
+ * @default ["content","screenshot"]
12719
+ */
12720
+ formats?: BrowserRunSnapshotFormat[];
12714
12721
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12715
12722
  screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12716
12723
  };
12724
+ /** Options for the `accessibilityTree` quick action. */
12725
+ type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12726
+ /** When true, prune nodes that carry no semantic meaning, such as generic
12727
+ * containers. Defaults to true, or to false when `root` is set so that the
12728
+ * requested subtree is returned as-is.
12729
+ */
12730
+ interestingOnly?: boolean;
12731
+ /** CSS selector limiting the tree to the matching element's subtree.
12732
+ * A selector that matches nothing yields `accessibilityTree: null` with
12733
+ * HTTP 200; a malformed selector is an error.
12734
+ */
12735
+ root?: string;
12736
+ };
12717
12737
  interface BrowserRunJsonBaseOptions {
12718
12738
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12719
12739
  custom_ai?: Array<{
@@ -12751,6 +12771,58 @@ type BrowserRunResponseMeta = {
12751
12771
  /** Page title */
12752
12772
  title: string;
12753
12773
  };
12774
+ /**
12775
+ * A node in the page's accessibility tree, as exposed to assistive technology.
12776
+ * `role` is the only field always present; the rest are populated when the
12777
+ * underlying element defines them.
12778
+ * @see https://pptr.dev/api/puppeteer.serializedaxnode
12779
+ */
12780
+ interface BrowserRunSerializedAXNode {
12781
+ /** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
12782
+ role: string;
12783
+ /** The `aria-autocomplete` value. */
12784
+ autocomplete?: string;
12785
+ /** Checked state of a checkbox, radio, or menu item. */
12786
+ checked?: boolean | "mixed";
12787
+ /** Accessible description, typically from `aria-describedby` or `title`. */
12788
+ description?: string;
12789
+ disabled?: boolean;
12790
+ expanded?: boolean;
12791
+ /** Whether the element currently holds keyboard focus. */
12792
+ focused?: boolean;
12793
+ /** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
12794
+ haspopup?: string;
12795
+ /** The `aria-invalid` value. */
12796
+ invalid?: string;
12797
+ /** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
12798
+ keyshortcuts?: string;
12799
+ /** Hierarchical level, e.g. the heading level of an `<h2>`. */
12800
+ level?: number;
12801
+ /** Whether the element is a modal dialog. */
12802
+ modal?: boolean;
12803
+ /** Whether a text input accepts multiple lines. */
12804
+ multiline?: boolean;
12805
+ /** Whether more than one option can be selected. */
12806
+ multiselectable?: boolean;
12807
+ /** Accessible name, e.g. a button's label or an image's alt text. */
12808
+ name?: string;
12809
+ orientation?: string;
12810
+ /** Pressed state of a toggle button. */
12811
+ pressed?: boolean | "mixed";
12812
+ readonly?: boolean;
12813
+ required?: boolean;
12814
+ /** Author-supplied role description, from `aria-roledescription`. */
12815
+ roledescription?: string;
12816
+ selected?: boolean;
12817
+ /** Current value of an input or range element. */
12818
+ value?: string | number;
12819
+ valuemax?: number;
12820
+ valuemin?: number;
12821
+ /** Human-readable form of `value`, from `aria-valuetext`. */
12822
+ valuetext?: string;
12823
+ /** Child nodes. Absent for leaf nodes. */
12824
+ children?: BrowserRunSerializedAXNode[];
12825
+ }
12754
12826
  /** Success response for `content` action. */
12755
12827
  type BrowserRunContentSuccessResponse = {
12756
12828
  success: true;
@@ -12794,14 +12866,31 @@ type BrowserRunScrapeSuccessResponse = {
12794
12866
  }>;
12795
12867
  }>;
12796
12868
  };
12797
- /** Success response for `snapshot` action. */
12869
+ /** Success response for `snapshot` action. Each field is present only when the
12870
+ * corresponding entry was requested in `formats`.
12871
+ */
12798
12872
  type BrowserRunSnapshotSuccessResponse = {
12799
12873
  success: true;
12800
12874
  result: {
12801
12875
  /** HTML content of the page. */
12802
- content: string;
12876
+ content?: string;
12803
12877
  /** Base64-encoded screenshot image. */
12804
- screenshot: string;
12878
+ screenshot?: string;
12879
+ /** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
12880
+ * page provides that metadata.
12881
+ */
12882
+ markdown?: string;
12883
+ /** Root of the page's accessibility tree. */
12884
+ accessibilityTree?: BrowserRunSerializedAXNode;
12885
+ };
12886
+ meta: BrowserRunResponseMeta;
12887
+ };
12888
+ /** Success response for `accessibilityTree` action. */
12889
+ type BrowserRunAccessibilityTreeSuccessResponse = {
12890
+ success: true;
12891
+ result: {
12892
+ /** Root of the accessibility tree, or `null` when `root` matched no element. */
12893
+ accessibilityTree: BrowserRunSerializedAXNode | null;
12805
12894
  };
12806
12895
  meta: BrowserRunResponseMeta;
12807
12896
  };
@@ -12937,9 +13026,10 @@ declare abstract class BrowserRun {
12937
13026
  options: BrowserRunLinksOptions,
12938
13027
  ): Promise<Response>;
12939
13028
  /**
12940
- * Get both the HTML content and a base64-encoded screenshot of a web page.
13029
+ * Get several representations of a web page in one request.
12941
13030
  * @param action - Must be `'snapshot'`.
12942
- * @param options - Snapshot options including screenshot settings (encoding is always base64).
13031
+ * @param options - Snapshot options including the `formats` to return and
13032
+ * screenshot settings (encoding is always base64).
12943
13033
  * @returns A `Response` containing one of:
12944
13034
  *
12945
13035
  * **Success (HTTP 200):**
@@ -12996,6 +13086,29 @@ declare abstract class BrowserRun {
12996
13086
  action: "markdown",
12997
13087
  options: BrowserRunMarkdownOptions,
12998
13088
  ): Promise<Response>;
13089
+ /**
13090
+ * Get the accessibility tree of a web page.
13091
+ * @param action - Must be `'accessibilityTree'`.
13092
+ * @param options - Options to scope the tree to a subtree and to control
13093
+ * whether semantically uninteresting nodes are pruned.
13094
+ * @returns A `Response` containing one of:
13095
+ *
13096
+ * **Success (HTTP 200):**
13097
+ * - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
13098
+ * - `result.accessibilityTree` is `null` when `root` matched no element
13099
+ *
13100
+ * **Error:**
13101
+ * - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
13102
+ * - HTTP 422 for a malformed `root` selector
13103
+ * - HTTP 500 with code `2017` or `2018` when the tree could not be built
13104
+ *
13105
+ * **Headers:**
13106
+ * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
13107
+ */
13108
+ quickAction(
13109
+ action: "accessibilityTree",
13110
+ options: BrowserRunAccessibilityTreeOptions,
13111
+ ): Promise<Response>;
12999
13112
  }
13000
13113
  /**
13001
13114
  * In addition to the properties you can set in the RequestInit dict
@@ -14667,6 +14780,27 @@ type ImageInfoResponse =
14667
14780
  width: number;
14668
14781
  height: number;
14669
14782
  };
14783
+ /**
14784
+ * Parameters for rasterizing text into an image.
14785
+ */
14786
+ type TextRasterize = {
14787
+ /** The text content to render */
14788
+ content: string;
14789
+ /** rasterization options for the text **/
14790
+ options: TextOptions;
14791
+ };
14792
+ type TextOptions = {
14793
+ /** Font configuration */
14794
+ font: {
14795
+ /** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
14796
+ url: string;
14797
+ };
14798
+ /** Font size in points (pt) */
14799
+ size?: number;
14800
+ /** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
14801
+ color?: string;
14802
+ };
14803
+ type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
14670
14804
  type ImageTransform = {
14671
14805
  width?: number;
14672
14806
  height?: number;
@@ -14778,6 +14912,9 @@ interface ImageUploadOptions {
14778
14912
  requireSignedURLs?: boolean;
14779
14913
  metadata?: Record<string, unknown>;
14780
14914
  creator?: string;
14915
+ /**
14916
+ * If 'base64', the input data will be decoded from base64 before processing
14917
+ */
14781
14918
  encoding?: "base64";
14782
14919
  }
14783
14920
  interface ImageUpdateOptions {
@@ -14785,11 +14922,41 @@ interface ImageUpdateOptions {
14785
14922
  metadata?: Record<string, unknown>;
14786
14923
  creator?: string;
14787
14924
  }
14925
+ type ImageMetadataFilterOperators = {
14926
+ eq?: string | number | boolean;
14927
+ in?: string[] | number[];
14928
+ gt?: number;
14929
+ gte?: number;
14930
+ lt?: number;
14931
+ lte?: number;
14932
+ };
14933
+ type ImageMetadataFilterValue =
14934
+ string | number | boolean | ImageMetadataFilterOperators;
14935
+ interface ImageListFilter {
14936
+ metadata?: Record<string, ImageMetadataFilterValue>;
14937
+ }
14788
14938
  interface ImageListOptions {
14789
14939
  limit?: number;
14790
14940
  cursor?: string;
14791
14941
  sortOrder?: "asc" | "desc";
14792
14942
  creator?: string;
14943
+ filter?: ImageListFilter;
14944
+ }
14945
+ interface ImageSignedUrlOptions {
14946
+ variant: string;
14947
+ expiresIn?: number;
14948
+ keyName?: string;
14949
+ }
14950
+ interface ImageDirectUploadOptions {
14951
+ id?: string;
14952
+ requireSignedURLs?: boolean;
14953
+ metadata?: Record<string, unknown>;
14954
+ creator?: string;
14955
+ expiresIn?: number;
14956
+ }
14957
+ interface ImageDirectUploadResult {
14958
+ id: string;
14959
+ uploadURL: string;
14793
14960
  }
14794
14961
  interface ImageList {
14795
14962
  images: ImageMetadata[];
@@ -14807,6 +14974,13 @@ interface ImageHandle {
14807
14974
  * @returns ReadableStream of image bytes, or null if not found
14808
14975
  */
14809
14976
  bytes(): Promise<ReadableStream<Uint8Array> | null>;
14977
+ /**
14978
+ * Generate a signed delivery URL for this hosted image.
14979
+ * @param options Signing configuration
14980
+ * @returns A signed image delivery URL
14981
+ * @throws {@link ImagesError} if signing fails
14982
+ */
14983
+ signedUrl(options: ImageSignedUrlOptions): Promise<string>;
14810
14984
  /**
14811
14985
  * Update hosted image metadata
14812
14986
  * @param options Properties to update
@@ -14845,6 +15019,16 @@ interface HostedImagesBinding {
14845
15019
  * @throws {@link ImagesError} if list fails
14846
15020
  */
14847
15021
  list(options?: ImageListOptions): Promise<ImageList>;
15022
+ /**
15023
+ * Create a Direct Creator Upload link, letting an end user upload an
15024
+ * image straight to Cloudflare without exposing an API token
15025
+ * @param options Upload link configuration
15026
+ * @returns The new image ID and the upload URL to hand to the end user
15027
+ * @throws {@link ImagesError} if creation fails
15028
+ */
15029
+ createDirectUpload(
15030
+ options?: ImageDirectUploadOptions,
15031
+ ): Promise<ImageDirectUploadResult>;
14848
15032
  }
14849
15033
  interface ImagesBinding {
14850
15034
  /**
@@ -14865,6 +15049,13 @@ interface ImagesBinding {
14865
15049
  stream: ReadableStream<Uint8Array>,
14866
15050
  options?: ImageInputOptions,
14867
15051
  ): ImageTransformer;
15052
+ /**
15053
+ * Begin applying a series of transformations to text
15054
+ * @param content string to be rendered
15055
+ * @param options font, optional color and size to use in rendering text
15056
+ * @returns A transform handle
15057
+ */
15058
+ text(content: string, options: TextOptions): ImageTransformer;
14868
15059
  /**
14869
15060
  * Access hosted images CRUD operations
14870
15061
  */
@@ -17189,6 +17380,20 @@ type WorkflowDurationLabel =
17189
17380
  type WorkflowSleepDuration =
17190
17381
  `${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
17191
17382
  type WorkflowRetentionDuration = WorkflowSleepDuration;
17383
+ /** Geographic regions supported when creating a Workflow instance.
17384
+ * Location hints are best-effort placement preferences. */
17385
+ type WorkflowInstanceLocationHint =
17386
+ | "wnam"
17387
+ | "enam"
17388
+ | "sam"
17389
+ | "weur"
17390
+ | "eeur"
17391
+ | "apac"
17392
+ | "apac-ne"
17393
+ | "apac-se"
17394
+ | "oc"
17395
+ | "afr"
17396
+ | "me";
17192
17397
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
17193
17398
  /**
17194
17399
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -17206,6 +17411,9 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
17206
17411
  successRetention?: WorkflowRetentionDuration;
17207
17412
  errorRetention?: WorkflowRetentionDuration;
17208
17413
  };
17414
+ /** A best-effort geographic placement preference for the Workflow instance.
17415
+ * See `WorkflowInstanceLocationHint` for supported regions. */
17416
+ locationHint?: WorkflowInstanceLocationHint;
17209
17417
  }
17210
17418
  type InstanceStatus = {
17211
17419
  status:
@@ -12724,10 +12724,30 @@ export type BrowserRunLinksOptions = BrowserRunCommonOptions & {
12724
12724
  /** When true, exclude links pointing to external domains. @default false */
12725
12725
  excludeExternalLinks?: boolean;
12726
12726
  };
12727
+ export type BrowserRunSnapshotFormat =
12728
+ "content" | "screenshot" | "markdown" | "accessibilityTree";
12727
12729
  export type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
12730
+ /** Which representations of the page to return. At least two distinct formats
12731
+ * are required; request a single format from its dedicated action instead.
12732
+ * @default ["content","screenshot"]
12733
+ */
12734
+ formats?: BrowserRunSnapshotFormat[];
12728
12735
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12729
12736
  screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12730
12737
  };
12738
+ /** Options for the `accessibilityTree` quick action. */
12739
+ export type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12740
+ /** When true, prune nodes that carry no semantic meaning, such as generic
12741
+ * containers. Defaults to true, or to false when `root` is set so that the
12742
+ * requested subtree is returned as-is.
12743
+ */
12744
+ interestingOnly?: boolean;
12745
+ /** CSS selector limiting the tree to the matching element's subtree.
12746
+ * A selector that matches nothing yields `accessibilityTree: null` with
12747
+ * HTTP 200; a malformed selector is an error.
12748
+ */
12749
+ root?: string;
12750
+ };
12731
12751
  export interface BrowserRunJsonBaseOptions {
12732
12752
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12733
12753
  custom_ai?: Array<{
@@ -12765,6 +12785,58 @@ export type BrowserRunResponseMeta = {
12765
12785
  /** Page title */
12766
12786
  title: string;
12767
12787
  };
12788
+ /**
12789
+ * A node in the page's accessibility tree, as exposed to assistive technology.
12790
+ * `role` is the only field always present; the rest are populated when the
12791
+ * underlying element defines them.
12792
+ * @see https://pptr.dev/api/puppeteer.serializedaxnode
12793
+ */
12794
+ export interface BrowserRunSerializedAXNode {
12795
+ /** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
12796
+ role: string;
12797
+ /** The `aria-autocomplete` value. */
12798
+ autocomplete?: string;
12799
+ /** Checked state of a checkbox, radio, or menu item. */
12800
+ checked?: boolean | "mixed";
12801
+ /** Accessible description, typically from `aria-describedby` or `title`. */
12802
+ description?: string;
12803
+ disabled?: boolean;
12804
+ expanded?: boolean;
12805
+ /** Whether the element currently holds keyboard focus. */
12806
+ focused?: boolean;
12807
+ /** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
12808
+ haspopup?: string;
12809
+ /** The `aria-invalid` value. */
12810
+ invalid?: string;
12811
+ /** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
12812
+ keyshortcuts?: string;
12813
+ /** Hierarchical level, e.g. the heading level of an `<h2>`. */
12814
+ level?: number;
12815
+ /** Whether the element is a modal dialog. */
12816
+ modal?: boolean;
12817
+ /** Whether a text input accepts multiple lines. */
12818
+ multiline?: boolean;
12819
+ /** Whether more than one option can be selected. */
12820
+ multiselectable?: boolean;
12821
+ /** Accessible name, e.g. a button's label or an image's alt text. */
12822
+ name?: string;
12823
+ orientation?: string;
12824
+ /** Pressed state of a toggle button. */
12825
+ pressed?: boolean | "mixed";
12826
+ readonly?: boolean;
12827
+ required?: boolean;
12828
+ /** Author-supplied role description, from `aria-roledescription`. */
12829
+ roledescription?: string;
12830
+ selected?: boolean;
12831
+ /** Current value of an input or range element. */
12832
+ value?: string | number;
12833
+ valuemax?: number;
12834
+ valuemin?: number;
12835
+ /** Human-readable form of `value`, from `aria-valuetext`. */
12836
+ valuetext?: string;
12837
+ /** Child nodes. Absent for leaf nodes. */
12838
+ children?: BrowserRunSerializedAXNode[];
12839
+ }
12768
12840
  /** Success response for `content` action. */
12769
12841
  export type BrowserRunContentSuccessResponse = {
12770
12842
  success: true;
@@ -12808,14 +12880,31 @@ export type BrowserRunScrapeSuccessResponse = {
12808
12880
  }>;
12809
12881
  }>;
12810
12882
  };
12811
- /** Success response for `snapshot` action. */
12883
+ /** Success response for `snapshot` action. Each field is present only when the
12884
+ * corresponding entry was requested in `formats`.
12885
+ */
12812
12886
  export type BrowserRunSnapshotSuccessResponse = {
12813
12887
  success: true;
12814
12888
  result: {
12815
12889
  /** HTML content of the page. */
12816
- content: string;
12890
+ content?: string;
12817
12891
  /** Base64-encoded screenshot image. */
12818
- screenshot: string;
12892
+ screenshot?: string;
12893
+ /** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
12894
+ * page provides that metadata.
12895
+ */
12896
+ markdown?: string;
12897
+ /** Root of the page's accessibility tree. */
12898
+ accessibilityTree?: BrowserRunSerializedAXNode;
12899
+ };
12900
+ meta: BrowserRunResponseMeta;
12901
+ };
12902
+ /** Success response for `accessibilityTree` action. */
12903
+ export type BrowserRunAccessibilityTreeSuccessResponse = {
12904
+ success: true;
12905
+ result: {
12906
+ /** Root of the accessibility tree, or `null` when `root` matched no element. */
12907
+ accessibilityTree: BrowserRunSerializedAXNode | null;
12819
12908
  };
12820
12909
  meta: BrowserRunResponseMeta;
12821
12910
  };
@@ -12951,9 +13040,10 @@ export declare abstract class BrowserRun {
12951
13040
  options: BrowserRunLinksOptions,
12952
13041
  ): Promise<Response>;
12953
13042
  /**
12954
- * Get both the HTML content and a base64-encoded screenshot of a web page.
13043
+ * Get several representations of a web page in one request.
12955
13044
  * @param action - Must be `'snapshot'`.
12956
- * @param options - Snapshot options including screenshot settings (encoding is always base64).
13045
+ * @param options - Snapshot options including the `formats` to return and
13046
+ * screenshot settings (encoding is always base64).
12957
13047
  * @returns A `Response` containing one of:
12958
13048
  *
12959
13049
  * **Success (HTTP 200):**
@@ -13010,6 +13100,29 @@ export declare abstract class BrowserRun {
13010
13100
  action: "markdown",
13011
13101
  options: BrowserRunMarkdownOptions,
13012
13102
  ): Promise<Response>;
13103
+ /**
13104
+ * Get the accessibility tree of a web page.
13105
+ * @param action - Must be `'accessibilityTree'`.
13106
+ * @param options - Options to scope the tree to a subtree and to control
13107
+ * whether semantically uninteresting nodes are pruned.
13108
+ * @returns A `Response` containing one of:
13109
+ *
13110
+ * **Success (HTTP 200):**
13111
+ * - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
13112
+ * - `result.accessibilityTree` is `null` when `root` matched no element
13113
+ *
13114
+ * **Error:**
13115
+ * - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
13116
+ * - HTTP 422 for a malformed `root` selector
13117
+ * - HTTP 500 with code `2017` or `2018` when the tree could not be built
13118
+ *
13119
+ * **Headers:**
13120
+ * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
13121
+ */
13122
+ quickAction(
13123
+ action: "accessibilityTree",
13124
+ options: BrowserRunAccessibilityTreeOptions,
13125
+ ): Promise<Response>;
13013
13126
  }
13014
13127
  /**
13015
13128
  * In addition to the properties you can set in the RequestInit dict
@@ -14684,6 +14797,27 @@ export type ImageInfoResponse =
14684
14797
  width: number;
14685
14798
  height: number;
14686
14799
  };
14800
+ /**
14801
+ * Parameters for rasterizing text into an image.
14802
+ */
14803
+ export type TextRasterize = {
14804
+ /** The text content to render */
14805
+ content: string;
14806
+ /** rasterization options for the text **/
14807
+ options: TextOptions;
14808
+ };
14809
+ export type TextOptions = {
14810
+ /** Font configuration */
14811
+ font: {
14812
+ /** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
14813
+ url: string;
14814
+ };
14815
+ /** Font size in points (pt) */
14816
+ size?: number;
14817
+ /** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
14818
+ color?: string;
14819
+ };
14820
+ export type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
14687
14821
  export type ImageTransform = {
14688
14822
  width?: number;
14689
14823
  height?: number;
@@ -14795,6 +14929,9 @@ export interface ImageUploadOptions {
14795
14929
  requireSignedURLs?: boolean;
14796
14930
  metadata?: Record<string, unknown>;
14797
14931
  creator?: string;
14932
+ /**
14933
+ * If 'base64', the input data will be decoded from base64 before processing
14934
+ */
14798
14935
  encoding?: "base64";
14799
14936
  }
14800
14937
  export interface ImageUpdateOptions {
@@ -14802,11 +14939,41 @@ export interface ImageUpdateOptions {
14802
14939
  metadata?: Record<string, unknown>;
14803
14940
  creator?: string;
14804
14941
  }
14942
+ export type ImageMetadataFilterOperators = {
14943
+ eq?: string | number | boolean;
14944
+ in?: string[] | number[];
14945
+ gt?: number;
14946
+ gte?: number;
14947
+ lt?: number;
14948
+ lte?: number;
14949
+ };
14950
+ export type ImageMetadataFilterValue =
14951
+ string | number | boolean | ImageMetadataFilterOperators;
14952
+ export interface ImageListFilter {
14953
+ metadata?: Record<string, ImageMetadataFilterValue>;
14954
+ }
14805
14955
  export interface ImageListOptions {
14806
14956
  limit?: number;
14807
14957
  cursor?: string;
14808
14958
  sortOrder?: "asc" | "desc";
14809
14959
  creator?: string;
14960
+ filter?: ImageListFilter;
14961
+ }
14962
+ export interface ImageSignedUrlOptions {
14963
+ variant: string;
14964
+ expiresIn?: number;
14965
+ keyName?: string;
14966
+ }
14967
+ export interface ImageDirectUploadOptions {
14968
+ id?: string;
14969
+ requireSignedURLs?: boolean;
14970
+ metadata?: Record<string, unknown>;
14971
+ creator?: string;
14972
+ expiresIn?: number;
14973
+ }
14974
+ export interface ImageDirectUploadResult {
14975
+ id: string;
14976
+ uploadURL: string;
14810
14977
  }
14811
14978
  export interface ImageList {
14812
14979
  images: ImageMetadata[];
@@ -14824,6 +14991,13 @@ export interface ImageHandle {
14824
14991
  * @returns ReadableStream of image bytes, or null if not found
14825
14992
  */
14826
14993
  bytes(): Promise<ReadableStream<Uint8Array> | null>;
14994
+ /**
14995
+ * Generate a signed delivery URL for this hosted image.
14996
+ * @param options Signing configuration
14997
+ * @returns A signed image delivery URL
14998
+ * @throws {@link ImagesError} if signing fails
14999
+ */
15000
+ signedUrl(options: ImageSignedUrlOptions): Promise<string>;
14827
15001
  /**
14828
15002
  * Update hosted image metadata
14829
15003
  * @param options Properties to update
@@ -14862,6 +15036,16 @@ export interface HostedImagesBinding {
14862
15036
  * @throws {@link ImagesError} if list fails
14863
15037
  */
14864
15038
  list(options?: ImageListOptions): Promise<ImageList>;
15039
+ /**
15040
+ * Create a Direct Creator Upload link, letting an end user upload an
15041
+ * image straight to Cloudflare without exposing an API token
15042
+ * @param options Upload link configuration
15043
+ * @returns The new image ID and the upload URL to hand to the end user
15044
+ * @throws {@link ImagesError} if creation fails
15045
+ */
15046
+ createDirectUpload(
15047
+ options?: ImageDirectUploadOptions,
15048
+ ): Promise<ImageDirectUploadResult>;
14865
15049
  }
14866
15050
  export interface ImagesBinding {
14867
15051
  /**
@@ -14882,6 +15066,13 @@ export interface ImagesBinding {
14882
15066
  stream: ReadableStream<Uint8Array>,
14883
15067
  options?: ImageInputOptions,
14884
15068
  ): ImageTransformer;
15069
+ /**
15070
+ * Begin applying a series of transformations to text
15071
+ * @param content string to be rendered
15072
+ * @param options font, optional color and size to use in rendering text
15073
+ * @returns A transform handle
15074
+ */
15075
+ text(content: string, options: TextOptions): ImageTransformer;
14885
15076
  /**
14886
15077
  * Access hosted images CRUD operations
14887
15078
  */
@@ -17138,6 +17329,20 @@ export type WorkflowDurationLabel =
17138
17329
  export type WorkflowSleepDuration =
17139
17330
  `${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
17140
17331
  export type WorkflowRetentionDuration = WorkflowSleepDuration;
17332
+ /** Geographic regions supported when creating a Workflow instance.
17333
+ * Location hints are best-effort placement preferences. */
17334
+ export type WorkflowInstanceLocationHint =
17335
+ | "wnam"
17336
+ | "enam"
17337
+ | "sam"
17338
+ | "weur"
17339
+ | "eeur"
17340
+ | "apac"
17341
+ | "apac-ne"
17342
+ | "apac-se"
17343
+ | "oc"
17344
+ | "afr"
17345
+ | "me";
17141
17346
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
17142
17347
  /**
17143
17348
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -17155,6 +17360,9 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
17155
17360
  successRetention?: WorkflowRetentionDuration;
17156
17361
  errorRetention?: WorkflowRetentionDuration;
17157
17362
  };
17363
+ /** A best-effort geographic placement preference for the Workflow instance.
17364
+ * See `WorkflowInstanceLocationHint` for supported regions. */
17365
+ locationHint?: WorkflowInstanceLocationHint;
17158
17366
  }
17159
17367
  export type InstanceStatus = {
17160
17368
  status:
package/index.d.ts CHANGED
@@ -12435,10 +12435,30 @@ type BrowserRunLinksOptions = BrowserRunCommonOptions & {
12435
12435
  /** When true, exclude links pointing to external domains. @default false */
12436
12436
  excludeExternalLinks?: boolean;
12437
12437
  };
12438
+ type BrowserRunSnapshotFormat =
12439
+ "content" | "screenshot" | "markdown" | "accessibilityTree";
12438
12440
  type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
12441
+ /** Which representations of the page to return. At least two distinct formats
12442
+ * are required; request a single format from its dedicated action instead.
12443
+ * @default ["content","screenshot"]
12444
+ */
12445
+ formats?: BrowserRunSnapshotFormat[];
12439
12446
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12440
12447
  screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12441
12448
  };
12449
+ /** Options for the `accessibilityTree` quick action. */
12450
+ type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12451
+ /** When true, prune nodes that carry no semantic meaning, such as generic
12452
+ * containers. Defaults to true, or to false when `root` is set so that the
12453
+ * requested subtree is returned as-is.
12454
+ */
12455
+ interestingOnly?: boolean;
12456
+ /** CSS selector limiting the tree to the matching element's subtree.
12457
+ * A selector that matches nothing yields `accessibilityTree: null` with
12458
+ * HTTP 200; a malformed selector is an error.
12459
+ */
12460
+ root?: string;
12461
+ };
12442
12462
  interface BrowserRunJsonBaseOptions {
12443
12463
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12444
12464
  custom_ai?: Array<{
@@ -12476,6 +12496,58 @@ type BrowserRunResponseMeta = {
12476
12496
  /** Page title */
12477
12497
  title: string;
12478
12498
  };
12499
+ /**
12500
+ * A node in the page's accessibility tree, as exposed to assistive technology.
12501
+ * `role` is the only field always present; the rest are populated when the
12502
+ * underlying element defines them.
12503
+ * @see https://pptr.dev/api/puppeteer.serializedaxnode
12504
+ */
12505
+ interface BrowserRunSerializedAXNode {
12506
+ /** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
12507
+ role: string;
12508
+ /** The `aria-autocomplete` value. */
12509
+ autocomplete?: string;
12510
+ /** Checked state of a checkbox, radio, or menu item. */
12511
+ checked?: boolean | "mixed";
12512
+ /** Accessible description, typically from `aria-describedby` or `title`. */
12513
+ description?: string;
12514
+ disabled?: boolean;
12515
+ expanded?: boolean;
12516
+ /** Whether the element currently holds keyboard focus. */
12517
+ focused?: boolean;
12518
+ /** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
12519
+ haspopup?: string;
12520
+ /** The `aria-invalid` value. */
12521
+ invalid?: string;
12522
+ /** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
12523
+ keyshortcuts?: string;
12524
+ /** Hierarchical level, e.g. the heading level of an `<h2>`. */
12525
+ level?: number;
12526
+ /** Whether the element is a modal dialog. */
12527
+ modal?: boolean;
12528
+ /** Whether a text input accepts multiple lines. */
12529
+ multiline?: boolean;
12530
+ /** Whether more than one option can be selected. */
12531
+ multiselectable?: boolean;
12532
+ /** Accessible name, e.g. a button's label or an image's alt text. */
12533
+ name?: string;
12534
+ orientation?: string;
12535
+ /** Pressed state of a toggle button. */
12536
+ pressed?: boolean | "mixed";
12537
+ readonly?: boolean;
12538
+ required?: boolean;
12539
+ /** Author-supplied role description, from `aria-roledescription`. */
12540
+ roledescription?: string;
12541
+ selected?: boolean;
12542
+ /** Current value of an input or range element. */
12543
+ value?: string | number;
12544
+ valuemax?: number;
12545
+ valuemin?: number;
12546
+ /** Human-readable form of `value`, from `aria-valuetext`. */
12547
+ valuetext?: string;
12548
+ /** Child nodes. Absent for leaf nodes. */
12549
+ children?: BrowserRunSerializedAXNode[];
12550
+ }
12479
12551
  /** Success response for `content` action. */
12480
12552
  type BrowserRunContentSuccessResponse = {
12481
12553
  success: true;
@@ -12519,14 +12591,31 @@ type BrowserRunScrapeSuccessResponse = {
12519
12591
  }>;
12520
12592
  }>;
12521
12593
  };
12522
- /** Success response for `snapshot` action. */
12594
+ /** Success response for `snapshot` action. Each field is present only when the
12595
+ * corresponding entry was requested in `formats`.
12596
+ */
12523
12597
  type BrowserRunSnapshotSuccessResponse = {
12524
12598
  success: true;
12525
12599
  result: {
12526
12600
  /** HTML content of the page. */
12527
- content: string;
12601
+ content?: string;
12528
12602
  /** Base64-encoded screenshot image. */
12529
- screenshot: string;
12603
+ screenshot?: string;
12604
+ /** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
12605
+ * page provides that metadata.
12606
+ */
12607
+ markdown?: string;
12608
+ /** Root of the page's accessibility tree. */
12609
+ accessibilityTree?: BrowserRunSerializedAXNode;
12610
+ };
12611
+ meta: BrowserRunResponseMeta;
12612
+ };
12613
+ /** Success response for `accessibilityTree` action. */
12614
+ type BrowserRunAccessibilityTreeSuccessResponse = {
12615
+ success: true;
12616
+ result: {
12617
+ /** Root of the accessibility tree, or `null` when `root` matched no element. */
12618
+ accessibilityTree: BrowserRunSerializedAXNode | null;
12530
12619
  };
12531
12620
  meta: BrowserRunResponseMeta;
12532
12621
  };
@@ -12662,9 +12751,10 @@ declare abstract class BrowserRun {
12662
12751
  options: BrowserRunLinksOptions,
12663
12752
  ): Promise<Response>;
12664
12753
  /**
12665
- * Get both the HTML content and a base64-encoded screenshot of a web page.
12754
+ * Get several representations of a web page in one request.
12666
12755
  * @param action - Must be `'snapshot'`.
12667
- * @param options - Snapshot options including screenshot settings (encoding is always base64).
12756
+ * @param options - Snapshot options including the `formats` to return and
12757
+ * screenshot settings (encoding is always base64).
12668
12758
  * @returns A `Response` containing one of:
12669
12759
  *
12670
12760
  * **Success (HTTP 200):**
@@ -12721,6 +12811,29 @@ declare abstract class BrowserRun {
12721
12811
  action: "markdown",
12722
12812
  options: BrowserRunMarkdownOptions,
12723
12813
  ): Promise<Response>;
12814
+ /**
12815
+ * Get the accessibility tree of a web page.
12816
+ * @param action - Must be `'accessibilityTree'`.
12817
+ * @param options - Options to scope the tree to a subtree and to control
12818
+ * whether semantically uninteresting nodes are pruned.
12819
+ * @returns A `Response` containing one of:
12820
+ *
12821
+ * **Success (HTTP 200):**
12822
+ * - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
12823
+ * - `result.accessibilityTree` is `null` when `root` matched no element
12824
+ *
12825
+ * **Error:**
12826
+ * - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
12827
+ * - HTTP 422 for a malformed `root` selector
12828
+ * - HTTP 500 with code `2017` or `2018` when the tree could not be built
12829
+ *
12830
+ * **Headers:**
12831
+ * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
12832
+ */
12833
+ quickAction(
12834
+ action: "accessibilityTree",
12835
+ options: BrowserRunAccessibilityTreeOptions,
12836
+ ): Promise<Response>;
12724
12837
  }
12725
12838
  /**
12726
12839
  * In addition to the properties you can set in the RequestInit dict
@@ -14392,6 +14505,27 @@ type ImageInfoResponse =
14392
14505
  width: number;
14393
14506
  height: number;
14394
14507
  };
14508
+ /**
14509
+ * Parameters for rasterizing text into an image.
14510
+ */
14511
+ type TextRasterize = {
14512
+ /** The text content to render */
14513
+ content: string;
14514
+ /** rasterization options for the text **/
14515
+ options: TextOptions;
14516
+ };
14517
+ type TextOptions = {
14518
+ /** Font configuration */
14519
+ font: {
14520
+ /** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
14521
+ url: string;
14522
+ };
14523
+ /** Font size in points (pt) */
14524
+ size?: number;
14525
+ /** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
14526
+ color?: string;
14527
+ };
14528
+ type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
14395
14529
  type ImageTransform = {
14396
14530
  width?: number;
14397
14531
  height?: number;
@@ -14503,6 +14637,9 @@ interface ImageUploadOptions {
14503
14637
  requireSignedURLs?: boolean;
14504
14638
  metadata?: Record<string, unknown>;
14505
14639
  creator?: string;
14640
+ /**
14641
+ * If 'base64', the input data will be decoded from base64 before processing
14642
+ */
14506
14643
  encoding?: "base64";
14507
14644
  }
14508
14645
  interface ImageUpdateOptions {
@@ -14510,11 +14647,41 @@ interface ImageUpdateOptions {
14510
14647
  metadata?: Record<string, unknown>;
14511
14648
  creator?: string;
14512
14649
  }
14650
+ type ImageMetadataFilterOperators = {
14651
+ eq?: string | number | boolean;
14652
+ in?: string[] | number[];
14653
+ gt?: number;
14654
+ gte?: number;
14655
+ lt?: number;
14656
+ lte?: number;
14657
+ };
14658
+ type ImageMetadataFilterValue =
14659
+ string | number | boolean | ImageMetadataFilterOperators;
14660
+ interface ImageListFilter {
14661
+ metadata?: Record<string, ImageMetadataFilterValue>;
14662
+ }
14513
14663
  interface ImageListOptions {
14514
14664
  limit?: number;
14515
14665
  cursor?: string;
14516
14666
  sortOrder?: "asc" | "desc";
14517
14667
  creator?: string;
14668
+ filter?: ImageListFilter;
14669
+ }
14670
+ interface ImageSignedUrlOptions {
14671
+ variant: string;
14672
+ expiresIn?: number;
14673
+ keyName?: string;
14674
+ }
14675
+ interface ImageDirectUploadOptions {
14676
+ id?: string;
14677
+ requireSignedURLs?: boolean;
14678
+ metadata?: Record<string, unknown>;
14679
+ creator?: string;
14680
+ expiresIn?: number;
14681
+ }
14682
+ interface ImageDirectUploadResult {
14683
+ id: string;
14684
+ uploadURL: string;
14518
14685
  }
14519
14686
  interface ImageList {
14520
14687
  images: ImageMetadata[];
@@ -14532,6 +14699,13 @@ interface ImageHandle {
14532
14699
  * @returns ReadableStream of image bytes, or null if not found
14533
14700
  */
14534
14701
  bytes(): Promise<ReadableStream<Uint8Array> | null>;
14702
+ /**
14703
+ * Generate a signed delivery URL for this hosted image.
14704
+ * @param options Signing configuration
14705
+ * @returns A signed image delivery URL
14706
+ * @throws {@link ImagesError} if signing fails
14707
+ */
14708
+ signedUrl(options: ImageSignedUrlOptions): Promise<string>;
14535
14709
  /**
14536
14710
  * Update hosted image metadata
14537
14711
  * @param options Properties to update
@@ -14570,6 +14744,16 @@ interface HostedImagesBinding {
14570
14744
  * @throws {@link ImagesError} if list fails
14571
14745
  */
14572
14746
  list(options?: ImageListOptions): Promise<ImageList>;
14747
+ /**
14748
+ * Create a Direct Creator Upload link, letting an end user upload an
14749
+ * image straight to Cloudflare without exposing an API token
14750
+ * @param options Upload link configuration
14751
+ * @returns The new image ID and the upload URL to hand to the end user
14752
+ * @throws {@link ImagesError} if creation fails
14753
+ */
14754
+ createDirectUpload(
14755
+ options?: ImageDirectUploadOptions,
14756
+ ): Promise<ImageDirectUploadResult>;
14573
14757
  }
14574
14758
  interface ImagesBinding {
14575
14759
  /**
@@ -14590,6 +14774,13 @@ interface ImagesBinding {
14590
14774
  stream: ReadableStream<Uint8Array>,
14591
14775
  options?: ImageInputOptions,
14592
14776
  ): ImageTransformer;
14777
+ /**
14778
+ * Begin applying a series of transformations to text
14779
+ * @param content string to be rendered
14780
+ * @param options font, optional color and size to use in rendering text
14781
+ * @returns A transform handle
14782
+ */
14783
+ text(content: string, options: TextOptions): ImageTransformer;
14593
14784
  /**
14594
14785
  * Access hosted images CRUD operations
14595
14786
  */
@@ -16914,6 +17105,20 @@ type WorkflowDurationLabel =
16914
17105
  type WorkflowSleepDuration =
16915
17106
  `${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
16916
17107
  type WorkflowRetentionDuration = WorkflowSleepDuration;
17108
+ /** Geographic regions supported when creating a Workflow instance.
17109
+ * Location hints are best-effort placement preferences. */
17110
+ type WorkflowInstanceLocationHint =
17111
+ | "wnam"
17112
+ | "enam"
17113
+ | "sam"
17114
+ | "weur"
17115
+ | "eeur"
17116
+ | "apac"
17117
+ | "apac-ne"
17118
+ | "apac-se"
17119
+ | "oc"
17120
+ | "afr"
17121
+ | "me";
16917
17122
  interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
16918
17123
  /**
16919
17124
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -16931,6 +17136,9 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
16931
17136
  successRetention?: WorkflowRetentionDuration;
16932
17137
  errorRetention?: WorkflowRetentionDuration;
16933
17138
  };
17139
+ /** A best-effort geographic placement preference for the Workflow instance.
17140
+ * See `WorkflowInstanceLocationHint` for supported regions. */
17141
+ locationHint?: WorkflowInstanceLocationHint;
16934
17142
  }
16935
17143
  type InstanceStatus = {
16936
17144
  status:
package/index.ts CHANGED
@@ -12449,10 +12449,30 @@ export type BrowserRunLinksOptions = BrowserRunCommonOptions & {
12449
12449
  /** When true, exclude links pointing to external domains. @default false */
12450
12450
  excludeExternalLinks?: boolean;
12451
12451
  };
12452
+ export type BrowserRunSnapshotFormat =
12453
+ "content" | "screenshot" | "markdown" | "accessibilityTree";
12452
12454
  export type BrowserRunSnapshotOptions = BrowserRunCommonOptions & {
12455
+ /** Which representations of the page to return. At least two distinct formats
12456
+ * are required; request a single format from its dedicated action instead.
12457
+ * @default ["content","screenshot"]
12458
+ */
12459
+ formats?: BrowserRunSnapshotFormat[];
12453
12460
  /** @see https://pptr.dev/api/puppeteer.screenshotoptions */
12454
12461
  screenshotOptions?: Omit<BrowserRunPuppeteerScreenshotOptions, "encoding">;
12455
12462
  };
12463
+ /** Options for the `accessibilityTree` quick action. */
12464
+ export type BrowserRunAccessibilityTreeOptions = BrowserRunCommonOptions & {
12465
+ /** When true, prune nodes that carry no semantic meaning, such as generic
12466
+ * containers. Defaults to true, or to false when `root` is set so that the
12467
+ * requested subtree is returned as-is.
12468
+ */
12469
+ interestingOnly?: boolean;
12470
+ /** CSS selector limiting the tree to the matching element's subtree.
12471
+ * A selector that matches nothing yields `accessibilityTree: null` with
12472
+ * HTTP 200; a malformed selector is an error.
12473
+ */
12474
+ root?: string;
12475
+ };
12456
12476
  export interface BrowserRunJsonBaseOptions {
12457
12477
  /** Custom AI models to try in order. Max 3. Falls back to next on error. */
12458
12478
  custom_ai?: Array<{
@@ -12490,6 +12510,58 @@ export type BrowserRunResponseMeta = {
12490
12510
  /** Page title */
12491
12511
  title: string;
12492
12512
  };
12513
+ /**
12514
+ * A node in the page's accessibility tree, as exposed to assistive technology.
12515
+ * `role` is the only field always present; the rest are populated when the
12516
+ * underlying element defines them.
12517
+ * @see https://pptr.dev/api/puppeteer.serializedaxnode
12518
+ */
12519
+ export interface BrowserRunSerializedAXNode {
12520
+ /** The ARIA role, e.g. `"button"`, `"heading"`, `"RootWebArea"`. */
12521
+ role: string;
12522
+ /** The `aria-autocomplete` value. */
12523
+ autocomplete?: string;
12524
+ /** Checked state of a checkbox, radio, or menu item. */
12525
+ checked?: boolean | "mixed";
12526
+ /** Accessible description, typically from `aria-describedby` or `title`. */
12527
+ description?: string;
12528
+ disabled?: boolean;
12529
+ expanded?: boolean;
12530
+ /** Whether the element currently holds keyboard focus. */
12531
+ focused?: boolean;
12532
+ /** The kind of popup the element triggers, e.g. `"menu"`, `"dialog"`. */
12533
+ haspopup?: string;
12534
+ /** The `aria-invalid` value. */
12535
+ invalid?: string;
12536
+ /** Keyboard shortcuts bound to the element, from `aria-keyshortcuts`. */
12537
+ keyshortcuts?: string;
12538
+ /** Hierarchical level, e.g. the heading level of an `<h2>`. */
12539
+ level?: number;
12540
+ /** Whether the element is a modal dialog. */
12541
+ modal?: boolean;
12542
+ /** Whether a text input accepts multiple lines. */
12543
+ multiline?: boolean;
12544
+ /** Whether more than one option can be selected. */
12545
+ multiselectable?: boolean;
12546
+ /** Accessible name, e.g. a button's label or an image's alt text. */
12547
+ name?: string;
12548
+ orientation?: string;
12549
+ /** Pressed state of a toggle button. */
12550
+ pressed?: boolean | "mixed";
12551
+ readonly?: boolean;
12552
+ required?: boolean;
12553
+ /** Author-supplied role description, from `aria-roledescription`. */
12554
+ roledescription?: string;
12555
+ selected?: boolean;
12556
+ /** Current value of an input or range element. */
12557
+ value?: string | number;
12558
+ valuemax?: number;
12559
+ valuemin?: number;
12560
+ /** Human-readable form of `value`, from `aria-valuetext`. */
12561
+ valuetext?: string;
12562
+ /** Child nodes. Absent for leaf nodes. */
12563
+ children?: BrowserRunSerializedAXNode[];
12564
+ }
12493
12565
  /** Success response for `content` action. */
12494
12566
  export type BrowserRunContentSuccessResponse = {
12495
12567
  success: true;
@@ -12533,14 +12605,31 @@ export type BrowserRunScrapeSuccessResponse = {
12533
12605
  }>;
12534
12606
  }>;
12535
12607
  };
12536
- /** Success response for `snapshot` action. */
12608
+ /** Success response for `snapshot` action. Each field is present only when the
12609
+ * corresponding entry was requested in `formats`.
12610
+ */
12537
12611
  export type BrowserRunSnapshotSuccessResponse = {
12538
12612
  success: true;
12539
12613
  result: {
12540
12614
  /** HTML content of the page. */
12541
- content: string;
12615
+ content?: string;
12542
12616
  /** Base64-encoded screenshot image. */
12543
- screenshot: string;
12617
+ screenshot?: string;
12618
+ /** Markdown content. Prefixed with YAML frontmatter (e.g. `title`) when the
12619
+ * page provides that metadata.
12620
+ */
12621
+ markdown?: string;
12622
+ /** Root of the page's accessibility tree. */
12623
+ accessibilityTree?: BrowserRunSerializedAXNode;
12624
+ };
12625
+ meta: BrowserRunResponseMeta;
12626
+ };
12627
+ /** Success response for `accessibilityTree` action. */
12628
+ export type BrowserRunAccessibilityTreeSuccessResponse = {
12629
+ success: true;
12630
+ result: {
12631
+ /** Root of the accessibility tree, or `null` when `root` matched no element. */
12632
+ accessibilityTree: BrowserRunSerializedAXNode | null;
12544
12633
  };
12545
12634
  meta: BrowserRunResponseMeta;
12546
12635
  };
@@ -12676,9 +12765,10 @@ export declare abstract class BrowserRun {
12676
12765
  options: BrowserRunLinksOptions,
12677
12766
  ): Promise<Response>;
12678
12767
  /**
12679
- * Get both the HTML content and a base64-encoded screenshot of a web page.
12768
+ * Get several representations of a web page in one request.
12680
12769
  * @param action - Must be `'snapshot'`.
12681
- * @param options - Snapshot options including screenshot settings (encoding is always base64).
12770
+ * @param options - Snapshot options including the `formats` to return and
12771
+ * screenshot settings (encoding is always base64).
12682
12772
  * @returns A `Response` containing one of:
12683
12773
  *
12684
12774
  * **Success (HTTP 200):**
@@ -12735,6 +12825,29 @@ export declare abstract class BrowserRun {
12735
12825
  action: "markdown",
12736
12826
  options: BrowserRunMarkdownOptions,
12737
12827
  ): Promise<Response>;
12828
+ /**
12829
+ * Get the accessibility tree of a web page.
12830
+ * @param action - Must be `'accessibilityTree'`.
12831
+ * @param options - Options to scope the tree to a subtree and to control
12832
+ * whether semantically uninteresting nodes are pruned.
12833
+ * @returns A `Response` containing one of:
12834
+ *
12835
+ * **Success (HTTP 200):**
12836
+ * - `BrowserRunAccessibilityTreeSuccessResponse` JSON with `Content-Type: application/json`
12837
+ * - `result.accessibilityTree` is `null` when `root` matched no element
12838
+ *
12839
+ * **Error:**
12840
+ * - `BrowserRunErrorResponse` JSON with appropriate HTTP status code (400, 422, 429, 500, 503)
12841
+ * - HTTP 422 for a malformed `root` selector
12842
+ * - HTTP 500 with code `2017` or `2018` when the tree could not be built
12843
+ *
12844
+ * **Headers:**
12845
+ * - `X-Browser-Ms-Used`: Browser time consumed in milliseconds (set when status < 500)
12846
+ */
12847
+ quickAction(
12848
+ action: "accessibilityTree",
12849
+ options: BrowserRunAccessibilityTreeOptions,
12850
+ ): Promise<Response>;
12738
12851
  }
12739
12852
  /**
12740
12853
  * In addition to the properties you can set in the RequestInit dict
@@ -14409,6 +14522,27 @@ export type ImageInfoResponse =
14409
14522
  width: number;
14410
14523
  height: number;
14411
14524
  };
14525
+ /**
14526
+ * Parameters for rasterizing text into an image.
14527
+ */
14528
+ export type TextRasterize = {
14529
+ /** The text content to render */
14530
+ content: string;
14531
+ /** rasterization options for the text **/
14532
+ options: TextOptions;
14533
+ };
14534
+ export type TextOptions = {
14535
+ /** Font configuration */
14536
+ font: {
14537
+ /** URL to a font file in TrueType (.ttf), OpenType (.otf), WOFF (.woff), or WOFF2 (.woff2) format */
14538
+ url: string;
14539
+ };
14540
+ /** Font size in points (pt) */
14541
+ size?: number;
14542
+ /** Text color in CSS format: hex (#RRGGBB or #RRGGBBAA), rgb(r,g,b), rgba(r,g,b,a), or named colors */
14543
+ color?: string;
14544
+ };
14545
+ export type ImageSource = ReadableStream<Uint8Array> | TextRasterize;
14412
14546
  export type ImageTransform = {
14413
14547
  width?: number;
14414
14548
  height?: number;
@@ -14520,6 +14654,9 @@ export interface ImageUploadOptions {
14520
14654
  requireSignedURLs?: boolean;
14521
14655
  metadata?: Record<string, unknown>;
14522
14656
  creator?: string;
14657
+ /**
14658
+ * If 'base64', the input data will be decoded from base64 before processing
14659
+ */
14523
14660
  encoding?: "base64";
14524
14661
  }
14525
14662
  export interface ImageUpdateOptions {
@@ -14527,11 +14664,41 @@ export interface ImageUpdateOptions {
14527
14664
  metadata?: Record<string, unknown>;
14528
14665
  creator?: string;
14529
14666
  }
14667
+ export type ImageMetadataFilterOperators = {
14668
+ eq?: string | number | boolean;
14669
+ in?: string[] | number[];
14670
+ gt?: number;
14671
+ gte?: number;
14672
+ lt?: number;
14673
+ lte?: number;
14674
+ };
14675
+ export type ImageMetadataFilterValue =
14676
+ string | number | boolean | ImageMetadataFilterOperators;
14677
+ export interface ImageListFilter {
14678
+ metadata?: Record<string, ImageMetadataFilterValue>;
14679
+ }
14530
14680
  export interface ImageListOptions {
14531
14681
  limit?: number;
14532
14682
  cursor?: string;
14533
14683
  sortOrder?: "asc" | "desc";
14534
14684
  creator?: string;
14685
+ filter?: ImageListFilter;
14686
+ }
14687
+ export interface ImageSignedUrlOptions {
14688
+ variant: string;
14689
+ expiresIn?: number;
14690
+ keyName?: string;
14691
+ }
14692
+ export interface ImageDirectUploadOptions {
14693
+ id?: string;
14694
+ requireSignedURLs?: boolean;
14695
+ metadata?: Record<string, unknown>;
14696
+ creator?: string;
14697
+ expiresIn?: number;
14698
+ }
14699
+ export interface ImageDirectUploadResult {
14700
+ id: string;
14701
+ uploadURL: string;
14535
14702
  }
14536
14703
  export interface ImageList {
14537
14704
  images: ImageMetadata[];
@@ -14549,6 +14716,13 @@ export interface ImageHandle {
14549
14716
  * @returns ReadableStream of image bytes, or null if not found
14550
14717
  */
14551
14718
  bytes(): Promise<ReadableStream<Uint8Array> | null>;
14719
+ /**
14720
+ * Generate a signed delivery URL for this hosted image.
14721
+ * @param options Signing configuration
14722
+ * @returns A signed image delivery URL
14723
+ * @throws {@link ImagesError} if signing fails
14724
+ */
14725
+ signedUrl(options: ImageSignedUrlOptions): Promise<string>;
14552
14726
  /**
14553
14727
  * Update hosted image metadata
14554
14728
  * @param options Properties to update
@@ -14587,6 +14761,16 @@ export interface HostedImagesBinding {
14587
14761
  * @throws {@link ImagesError} if list fails
14588
14762
  */
14589
14763
  list(options?: ImageListOptions): Promise<ImageList>;
14764
+ /**
14765
+ * Create a Direct Creator Upload link, letting an end user upload an
14766
+ * image straight to Cloudflare without exposing an API token
14767
+ * @param options Upload link configuration
14768
+ * @returns The new image ID and the upload URL to hand to the end user
14769
+ * @throws {@link ImagesError} if creation fails
14770
+ */
14771
+ createDirectUpload(
14772
+ options?: ImageDirectUploadOptions,
14773
+ ): Promise<ImageDirectUploadResult>;
14590
14774
  }
14591
14775
  export interface ImagesBinding {
14592
14776
  /**
@@ -14607,6 +14791,13 @@ export interface ImagesBinding {
14607
14791
  stream: ReadableStream<Uint8Array>,
14608
14792
  options?: ImageInputOptions,
14609
14793
  ): ImageTransformer;
14794
+ /**
14795
+ * Begin applying a series of transformations to text
14796
+ * @param content string to be rendered
14797
+ * @param options font, optional color and size to use in rendering text
14798
+ * @returns A transform handle
14799
+ */
14800
+ text(content: string, options: TextOptions): ImageTransformer;
14610
14801
  /**
14611
14802
  * Access hosted images CRUD operations
14612
14803
  */
@@ -16863,6 +17054,20 @@ export type WorkflowDurationLabel =
16863
17054
  export type WorkflowSleepDuration =
16864
17055
  `${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
16865
17056
  export type WorkflowRetentionDuration = WorkflowSleepDuration;
17057
+ /** Geographic regions supported when creating a Workflow instance.
17058
+ * Location hints are best-effort placement preferences. */
17059
+ export type WorkflowInstanceLocationHint =
17060
+ | "wnam"
17061
+ | "enam"
17062
+ | "sam"
17063
+ | "weur"
17064
+ | "eeur"
17065
+ | "apac"
17066
+ | "apac-ne"
17067
+ | "apac-se"
17068
+ | "oc"
17069
+ | "afr"
17070
+ | "me";
16866
17071
  export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
16867
17072
  /**
16868
17073
  * An id for your Workflow instance. Must be unique within the Workflow.
@@ -16880,6 +17085,9 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
16880
17085
  successRetention?: WorkflowRetentionDuration;
16881
17086
  errorRetention?: WorkflowRetentionDuration;
16882
17087
  };
17088
+ /** A best-effort geographic placement preference for the Workflow instance.
17089
+ * See `WorkflowInstanceLocationHint` for supported regions. */
17090
+ locationHint?: WorkflowInstanceLocationHint;
16883
17091
  }
16884
17092
  export type InstanceStatus = {
16885
17093
  status:
package/package.json CHANGED
@@ -7,5 +7,5 @@
7
7
  },
8
8
  "author": "Cloudflare Workers DevProd Team <workers-devprod@cloudflare.com> (https://workers.cloudflare.com)",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "5.20260819.1"
10
+ "version": "5.20260820.1"
11
11
  }