|
1 | 1 | import SplitIO from '../../types/splitio'; |
2 | | -import { MaybeThenable, ISplit, IMySegmentsResponse } from '../dtos/types'; |
| 2 | +import { MaybeThenable, ISplit, IRBSegment, IMySegmentsResponse } from '../dtos/types'; |
3 | 3 | import { MySegmentsData } from '../sync/polling/types'; |
4 | 4 | import { EventDataType, HttpErrors, HttpLatencies, ImpressionDataType, LastSync, Method, MethodExceptions, MethodLatencies, MultiMethodExceptions, MultiMethodLatencies, MultiConfigs, OperationType, StoredEventWithMetadata, StoredImpressionWithMetadata, StreamingEvent, UniqueKeysPayloadCs, UniqueKeysPayloadSs, TelemetryUsageStatsPayload, UpdatesFromSSEEnum } from '../sync/submitters/types'; |
5 | 5 | import { ISettings } from '../types'; |
@@ -225,6 +225,34 @@ export interface ISplitsCacheAsync extends ISplitsCacheBase { |
225 | 225 | getNamesByFlagSets(flagSets: string[]): Promise<Set<string>[]> |
226 | 226 | } |
227 | 227 |
|
| 228 | +/** Rule-Based Segments cache */ |
| 229 | + |
| 230 | +export interface IRBSegmentsCacheBase { |
| 231 | + update(toAdd: IRBSegment[], toRemove: IRBSegment[], changeNumber: number): MaybeThenable<boolean>, |
| 232 | + get(name: string): MaybeThenable<IRBSegment | null>, |
| 233 | + getChangeNumber(): MaybeThenable<number>, |
| 234 | + clear(): MaybeThenable<boolean | void>, |
| 235 | + contains(names: Set<string>): MaybeThenable<boolean>, |
| 236 | +} |
| 237 | + |
| 238 | +export interface IRBSegmentsCacheSync extends IRBSegmentsCacheBase { |
| 239 | + update(toAdd: IRBSegment[], toRemove: IRBSegment[], changeNumber: number): boolean, |
| 240 | + get(name: string): IRBSegment | null, |
| 241 | + getChangeNumber(): number, |
| 242 | + clear(): void, |
| 243 | + contains(names: Set<string>): boolean, |
| 244 | + // Used only for smart pausing in client-side standalone. Returns true if the storage contains a RBSegment using segments or large segments matchers |
| 245 | + usesSegments(): boolean, |
| 246 | +} |
| 247 | + |
| 248 | +export interface IRBSegmentsCacheAsync extends IRBSegmentsCacheBase { |
| 249 | + update(toAdd: IRBSegment[], toRemove: IRBSegment[], changeNumber: number): Promise<boolean>, |
| 250 | + get(name: string): Promise<IRBSegment | null>, |
| 251 | + getChangeNumber(): Promise<number>, |
| 252 | + clear(): Promise<boolean | void>, |
| 253 | + contains(names: Set<string>): Promise<boolean>, |
| 254 | +} |
| 255 | + |
228 | 256 | /** Segments cache */ |
229 | 257 |
|
230 | 258 | export interface ISegmentsCacheBase { |
|
0 commit comments