{"version":3,"file":"ngmd-websocket.mjs","sources":["../../../projects/lib/src/lib/models/notification.dto.model.ts","../../../projects/lib/src/lib/tokens/index.ts","../../../projects/lib/src/lib/providers/index.ts","../../../projects/lib/src/public-api.ts","../../../projects/lib/src/ngmd-websocket.ts"],"sourcesContent":["import { INotification } from '../interfaces';\r\n\r\nexport class NotificationDto<ActionType extends string = string, Payload extends object = any>\r\n  implements INotification\r\n{\r\n  constructor(\r\n    public type: ActionType,\r\n    public payload: Payload = null,\r\n  ) {}\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\n\r\nimport { INotification, IWebsocketClient } from '../interfaces';\r\n\r\nexport const WS_CLIENT: InjectionToken<IWebsocketClient<INotification, INotification>> =\r\n  new InjectionToken('WS_CLIENT');\r\n","import { inject, Provider } from '@angular/core';\r\n\r\nimport { INotification, IWebsocketClient } from '../interfaces';\r\nimport { WS_CLIENT } from '../tokens';\r\nimport { WebsocketClientFeature } from '../types';\r\n\r\nexport function provideWebsocket(client: WebsocketClientFeature): Provider {\r\n  return client as unknown as Provider;\r\n}\r\n\r\nexport function useWebsocket<\r\n  T extends IWebsocketClient<INotification<any>, INotification<any>>,\r\n>(): T {\r\n  return inject(WS_CLIENT) as T;\r\n}\r\n","/*\n * Public API Surface of lib\n */\n\nexport * from './lib/interfaces';\nexport * from './lib/models';\nexport * from './lib/providers';\nexport * from './lib/tokens';\nexport * from './lib/types';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;MAEa,eAAe,CAAA;IAG1B,WAAA,CACS,IAAgB,EAChB,OAAA,GAAmB,IAAI,EAAA;QADvB,IAAA,CAAA,IAAI,GAAJ,IAAI;QACJ,IAAA,CAAA,OAAO,GAAP,OAAO;IACb;AACJ;;MCLY,SAAS,GACpB,IAAI,cAAc,CAAC,WAAW;;ACC1B,SAAU,gBAAgB,CAAC,MAA8B,EAAA;AAC7D,IAAA,OAAO,MAA6B;AACtC;SAEgB,YAAY,GAAA;AAG1B,IAAA,OAAO,MAAM,CAAC,SAAS,CAAM;AAC/B;;ACdA;;AAEG;;ACFH;;AAEG;;;;"}