@cloudflare/workers-types 5.20261008.1 → 5.20261010.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.
@@ -4009,15 +4009,7 @@ type SqlStorageValue = ArrayBuffer | string | number | null;
4009
4009
  declare abstract class SqlStorageCursor<
4010
4010
  T extends Record<string, SqlStorageValue>,
4011
4011
  > {
4012
- next():
4013
- | {
4014
- done?: false;
4015
- value: T;
4016
- }
4017
- | {
4018
- done: true;
4019
- value?: never;
4020
- };
4012
+ next(): IteratorResult<T, undefined>;
4021
4013
  toArray(): T[];
4022
4014
  one(): T;
4023
4015
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
@@ -4936,6 +4928,7 @@ interface Tracing {
4936
4928
  }
4937
4929
  declare abstract class Span {
4938
4930
  get isTraced(): boolean;
4931
+ spanContext(): TracingSpanContext;
4939
4932
  setAttribute(key: string, value: boolean | number | string): this;
4940
4933
  setAttributes(
4941
4934
  attributes: Record<string, boolean | number | string | undefined>,
@@ -4971,6 +4964,11 @@ interface TracingSpanStatus {
4971
4964
  code: TracingSpanStatusCode;
4972
4965
  message?: string;
4973
4966
  }
4967
+ interface TracingSpanContext {
4968
+ traceId: string;
4969
+ spanId: string;
4970
+ traceFlags: number;
4971
+ }
4974
4972
  /**
4975
4973
  * Represents the identity of a user authenticated via Cloudflare Access.
4976
4974
  * This matches the result of calling /cdn-cgi/access/get-identity.
@@ -15428,26 +15426,32 @@ declare abstract class D1PreparedStatement {
15428
15426
  interface Disposable {}
15429
15427
  declare module "cloudflare:durable-objects" {
15430
15428
  /**
15431
- * Marks a Durable Object method as safe to run more than once. The runtime may then retry calls
15432
- * to it after a disconnect that might have happened after the method started. It does not
15429
+ * Marks Durable Object methods as safe to run more than once. The runtime may then retry calls
15430
+ * to them after a disconnect that might have happened after the method started. It does not
15433
15431
  * enable retries or change how many are made.
15434
15432
  *
15433
+ * Mark methods on the class prototype, for example from a static block:
15434
+ *
15435
+ * ```ts
15436
+ * class Counter extends DurableObject {
15437
+ * static {
15438
+ * retryable(this.prototype.reset);
15439
+ * }
15440
+ * async reset() {}
15441
+ * }
15442
+ * ```
15443
+ *
15444
+ * The mark is on the function itself. A subclass inherits it, but an override, a bound copy, or
15445
+ * a wrapper is not marked unless it is also passed to `retryable()`.
15446
+ *
15435
15447
  * Each attempt creates its own return value, so if the method returns an `RpcTarget`, its
15436
15448
  * `[Symbol.dispose]()` may run once per attempt.
15437
15449
  *
15438
- * Only public instance methods can be decorated. When composing decorators, apply `@retryable`
15439
- * outermost (first in source order) so it marks the method that is finally installed.
15440
- * Otherwise `@retryable` has no effect, and constructing the object logs a warning.
15441
- * Requires standard (not `experimentalDecorators`) decorators and a bundler that transforms
15442
- * them, such as Wrangler.
15443
- */
15444
- export function retryable<This, Args extends unknown[], Return>(
15445
- value: (this: This, ...args: Args) => Return,
15446
- context: ClassMethodDecoratorContext<
15447
- This,
15448
- (this: This, ...args: Args) => Return
15449
- >,
15450
- ): (this: This, ...args: Args) => Return;
15450
+ * @throws TypeError if an argument is not a function.
15451
+ */
15452
+ export function retryable(
15453
+ ...methods: ((...args: never[]) => unknown)[]
15454
+ ): void;
15451
15455
  }
15452
15456
  /**
15453
15457
  * The returned data after sending an email
@@ -4018,15 +4018,7 @@ export type SqlStorageValue = ArrayBuffer | string | number | null;
4018
4018
  export declare abstract class SqlStorageCursor<
4019
4019
  T extends Record<string, SqlStorageValue>,
4020
4020
  > {
4021
- next():
4022
- | {
4023
- done?: false;
4024
- value: T;
4025
- }
4026
- | {
4027
- done: true;
4028
- value?: never;
4029
- };
4021
+ next(): IteratorResult<T, undefined>;
4030
4022
  toArray(): T[];
4031
4023
  one(): T;
4032
4024
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
@@ -4945,6 +4937,7 @@ export interface Tracing {
4945
4937
  }
4946
4938
  export declare abstract class Span {
4947
4939
  get isTraced(): boolean;
4940
+ spanContext(): TracingSpanContext;
4948
4941
  setAttribute(key: string, value: boolean | number | string): this;
4949
4942
  setAttributes(
4950
4943
  attributes: Record<string, boolean | number | string | undefined>,
@@ -4980,6 +4973,11 @@ export interface TracingSpanStatus {
4980
4973
  code: TracingSpanStatusCode;
4981
4974
  message?: string;
4982
4975
  }
4976
+ export interface TracingSpanContext {
4977
+ traceId: string;
4978
+ spanId: string;
4979
+ traceFlags: number;
4980
+ }
4983
4981
  /**
4984
4982
  * Represents the identity of a user authenticated via Cloudflare Access.
4985
4983
  * This matches the result of calling /cdn-cgi/access/get-identity.
package/index.d.ts CHANGED
@@ -483,9 +483,9 @@ declare const scheduler: Scheduler;
483
483
  declare const performance: Performance;
484
484
  declare const Cloudflare: Cloudflare;
485
485
  declare const origin: string;
486
- declare const Buffer: any;
487
- declare const process: any;
488
- declare const global: ServiceWorkerGlobalScope;
486
+ declare var Buffer: any;
487
+ declare var process: any;
488
+ declare var global: ServiceWorkerGlobalScope;
489
489
  declare function setImmediate(
490
490
  $function: (...param0: any[]) => void,
491
491
  ...args: any[]
@@ -3863,15 +3863,7 @@ type SqlStorageValue = ArrayBuffer | string | number | null;
3863
3863
  declare abstract class SqlStorageCursor<
3864
3864
  T extends Record<string, SqlStorageValue>,
3865
3865
  > {
3866
- next():
3867
- | {
3868
- done?: false;
3869
- value: T;
3870
- }
3871
- | {
3872
- done: true;
3873
- value?: never;
3874
- };
3866
+ next(): IteratorResult<T, undefined>;
3875
3867
  toArray(): T[];
3876
3868
  one(): T;
3877
3869
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
@@ -4588,6 +4580,7 @@ interface Tracing {
4588
4580
  }
4589
4581
  declare abstract class Span {
4590
4582
  get isTraced(): boolean;
4583
+ spanContext(): TracingSpanContext;
4591
4584
  setAttribute(key: string, value: boolean | number | string): this;
4592
4585
  setAttributes(
4593
4586
  attributes: Record<string, boolean | number | string | undefined>,
@@ -4623,6 +4616,11 @@ interface TracingSpanStatus {
4623
4616
  code: TracingSpanStatusCode;
4624
4617
  message?: string;
4625
4618
  }
4619
+ interface TracingSpanContext {
4620
+ traceId: string;
4621
+ spanId: string;
4622
+ traceFlags: number;
4623
+ }
4626
4624
  /**
4627
4625
  * Represents the identity of a user authenticated via Cloudflare Access.
4628
4626
  * This matches the result of calling /cdn-cgi/access/get-identity.
@@ -15080,26 +15078,32 @@ declare abstract class D1PreparedStatement {
15080
15078
  interface Disposable {}
15081
15079
  declare module "cloudflare:durable-objects" {
15082
15080
  /**
15083
- * Marks a Durable Object method as safe to run more than once. The runtime may then retry calls
15084
- * to it after a disconnect that might have happened after the method started. It does not
15081
+ * Marks Durable Object methods as safe to run more than once. The runtime may then retry calls
15082
+ * to them after a disconnect that might have happened after the method started. It does not
15085
15083
  * enable retries or change how many are made.
15086
15084
  *
15085
+ * Mark methods on the class prototype, for example from a static block:
15086
+ *
15087
+ * ```ts
15088
+ * class Counter extends DurableObject {
15089
+ * static {
15090
+ * retryable(this.prototype.reset);
15091
+ * }
15092
+ * async reset() {}
15093
+ * }
15094
+ * ```
15095
+ *
15096
+ * The mark is on the function itself. A subclass inherits it, but an override, a bound copy, or
15097
+ * a wrapper is not marked unless it is also passed to `retryable()`.
15098
+ *
15087
15099
  * Each attempt creates its own return value, so if the method returns an `RpcTarget`, its
15088
15100
  * `[Symbol.dispose]()` may run once per attempt.
15089
15101
  *
15090
- * Only public instance methods can be decorated. When composing decorators, apply `@retryable`
15091
- * outermost (first in source order) so it marks the method that is finally installed.
15092
- * Otherwise `@retryable` has no effect, and constructing the object logs a warning.
15093
- * Requires standard (not `experimentalDecorators`) decorators and a bundler that transforms
15094
- * them, such as Wrangler.
15095
- */
15096
- export function retryable<This, Args extends unknown[], Return>(
15097
- value: (this: This, ...args: Args) => Return,
15098
- context: ClassMethodDecoratorContext<
15099
- This,
15100
- (this: This, ...args: Args) => Return
15101
- >,
15102
- ): (this: This, ...args: Args) => Return;
15102
+ * @throws TypeError if an argument is not a function.
15103
+ */
15104
+ export function retryable(
15105
+ ...methods: ((...args: never[]) => unknown)[]
15106
+ ): void;
15103
15107
  }
15104
15108
  /**
15105
15109
  * The returned data after sending an email
package/index.ts CHANGED
@@ -485,9 +485,9 @@ export declare const scheduler: Scheduler;
485
485
  export declare const performance: Performance;
486
486
  export declare const Cloudflare: Cloudflare;
487
487
  export declare const origin: string;
488
- export declare const Buffer: any;
489
- export declare const process: any;
490
- export declare const global: ServiceWorkerGlobalScope;
488
+ export declare var Buffer: any;
489
+ export declare var process: any;
490
+ export declare var global: ServiceWorkerGlobalScope;
491
491
  export declare function setImmediate(
492
492
  $function: (...param0: any[]) => void,
493
493
  ...args: any[]
@@ -3872,15 +3872,7 @@ export type SqlStorageValue = ArrayBuffer | string | number | null;
3872
3872
  export declare abstract class SqlStorageCursor<
3873
3873
  T extends Record<string, SqlStorageValue>,
3874
3874
  > {
3875
- next():
3876
- | {
3877
- done?: false;
3878
- value: T;
3879
- }
3880
- | {
3881
- done: true;
3882
- value?: never;
3883
- };
3875
+ next(): IteratorResult<T, undefined>;
3884
3876
  toArray(): T[];
3885
3877
  one(): T;
3886
3878
  raw<U extends SqlStorageValue[]>(): IterableIterator<U>;
@@ -4597,6 +4589,7 @@ export interface Tracing {
4597
4589
  }
4598
4590
  export declare abstract class Span {
4599
4591
  get isTraced(): boolean;
4592
+ spanContext(): TracingSpanContext;
4600
4593
  setAttribute(key: string, value: boolean | number | string): this;
4601
4594
  setAttributes(
4602
4595
  attributes: Record<string, boolean | number | string | undefined>,
@@ -4632,6 +4625,11 @@ export interface TracingSpanStatus {
4632
4625
  code: TracingSpanStatusCode;
4633
4626
  message?: string;
4634
4627
  }
4628
+ export interface TracingSpanContext {
4629
+ traceId: string;
4630
+ spanId: string;
4631
+ traceFlags: number;
4632
+ }
4635
4633
  /**
4636
4634
  * Represents the identity of a user authenticated via Cloudflare Access.
4637
4635
  * This matches the result of calling /cdn-cgi/access/get-identity.
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.20261008.1"
10
+ "version": "5.20261010.1"
11
11
  }