@cloudflare/workers-types 5.20260818.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.
- package/experimental/index.d.ts +218 -6
- package/experimental/index.ts +218 -6
- package/index.d.ts +236 -9
- package/index.ts +236 -9
- package/package.json +1 -1
package/experimental/index.d.ts
CHANGED
|
@@ -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
|
|
12876
|
+
content?: string;
|
|
12803
12877
|
/** Base64-encoded screenshot image. */
|
|
12804
|
-
screenshot
|
|
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
|
|
13029
|
+
* Get several representations of a web page in one request.
|
|
12941
13030
|
* @param action - Must be `'snapshot'`.
|
|
12942
|
-
* @param options - Snapshot options including
|
|
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
|
*/
|
|
@@ -14897,11 +15088,15 @@ interface ImageTransformer {
|
|
|
14897
15088
|
type ImageTransformationOutputOptions = {
|
|
14898
15089
|
encoding?: "base64";
|
|
14899
15090
|
};
|
|
15091
|
+
type ImageTransformationResponseOptions = {
|
|
15092
|
+
headers?: HeadersInit;
|
|
15093
|
+
};
|
|
14900
15094
|
interface ImageTransformationResult {
|
|
14901
15095
|
/**
|
|
14902
15096
|
* The image as a response, ready to store in cache or return to users
|
|
15097
|
+
* @param options Options that apply to the returned response, e.g. additional headers
|
|
14903
15098
|
*/
|
|
14904
|
-
response(): Response;
|
|
15099
|
+
response(options?: ImageTransformationResponseOptions): Response;
|
|
14905
15100
|
/**
|
|
14906
15101
|
* The content type of the returned image
|
|
14907
15102
|
*/
|
|
@@ -17185,6 +17380,20 @@ type WorkflowDurationLabel =
|
|
|
17185
17380
|
type WorkflowSleepDuration =
|
|
17186
17381
|
`${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
|
|
17187
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";
|
|
17188
17397
|
interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
17189
17398
|
/**
|
|
17190
17399
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
|
@@ -17202,6 +17411,9 @@ interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
|
17202
17411
|
successRetention?: WorkflowRetentionDuration;
|
|
17203
17412
|
errorRetention?: WorkflowRetentionDuration;
|
|
17204
17413
|
};
|
|
17414
|
+
/** A best-effort geographic placement preference for the Workflow instance.
|
|
17415
|
+
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
17416
|
+
locationHint?: WorkflowInstanceLocationHint;
|
|
17205
17417
|
}
|
|
17206
17418
|
type InstanceStatus = {
|
|
17207
17419
|
status:
|
package/experimental/index.ts
CHANGED
|
@@ -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
|
|
12890
|
+
content?: string;
|
|
12817
12891
|
/** Base64-encoded screenshot image. */
|
|
12818
|
-
screenshot
|
|
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
|
|
13043
|
+
* Get several representations of a web page in one request.
|
|
12955
13044
|
* @param action - Must be `'snapshot'`.
|
|
12956
|
-
* @param options - Snapshot options including
|
|
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
|
*/
|
|
@@ -14914,11 +15105,15 @@ export interface ImageTransformer {
|
|
|
14914
15105
|
export type ImageTransformationOutputOptions = {
|
|
14915
15106
|
encoding?: "base64";
|
|
14916
15107
|
};
|
|
15108
|
+
export type ImageTransformationResponseOptions = {
|
|
15109
|
+
headers?: HeadersInit;
|
|
15110
|
+
};
|
|
14917
15111
|
export interface ImageTransformationResult {
|
|
14918
15112
|
/**
|
|
14919
15113
|
* The image as a response, ready to store in cache or return to users
|
|
15114
|
+
* @param options Options that apply to the returned response, e.g. additional headers
|
|
14920
15115
|
*/
|
|
14921
|
-
response(): Response;
|
|
15116
|
+
response(options?: ImageTransformationResponseOptions): Response;
|
|
14922
15117
|
/**
|
|
14923
15118
|
* The content type of the returned image
|
|
14924
15119
|
*/
|
|
@@ -17134,6 +17329,20 @@ export type WorkflowDurationLabel =
|
|
|
17134
17329
|
export type WorkflowSleepDuration =
|
|
17135
17330
|
`${number} ${WorkflowDurationLabel}${"s" | ""}` | number;
|
|
17136
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";
|
|
17137
17346
|
export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
17138
17347
|
/**
|
|
17139
17348
|
* An id for your Workflow instance. Must be unique within the Workflow.
|
|
@@ -17151,6 +17360,9 @@ export interface WorkflowInstanceCreateOptions<PARAMS = unknown> {
|
|
|
17151
17360
|
successRetention?: WorkflowRetentionDuration;
|
|
17152
17361
|
errorRetention?: WorkflowRetentionDuration;
|
|
17153
17362
|
};
|
|
17363
|
+
/** A best-effort geographic placement preference for the Workflow instance.
|
|
17364
|
+
* See `WorkflowInstanceLocationHint` for supported regions. */
|
|
17365
|
+
locationHint?: WorkflowInstanceLocationHint;
|
|
17154
17366
|
}
|
|
17155
17367
|
export type InstanceStatus = {
|
|
17156
17368
|
status:
|