/** * @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;