-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtypes.ts
More file actions
43 lines (35 loc) · 1.6 KB
/
Copy pathtypes.ts
File metadata and controls
43 lines (35 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { IRBSegment, ISplit } from '../../dtos/types';
import { IReadinessManager } from '../../readiness/types';
import { IStorageSync } from '../../storages/types';
import { MEMBERSHIPS_LS_UPDATE, MEMBERSHIPS_MS_UPDATE } from '../streaming/types';
import { ITask, ISyncTask } from '../types';
export interface ISplitsSyncTask extends ISyncTask<[noCache?: boolean, till?: number, splitUpdateNotification?: { payload: ISplit | IRBSegment, changeNumber: number }], boolean> { }
export interface ISegmentsSyncTask extends ISyncTask<[fetchOnlyNew?: boolean, segmentName?: string, noCache?: boolean, till?: number], boolean> { }
export type MySegmentsData = {
type: MEMBERSHIPS_MS_UPDATE | MEMBERSHIPS_LS_UPDATE
cn: number
added: string[]
removed: string[]
}
export interface IMySegmentsSyncTask extends ISyncTask<[segmentsData?: MySegmentsData, noCache?: boolean, till?: number], boolean> { }
export interface IPollingManager extends ITask {
syncAll(): Promise<any>
splitsSyncTask: ISplitsSyncTask
segmentsSyncTask: ISyncTask
}
/**
* PollingManager for client-side with support for multiple clients
*/
export interface IPollingManagerCS extends IPollingManager {
add(matchingKey: string, readiness: IReadinessManager, storage: IStorageSync): IMySegmentsSyncTask
remove(matchingKey: string): void;
get(matchingKey: string): IMySegmentsSyncTask | undefined
}
export enum SdkUpdateMetadataKeys {
UPDATED_FLAGS = 'updatedFlags',
UPDATED_SEGMENTS = 'updatedSegments'
}
export type SdkUpdateMetadata = {
[SdkUpdateMetadataKeys.UPDATED_FLAGS]?: string[]
[SdkUpdateMetadataKeys.UPDATED_SEGMENTS]?: string[]
}