UNPKG

1.9 kBTypeScriptView Raw
1import type { AllDestinations } from './destination-accessor-types';
2import type { Destination } from './destination-service-types';
3export declare type DestinationSelectionStrategy = (allDestinations: AllDestinations, destinationName: string) => Destination | null;
4/**
5 * Constraints the selection to provider destinations.
6 * @param allDestinations - Retrieved destinations.
7 * @param destinationName - Name of the destination to retrieve.
8 * @returns the destination to retrieve, returns `null`, if no matched provider destination is found.
9 */
10export declare function alwaysProvider(allDestinations: AllDestinations, destinationName: string): Destination | null;
11/**
12 * Constraints the selection to subscriber destinations.
13 * @param allDestinations - Retrieved destinations.
14 * @param destinationName - Name of the destination to retrieve.
15 * @returns the destination to retrieve, returns `null`, if no matched subscriber destination is found.
16 */
17export declare function alwaysSubscriber(allDestinations: AllDestinations, destinationName: string): Destination | null;
18/**
19 * Prioritizes the selection of subscriber destinations.
20 * @param allDestinations - Retrieved destinations.
21 * @param destinationName - Name of the destination to retrieve.
22 * @returns the destination to retrieve, returns `null` if no matched destination is found.
23 */
24export declare function subscriberFirst(allDestinations: AllDestinations, destinationName: string): Destination | null;
25/**
26 * Selector of destination selection strategies. See [[alwaysProvider]], [[alwaysSubscriber]] and [[subscriberFirst]] for more information available selection strategies.
27 */
28export declare const DestinationSelectionStrategies: {
29 alwaysProvider: typeof alwaysProvider;
30 alwaysSubscriber: typeof alwaysSubscriber;
31 subscriberFirst: typeof subscriberFirst;
32};
33//# sourceMappingURL=destination-selection-strategies.d.ts.map
\No newline at end of file