@mastra/core
Version:
19 lines • 1.31 kB
TypeScript
import type { NotificationDeliveryAction, NotificationDeliveryDecision, NotificationDeliveryThreadState, NotificationPriority, NotificationRecord } from './types.js';
export type NotificationDeliveryPolicyDecision = NotificationDeliveryAction | NotificationDeliveryDecision;
export type NotificationDeliveryPolicyInput = {
record: NotificationRecord;
threadState: NotificationDeliveryThreadState;
now: Date;
};
export type NotificationDeliveryPolicyDecider = (input: NotificationDeliveryPolicyInput) => NotificationDeliveryPolicyDecision | undefined | Promise<NotificationDeliveryPolicyDecision | undefined>;
export type NotificationDeliveryPolicyConfig = {
default?: NotificationDeliveryPolicyDecision;
priorities?: Partial<Record<NotificationPriority, NotificationDeliveryPolicyDecision>>;
sources?: Record<string, NotificationDeliveryPolicyDecision>;
decide?: NotificationDeliveryPolicyDecider;
};
export declare function defaultNotificationDeliveryDecision(input: NotificationDeliveryPolicyInput): NotificationDeliveryDecision;
export declare function resolveNotificationDeliveryDecision({ config, ...input }: NotificationDeliveryPolicyInput & {
config?: NotificationDeliveryPolicyConfig;
}): Promise<NotificationDeliveryDecision>;
//# sourceMappingURL=delivery-policy.d.ts.map