@@ -17,6 +17,7 @@ import { IConfigurationStore } from '../configuration-store/configuration-store'
17
17
import { MemoryOnlyConfigurationStore } from '../configuration-store/memory.store' ;
18
18
import { MAX_EVENT_QUEUE_SIZE , DEFAULT_POLL_INTERVAL_MS , POLL_JITTER_PCT } from '../constants' ;
19
19
import { Flag , ObfuscatedFlag , VariationType } from '../interfaces' ;
20
+ import { AttributeType } from '../types' ;
20
21
21
22
import EppoClient , { FlagConfigurationRequestParameters , checkTypeMatch } from './eppo-client' ;
22
23
import { initConfiguration } from './test-utils' ;
@@ -214,7 +215,12 @@ describe('EppoClient E2E test', () => {
214
215
[ VariationType . JSON ] : client . getJSONAssignment . bind ( client ) ,
215
216
} ;
216
217
217
- const assignmentFn = typeAssignmentFunctions [ variationType ] ;
218
+ const assignmentFn = typeAssignmentFunctions [ variationType ] as (
219
+ flagKey : string ,
220
+ subjectKey : string ,
221
+ subjectAttributes : Record < string , AttributeType > ,
222
+ defaultValue : boolean | string | number | object ,
223
+ ) => never ;
218
224
if ( ! assignmentFn ) {
219
225
throw new Error ( `Unknown variation type: ${ variationType } ` ) ;
220
226
}
@@ -258,7 +264,12 @@ describe('EppoClient E2E test', () => {
258
264
[ VariationType . JSON ] : client . getJSONAssignment . bind ( client ) ,
259
265
} ;
260
266
261
- const assignmentFn = typeAssignmentFunctions [ variationType ] ;
267
+ const assignmentFn = typeAssignmentFunctions [ variationType ] as (
268
+ flagKey : string ,
269
+ subjectKey : string ,
270
+ subjectAttributes : Record < string , AttributeType > ,
271
+ defaultValue : boolean | string | number | object ,
272
+ ) => never ;
262
273
if ( ! assignmentFn ) {
263
274
throw new Error ( `Unknown variation type: ${ variationType } ` ) ;
264
275
}
0 commit comments