export declare interface FeatureScopeKeyProvider { featureFlagScope: string | number | (() => string | number) featureFlagType?: string | (() => string) } export declare interface FeatureContext { name: string scope: Scope scopeKey: string } export declare interface FeatureEvaluation extends FeatureContext { value: FeatureValue source: FeatureEvaluationSource } export declare interface FeatureDriver { get: (name: string, scopeKey: string) => Promise set: (name: string, scopeKey: string, value: FeatureValue) => Promise delete: (name: string, scopeKey: string) => Promise deleteForAllScopes: (names?: readonly string[]) => Promise clear: () => Promise stored: (scopeKey: string) => Promise> } export declare interface FeatureFlagManagerOptions { driver?: FeatureDriver | FeatureDriverFactory missing?: 'false' | 'throw' scopeResolver?: (scope: FeatureScope) => string } export declare interface DatabaseFeatureFlagDriverOptions { table?: string autoCreate?: boolean dialect?: 'sqlite' | 'mysql' | 'postgres' } export declare interface FeatureDatabaseClient { selectFrom: (table: string) => any insertInto: (table: string) => any updateTable: (table: string) => any deleteFrom: (table: string) => any unsafe?: (sql: string) => any } export type FeatureScalar = boolean | string | number | null; export type FeatureValue = | FeatureScalar | { [key: string]: FeatureValue } | FeatureValue[]; export type FeatureScope = unknown; export type FeatureResolver = ( scope: Scope, context: FeatureContext, ) => FeatureValue | Promise; export type FeatureDefinition = FeatureValue | FeatureResolver; export type FeatureEvaluationSource = 'stored' | 'resolver' | 'missing'; export type FeatureDriverFactory = () => FeatureDriver | Promise;