diff --git a/types/defines/flags.d.ts b/types/defines/flagship.d.ts similarity index 84% rename from types/defines/flags.d.ts rename to types/defines/flagship.d.ts index 827904bffc3..dc4bfb47779 100644 --- a/types/defines/flags.d.ts +++ b/types/defines/flagship.d.ts @@ -2,9 +2,12 @@ * Evaluation context for targeting rules. * Keys are attribute names (e.g. "userId", "country"), values are the attribute values. */ -export type EvaluationContext = Record; +export type FlagshipEvaluationContext = Record< + string, + string | number | boolean +>; -export interface EvaluationDetails { +export interface FlagshipEvaluationDetails { flagKey: string; value: T; variant?: string | undefined; @@ -13,7 +16,7 @@ export interface EvaluationDetails { errorMessage?: string | undefined; } -export interface FlagEvaluationError extends Error {} +export interface FlagshipEvaluationError extends Error {} /** * Feature flags binding for evaluating feature flags from a Cloudflare Workers script. @@ -34,7 +37,7 @@ export interface FlagEvaluationError extends Error {} * console.log(details.variant, details.reason); * ``` */ -export declare abstract class Flags { +export declare abstract class Flagship { /** * Get a flag value without type checking. * @param flagKey The key of the flag to evaluate. @@ -44,7 +47,7 @@ export declare abstract class Flags { get( flagKey: string, defaultValue?: unknown, - context?: EvaluationContext + context?: FlagshipEvaluationContext ): Promise; /** @@ -56,7 +59,7 @@ export declare abstract class Flags { getBooleanValue( flagKey: string, defaultValue: boolean, - context?: EvaluationContext + context?: FlagshipEvaluationContext ): Promise; /** @@ -68,7 +71,7 @@ export declare abstract class Flags { getStringValue( flagKey: string, defaultValue: string, - context?: EvaluationContext + context?: FlagshipEvaluationContext ): Promise; /** @@ -80,7 +83,7 @@ export declare abstract class Flags { getNumberValue( flagKey: string, defaultValue: number, - context?: EvaluationContext + context?: FlagshipEvaluationContext ): Promise; /** @@ -92,7 +95,7 @@ export declare abstract class Flags { getObjectValue( flagKey: string, defaultValue: T, - context?: EvaluationContext + context?: FlagshipEvaluationContext ): Promise; /** @@ -104,8 +107,8 @@ export declare abstract class Flags { getBooleanDetails( flagKey: string, defaultValue: boolean, - context?: EvaluationContext - ): Promise>; + context?: FlagshipEvaluationContext + ): Promise>; /** * Get a string flag value with full evaluation details. @@ -116,8 +119,8 @@ export declare abstract class Flags { getStringDetails( flagKey: string, defaultValue: string, - context?: EvaluationContext - ): Promise>; + context?: FlagshipEvaluationContext + ): Promise>; /** * Get a number flag value with full evaluation details. @@ -128,8 +131,8 @@ export declare abstract class Flags { getNumberDetails( flagKey: string, defaultValue: number, - context?: EvaluationContext - ): Promise>; + context?: FlagshipEvaluationContext + ): Promise>; /** * Get an object flag value with full evaluation details. @@ -140,6 +143,6 @@ export declare abstract class Flags { getObjectDetails( flagKey: string, defaultValue: T, - context?: EvaluationContext - ): Promise>; + context?: FlagshipEvaluationContext + ): Promise>; } diff --git a/types/generated-snapshot/experimental/index.d.ts b/types/generated-snapshot/experimental/index.d.ts index 9528577967c..bfae197690a 100755 --- a/types/generated-snapshot/experimental/index.d.ts +++ b/types/generated-snapshot/experimental/index.d.ts @@ -12816,8 +12816,8 @@ declare module "cloudflare:email" { * Evaluation context for targeting rules. * Keys are attribute names (e.g. "userId", "country"), values are the attribute values. */ -type EvaluationContext = Record; -interface EvaluationDetails { +type FlagshipEvaluationContext = Record; +interface FlagshipEvaluationDetails { flagKey: string; value: T; variant?: string | undefined; @@ -12825,7 +12825,7 @@ interface EvaluationDetails { errorCode?: string | undefined; errorMessage?: string | undefined; } -interface FlagEvaluationError extends Error {} +interface FlagshipEvaluationError extends Error {} /** * Feature flags binding for evaluating feature flags from a Cloudflare Workers script. * @@ -12845,7 +12845,7 @@ interface FlagEvaluationError extends Error {} * console.log(details.variant, details.reason); * ``` */ -declare abstract class Flags { +declare abstract class Flagship { /** * Get a flag value without type checking. * @param flagKey The key of the flag to evaluate. @@ -12855,7 +12855,7 @@ declare abstract class Flags { get( flagKey: string, defaultValue?: unknown, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value. @@ -12866,7 +12866,7 @@ declare abstract class Flags { getBooleanValue( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a string flag value. @@ -12877,7 +12877,7 @@ declare abstract class Flags { getStringValue( flagKey: string, defaultValue: string, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a number flag value. @@ -12888,7 +12888,7 @@ declare abstract class Flags { getNumberValue( flagKey: string, defaultValue: number, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get an object flag value. @@ -12899,7 +12899,7 @@ declare abstract class Flags { getObjectValue( flagKey: string, defaultValue: T, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value with full evaluation details. @@ -12910,8 +12910,8 @@ declare abstract class Flags { getBooleanDetails( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a string flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12921,8 +12921,8 @@ declare abstract class Flags { getStringDetails( flagKey: string, defaultValue: string, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a number flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12932,8 +12932,8 @@ declare abstract class Flags { getNumberDetails( flagKey: string, defaultValue: number, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get an object flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12943,8 +12943,8 @@ declare abstract class Flags { getObjectDetails( flagKey: string, defaultValue: T, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; } /** * Hello World binding to serve as an explanatory example. DO NOT USE diff --git a/types/generated-snapshot/experimental/index.ts b/types/generated-snapshot/experimental/index.ts index fccf25f209f..aee4337f175 100755 --- a/types/generated-snapshot/experimental/index.ts +++ b/types/generated-snapshot/experimental/index.ts @@ -12832,8 +12832,11 @@ export declare type EmailExportedHandler = ( * Evaluation context for targeting rules. * Keys are attribute names (e.g. "userId", "country"), values are the attribute values. */ -export type EvaluationContext = Record; -export interface EvaluationDetails { +export type FlagshipEvaluationContext = Record< + string, + string | number | boolean +>; +export interface FlagshipEvaluationDetails { flagKey: string; value: T; variant?: string | undefined; @@ -12841,7 +12844,7 @@ export interface EvaluationDetails { errorCode?: string | undefined; errorMessage?: string | undefined; } -export interface FlagEvaluationError extends Error {} +export interface FlagshipEvaluationError extends Error {} /** * Feature flags binding for evaluating feature flags from a Cloudflare Workers script. * @@ -12861,7 +12864,7 @@ export interface FlagEvaluationError extends Error {} * console.log(details.variant, details.reason); * ``` */ -export declare abstract class Flags { +export declare abstract class Flagship { /** * Get a flag value without type checking. * @param flagKey The key of the flag to evaluate. @@ -12871,7 +12874,7 @@ export declare abstract class Flags { get( flagKey: string, defaultValue?: unknown, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value. @@ -12882,7 +12885,7 @@ export declare abstract class Flags { getBooleanValue( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a string flag value. @@ -12893,7 +12896,7 @@ export declare abstract class Flags { getStringValue( flagKey: string, defaultValue: string, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a number flag value. @@ -12904,7 +12907,7 @@ export declare abstract class Flags { getNumberValue( flagKey: string, defaultValue: number, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get an object flag value. @@ -12915,7 +12918,7 @@ export declare abstract class Flags { getObjectValue( flagKey: string, defaultValue: T, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value with full evaluation details. @@ -12926,8 +12929,8 @@ export declare abstract class Flags { getBooleanDetails( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a string flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12937,8 +12940,8 @@ export declare abstract class Flags { getStringDetails( flagKey: string, defaultValue: string, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a number flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12948,8 +12951,8 @@ export declare abstract class Flags { getNumberDetails( flagKey: string, defaultValue: number, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get an object flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12959,8 +12962,8 @@ export declare abstract class Flags { getObjectDetails( flagKey: string, defaultValue: T, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; } /** * Hello World binding to serve as an explanatory example. DO NOT USE diff --git a/types/generated-snapshot/latest/index.d.ts b/types/generated-snapshot/latest/index.d.ts index ada160044bf..06d2a3ceab9 100755 --- a/types/generated-snapshot/latest/index.d.ts +++ b/types/generated-snapshot/latest/index.d.ts @@ -12124,8 +12124,8 @@ declare module "cloudflare:email" { * Evaluation context for targeting rules. * Keys are attribute names (e.g. "userId", "country"), values are the attribute values. */ -type EvaluationContext = Record; -interface EvaluationDetails { +type FlagshipEvaluationContext = Record; +interface FlagshipEvaluationDetails { flagKey: string; value: T; variant?: string | undefined; @@ -12133,7 +12133,7 @@ interface EvaluationDetails { errorCode?: string | undefined; errorMessage?: string | undefined; } -interface FlagEvaluationError extends Error {} +interface FlagshipEvaluationError extends Error {} /** * Feature flags binding for evaluating feature flags from a Cloudflare Workers script. * @@ -12153,7 +12153,7 @@ interface FlagEvaluationError extends Error {} * console.log(details.variant, details.reason); * ``` */ -declare abstract class Flags { +declare abstract class Flagship { /** * Get a flag value without type checking. * @param flagKey The key of the flag to evaluate. @@ -12163,7 +12163,7 @@ declare abstract class Flags { get( flagKey: string, defaultValue?: unknown, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value. @@ -12174,7 +12174,7 @@ declare abstract class Flags { getBooleanValue( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a string flag value. @@ -12185,7 +12185,7 @@ declare abstract class Flags { getStringValue( flagKey: string, defaultValue: string, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a number flag value. @@ -12196,7 +12196,7 @@ declare abstract class Flags { getNumberValue( flagKey: string, defaultValue: number, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get an object flag value. @@ -12207,7 +12207,7 @@ declare abstract class Flags { getObjectValue( flagKey: string, defaultValue: T, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value with full evaluation details. @@ -12218,8 +12218,8 @@ declare abstract class Flags { getBooleanDetails( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a string flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12229,8 +12229,8 @@ declare abstract class Flags { getStringDetails( flagKey: string, defaultValue: string, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a number flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12240,8 +12240,8 @@ declare abstract class Flags { getNumberDetails( flagKey: string, defaultValue: number, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get an object flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12251,8 +12251,8 @@ declare abstract class Flags { getObjectDetails( flagKey: string, defaultValue: T, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; } /** * Hello World binding to serve as an explanatory example. DO NOT USE diff --git a/types/generated-snapshot/latest/index.ts b/types/generated-snapshot/latest/index.ts index 54bd199b596..7276b9f821f 100755 --- a/types/generated-snapshot/latest/index.ts +++ b/types/generated-snapshot/latest/index.ts @@ -12140,8 +12140,11 @@ export declare type EmailExportedHandler = ( * Evaluation context for targeting rules. * Keys are attribute names (e.g. "userId", "country"), values are the attribute values. */ -export type EvaluationContext = Record; -export interface EvaluationDetails { +export type FlagshipEvaluationContext = Record< + string, + string | number | boolean +>; +export interface FlagshipEvaluationDetails { flagKey: string; value: T; variant?: string | undefined; @@ -12149,7 +12152,7 @@ export interface EvaluationDetails { errorCode?: string | undefined; errorMessage?: string | undefined; } -export interface FlagEvaluationError extends Error {} +export interface FlagshipEvaluationError extends Error {} /** * Feature flags binding for evaluating feature flags from a Cloudflare Workers script. * @@ -12169,7 +12172,7 @@ export interface FlagEvaluationError extends Error {} * console.log(details.variant, details.reason); * ``` */ -export declare abstract class Flags { +export declare abstract class Flagship { /** * Get a flag value without type checking. * @param flagKey The key of the flag to evaluate. @@ -12179,7 +12182,7 @@ export declare abstract class Flags { get( flagKey: string, defaultValue?: unknown, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value. @@ -12190,7 +12193,7 @@ export declare abstract class Flags { getBooleanValue( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a string flag value. @@ -12201,7 +12204,7 @@ export declare abstract class Flags { getStringValue( flagKey: string, defaultValue: string, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a number flag value. @@ -12212,7 +12215,7 @@ export declare abstract class Flags { getNumberValue( flagKey: string, defaultValue: number, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get an object flag value. @@ -12223,7 +12226,7 @@ export declare abstract class Flags { getObjectValue( flagKey: string, defaultValue: T, - context?: EvaluationContext, + context?: FlagshipEvaluationContext, ): Promise; /** * Get a boolean flag value with full evaluation details. @@ -12234,8 +12237,8 @@ export declare abstract class Flags { getBooleanDetails( flagKey: string, defaultValue: boolean, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a string flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12245,8 +12248,8 @@ export declare abstract class Flags { getStringDetails( flagKey: string, defaultValue: string, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get a number flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12256,8 +12259,8 @@ export declare abstract class Flags { getNumberDetails( flagKey: string, defaultValue: number, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; /** * Get an object flag value with full evaluation details. * @param flagKey The key of the flag to evaluate. @@ -12267,8 +12270,8 @@ export declare abstract class Flags { getObjectDetails( flagKey: string, defaultValue: T, - context?: EvaluationContext, - ): Promise>; + context?: FlagshipEvaluationContext, + ): Promise>; } /** * Hello World binding to serve as an explanatory example. DO NOT USE