/** * @module notification.api.util * * Utility functions for applying {@link UpdateNotificationUserParams} changes to notification config objects. * Used by the server action service when processing user config update requests. */ import { type Maybe } from '@dereekb/util'; import { type NotificationBoxRecipientTemplateConfigRecord, type NotificationUserDefaultNotificationBoxRecipientConfig, type NotificationUserNotificationBoxRecipientConfig } from './notification.config'; import { type NotificationBoxRecipientTemplateConfigArrayEntryParam, type UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams, type UpdateNotificationUserNotificationBoxRecipientParams } from './notification.api'; import { type AppNotificationTemplateTypeInfoRecordService } from './notification.details'; import { type NotificationTemplateType } from './notification.id'; /** * Applies an array of config entry params to a {@link NotificationBoxRecipientTemplateConfigRecord}, * inserting new entries, merging updates, and removing entries marked with `remove: true`. * * @param a - Existing config record. * @param b - Array of update params to apply. * @param limitToAllowedConfigTypes - When provided, filters the result to only include these template types. * @returns The updated config record, or undefined if no changes were made. */ export declare function updateNotificationBoxRecipientTemplateConfigRecord(a: NotificationBoxRecipientTemplateConfigRecord, b: NotificationBoxRecipientTemplateConfigArrayEntryParam[], limitToAllowedConfigTypes?: Maybe>): Maybe; /** * Applies {@link UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams} to an existing * {@link NotificationUserDefaultNotificationBoxRecipientConfig}, producing an updated config. * * @param a - Existing config. * @param b - Update params to apply. * @param limitToAllowedConfigTypes - When provided, filters config types to only allowed template types. * @returns The updated default recipient config. */ export declare function updateNotificationUserDefaultNotificationBoxRecipientConfig(a: NotificationUserDefaultNotificationBoxRecipientConfig, b: UpdateNotificationUserDefaultNotificationBoxRecipientConfigParams, limitToAllowedConfigTypes?: Maybe>): NotificationUserDefaultNotificationBoxRecipientConfig; /** * Applies update params to a {@link NotificationUserNotificationBoxRecipientConfig} and returns the updated config * only if it actually changed. Returns `undefined` if no changes were detected. * * Automatically sets `ns = true` (needs sync) when changes are detected and the recipient has been indexed. * * @param a - Existing per-box recipient config. * @param b - Update params to apply. * @param limitToAllowedConfigTypes - When provided, filters template config types to only allowed types. * @returns The updated config if changes were detected, or undefined if no changes occurred. */ export declare function updateNotificationUserNotificationBoxRecipientConfigIfChanged(a: NotificationUserNotificationBoxRecipientConfig, b: UpdateNotificationUserNotificationBoxRecipientParams, limitToAllowedConfigTypes?: Maybe>): Maybe; /** * Batch-applies an array of {@link UpdateNotificationUserNotificationBoxRecipientParams} to the user's * per-box config array. Only updates configs for boxes that already exist in the user's config. * * Handles deletion of removed configs (when `deleteRemovedConfig` is set) and filters template types * through the optional {@link AppNotificationTemplateTypeInfoRecordService}. * * Returns `undefined` if no changes were made. * * @param a - Existing per-box recipient config array. * @param b - Array of update params to apply to matching boxes. * @param filterWithService - Optional service used to filter template types to only those valid for each box's model. * @returns The updated config array if any changes occurred, or undefined if nothing changed. */ export declare function updateNotificationUserNotificationBoxRecipientConfigs(a: NotificationUserNotificationBoxRecipientConfig[], b: UpdateNotificationUserNotificationBoxRecipientParams[], filterWithService?: AppNotificationTemplateTypeInfoRecordService): Maybe;