UNPKG

3.09 kBTypeScriptView Raw
1/**
2 * Conditions that can be applied to string attributes.
3 */
4export interface StringConditions {
5 /**
6 * Match one or more values.
7 *
8 * @deprecated use `allowlist`
9 * @default - None
10 */
11 readonly whitelist?: string[];
12 /**
13 * Match any value that doesn't include any of the specified values.
14 * @deprecated use `denylist`
15 * @default - None
16 */
17 readonly blacklist?: string[];
18 /**
19 * Match one or more values.
20 * @default - None
21 */
22 readonly allowlist?: string[];
23 /**
24 * Match any value that doesn't include any of the specified values.
25 * @default - None
26 */
27 readonly denylist?: string[];
28 /**
29 * Matches values that begins with the specified prefixes.
30 *
31 * @default - None
32 */
33 readonly matchPrefixes?: string[];
34}
35/**
36 * Between condition for a numeric attribute.
37 */
38export interface BetweenCondition {
39 /**
40 * The start value.
41 */
42 readonly start: number;
43 /**
44 * The stop value.
45 */
46 readonly stop: number;
47}
48/**
49 * Conditions that can be applied to numeric attributes.
50 */
51export interface NumericConditions {
52 /**
53 * Match one or more values.
54 * @deprecated use `allowlist`
55 * @default - None
56 */
57 readonly whitelist?: number[];
58 /**
59 * Match one or more values.
60 *
61 * @default - None
62 */
63 readonly allowlist?: number[];
64 /**
65 * Match values that are greater than the specified value.
66 *
67 * @default - None
68 */
69 readonly greaterThan?: number;
70 /**
71 * Match values that are greater than or equal to the specified value.
72 *
73 * @default - None
74 */
75 readonly greaterThanOrEqualTo?: number;
76 /**
77 * Match values that are less than the specified value.
78 *
79 * @default - None
80 */
81 readonly lessThan?: number;
82 /**
83 * Match values that are less than or equal to the specified value.
84 *
85 * @default - None
86 */
87 readonly lessThanOrEqualTo?: number;
88 /**
89 * Match values that are between the specified values.
90 *
91 * @default - None
92 */
93 readonly between?: BetweenCondition;
94 /**
95 * Match values that are strictly between the specified values.
96 *
97 * @default - None
98 */
99 readonly betweenStrict?: BetweenCondition;
100}
101/**
102 * A subscription filter for an attribute.
103 */
104export declare class SubscriptionFilter {
105 readonly conditions: any[];
106 /**
107 * Returns a subscription filter for a string attribute.
108 */
109 static stringFilter(stringConditions: StringConditions): SubscriptionFilter;
110 /**
111 * Returns a subscription filter for a numeric attribute.
112 */
113 static numericFilter(numericConditions: NumericConditions): SubscriptionFilter;
114 /**
115 * Returns a subscription filter for attribute key matching.
116 */
117 static existsFilter(): SubscriptionFilter;
118 /**
119 *
120 * @param conditions conditions that specify the message attributes that should be included, excluded, matched, etc.
121 */
122 constructor(conditions?: any[]);
123}