@cloudflare/workers-types 3.15.0 → 3.16.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.
- package/index.d.ts +61 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -293,6 +293,29 @@ interface CryptoKeyVoprfKeyAlgorithm {
|
|
|
293
293
|
namedCurve: string;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
interface D1Database {
|
|
297
|
+
prepare(query: string): D1PreparedStatement;
|
|
298
|
+
dump(): Promise<ArrayBuffer>;
|
|
299
|
+
batch<T = unknown>(statements: D1PreparedStatement[]): Promise<D1Result<T>[]>;
|
|
300
|
+
exec<T = unknown>(query: string): Promise<D1Result<T>>;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
interface D1PreparedStatement {
|
|
304
|
+
bind(...values: any[]): D1PreparedStatement;
|
|
305
|
+
first<T = unknown>(colName?: string): Promise<T>;
|
|
306
|
+
run<T = unknown>(): Promise<D1Result<T>>;
|
|
307
|
+
all<T = unknown>(): Promise<D1Result<T[]>>;
|
|
308
|
+
raw<T = unknown>(): Promise<T[]>;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
declare type D1Result<T = unknown> = {
|
|
312
|
+
results?: T[];
|
|
313
|
+
lastRowId: number | null;
|
|
314
|
+
changes: number;
|
|
315
|
+
duration: number;
|
|
316
|
+
error?: string;
|
|
317
|
+
};
|
|
318
|
+
|
|
296
319
|
declare class DOMException extends Error {
|
|
297
320
|
constructor(message?: string, name?: string);
|
|
298
321
|
readonly code: number;
|
|
@@ -399,7 +422,7 @@ interface DurableObjectSetAlarmOptions {
|
|
|
399
422
|
|
|
400
423
|
interface DurableObjectState {
|
|
401
424
|
waitUntil(promise: Promise<any>): void;
|
|
402
|
-
|
|
425
|
+
id: DurableObjectId;
|
|
403
426
|
readonly storage: DurableObjectStorage;
|
|
404
427
|
blockConcurrencyWhile<T>(callback: () => Promise<T>): Promise<T>;
|
|
405
428
|
}
|
|
@@ -464,7 +487,10 @@ interface DurableObjectStub extends Fetcher {
|
|
|
464
487
|
}
|
|
465
488
|
|
|
466
489
|
interface DurableObjectTransaction {
|
|
467
|
-
get<T = unknown>(
|
|
490
|
+
get<T = unknown>(
|
|
491
|
+
key: string,
|
|
492
|
+
options?: DurableObjectGetOptions
|
|
493
|
+
): Promise<T | undefined>;
|
|
468
494
|
get<T = unknown>(
|
|
469
495
|
keys: string[],
|
|
470
496
|
options?: DurableObjectGetOptions
|
|
@@ -597,6 +623,10 @@ interface EventTargetEventListenerOptions {
|
|
|
597
623
|
capture?: boolean;
|
|
598
624
|
}
|
|
599
625
|
|
|
626
|
+
interface EventTargetHandlerObject {
|
|
627
|
+
handleEvent(arg1: Event): any | undefined;
|
|
628
|
+
}
|
|
629
|
+
|
|
600
630
|
interface ExecutionContext {
|
|
601
631
|
waitUntil(promise: Promise<any>): void;
|
|
602
632
|
passThroughOnException(): void;
|
|
@@ -664,7 +694,7 @@ declare class FormData {
|
|
|
664
694
|
set(name: string, value: Blob, filename?: string): void;
|
|
665
695
|
entries(): IterableIterator<[key: string, value: File | string]>;
|
|
666
696
|
keys(): IterableIterator<string>;
|
|
667
|
-
values(): IterableIterator<
|
|
697
|
+
values(): IterableIterator<string | File>;
|
|
668
698
|
forEach<This = unknown>(
|
|
669
699
|
callback: (
|
|
670
700
|
this: This,
|
|
@@ -768,6 +798,7 @@ interface IncomingRequestCfProperties {
|
|
|
768
798
|
*/
|
|
769
799
|
country: string;
|
|
770
800
|
httpProtocol: string;
|
|
801
|
+
isEUCountry?: string;
|
|
771
802
|
latitude?: string;
|
|
772
803
|
longitude?: string;
|
|
773
804
|
/**
|
|
@@ -805,9 +836,13 @@ interface IncomingRequestCfPropertiesBotManagement {
|
|
|
805
836
|
interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
806
837
|
certIssuerDNLegacy: string;
|
|
807
838
|
certIssuerDN: string;
|
|
839
|
+
certIssuerDNRFC2253: string;
|
|
840
|
+
certIssuerSKI: string;
|
|
841
|
+
certIssuerSerial: string;
|
|
808
842
|
certPresented: "0" | "1";
|
|
809
843
|
certSubjectDNLegacy: string;
|
|
810
844
|
certSubjectDN: string;
|
|
845
|
+
certSubjectDNRFC2253: string;
|
|
811
846
|
/**
|
|
812
847
|
* In format "Dec 22 19:39:00 2018 GMT"
|
|
813
848
|
*/
|
|
@@ -822,6 +857,8 @@ interface IncomingRequestCfPropertiesTLSClientAuth {
|
|
|
822
857
|
* "SUCCESS", "FAILED:reason", "NONE"
|
|
823
858
|
*/
|
|
824
859
|
certVerified: string;
|
|
860
|
+
certRevoked: string;
|
|
861
|
+
certSKI: string;
|
|
825
862
|
}
|
|
826
863
|
|
|
827
864
|
interface JsonWebKey {
|
|
@@ -1042,6 +1079,7 @@ interface R2Conditional {
|
|
|
1042
1079
|
etagDoesNotMatch?: string;
|
|
1043
1080
|
uploadedBefore?: Date;
|
|
1044
1081
|
uploadedAfter?: Date;
|
|
1082
|
+
secondsGranularity?: boolean;
|
|
1045
1083
|
}
|
|
1046
1084
|
|
|
1047
1085
|
/**
|
|
@@ -1049,7 +1087,7 @@ interface R2Conditional {
|
|
|
1049
1087
|
*/
|
|
1050
1088
|
interface R2GetOptions {
|
|
1051
1089
|
onlyIf?: R2Conditional | Headers;
|
|
1052
|
-
range?: R2Range;
|
|
1090
|
+
range?: R2Range | Headers;
|
|
1053
1091
|
}
|
|
1054
1092
|
|
|
1055
1093
|
/**
|
|
@@ -1077,6 +1115,7 @@ interface R2ListOptions {
|
|
|
1077
1115
|
prefix?: string;
|
|
1078
1116
|
cursor?: string;
|
|
1079
1117
|
delimiter?: string;
|
|
1118
|
+
startAfter?: string;
|
|
1080
1119
|
/**
|
|
1081
1120
|
* If you populate this array, then items returned will include this metadata.
|
|
1082
1121
|
* A tradeoff is that fewer results may be returned depending on how big this
|
|
@@ -1103,8 +1142,8 @@ declare abstract class R2Object {
|
|
|
1103
1142
|
readonly etag: string;
|
|
1104
1143
|
readonly httpEtag: string;
|
|
1105
1144
|
readonly uploaded: Date;
|
|
1106
|
-
readonly httpMetadata
|
|
1107
|
-
readonly customMetadata
|
|
1145
|
+
readonly httpMetadata?: R2HTTPMetadata;
|
|
1146
|
+
readonly customMetadata?: Record<string, string>;
|
|
1108
1147
|
readonly range?: R2Range;
|
|
1109
1148
|
writeHttpMetadata(headers: Headers): void;
|
|
1110
1149
|
}
|
|
@@ -1624,6 +1663,10 @@ declare abstract class SubtleCrypto {
|
|
|
1624
1663
|
extractable: boolean,
|
|
1625
1664
|
keyUsages: string[]
|
|
1626
1665
|
): Promise<CryptoKey>;
|
|
1666
|
+
timingSafeEqual(
|
|
1667
|
+
a: ArrayBuffer | ArrayBufferView,
|
|
1668
|
+
b: ArrayBuffer | ArrayBufferView
|
|
1669
|
+
): boolean;
|
|
1627
1670
|
}
|
|
1628
1671
|
|
|
1629
1672
|
interface SubtleCryptoDeriveKeyAlgorithm {
|
|
@@ -1718,6 +1761,14 @@ interface TextDecoderDecodeOptions {
|
|
|
1718
1761
|
stream: boolean;
|
|
1719
1762
|
}
|
|
1720
1763
|
|
|
1764
|
+
declare class TextDecoderStream extends TransformStream {
|
|
1765
|
+
constructor(label?: string, options?: TextDecoderStreamTextDecoderStreamInit);
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
interface TextDecoderStreamTextDecoderStreamInit {
|
|
1769
|
+
fatal?: boolean;
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1721
1772
|
declare class TextEncoder {
|
|
1722
1773
|
constructor();
|
|
1723
1774
|
encode(input?: string): Uint8Array;
|
|
@@ -1730,6 +1781,10 @@ interface TextEncoderEncodeIntoResult {
|
|
|
1730
1781
|
written: number;
|
|
1731
1782
|
}
|
|
1732
1783
|
|
|
1784
|
+
declare class TextEncoderStream extends TransformStream {
|
|
1785
|
+
constructor();
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1733
1788
|
declare class TransformStream {
|
|
1734
1789
|
constructor(
|
|
1735
1790
|
maybeTransformer?: Transformer,
|