11import SplitIO from '../../types/splitio' ;
2- import { MaybeThenable , ISplit , IRBSegment , IMySegmentsResponse } from '../dtos/types' ;
2+ import { MaybeThenable , ISplit , IRBSegment , IMySegmentsResponse , IMembershipsResponse , ISegmentChangesResponse , ISplitChangesResponse } from '../dtos/types' ;
33import { MySegmentsData } from '../sync/polling/types' ;
44import { EventDataType , HttpErrors , HttpLatencies , ImpressionDataType , LastSync , Method , MethodExceptions , MethodLatencies , MultiMethodExceptions , MultiMethodLatencies , MultiConfigs , OperationType , StoredEventWithMetadata , StoredImpressionWithMetadata , StreamingEvent , UniqueKeysPayloadCs , UniqueKeysPayloadSs , TelemetryUsageStatsPayload , UpdatesFromSSEEnum } from '../sync/submitters/types' ;
55import { ISettings } from '../types' ;
@@ -235,6 +235,7 @@ export interface IRBSegmentsCacheSync extends IRBSegmentsCacheBase {
235235 update ( toAdd : IRBSegment [ ] , toRemove : IRBSegment [ ] , changeNumber : number ) : boolean ,
236236 get ( name : string ) : IRBSegment | null ,
237237 getChangeNumber ( ) : number ,
238+ getAll ( ) : IRBSegment [ ] ,
238239 clear ( ) : void ,
239240 contains ( names : Set < string > ) : boolean ,
240241 // Used only for smart pausing in client-side standalone. Returns true if the storage contains a RBSegment using segments or large segments matchers
@@ -465,7 +466,7 @@ export interface IStorageBase<
465466 telemetry ?: TTelemetryCache ,
466467 uniqueKeys : TUniqueKeysCache ,
467468 destroy ( ) : void | Promise < void > ,
468- shared ?: ( matchingKey : string , onReadyCb : ( error ?: any ) => void ) => this
469+ shared ?: ( matchingKey : string , onReadyCb ? : ( error ?: any ) => void ) => this
469470}
470471
471472export interface IStorageSync extends IStorageBase <
@@ -496,15 +497,16 @@ export interface IStorageAsync extends IStorageBase<
496497
497498/** StorageFactory */
498499
499- export type DataLoader = ( storage : IStorageSync , matchingKey : string ) => void
500-
501500export interface IStorageFactoryParams {
502501 settings : ISettings ,
503502 /**
504503 * Error-first callback invoked when the storage is ready to be used. An error means that the storage failed to connect and shouldn't be used.
505504 * It is meant for emitting SDK_READY event in consumer mode, and waiting before using the storage in the synchronizer.
506505 */
507506 onReadyCb : ( error ?: any ) => void ,
507+ /**
508+ * For emitting SDK_READY_FROM_CACHE event in consumer mode with Redis to allow immediate evaluations
509+ */
508510 onReadyFromCacheCb : ( ) => void ,
509511}
510512
@@ -518,3 +520,21 @@ export type IStorageAsyncFactory = SplitIO.StorageAsyncFactory & {
518520 readonly type : SplitIO . StorageType ,
519521 ( params : IStorageFactoryParams ) : IStorageAsync
520522}
523+
524+ export type RolloutPlan = {
525+ /**
526+ * Feature flags and rule-based segments.
527+ */
528+ splitChanges : ISplitChangesResponse ;
529+ /**
530+ * Optional map of matching keys to their memberships.
531+ */
532+ memberships ?: {
533+ [ matchingKey : string ] : IMembershipsResponse ;
534+ } ;
535+ /**
536+ * Optional list of standard segments.
537+ * This property is ignored if `memberships` is provided.
538+ */
539+ segmentChanges ?: ISegmentChangesResponse [ ] ;
540+ } ;
0 commit comments