import type { ABConfig, AbbyConfig, RemoteConfigValueString } from "."; import type { ValidatorType } from "./validation"; export const DYNAMIC_ABBY_CONFIG_KEYS = [ "projectId", "currentEnvironment", "debug", "apiUrl", "__experimentalCdnUrl", ] as const satisfies readonly (keyof AbbyConfig)[]; export type DynamicConfigKeys = (typeof DYNAMIC_ABBY_CONFIG_KEYS)[number]; export function defineConfig< const FlagName extends string, const Tests extends Record, const RemoteConfig extends Record, const RemoteConfigName extends Extract, const User extends Record = Record< string, ValidatorType >, >( dynamicConfig: Pick< AbbyConfig, DynamicConfigKeys >, config: Omit< AbbyConfig, DynamicConfigKeys > ) { return { ...dynamicConfig, ...config }; }