Skip to content

Commit

Permalink
INT: added support for string tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
kukjevov committed Aug 18, 2023
1 parent 5c9820d commit 64c7622
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/notifications.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> | InjectionToken<unknown>): FactoryProvider|[FactoryProvider, ValueProvider];
(name: string, customNotificationsToken?: Function | Type<any> | InjectionToken<unknown> | string): FactoryProvider|[FactoryProvider, ValueProvider];
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/common/notifications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Object.defineProperty(GLOBAL_NOTIFICATIONS_DEFINITION, nameof<GlobalNotification
{
get()
{
return (name: string, customNotificationsToken?: Function | Type<any> | InjectionToken<unknown>): FactoryProvider =>
return (name: string, customNotificationsToken?: Function | Type<any> | InjectionToken<unknown> | string): FactoryProvider =>
{
return {
provide: customNotificationsToken ?? GlobalNotificationsService,
Expand Down Expand Up @@ -201,7 +201,7 @@ Object.defineProperty(LOCAL_NOTIFICATIONS_DEFINITION, nameof<LocalNotificationsP
{
get()
{
return (name: string = generateId(6), customNotificationsToken?: Function | Type<any> | InjectionToken<unknown>): [FactoryProvider, ValueProvider] =>
return (name: string = generateId(6), customNotificationsToken?: Function | Type<any> | InjectionToken<unknown> | string): [FactoryProvider, ValueProvider] =>
{
const scopeName = `${LOCAL_NOTIFICATIONS_SCOPE_NAME}-${name}`;

Expand Down
4 changes: 2 additions & 2 deletions src/misc/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> | InjectionToken<unknown>): EnvironmentProviders
export function provideGlobalNotifications(name?: string, customNotificationsToken?: Function | Type<any> | InjectionToken<unknown> | string): EnvironmentProviders
{
if(isPresent(name))
{
Expand All @@ -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<any> | InjectionToken<unknown>): Provider[]
export function provideLocalNotifications(name?: string, customNotificationsToken?: Function | Type<any> | InjectionToken<unknown> | string): Provider[]
{
if(isPresent(name))
{
Expand Down

0 comments on commit 64c7622

Please sign in to comment.