@depup/cloudflare__workers-types 5.20261006.1-depup.0 → 5.20261007.1-depup.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/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/cloudflare__workers-types
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@cloudflare/workers-types](https://www.npmjs.com/package/@cloudflare/workers-types) @ 5.20261006.1 |
17
- | Processed | 2026-10-06 |
16
+ | Original | [@cloudflare/workers-types](https://www.npmjs.com/package/@cloudflare/workers-types) @ 5.20261007.1 |
17
+ | Processed | 2026-10-07 |
18
18
  | Smoke test | failed |
19
19
  | Deps updated | 0 |
20
20
 
package/changes.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "bumped": {},
3
- "timestamp": "2026-10-06T08:12:17.329Z",
3
+ "timestamp": "2026-10-07T08:12:36.168Z",
4
4
  "totalUpdated": 0
5
5
  }
@@ -15599,7 +15599,16 @@ declare module "cloudflare:email" {
15599
15599
  * Evaluation context for targeting rules.
15600
15600
  * Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
15601
15601
  */
15602
- type FlagshipEvaluationContext = Record<string, string | number | boolean>;
15602
+ type FlagshipEvaluationContextValue =
15603
+ | string
15604
+ | number
15605
+ | boolean
15606
+ | null
15607
+ | FlagshipEvaluationContextValue[]
15608
+ | {
15609
+ [key: string]: FlagshipEvaluationContextValue;
15610
+ };
15611
+ type FlagshipEvaluationContext = Record<string, FlagshipEvaluationContextValue>;
15603
15612
  interface FlagshipEvaluationDetails<T> {
15604
15613
  flagKey: string;
15605
15614
  value: T;
@@ -15608,6 +15617,13 @@ interface FlagshipEvaluationDetails<T> {
15608
15617
  errorCode?: string | undefined;
15609
15618
  errorMessage?: string | undefined;
15610
15619
  }
15620
+ type FlagshipWidenedValue<T> = T extends boolean
15621
+ ? boolean
15622
+ : T extends string
15623
+ ? string
15624
+ : T extends number
15625
+ ? number
15626
+ : T;
15611
15627
  interface FlagshipEvaluationError extends Error {}
15612
15628
  /**
15613
15629
  * Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
@@ -15634,12 +15650,39 @@ declare abstract class Flagship {
15634
15650
  * @param flagKey The key of the flag to evaluate.
15635
15651
  * @param defaultValue Optional default value returned when evaluation fails.
15636
15652
  * @param context Optional evaluation context for targeting rules.
15653
+ * @deprecated Use getValue() instead.
15637
15654
  */
15638
15655
  get(
15639
15656
  flagKey: string,
15640
15657
  defaultValue?: unknown,
15641
15658
  context?: FlagshipEvaluationContext,
15642
15659
  ): Promise<unknown>;
15660
+ /**
15661
+ * Get a flag value, inferring its expected type from the default value.
15662
+ * @param flagKey The key of the flag to evaluate.
15663
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15664
+ * @param context Optional evaluation context for targeting rules.
15665
+ */
15666
+ getValue<
15667
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15668
+ >(
15669
+ flagKey: string,
15670
+ defaultValue: T,
15671
+ context?: FlagshipEvaluationContext,
15672
+ ): Promise<FlagshipWidenedValue<T>>;
15673
+ /**
15674
+ * Get a flag value with full evaluation details, inferring its expected type from the default value.
15675
+ * @param flagKey The key of the flag to evaluate.
15676
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15677
+ * @param context Optional evaluation context for targeting rules.
15678
+ */
15679
+ getDetails<
15680
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15681
+ >(
15682
+ flagKey: string,
15683
+ defaultValue: T,
15684
+ context?: FlagshipEvaluationContext,
15685
+ ): Promise<FlagshipEvaluationDetails<FlagshipWidenedValue<T>>>;
15643
15686
  /**
15644
15687
  * Get a boolean flag value.
15645
15688
  * @param flagKey The key of the flag to evaluate.
@@ -16543,6 +16586,11 @@ declare namespace Rpc {
16543
16586
  T extends Map<unknown, infer U> ? Serializable<U> : never
16544
16587
  >
16545
16588
  | Set<T extends Set<infer U> ? Serializable<U> : never>
16589
+ | ReadonlyMap<
16590
+ T extends ReadonlyMap<infer U, unknown> ? Serializable<U> : never,
16591
+ T extends ReadonlyMap<unknown, infer U> ? Serializable<U> : never
16592
+ >
16593
+ | ReadonlySet<T extends ReadonlySet<infer U> ? Serializable<U> : never>
16546
16594
  | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
16547
16595
  | {
16548
16596
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
@@ -16585,19 +16633,23 @@ declare namespace Rpc {
16585
16633
  ? Map<Stubify<K>, Stubify<V>>
16586
16634
  : T extends Set<infer V>
16587
16635
  ? Set<Stubify<V>>
16588
- : T extends Array<infer V>
16589
- ? Array<Stubify<V>>
16590
- : T extends ReadonlyArray<infer V>
16591
- ? ReadonlyArray<Stubify<V>>
16592
- : T extends BaseType
16593
- ? T
16594
- : T extends {
16595
- [key: string | number]: any;
16596
- }
16597
- ? {
16598
- [K in keyof T]: Stubify<T[K]>;
16599
- }
16600
- : T;
16636
+ : T extends ReadonlyMap<infer K, infer V>
16637
+ ? ReadonlyMap<Stubify<K>, Stubify<V>>
16638
+ : T extends ReadonlySet<infer V>
16639
+ ? ReadonlySet<Stubify<V>>
16640
+ : T extends Array<infer V>
16641
+ ? Array<Stubify<V>>
16642
+ : T extends ReadonlyArray<infer V>
16643
+ ? ReadonlyArray<Stubify<V>>
16644
+ : T extends BaseType
16645
+ ? T
16646
+ : T extends {
16647
+ [key: string | number]: any;
16648
+ }
16649
+ ? {
16650
+ [K in keyof T]: Stubify<T[K]>;
16651
+ }
16652
+ : T;
16601
16653
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
16602
16654
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
16603
16655
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -16608,19 +16660,23 @@ declare namespace Rpc {
16608
16660
  ? Map<Unstubify<K>, Unstubify<V>>
16609
16661
  : T extends Set<infer V>
16610
16662
  ? Set<Unstubify<V>>
16611
- : T extends Array<infer V>
16612
- ? Array<Unstubify<V>>
16613
- : T extends ReadonlyArray<infer V>
16614
- ? ReadonlyArray<Unstubify<V>>
16615
- : T extends BaseType
16616
- ? T
16617
- : T extends {
16618
- [key: string | number]: unknown;
16619
- }
16620
- ? {
16621
- [K in keyof T]: Unstubify<T[K]>;
16622
- }
16623
- : T;
16663
+ : T extends ReadonlyMap<infer K, infer V>
16664
+ ? ReadonlyMap<Unstubify<K>, Unstubify<V>>
16665
+ : T extends ReadonlySet<infer V>
16666
+ ? ReadonlySet<Unstubify<V>>
16667
+ : T extends Array<infer V>
16668
+ ? Array<Unstubify<V>>
16669
+ : T extends ReadonlyArray<infer V>
16670
+ ? ReadonlyArray<Unstubify<V>>
16671
+ : T extends BaseType
16672
+ ? T
16673
+ : T extends {
16674
+ [key: string | number]: unknown;
16675
+ }
16676
+ ? {
16677
+ [K in keyof T]: Unstubify<T[K]>;
16678
+ }
16679
+ : T;
16624
16680
  type UnstubifyAll<A extends any[]> = {
16625
16681
  [I in keyof A]: Unstubify<A[I]>;
16626
16682
  };
@@ -15594,9 +15594,18 @@ export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
15594
15594
  * Evaluation context for targeting rules.
15595
15595
  * Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
15596
15596
  */
15597
+ export type FlagshipEvaluationContextValue =
15598
+ | string
15599
+ | number
15600
+ | boolean
15601
+ | null
15602
+ | FlagshipEvaluationContextValue[]
15603
+ | {
15604
+ [key: string]: FlagshipEvaluationContextValue;
15605
+ };
15597
15606
  export type FlagshipEvaluationContext = Record<
15598
15607
  string,
15599
- string | number | boolean
15608
+ FlagshipEvaluationContextValue
15600
15609
  >;
15601
15610
  export interface FlagshipEvaluationDetails<T> {
15602
15611
  flagKey: string;
@@ -15606,6 +15615,13 @@ export interface FlagshipEvaluationDetails<T> {
15606
15615
  errorCode?: string | undefined;
15607
15616
  errorMessage?: string | undefined;
15608
15617
  }
15618
+ export type FlagshipWidenedValue<T> = T extends boolean
15619
+ ? boolean
15620
+ : T extends string
15621
+ ? string
15622
+ : T extends number
15623
+ ? number
15624
+ : T;
15609
15625
  export interface FlagshipEvaluationError extends Error {}
15610
15626
  /**
15611
15627
  * Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
@@ -15632,12 +15648,39 @@ export declare abstract class Flagship {
15632
15648
  * @param flagKey The key of the flag to evaluate.
15633
15649
  * @param defaultValue Optional default value returned when evaluation fails.
15634
15650
  * @param context Optional evaluation context for targeting rules.
15651
+ * @deprecated Use getValue() instead.
15635
15652
  */
15636
15653
  get(
15637
15654
  flagKey: string,
15638
15655
  defaultValue?: unknown,
15639
15656
  context?: FlagshipEvaluationContext,
15640
15657
  ): Promise<unknown>;
15658
+ /**
15659
+ * Get a flag value, inferring its expected type from the default value.
15660
+ * @param flagKey The key of the flag to evaluate.
15661
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15662
+ * @param context Optional evaluation context for targeting rules.
15663
+ */
15664
+ getValue<
15665
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15666
+ >(
15667
+ flagKey: string,
15668
+ defaultValue: T,
15669
+ context?: FlagshipEvaluationContext,
15670
+ ): Promise<FlagshipWidenedValue<T>>;
15671
+ /**
15672
+ * Get a flag value with full evaluation details, inferring its expected type from the default value.
15673
+ * @param flagKey The key of the flag to evaluate.
15674
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15675
+ * @param context Optional evaluation context for targeting rules.
15676
+ */
15677
+ getDetails<
15678
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15679
+ >(
15680
+ flagKey: string,
15681
+ defaultValue: T,
15682
+ context?: FlagshipEvaluationContext,
15683
+ ): Promise<FlagshipEvaluationDetails<FlagshipWidenedValue<T>>>;
15641
15684
  /**
15642
15685
  * Get a boolean flag value.
15643
15686
  * @param flagKey The key of the flag to evaluate.
@@ -16462,6 +16505,11 @@ export declare namespace Rpc {
16462
16505
  T extends Map<unknown, infer U> ? Serializable<U> : never
16463
16506
  >
16464
16507
  | Set<T extends Set<infer U> ? Serializable<U> : never>
16508
+ | ReadonlyMap<
16509
+ T extends ReadonlyMap<infer U, unknown> ? Serializable<U> : never,
16510
+ T extends ReadonlyMap<unknown, infer U> ? Serializable<U> : never
16511
+ >
16512
+ | ReadonlySet<T extends ReadonlySet<infer U> ? Serializable<U> : never>
16465
16513
  | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
16466
16514
  | {
16467
16515
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
@@ -16504,19 +16552,23 @@ export declare namespace Rpc {
16504
16552
  ? Map<Stubify<K>, Stubify<V>>
16505
16553
  : T extends Set<infer V>
16506
16554
  ? Set<Stubify<V>>
16507
- : T extends Array<infer V>
16508
- ? Array<Stubify<V>>
16509
- : T extends ReadonlyArray<infer V>
16510
- ? ReadonlyArray<Stubify<V>>
16511
- : T extends BaseType
16512
- ? T
16513
- : T extends {
16514
- [key: string | number]: any;
16515
- }
16516
- ? {
16517
- [K in keyof T]: Stubify<T[K]>;
16518
- }
16519
- : T;
16555
+ : T extends ReadonlyMap<infer K, infer V>
16556
+ ? ReadonlyMap<Stubify<K>, Stubify<V>>
16557
+ : T extends ReadonlySet<infer V>
16558
+ ? ReadonlySet<Stubify<V>>
16559
+ : T extends Array<infer V>
16560
+ ? Array<Stubify<V>>
16561
+ : T extends ReadonlyArray<infer V>
16562
+ ? ReadonlyArray<Stubify<V>>
16563
+ : T extends BaseType
16564
+ ? T
16565
+ : T extends {
16566
+ [key: string | number]: any;
16567
+ }
16568
+ ? {
16569
+ [K in keyof T]: Stubify<T[K]>;
16570
+ }
16571
+ : T;
16520
16572
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
16521
16573
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
16522
16574
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -16527,19 +16579,23 @@ export declare namespace Rpc {
16527
16579
  ? Map<Unstubify<K>, Unstubify<V>>
16528
16580
  : T extends Set<infer V>
16529
16581
  ? Set<Unstubify<V>>
16530
- : T extends Array<infer V>
16531
- ? Array<Unstubify<V>>
16532
- : T extends ReadonlyArray<infer V>
16533
- ? ReadonlyArray<Unstubify<V>>
16534
- : T extends BaseType
16535
- ? T
16536
- : T extends {
16537
- [key: string | number]: unknown;
16538
- }
16539
- ? {
16540
- [K in keyof T]: Unstubify<T[K]>;
16541
- }
16542
- : T;
16582
+ : T extends ReadonlyMap<infer K, infer V>
16583
+ ? ReadonlyMap<Unstubify<K>, Unstubify<V>>
16584
+ : T extends ReadonlySet<infer V>
16585
+ ? ReadonlySet<Unstubify<V>>
16586
+ : T extends Array<infer V>
16587
+ ? Array<Unstubify<V>>
16588
+ : T extends ReadonlyArray<infer V>
16589
+ ? ReadonlyArray<Unstubify<V>>
16590
+ : T extends BaseType
16591
+ ? T
16592
+ : T extends {
16593
+ [key: string | number]: unknown;
16594
+ }
16595
+ ? {
16596
+ [K in keyof T]: Unstubify<T[K]>;
16597
+ }
16598
+ : T;
16543
16599
  type UnstubifyAll<A extends any[]> = {
16544
16600
  [I in keyof A]: Unstubify<A[I]>;
16545
16601
  };
package/index.d.ts CHANGED
@@ -15251,7 +15251,16 @@ declare module "cloudflare:email" {
15251
15251
  * Evaluation context for targeting rules.
15252
15252
  * Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
15253
15253
  */
15254
- type FlagshipEvaluationContext = Record<string, string | number | boolean>;
15254
+ type FlagshipEvaluationContextValue =
15255
+ | string
15256
+ | number
15257
+ | boolean
15258
+ | null
15259
+ | FlagshipEvaluationContextValue[]
15260
+ | {
15261
+ [key: string]: FlagshipEvaluationContextValue;
15262
+ };
15263
+ type FlagshipEvaluationContext = Record<string, FlagshipEvaluationContextValue>;
15255
15264
  interface FlagshipEvaluationDetails<T> {
15256
15265
  flagKey: string;
15257
15266
  value: T;
@@ -15260,6 +15269,13 @@ interface FlagshipEvaluationDetails<T> {
15260
15269
  errorCode?: string | undefined;
15261
15270
  errorMessage?: string | undefined;
15262
15271
  }
15272
+ type FlagshipWidenedValue<T> = T extends boolean
15273
+ ? boolean
15274
+ : T extends string
15275
+ ? string
15276
+ : T extends number
15277
+ ? number
15278
+ : T;
15263
15279
  interface FlagshipEvaluationError extends Error {}
15264
15280
  /**
15265
15281
  * Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
@@ -15286,12 +15302,39 @@ declare abstract class Flagship {
15286
15302
  * @param flagKey The key of the flag to evaluate.
15287
15303
  * @param defaultValue Optional default value returned when evaluation fails.
15288
15304
  * @param context Optional evaluation context for targeting rules.
15305
+ * @deprecated Use getValue() instead.
15289
15306
  */
15290
15307
  get(
15291
15308
  flagKey: string,
15292
15309
  defaultValue?: unknown,
15293
15310
  context?: FlagshipEvaluationContext,
15294
15311
  ): Promise<unknown>;
15312
+ /**
15313
+ * Get a flag value, inferring its expected type from the default value.
15314
+ * @param flagKey The key of the flag to evaluate.
15315
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15316
+ * @param context Optional evaluation context for targeting rules.
15317
+ */
15318
+ getValue<
15319
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15320
+ >(
15321
+ flagKey: string,
15322
+ defaultValue: T,
15323
+ context?: FlagshipEvaluationContext,
15324
+ ): Promise<FlagshipWidenedValue<T>>;
15325
+ /**
15326
+ * Get a flag value with full evaluation details, inferring its expected type from the default value.
15327
+ * @param flagKey The key of the flag to evaluate.
15328
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15329
+ * @param context Optional evaluation context for targeting rules.
15330
+ */
15331
+ getDetails<
15332
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15333
+ >(
15334
+ flagKey: string,
15335
+ defaultValue: T,
15336
+ context?: FlagshipEvaluationContext,
15337
+ ): Promise<FlagshipEvaluationDetails<FlagshipWidenedValue<T>>>;
15295
15338
  /**
15296
15339
  * Get a boolean flag value.
15297
15340
  * @param flagKey The key of the flag to evaluate.
@@ -16195,6 +16238,11 @@ declare namespace Rpc {
16195
16238
  T extends Map<unknown, infer U> ? Serializable<U> : never
16196
16239
  >
16197
16240
  | Set<T extends Set<infer U> ? Serializable<U> : never>
16241
+ | ReadonlyMap<
16242
+ T extends ReadonlyMap<infer U, unknown> ? Serializable<U> : never,
16243
+ T extends ReadonlyMap<unknown, infer U> ? Serializable<U> : never
16244
+ >
16245
+ | ReadonlySet<T extends ReadonlySet<infer U> ? Serializable<U> : never>
16198
16246
  | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
16199
16247
  | {
16200
16248
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
@@ -16237,19 +16285,23 @@ declare namespace Rpc {
16237
16285
  ? Map<Stubify<K>, Stubify<V>>
16238
16286
  : T extends Set<infer V>
16239
16287
  ? Set<Stubify<V>>
16240
- : T extends Array<infer V>
16241
- ? Array<Stubify<V>>
16242
- : T extends ReadonlyArray<infer V>
16243
- ? ReadonlyArray<Stubify<V>>
16244
- : T extends BaseType
16245
- ? T
16246
- : T extends {
16247
- [key: string | number]: any;
16248
- }
16249
- ? {
16250
- [K in keyof T]: Stubify<T[K]>;
16251
- }
16252
- : T;
16288
+ : T extends ReadonlyMap<infer K, infer V>
16289
+ ? ReadonlyMap<Stubify<K>, Stubify<V>>
16290
+ : T extends ReadonlySet<infer V>
16291
+ ? ReadonlySet<Stubify<V>>
16292
+ : T extends Array<infer V>
16293
+ ? Array<Stubify<V>>
16294
+ : T extends ReadonlyArray<infer V>
16295
+ ? ReadonlyArray<Stubify<V>>
16296
+ : T extends BaseType
16297
+ ? T
16298
+ : T extends {
16299
+ [key: string | number]: any;
16300
+ }
16301
+ ? {
16302
+ [K in keyof T]: Stubify<T[K]>;
16303
+ }
16304
+ : T;
16253
16305
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
16254
16306
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
16255
16307
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -16260,19 +16312,23 @@ declare namespace Rpc {
16260
16312
  ? Map<Unstubify<K>, Unstubify<V>>
16261
16313
  : T extends Set<infer V>
16262
16314
  ? Set<Unstubify<V>>
16263
- : T extends Array<infer V>
16264
- ? Array<Unstubify<V>>
16265
- : T extends ReadonlyArray<infer V>
16266
- ? ReadonlyArray<Unstubify<V>>
16267
- : T extends BaseType
16268
- ? T
16269
- : T extends {
16270
- [key: string | number]: unknown;
16271
- }
16272
- ? {
16273
- [K in keyof T]: Unstubify<T[K]>;
16274
- }
16275
- : T;
16315
+ : T extends ReadonlyMap<infer K, infer V>
16316
+ ? ReadonlyMap<Unstubify<K>, Unstubify<V>>
16317
+ : T extends ReadonlySet<infer V>
16318
+ ? ReadonlySet<Unstubify<V>>
16319
+ : T extends Array<infer V>
16320
+ ? Array<Unstubify<V>>
16321
+ : T extends ReadonlyArray<infer V>
16322
+ ? ReadonlyArray<Unstubify<V>>
16323
+ : T extends BaseType
16324
+ ? T
16325
+ : T extends {
16326
+ [key: string | number]: unknown;
16327
+ }
16328
+ ? {
16329
+ [K in keyof T]: Unstubify<T[K]>;
16330
+ }
16331
+ : T;
16276
16332
  type UnstubifyAll<A extends any[]> = {
16277
16333
  [I in keyof A]: Unstubify<A[I]>;
16278
16334
  };
package/index.ts CHANGED
@@ -15246,9 +15246,18 @@ export declare type EmailExportedHandler<Env = unknown, Props = unknown> = (
15246
15246
  * Evaluation context for targeting rules.
15247
15247
  * Keys are attribute names (e.g. "userId", "country"), values are the attribute values.
15248
15248
  */
15249
+ export type FlagshipEvaluationContextValue =
15250
+ | string
15251
+ | number
15252
+ | boolean
15253
+ | null
15254
+ | FlagshipEvaluationContextValue[]
15255
+ | {
15256
+ [key: string]: FlagshipEvaluationContextValue;
15257
+ };
15249
15258
  export type FlagshipEvaluationContext = Record<
15250
15259
  string,
15251
- string | number | boolean
15260
+ FlagshipEvaluationContextValue
15252
15261
  >;
15253
15262
  export interface FlagshipEvaluationDetails<T> {
15254
15263
  flagKey: string;
@@ -15258,6 +15267,13 @@ export interface FlagshipEvaluationDetails<T> {
15258
15267
  errorCode?: string | undefined;
15259
15268
  errorMessage?: string | undefined;
15260
15269
  }
15270
+ export type FlagshipWidenedValue<T> = T extends boolean
15271
+ ? boolean
15272
+ : T extends string
15273
+ ? string
15274
+ : T extends number
15275
+ ? number
15276
+ : T;
15261
15277
  export interface FlagshipEvaluationError extends Error {}
15262
15278
  /**
15263
15279
  * Feature flags binding for evaluating feature flags from a Cloudflare Workers script.
@@ -15284,12 +15300,39 @@ export declare abstract class Flagship {
15284
15300
  * @param flagKey The key of the flag to evaluate.
15285
15301
  * @param defaultValue Optional default value returned when evaluation fails.
15286
15302
  * @param context Optional evaluation context for targeting rules.
15303
+ * @deprecated Use getValue() instead.
15287
15304
  */
15288
15305
  get(
15289
15306
  flagKey: string,
15290
15307
  defaultValue?: unknown,
15291
15308
  context?: FlagshipEvaluationContext,
15292
15309
  ): Promise<unknown>;
15310
+ /**
15311
+ * Get a flag value, inferring its expected type from the default value.
15312
+ * @param flagKey The key of the flag to evaluate.
15313
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15314
+ * @param context Optional evaluation context for targeting rules.
15315
+ */
15316
+ getValue<
15317
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15318
+ >(
15319
+ flagKey: string,
15320
+ defaultValue: T,
15321
+ context?: FlagshipEvaluationContext,
15322
+ ): Promise<FlagshipWidenedValue<T>>;
15323
+ /**
15324
+ * Get a flag value with full evaluation details, inferring its expected type from the default value.
15325
+ * @param flagKey The key of the flag to evaluate.
15326
+ * @param defaultValue Default value returned when evaluation fails or the flag type does not match.
15327
+ * @param context Optional evaluation context for targeting rules.
15328
+ */
15329
+ getDetails<
15330
+ T extends boolean | string | number | Record<string, unknown> | unknown[],
15331
+ >(
15332
+ flagKey: string,
15333
+ defaultValue: T,
15334
+ context?: FlagshipEvaluationContext,
15335
+ ): Promise<FlagshipEvaluationDetails<FlagshipWidenedValue<T>>>;
15293
15336
  /**
15294
15337
  * Get a boolean flag value.
15295
15338
  * @param flagKey The key of the flag to evaluate.
@@ -16114,6 +16157,11 @@ export declare namespace Rpc {
16114
16157
  T extends Map<unknown, infer U> ? Serializable<U> : never
16115
16158
  >
16116
16159
  | Set<T extends Set<infer U> ? Serializable<U> : never>
16160
+ | ReadonlyMap<
16161
+ T extends ReadonlyMap<infer U, unknown> ? Serializable<U> : never,
16162
+ T extends ReadonlyMap<unknown, infer U> ? Serializable<U> : never
16163
+ >
16164
+ | ReadonlySet<T extends ReadonlySet<infer U> ? Serializable<U> : never>
16117
16165
  | ReadonlyArray<T extends ReadonlyArray<infer U> ? Serializable<U> : never>
16118
16166
  | {
16119
16167
  [K in keyof T]: K extends number | string ? Serializable<T[K]> : never;
@@ -16156,19 +16204,23 @@ export declare namespace Rpc {
16156
16204
  ? Map<Stubify<K>, Stubify<V>>
16157
16205
  : T extends Set<infer V>
16158
16206
  ? Set<Stubify<V>>
16159
- : T extends Array<infer V>
16160
- ? Array<Stubify<V>>
16161
- : T extends ReadonlyArray<infer V>
16162
- ? ReadonlyArray<Stubify<V>>
16163
- : T extends BaseType
16164
- ? T
16165
- : T extends {
16166
- [key: string | number]: any;
16167
- }
16168
- ? {
16169
- [K in keyof T]: Stubify<T[K]>;
16170
- }
16171
- : T;
16207
+ : T extends ReadonlyMap<infer K, infer V>
16208
+ ? ReadonlyMap<Stubify<K>, Stubify<V>>
16209
+ : T extends ReadonlySet<infer V>
16210
+ ? ReadonlySet<Stubify<V>>
16211
+ : T extends Array<infer V>
16212
+ ? Array<Stubify<V>>
16213
+ : T extends ReadonlyArray<infer V>
16214
+ ? ReadonlyArray<Stubify<V>>
16215
+ : T extends BaseType
16216
+ ? T
16217
+ : T extends {
16218
+ [key: string | number]: any;
16219
+ }
16220
+ ? {
16221
+ [K in keyof T]: Stubify<T[K]>;
16222
+ }
16223
+ : T;
16172
16224
  // Recursively rewrite all `Stub<T>`s with the corresponding `T`s.
16173
16225
  // Note we use `StubBase` instead of `Stub` here to avoid circular dependencies:
16174
16226
  // `Stub` depends on `Provider`, which depends on `Unstubify`, which would depend on `Stub`.
@@ -16179,19 +16231,23 @@ export declare namespace Rpc {
16179
16231
  ? Map<Unstubify<K>, Unstubify<V>>
16180
16232
  : T extends Set<infer V>
16181
16233
  ? Set<Unstubify<V>>
16182
- : T extends Array<infer V>
16183
- ? Array<Unstubify<V>>
16184
- : T extends ReadonlyArray<infer V>
16185
- ? ReadonlyArray<Unstubify<V>>
16186
- : T extends BaseType
16187
- ? T
16188
- : T extends {
16189
- [key: string | number]: unknown;
16190
- }
16191
- ? {
16192
- [K in keyof T]: Unstubify<T[K]>;
16193
- }
16194
- : T;
16234
+ : T extends ReadonlyMap<infer K, infer V>
16235
+ ? ReadonlyMap<Unstubify<K>, Unstubify<V>>
16236
+ : T extends ReadonlySet<infer V>
16237
+ ? ReadonlySet<Unstubify<V>>
16238
+ : T extends Array<infer V>
16239
+ ? Array<Unstubify<V>>
16240
+ : T extends ReadonlyArray<infer V>
16241
+ ? ReadonlyArray<Unstubify<V>>
16242
+ : T extends BaseType
16243
+ ? T
16244
+ : T extends {
16245
+ [key: string | number]: unknown;
16246
+ }
16247
+ ? {
16248
+ [K in keyof T]: Unstubify<T[K]>;
16249
+ }
16250
+ : T;
16195
16251
  type UnstubifyAll<A extends any[]> = {
16196
16252
  [I in keyof A]: Unstubify<A[I]>;
16197
16253
  };
package/package.json CHANGED
@@ -7,7 +7,7 @@
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.20261006.1-depup.0",
10
+ "version": "5.20261007.1-depup.0",
11
11
  "keywords": [
12
12
  "@cloudflare/workers-types",
13
13
  "depup",
@@ -20,8 +20,8 @@
20
20
  "changes": {},
21
21
  "depsUpdated": 0,
22
22
  "originalPackage": "@cloudflare/workers-types",
23
- "originalVersion": "5.20261006.1",
24
- "processedAt": "2026-10-06T08:12:18.455Z",
23
+ "originalVersion": "5.20261007.1",
24
+ "processedAt": "2026-10-07T08:12:36.866Z",
25
25
  "smokeTest": "failed"
26
26
  }
27
27
  }