UNPKG

1.4 kBTypeScriptView Raw
1import { PushListenerInvocation } from "../../listener/PushListener";
2import { Predicated } from "../PredicateMapping";
3import { PushMapping } from "../PushMapping";
4import { PushTest } from "../PushTest";
5import { StaticPushMapping } from "./StaticPushMapping";
6/**
7 * Generic DSL support for returning an object on a push
8 */
9export declare class PushRule<V = any> implements StaticPushMapping<V>, Predicated<PushListenerInvocation> {
10 protected guard1: PushTest;
11 protected guards: PushTest[];
12 private staticValue;
13 get value(): V;
14 get name(): string;
15 /**
16 * The test for this rule
17 */
18 readonly pushTest: PushTest;
19 get test(): PushTest;
20 private reason;
21 constructor(guard1: PushTest, guards: PushTest[], reason?: string);
22 /**
23 * Set an additional reason if we want to add information to that which is
24 * available from the push tests themselves
25 * @param {string} reason
26 * @return {this}
27 */
28 itMeans(reason: string): this;
29 /**
30 * Set the value that will be resolved from this rule
31 * @param {V} value
32 * @return {this}
33 */
34 set(value: V): this;
35 mapping(p: PushListenerInvocation): Promise<V | undefined>;
36}
37export declare function isPredicatedStaticValue<T>(pushMapping: PushMapping<T>): pushMapping is StaticPushMapping<T> & Predicated<PushListenerInvocation>;
38//# sourceMappingURL=PushRule.d.ts.map
\No newline at end of file