{"version":3,"sources":["../../../src/utils/types.ts"],"sourcesContent":["import type { Context, DefaultSchedule, NovuSocketOptions, Subscriber, UnreadCount } from '@novu/js';\nimport type {\n  AllIconKey,\n  AllTheme,\n  InboxIconKey,\n  InboxLocalization,\n  InboxProps,\n  InboxTheme,\n  Notification,\n  NotificationActionClickHandler,\n  NotificationClickHandler,\n  PreferenceGroups,\n  PreferencesFilter,\n  PreferencesSort,\n  RouterPush,\n  SubscriptionIconKey,\n  SubscriptionTheme,\n  Tab,\n} from '@novu/js/ui';\nimport type { ReactNode } from 'react';\n\nexport type NotificationsRenderer = (notification: Notification) => React.ReactNode;\nexport type AvatarRenderer = (notification: Notification) => React.ReactNode;\nexport type SubjectRenderer = (notification: Notification) => React.ReactNode;\nexport type BodyRenderer = (notification: Notification) => React.ReactNode;\nexport type DefaultActionsRenderer = (notification: Notification) => React.ReactNode;\nexport type CustomActionsRenderer = (notification: Notification) => React.ReactNode;\nexport type BellRenderer = (unreadCount: UnreadCount) => React.ReactNode;\n\nexport type ReactIconRendererProps = { class?: string };\nexport type ReactIconRenderer = (props: ReactIconRendererProps) => ReactNode;\n\nexport type ReactInboxIconOverrides = {\n  [key in InboxIconKey]?: ReactIconRenderer;\n};\n\nexport type ReactInboxTheme = Omit<InboxTheme, 'icons'> & {\n  icons?: ReactInboxIconOverrides;\n};\n\nexport type ReactSubscriptionIconOverrides = {\n  [key in SubscriptionIconKey]?: ReactIconRenderer;\n};\n\nexport type ReactSubscriptionTheme = Omit<SubscriptionTheme, 'icons'> & {\n  icons?: ReactSubscriptionIconOverrides;\n};\n\nexport type ReactAllIconOverrides = {\n  [key in AllIconKey]?: ReactIconRenderer;\n};\n\nexport type ReactAllTheme = Omit<AllTheme, 'icons'> & {\n  icons?: ReactAllIconOverrides;\n};\n\nexport type ReactInboxAppearance = ReactInboxTheme & {\n  baseTheme?: InboxTheme | InboxTheme[];\n};\n\nexport type ReactSubscriptionAppearance = ReactSubscriptionTheme & {\n  baseTheme?: SubscriptionTheme | SubscriptionTheme[];\n};\n\nexport type ReactAllAppearance = ReactAllTheme & {\n  baseTheme?: ReactAllTheme | ReactAllTheme[];\n};\n\nexport type DefaultInboxProps = {\n  open?: boolean;\n  renderNotification?: NotificationsRenderer;\n  renderAvatar?: AvatarRenderer;\n  renderSubject?: SubjectRenderer;\n  renderBody?: BodyRenderer;\n  renderDefaultActions?: DefaultActionsRenderer;\n  renderCustomActions?: CustomActionsRenderer;\n  renderBell?: BellRenderer;\n  onNotificationClick?: NotificationClickHandler;\n  onPrimaryActionClick?: NotificationActionClickHandler;\n  onSecondaryActionClick?: NotificationActionClickHandler;\n  placement?: InboxProps['placement'];\n  placementOffset?: InboxProps['placementOffset'];\n};\n\ntype StandardBaseProps = {\n  subscriberHash?: string;\n  contextHash?: string;\n  backendUrl?: string;\n  socketUrl?: string;\n  socketOptions?: NovuSocketOptions;\n  appearance?: ReactInboxAppearance;\n  localization?: InboxLocalization;\n  tabs?: Array<Tab>;\n  preferencesFilter?: PreferencesFilter;\n  preferenceGroups?: PreferenceGroups;\n  preferencesSort?: PreferencesSort;\n  defaultSchedule?: DefaultSchedule;\n  routerPush?: RouterPush;\n  context?: Context;\n} & (\n  | {\n      // TODO: Backward compatibility support - remove in future versions (see NV-5801)\n      /** @deprecated Use subscriber prop instead */\n      subscriberId: string;\n      subscriber?: never;\n      applicationIdentifier: string;\n    }\n  | {\n      subscriber: Subscriber | string;\n      subscriberId?: never;\n      applicationIdentifier: string;\n    }\n  | {\n      // Keyless mode - no subscriber or subscriberId or applicationIdentifier\n      subscriber?: never;\n      subscriberId?: never;\n      applicationIdentifier?: never;\n    }\n);\n\ntype InboxBaseProps = Omit<StandardBaseProps, 'appearance'> & {\n  appearance?: ReactInboxAppearance;\n};\n\nexport type BaseProps = InboxBaseProps;\n\nexport type NotificationRendererProps = {\n  renderNotification: NotificationsRenderer;\n  renderAvatar?: never;\n  renderSubject?: never;\n  renderBody?: never;\n  renderDefaultActions?: never;\n  renderCustomActions?: never;\n};\n\nexport type SubjectBodyRendererProps = {\n  renderNotification?: never;\n  renderAvatar?: AvatarRenderer;\n  renderSubject?: SubjectRenderer;\n  renderBody?: BodyRenderer;\n  renderDefaultActions?: DefaultActionsRenderer;\n  renderCustomActions?: CustomActionsRenderer;\n};\n\nexport type NoRendererProps = {\n  renderNotification?: undefined;\n  renderAvatar?: undefined;\n  renderSubject?: undefined;\n  renderBody?: undefined;\n  renderDefaultActions?: undefined;\n  renderCustomActions?: undefined;\n};\n\nexport type DefaultProps = BaseProps &\n  DefaultInboxProps & {\n    children?: never;\n  } & (NotificationRendererProps | SubjectBodyRendererProps | NoRendererProps);\n\nexport type WithChildrenProps = BaseProps & {\n  children: React.ReactNode;\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}