@cloudflare/workers-types 3.16.0 → 3.17.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 (2) hide show
  1. package/index.d.ts +109 -21
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -252,8 +252,14 @@ declare type CryptoKeyAlgorithmVariant =
252
252
  | CryptoKeyHmacKeyAlgorithm
253
253
  | CryptoKeyRsaKeyAlgorithm
254
254
  | CryptoKeyEllipticKeyAlgorithm
255
- | CryptoKeyVoprfKeyAlgorithm
256
- | CryptoKeyOprfKeyAlgorithm;
255
+ | CryptoKeyArbitraryKeyAlgorithm;
256
+
257
+ interface CryptoKeyArbitraryKeyAlgorithm {
258
+ name: string;
259
+ hash?: CryptoKeyKeyAlgorithm;
260
+ namedCurve?: string;
261
+ length?: number;
262
+ }
257
263
 
258
264
  interface CryptoKeyEllipticKeyAlgorithm {
259
265
  name: string;
@@ -270,11 +276,6 @@ interface CryptoKeyKeyAlgorithm {
270
276
  name: string;
271
277
  }
272
278
 
273
- interface CryptoKeyOprfKeyAlgorithm {
274
- name: string;
275
- namedCurve: string;
276
- }
277
-
278
279
  interface CryptoKeyPair {
279
280
  publicKey: CryptoKey;
280
281
  privateKey: CryptoKey;
@@ -287,12 +288,6 @@ interface CryptoKeyRsaKeyAlgorithm {
287
288
  hash?: CryptoKeyKeyAlgorithm;
288
289
  }
289
290
 
290
- interface CryptoKeyVoprfKeyAlgorithm {
291
- name: string;
292
- hash: CryptoKeyKeyAlgorithm;
293
- namedCurve: string;
294
- }
295
-
296
291
  interface D1Database {
297
292
  prepare(query: string): D1PreparedStatement;
298
293
  dump(): Promise<ArrayBuffer>;
@@ -304,7 +299,7 @@ interface D1PreparedStatement {
304
299
  bind(...values: any[]): D1PreparedStatement;
305
300
  first<T = unknown>(colName?: string): Promise<T>;
306
301
  run<T = unknown>(): Promise<D1Result<T>>;
307
- all<T = unknown>(): Promise<D1Result<T[]>>;
302
+ all<T = unknown>(): Promise<D1Result<T>>;
308
303
  raw<T = unknown>(): Promise<T[]>;
309
304
  }
310
305
 
@@ -698,8 +693,8 @@ declare class FormData {
698
693
  forEach<This = unknown>(
699
694
  callback: (
700
695
  this: This,
701
- key: string,
702
696
  value: File | string,
697
+ key: string,
703
698
  parent: FormData
704
699
  ) => void,
705
700
  thisArg?: This
@@ -739,7 +734,7 @@ declare class Headers {
739
734
  append(name: string, value: string): void;
740
735
  delete(name: string): void;
741
736
  forEach<This = unknown>(
742
- callback: (this: This, key: string, value: string, parent: Headers) => void,
737
+ callback: (this: This, value: string, key: string, parent: Headers) => void,
743
738
  thisArg?: This
744
739
  ): void;
745
740
  entries(): IterableIterator<[key: string, value: string]>;
@@ -784,7 +779,7 @@ interface IncomingRequestCfProperties {
784
779
  botManagement?: IncomingRequestCfPropertiesBotManagement;
785
780
  city?: string;
786
781
  clientAcceptEncoding?: string;
787
- clientTcpRtt: number;
782
+ clientTcpRtt?: number;
788
783
  clientTrustScore?: number;
789
784
  /**
790
785
  * The three-letter airport code of the data center that the request
@@ -828,6 +823,8 @@ interface IncomingRequestCfProperties {
828
823
  }
829
824
 
830
825
  interface IncomingRequestCfPropertiesBotManagement {
826
+ corporateProxy: boolean;
827
+ ja3Hash?: string;
831
828
  score: number;
832
829
  staticResource: boolean;
833
830
  verifiedBot: boolean;
@@ -1067,10 +1064,21 @@ interface R2Bucket {
1067
1064
  | Blob,
1068
1065
  options?: R2PutOptions
1069
1066
  ): Promise<R2Object>;
1070
- delete(key: string): Promise<void>;
1067
+ delete(keys: string | string[]): Promise<void>;
1071
1068
  list(options?: R2ListOptions): Promise<R2Objects>;
1072
1069
  }
1073
1070
 
1071
+ /**
1072
+ * The checksums associated with the object.
1073
+ */
1074
+ interface R2Checksums {
1075
+ md5?: ArrayBuffer;
1076
+ sha1?: ArrayBuffer;
1077
+ sha256?: ArrayBuffer;
1078
+ sha384?: ArrayBuffer;
1079
+ sha512?: ArrayBuffer;
1080
+ }
1081
+
1074
1082
  /**
1075
1083
  * Perform the operation conditionally based on meeting the defined criteria.
1076
1084
  */
@@ -1141,6 +1149,7 @@ declare abstract class R2Object {
1141
1149
  readonly size: number;
1142
1150
  readonly etag: string;
1143
1151
  readonly httpEtag: string;
1152
+ readonly checksums: R2Checksums;
1144
1153
  readonly uploaded: Date;
1145
1154
  readonly httpMetadata?: R2HTTPMetadata;
1146
1155
  readonly customMetadata?: Record<string, string>;
@@ -1168,9 +1177,14 @@ interface R2Objects {
1168
1177
  }
1169
1178
 
1170
1179
  interface R2PutOptions {
1180
+ onlyIf?: R2Conditional | Headers;
1171
1181
  httpMetadata?: R2HTTPMetadata | Headers;
1172
1182
  customMetadata?: Record<string, string>;
1173
1183
  md5?: ArrayBuffer | string;
1184
+ sha1?: ArrayBuffer | string;
1185
+ sha256?: ArrayBuffer | string;
1186
+ sha384?: ArrayBuffer | string;
1187
+ sha512?: ArrayBuffer | string;
1174
1188
  }
1175
1189
 
1176
1190
  declare type R2Range =
@@ -1404,8 +1418,10 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
1404
1418
  * - json: instead of generating an image, outputs information about the
1405
1419
  * image, in JSON format. The JSON object will contain image size
1406
1420
  * (before and after resizing), source image’s MIME type, file size, etc.
1421
+ * - jpeg: generate images in JPEG format.
1422
+ * - png: generate images in PNG format.
1407
1423
  */
1408
- format?: "avif" | "webp" | "json";
1424
+ format?: "avif" | "webp" | "json" | "jpeg" | "png";
1409
1425
  /**
1410
1426
  * Whether to preserve animation frames from input files. Default is true.
1411
1427
  * Setting it to false reduces animations to still images. This setting is
@@ -1445,6 +1461,12 @@ interface RequestInitCfPropertiesImage extends BasicImageTransformations {
1445
1461
  * entry is the topmost layer).
1446
1462
  */
1447
1463
  draw?: RequestInitCfPropertiesImageDraw[];
1464
+ /**
1465
+ * Fetching image from authenticated origin. Setting this property will
1466
+ * pass authentication headers (Authorization, Cookie, etc.) through to
1467
+ * the origin.
1468
+ */
1469
+ "origin-auth"?: "share-publicly";
1448
1470
  }
1449
1471
 
1450
1472
  interface RequestInitCfPropertiesImageDraw extends BasicImageTransformations {
@@ -1593,7 +1615,7 @@ interface ServiceWorkerGlobalScopeStructuredCloneOptions {
1593
1615
  declare type StreamPipeOptions = PipeToOptions;
1594
1616
 
1595
1617
  interface StreamQueuingStrategy {
1596
- highWaterMark?: number;
1618
+ highWaterMark?: bigint;
1597
1619
  size(chunk: any): number;
1598
1620
  }
1599
1621
 
@@ -1785,6 +1807,68 @@ declare class TextEncoderStream extends TransformStream {
1785
1807
  constructor();
1786
1808
  }
1787
1809
 
1810
+ interface TraceEvent extends ExtendableEvent {
1811
+ readonly traces: TraceItem[];
1812
+ }
1813
+
1814
+ interface TraceException {
1815
+ readonly timestamp: number;
1816
+ readonly message: string;
1817
+ readonly name: string;
1818
+ }
1819
+
1820
+ interface TraceItem {
1821
+ readonly event: TraceItemEventInfo | null;
1822
+ readonly eventTimestamp: number | null;
1823
+ readonly logs: TraceLog[];
1824
+ readonly exceptions: TraceException[];
1825
+ readonly scriptName: string | null;
1826
+ readonly dispatchNamespace?: string;
1827
+ readonly outcome: string;
1828
+ }
1829
+
1830
+ interface TraceItemAlarmEventInfo {
1831
+ readonly scheduledTime: Date;
1832
+ }
1833
+
1834
+ declare type TraceItemEventInfo =
1835
+ | TraceItemFetchEventInfo
1836
+ | TraceItemScheduledEventInfo
1837
+ | TraceItemAlarmEventInfo;
1838
+
1839
+ interface TraceItemFetchEventInfo {
1840
+ readonly response?: TraceItemFetchEventInfoResponse;
1841
+ readonly request: TraceItemFetchEventInfoRequest;
1842
+ }
1843
+
1844
+ interface TraceItemFetchEventInfoRequest {
1845
+ readonly cf?: Object;
1846
+ readonly headers: Record<string, string>;
1847
+ readonly method: string;
1848
+ readonly url: string;
1849
+ getUnredacted(): TraceItemFetchEventInfoRequest;
1850
+ }
1851
+
1852
+ interface TraceItemFetchEventInfoResponse {
1853
+ readonly status: number;
1854
+ }
1855
+
1856
+ interface TraceItemScheduledEventInfo {
1857
+ readonly scheduledTime: number;
1858
+ readonly cron: string;
1859
+ }
1860
+
1861
+ interface TraceLog {
1862
+ readonly timestamp: number;
1863
+ readonly level: string;
1864
+ readonly message: Object;
1865
+ }
1866
+
1867
+ interface TraceMetrics {
1868
+ readonly cpuTime: number;
1869
+ readonly wallTime: number;
1870
+ }
1871
+
1788
1872
  declare class TransformStream {
1789
1873
  constructor(
1790
1874
  maybeTransformer?: Transformer,
@@ -1889,8 +1973,8 @@ declare class URLSearchParams {
1889
1973
  forEach<This = unknown>(
1890
1974
  callback: (
1891
1975
  this: This,
1892
- key: string,
1893
1976
  value: string,
1977
+ key: string,
1894
1978
  parent: URLSearchParams
1895
1979
  ) => void,
1896
1980
  thisArg?: This
@@ -1933,6 +2017,10 @@ interface UnderlyingSource {
1933
2017
  cancel?(reason?: any): any;
1934
2018
  }
1935
2019
 
2020
+ interface UnsafeTraceMetrics {
2021
+ fromTrace(arg4: TraceItem): TraceMetrics;
2022
+ }
2023
+
1936
2024
  declare class WebSocket extends EventTarget<WebSocketEventMap> {
1937
2025
  constructor(url: string, protocols?: string[] | string);
1938
2026
  accept(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/workers-types",
3
- "version": "3.16.0",
3
+ "version": "3.17.0",
4
4
  "description": "TypeScript typings for Cloudflare Workers",
5
5
  "repository": {
6
6
  "type": "git",