UNPKG

3.73 kBTypeScriptView Raw
1import * as Collections from 'typescript-collections';
2import { IMessageClass } from "@jayesol/jayeson.lib.delivery";
3import { ISnapshot, Snapshot, PartitionKey, IBetMatch } from "@jayesol/jayeson.lib.record";
4export declare class Incoming {
5 private _msgType;
6 private _stream;
7 private _data;
8 constructor(_msgType: IMessageClass, _stream: string, _data: IndexedSnapshot);
9 msgType(): IMessageClass;
10 stream(): string;
11 data(): IndexedSnapshot;
12}
13export interface IndexedSnapshot extends ISnapshot<IBetMatch> {
14 getPartitions(): Collections.Set<PartitionKey>;
15 getPartitionMap(): Collections.Dictionary<PartitionKey, number>;
16}
17export declare class IndexedSnapshotImpl extends Snapshot<IBetMatch> implements IndexedSnapshot {
18 private partitions;
19 static EMPTY_SNAPSHOT: IndexedSnapshotImpl;
20 constructor(matches?: {
21 [sport: number]: IBetMatch[];
22 }, partitions?: Collections.Dictionary<PartitionKey, number>);
23 getPartitions(): Collections.Set<PartitionKey>;
24 getPartitionMap(): Collections.Dictionary<PartitionKey, number>;
25}
26export interface Outgoing {
27 msgType(): IMessageClass;
28}
29export interface DeltaOutgoing extends Outgoing {
30 /**
31 * Indexed snapshot after Merge
32 */
33 after(): IndexedSnapshot;
34 /**
35 * Contents of this Delta
36 */
37 delta(): IndexedSnapshot;
38 /**
39 * Indexed Snapshot before Merge
40 */
41 before(): IndexedSnapshot;
42}
43export declare class OutgoingImpl implements Outgoing {
44 private _msgType;
45 private _msg;
46 constructor(_msgType: IMessageClass, _msg: any);
47 msgType(): IMessageClass;
48 msg(): any;
49}
50export declare class DeltaOutgoingImpl extends OutgoingImpl implements DeltaOutgoing {
51 private _delta;
52 private _after?;
53 private _before?;
54 constructor(_msgType: IMessageClass, _delta: IndexedSnapshot, _after?: IndexedSnapshot, _before?: IndexedSnapshot);
55 after(): IndexedSnapshot;
56 delta(): IndexedSnapshot;
57 before(): IndexedSnapshot;
58}
59export declare class MessageBeforeTransform {
60 private transformEvent;
61 private insertEvent;
62 private deleteEvent;
63 private suppressMatch;
64 private insertMatch;
65 private deleteMatch;
66 private afterSs;
67 private beforeSs;
68 constructor();
69 getTransformEvent(): string[];
70 setTransformEvent(eventId: string): void;
71 getSuppressMatch(): string[];
72 setSuppressMatch(matchId: string): void;
73 setAfterSs(afterSs: IndexedSnapshot): void;
74 getAfterSs(): IndexedSnapshot;
75 setBeforeSs(beforeSs: IndexedSnapshot): void;
76 getBeforeSs(): IndexedSnapshot;
77 setInsertEvent(eventId: string): void;
78 getInsertEvent(): string[];
79 setDeleteEvent(eventId: string): void;
80 getDeleteEvent(): string[];
81 setInsertMatch(matchId: string): void;
82 getInsertMatch(): string[];
83 setDeleteMatch(matchId: string): void;
84 getDeleteMatch(): string[];
85}
86export declare enum ConvertedMsg {
87 INSERT_EVENT_TO_UPDATE = 0,
88 DELETE_EVENT_TO_UPDATE = 1,
89 INSERT_MATCH_SUPPRESS = 2,
90 DELETE_MATCH_SUPPRESS = 3,
91 ORIGINAL = 4
92}
93export declare class MergeableWrapper {
94 private deltaOut;
95 private snap;
96 constructor();
97 setDeltaOut(out: DeltaOutgoing[]): void;
98 setAfter(after: IndexedSnapshot): void;
99 getDeltaOut(): DeltaOutgoing[];
100 getAfter(): IndexedSnapshot;
101}
102export declare class TTLWrapper {
103 private removedSs;
104 private remainingSs;
105 private restoredSs;
106 _RemovedKey(): void;
107 setRemovedSs(remove: IndexedSnapshot): void;
108 getRemovedSs(): IndexedSnapshot;
109 setRemainingSs(remain: IndexedSnapshot): void;
110 getRemainingSs(): IndexedSnapshot;
111 getRestoredSs(): IndexedSnapshot;
112 setRestoredSs(restore: IndexedSnapshot): void;
113}