Here is the snippet we use:
import type { Config } from '@optimizely/optimizely-sdk';
type OptimizelyDatafile = Config['datafile'];
When you import the type, you can see its string | object
which is clearly not good enough for the object type, because in general shape of datafile is at least the following:
export const FALLBACK_DATAFILE = {
rollouts: [],
typedAudiences: [],
anonymizeIP:true,
variables: [],
featureFlags: [],
experiments: [],
audiences: [],
groups: [],
attributes: [],
botFiltering:true,
events: [],
revision:'1',
version:'4'
};
so clearly the datafile is ought to be more specific than object, can we get it properly typed in its shape, values and all the fields within it too?