@workers-community/workers-types 4.20260421.1 → 4.20260423.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/index.d.ts +17 -1
- package/index.ts +17 -1
- 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 {}
|
|
@@ -13700,6 +13713,8 @@ declare namespace CloudflareWorkersModule {
|
|
|
13700
13713
|
): unknown;
|
|
13701
13714
|
export const env: Cloudflare.Env;
|
|
13702
13715
|
export const exports: Cloudflare.Exports;
|
|
13716
|
+
export const cache: CacheContext;
|
|
13717
|
+
export const tracing: Tracing;
|
|
13703
13718
|
}
|
|
13704
13719
|
declare module "cloudflare:workers" {
|
|
13705
13720
|
export = CloudflareWorkersModule;
|
|
@@ -14607,7 +14622,8 @@ declare namespace TailStream {
|
|
|
14607
14622
|
| "exceededMemory"
|
|
14608
14623
|
| "loadShed"
|
|
14609
14624
|
| "responseStreamDisconnected"
|
|
14610
|
-
| "scriptNotFound"
|
|
14625
|
+
| "scriptNotFound"
|
|
14626
|
+
| "internalError";
|
|
14611
14627
|
interface ScriptVersion {
|
|
14612
14628
|
readonly id: string;
|
|
14613
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 {}
|
|
@@ -13671,6 +13684,8 @@ export declare namespace CloudflareWorkersModule {
|
|
|
13671
13684
|
): unknown;
|
|
13672
13685
|
export const env: Cloudflare.Env;
|
|
13673
13686
|
export const exports: Cloudflare.Exports;
|
|
13687
|
+
export const cache: CacheContext;
|
|
13688
|
+
export const tracing: Tracing;
|
|
13674
13689
|
}
|
|
13675
13690
|
export interface SecretsStoreSecret {
|
|
13676
13691
|
/**
|
|
@@ -14568,7 +14583,8 @@ export declare namespace TailStream {
|
|
|
14568
14583
|
| "exceededMemory"
|
|
14569
14584
|
| "loadShed"
|
|
14570
14585
|
| "responseStreamDisconnected"
|
|
14571
|
-
| "scriptNotFound"
|
|
14586
|
+
| "scriptNotFound"
|
|
14587
|
+
| "internalError";
|
|
14572
14588
|
interface ScriptVersion {
|
|
14573
14589
|
readonly id: string;
|
|
14574
14590
|
readonly tag?: string;
|