diff --git a/src/common/notifications.interface.ts b/src/common/notifications.interface.ts index aa4df41..577aaca 100644 --- a/src/common/notifications.interface.ts +++ b/src/common/notifications.interface.ts @@ -140,7 +140,7 @@ export interface NamedNotificationsProviderFactory * @param name - Name of scope for notifications provider * @param customNotificationsToken - Optional type or token that should be provided for custom notifications */ - (name: string, customNotificationsToken?: Function | Type | InjectionToken): FactoryProvider|[FactoryProvider, ValueProvider]; + (name: string, customNotificationsToken?: Function | Type | InjectionToken | string): FactoryProvider|[FactoryProvider, ValueProvider]; } /** diff --git a/src/common/notifications.service.ts b/src/common/notifications.service.ts index 4b6e990..8b3a805 100644 --- a/src/common/notifications.service.ts +++ b/src/common/notifications.service.ts @@ -155,7 +155,7 @@ Object.defineProperty(GLOBAL_NOTIFICATIONS_DEFINITION, nameof | InjectionToken): FactoryProvider => + return (name: string, customNotificationsToken?: Function | Type | InjectionToken | string): FactoryProvider => { return { provide: customNotificationsToken ?? GlobalNotificationsService, @@ -201,7 +201,7 @@ Object.defineProperty(LOCAL_NOTIFICATIONS_DEFINITION, nameof | InjectionToken): [FactoryProvider, ValueProvider] => + return (name: string = generateId(6), customNotificationsToken?: Function | Type | InjectionToken | string): [FactoryProvider, ValueProvider] => { const scopeName = `${LOCAL_NOTIFICATIONS_SCOPE_NAME}-${name}`; diff --git a/src/misc/providers.ts b/src/misc/providers.ts index a21f4b3..d816e9f 100644 --- a/src/misc/providers.ts +++ b/src/misc/providers.ts @@ -8,7 +8,7 @@ import {GLOBAL_NOTIFICATIONS, LOCAL_NOTIFICATIONS} from '../common/notifications * @param name - Name for global notifications scope * @param customNotificationsToken - Optional type or token that should be provided for custom notifications */ -export function provideGlobalNotifications(name?: string, customNotificationsToken?: Function | Type | InjectionToken): EnvironmentProviders +export function provideGlobalNotifications(name?: string, customNotificationsToken?: Function | Type | InjectionToken | string): EnvironmentProviders { if(isPresent(name)) { @@ -29,7 +29,7 @@ export function provideGlobalNotifications(name?: string, customNotificationsTok * @param name - Name for local notifications scope * @param customNotificationsToken - Optional type or token that should be provided for custom notifications */ -export function provideLocalNotifications(name?: string, customNotificationsToken?: Function | Type | InjectionToken): Provider[] +export function provideLocalNotifications(name?: string, customNotificationsToken?: Function | Type | InjectionToken | string): Provider[] { if(isPresent(name)) {