@workers-community/workers-types 4.20260422.1 → 4.20260424.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.
Files changed (3) hide show
  1. package/index.d.ts +16 -1
  2. package/index.ts +16 -1
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -477,6 +477,7 @@ interface ExecutionContext<Props = unknown> {
477
477
  passThroughOnException(): void;
478
478
  readonly props: Props;
479
479
  cache?: CacheContext;
480
+ tracing?: Tracing;
480
481
  }
481
482
  type ExportedHandlerFetchHandler<
482
483
  Env = unknown,
@@ -4020,6 +4021,18 @@ declare abstract class Performance {
4020
4021
  */
4021
4022
  toJSON(): object;
4022
4023
  }
4024
+ interface Tracing {
4025
+ enterSpan<T, A extends unknown[]>(
4026
+ name: string,
4027
+ callback: (span: Span, ...args: A) => T,
4028
+ ...args: A
4029
+ ): T;
4030
+ Span: typeof Span;
4031
+ }
4032
+ declare abstract class Span {
4033
+ get isTraced(): boolean;
4034
+ setAttribute(key: string, value?: boolean | number | string): void;
4035
+ }
4023
4036
  // ============ AI Search Error Interfaces ============
4024
4037
  interface AiSearchInternalError extends Error {}
4025
4038
  interface AiSearchNotFoundError extends Error {}
@@ -13701,6 +13714,7 @@ declare namespace CloudflareWorkersModule {
13701
13714
  export const env: Cloudflare.Env;
13702
13715
  export const exports: Cloudflare.Exports;
13703
13716
  export const cache: CacheContext;
13717
+ export const tracing: Tracing;
13704
13718
  }
13705
13719
  declare module "cloudflare:workers" {
13706
13720
  export = CloudflareWorkersModule;
@@ -14608,7 +14622,8 @@ declare namespace TailStream {
14608
14622
  | "exceededMemory"
14609
14623
  | "loadShed"
14610
14624
  | "responseStreamDisconnected"
14611
- | "scriptNotFound";
14625
+ | "scriptNotFound"
14626
+ | "internalError";
14612
14627
  interface ScriptVersion {
14613
14628
  readonly id: string;
14614
14629
  readonly tag?: string;
package/index.ts CHANGED
@@ -479,6 +479,7 @@ export interface ExecutionContext<Props = unknown> {
479
479
  passThroughOnException(): void;
480
480
  readonly props: Props;
481
481
  cache?: CacheContext;
482
+ tracing?: Tracing;
482
483
  }
483
484
  export type ExportedHandlerFetchHandler<
484
485
  Env = unknown,
@@ -4026,6 +4027,18 @@ export declare abstract class Performance {
4026
4027
  */
4027
4028
  toJSON(): object;
4028
4029
  }
4030
+ export interface Tracing {
4031
+ enterSpan<T, A extends unknown[]>(
4032
+ name: string,
4033
+ callback: (span: Span, ...args: A) => T,
4034
+ ...args: A
4035
+ ): T;
4036
+ Span: typeof Span;
4037
+ }
4038
+ export declare abstract class Span {
4039
+ get isTraced(): boolean;
4040
+ setAttribute(key: string, value?: boolean | number | string): void;
4041
+ }
4029
4042
  // ============ AI Search Error Interfaces ============
4030
4043
  export interface AiSearchInternalError extends Error {}
4031
4044
  export interface AiSearchNotFoundError extends Error {}
@@ -13672,6 +13685,7 @@ export declare namespace CloudflareWorkersModule {
13672
13685
  export const env: Cloudflare.Env;
13673
13686
  export const exports: Cloudflare.Exports;
13674
13687
  export const cache: CacheContext;
13688
+ export const tracing: Tracing;
13675
13689
  }
13676
13690
  export interface SecretsStoreSecret {
13677
13691
  /**
@@ -14569,7 +14583,8 @@ export declare namespace TailStream {
14569
14583
  | "exceededMemory"
14570
14584
  | "loadShed"
14571
14585
  | "responseStreamDisconnected"
14572
- | "scriptNotFound";
14586
+ | "scriptNotFound"
14587
+ | "internalError";
14573
14588
  interface ScriptVersion {
14574
14589
  readonly id: string;
14575
14590
  readonly tag?: string;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "author": "Workers Community",
9
9
  "license": "MIT OR Apache-2.0",
10
- "version": "4.20260422.1",
10
+ "version": "4.20260424.1",
11
11
  "exports": {
12
12
  ".": {
13
13
  "types": "./index.d.ts",