@magicbell/react-headless
Version:
Hooks to build a notification inbox
19 lines (18 loc) • 841 B
TypeScript
import { IRemoteNotification } from '../../../types/index.js';
import { IStrategyComparator } from '../../../types/INotificationStore.js';
export type NotificationCompareStrategy = (notification: IRemoteNotification, context: Record<string, unknown>, comparator?: IStrategyComparator) => {
result: boolean;
delta: string[];
};
/**
* Check if a notification satisfies all conditions of the given `context`. It
* Uses equal to compare.
*
* @param notification Notification to test
* @param context Set of rules to test the notification against
* @param comparator Function used to compare notification attributes and context values
*/
export declare function objMatchesContext(notification: IRemoteNotification, context: Record<string, unknown>, comparator?: IStrategyComparator): {
result: boolean;
delta: string[];
};