UNPKG

3.15 kBTypeScriptView Raw
1import { IndexedSnapshot, Incoming, MessageBeforeTransform, MergeableWrapper } from './data_structure';
2import { SportsFeedMessageGroup } from './message_class';
3import { IMessageClass } from '@jayesol/jayeson.lib.delivery';
4import { IBetMatch, PartitionKey } from '@jayesol/jayeson.lib.record';
5import * as Collections from 'typescript-collections';
6export declare enum MsgType {
7 INSERT = 0,
8 UPDATE = 1,
9 DELETE = 2
10}
11export declare class SnapshotUtil {
12 private static readonly SPORTS_GROUP;
13 static combineSnapshots(msgType: IMessageClass, childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
14 static processRefresh(childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
15 static processReset(childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
16 static processMatches(msgType: MsgType, childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
17 static processEvents(msgType: MsgType, childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
18 static processOdds(msgType: MsgType, childSs: IndexedSnapshot, parentSs: IndexedSnapshot): MessageBeforeTransform;
19}
20export declare class DeltaTransformingLogicImpl {
21 static transform(sportsGrp: SportsFeedMessageGroup, stream: string, msgType: IMessageClass, delta: IndexedSnapshot, msgBefore: MessageBeforeTransform): Incoming[];
22 static combineEventState(msgBefore: MessageBeforeTransform, sportsGrp: SportsFeedMessageGroup, msgType: IMessageClass, stream: string, delta: IndexedSnapshot, msg: Incoming[]): Incoming[];
23 static suppressInsertEvent(msgBefore: MessageBeforeTransform, sportsGrp: SportsFeedMessageGroup, msgType: IMessageClass, stream: string, delta: IndexedSnapshot, msg: Incoming[]): Incoming[];
24 static transformTTLRestore(ttlRestoredList: IndexedSnapshot[], grp: SportsFeedMessageGroup, stream: string, before: IndexedSnapshot, after: IndexedSnapshot, matches: {
25 [sport: number]: IBetMatch[];
26 }, restoredKeys: Collections.Dictionary<PartitionKey, number>): MergeableWrapper;
27 static transformTTLRemove(ttlRemoveList: IndexedSnapshot[], grp: SportsFeedMessageGroup, stream: string, before: IndexedSnapshot, after: IndexedSnapshot, keysRemoved: Collections.Dictionary<PartitionKey, number>): MergeableWrapper;
28 static breakdownTTL(grp: SportsFeedMessageGroup, stream: string, restoredSS: IndexedSnapshot): Incoming[];
29 static breakdownReset(grp: SportsFeedMessageGroup, stream: string, removeSs: IndexedSnapshot): Incoming[];
30 static suppressInsertMatch(msgBefore: MessageBeforeTransform, sportsGrp: SportsFeedMessageGroup, msgType: IMessageClass, stream: string, delta: IndexedSnapshot, msg: Incoming[]): Incoming[];
31 static suppressDeleteEvent(msgBefore: MessageBeforeTransform, sportsGrp: SportsFeedMessageGroup, msgType: IMessageClass, stream: string, delta: IndexedSnapshot, msg: Incoming[]): Incoming[];
32 static suppressDeleteMatch(msgBefore: MessageBeforeTransform, sportsGrp: SportsFeedMessageGroup, msgType: IMessageClass, stream: string, delta: IndexedSnapshot, msg: Incoming[]): Incoming[];
33}