UNPKG

2.15 kBTypeScriptView Raw
1/// <reference types="long" />
2import * as proto from "./protobuf_bundle";
3import * as rec from "@jayesol/jayeson.lib.record";
4import { RuleCombination } from "@jayesol/jayeson.model";
5export declare enum EncodeAction {
6 INSERT = 0,
7 UPDATE = 1,
8 DELETE = 2
9}
10export interface ICodec {
11 decodeRecord(input: proto.BaseRecord[], pool: string[], action: EncodeAction, key: rec.PartitionKey): rec.IBetMatch[];
12 decodeEvent(input: proto.BaseEvent[], pool: string[], action: EncodeAction, key: rec.PartitionKey): rec.IBetMatch[];
13 decodeMatch(input: proto.BaseMatch[], pool: string[], action: EncodeAction, key: rec.PartitionKey): rec.IBetMatch[];
14}
15export declare class CodecHelper {
16 constructor();
17 coerceInt64(val: number | Long): number;
18 populatePKIntoMetaInfo(meta: rec.StringMap, key: rec.PartitionKey): rec.StringMap;
19 round(num: number): number;
20}
21export declare class FilterRequest {
22 private _requestId;
23 private _ruleCombination;
24 static readonly IGNORED_REQUEST_ID: number;
25 constructor(_requestId: number, _ruleCombination: RuleCombination);
26 getRequestId(): number;
27 getFilterData(): RuleCombination;
28 toJSON(): any;
29}
30export declare class Util {
31 private static SEPARATOR;
32 /**
33 * Utility to Store array of String values as single String Also see
34 * {@link #removeKey(String, String)}
35 *
36 * @param existing
37 * "IBC_LIVE,CROWN_LIVE"
38 * @param incoming
39 * "SBO_LIVE"
40 * @return "IBC_LIVE,CROWN_LIVE,SBO_LIVE"
41 *
42 */
43 static addKey(existing: string, incoming: string): string;
44 /**
45 * Utility to remove element from string values Stored as String Also see
46 * {@link #addKey(String, String)}
47 *
48 * @param existing
49 * "IBC_LIVE,CROWN_LIVE"
50 * @param incoming
51 * "IBC_LIVE"
52 * @return "CROWN_LIVE". return empty string if there are no more keys. Return
53 * existing string if incoming is not present in existing
54 */
55 static removeKey(existing: string, incoming: string): string;
56 static containsKey(existing: string, incoming: string): boolean;
57}