@adobe/exc-app 0.2.42 → 0.2.44-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/RuntimeConfiguration.d.ts +29 -16
  2. package/RuntimeConfiguration.ts +31 -15
  3. package/appapi.d.ts +1 -0
  4. package/appapi.js +1 -0
  5. package/appapi.js.map +1 -1
  6. package/appapi.ts +1 -0
  7. package/build/preBuild.js +1 -0
  8. package/capabilityapi.d.ts +4 -0
  9. package/capabilityapi.js +4 -0
  10. package/capabilityapi.js.map +1 -1
  11. package/capabilityapi.ts +4 -0
  12. package/docs/README.md +1 -1
  13. package/docs/enums/capabilityapi.capabilityids.md +14 -0
  14. package/docs/enums/capabilityapi.capabilitynames.md +14 -0
  15. package/docs/interfaces/appapi.appapi-1.md +2 -2
  16. package/docs/interfaces/capabilityapi.capabilityapi-1.md +2 -2
  17. package/docs/interfaces/helpcenter.helpcenterconfig.md +4 -4
  18. package/docs/interfaces/metrics.analytics.md +6 -6
  19. package/docs/interfaces/metrics.metrics-1.md +2 -2
  20. package/docs/interfaces/metrics.metricsapi.md +2 -2
  21. package/docs/interfaces/network.apolloclientoptions.md +35 -0
  22. package/docs/interfaces/network.defaultmetadata.md +1 -1
  23. package/docs/interfaces/network.graphqlquery.md +1 -1
  24. package/docs/interfaces/network.networkapi.md +37 -4
  25. package/docs/interfaces/network.queryrequest.md +1 -1
  26. package/docs/interfaces/page.callback.md +21 -0
  27. package/docs/interfaces/page.pageapi.md +82 -5
  28. package/docs/interfaces/permissions.permissionsapi.md +2 -2
  29. package/docs/interfaces/permissions.permissionsresponse.md +1 -1
  30. package/docs/interfaces/pulse.pulseapi.md +38 -2
  31. package/docs/interfaces/pulse.pulsebuttonconfig.md +32 -0
  32. package/docs/interfaces/pulse.pulsenotification.md +2 -2
  33. package/docs/interfaces/root.modules.md +161 -0
  34. package/docs/interfaces/root.runtime.md +102 -0
  35. package/docs/interfaces/root.runtimeconfiguration.md +392 -0
  36. package/docs/interfaces/session.sessionapi.md +6 -6
  37. package/docs/interfaces/settings.parameters.md +1 -1
  38. package/docs/interfaces/settings.settingsapi.md +6 -6
  39. package/docs/interfaces/settings.settingsresponse.md +1 -1
  40. package/docs/interfaces/shell.shellapi.md +6 -6
  41. package/docs/interfaces/shell.shellinfo.md +1 -1
  42. package/docs/interfaces/user.imsinfo.md +1 -1
  43. package/docs/interfaces/user.userapi.md +6 -6
  44. package/docs/interfaces/user.userinfo.md +2 -2
  45. package/docs/modules/metrics.md +39 -8
  46. package/docs/modules/network.md +38 -4
  47. package/docs/modules/page.md +1 -0
  48. package/docs/modules/pulse.md +1 -0
  49. package/docs/modules/root.md +88 -0
  50. package/internal.d.ts +24 -0
  51. package/internal.js +15 -1
  52. package/internal.js.map +1 -1
  53. package/internal.ts +34 -0
  54. package/package.json +4 -3
  55. package/page.d.ts +3 -1
  56. package/page.js.map +1 -1
  57. package/page.ts +3 -1
  58. package/pulse.d.ts +22 -0
  59. package/pulse.js +6 -0
  60. package/pulse.js.map +1 -1
  61. package/pulse.ts +32 -0
  62. package/tests/pulse.test.js +3 -1
  63. package/tests/pulse.test.js.map +1 -1
  64. package/tests/pulse.test.ts +3 -1
  65. package/coverage/lcov-report/block-navigation.js +0 -79
  66. package/coverage/lcov-report/prettify.js +0 -2
  67. package/coverage/lcov-report/sorter.js +0 -170
@@ -13,13 +13,14 @@
13
13
  ### Methods
14
14
 
15
15
  * [fetch](network.networkapi.md#fetch)
16
+ * [getApolloClient](network.networkapi.md#getapolloclient)
16
17
  * [query](network.networkapi.md#query)
17
18
 
18
19
  ## Methods
19
20
 
20
21
  ### fetch
21
22
 
22
- ▸ **fetch**(`input`: RequestInfo, `init?`: [FetchInit](../modules/network.md#fetchinit)): Promise\<Response>
23
+ ▸ **fetch**(`input`: RequestInfo, `init?`: [FetchInit](../modules/network.md#fetchinit)): Promise<Response\>
23
24
 
24
25
  Provides an interface for fetching resources powered by the global 'fetch' API.
25
26
 
@@ -48,15 +49,47 @@ Name | Type | Description |
48
49
  `input` | RequestInfo | The resource that you wish to fetch. It can either be the URL of the resource you want to fetch or a Request object. |
49
50
  `init?` | [FetchInit](../modules/network.md#fetchinit) | An object containing any custom settings that you want to apply to the request. |
50
51
 
51
- **Returns:** Promise\<Response>
52
+ **Returns:** Promise<Response\>
52
53
 
53
54
  The promise for the response to the fetch operation.
54
55
 
55
56
  ___
56
57
 
58
+ ### getApolloClient
59
+
60
+ ▸ **getApolloClient**(`options?`: [ApolloClientOptions](network.apolloclientoptions.md)): Promise<{ apolloClient: ApolloClient<InMemoryCache\> ; gql: *typeof* gql }\>
61
+
62
+ Provides an interface for querying resources via GraphqQL using ApolloClient
63
+ ***Example***
64
+ ```typescript
65
+ const apolloClientModule = await getApolloClient();
66
+ const apolloClient = apolloClientModule.apolloClient;
67
+ const gql = apolloClientModule.gql;
68
+ const result = await apolloClient.query({
69
+ query: gql`query user {
70
+ id
71
+ name
72
+ }`,
73
+ variables : {}
74
+ });
75
+ console.log(result.data);
76
+ ```
77
+
78
+ #### Parameters:
79
+
80
+ Name | Type | Description |
81
+ ------ | ------ | ------ |
82
+ `options?` | [ApolloClientOptions](network.apolloclientoptions.md) | Configuration to create ApolloClient instance |
83
+
84
+ **Returns:** Promise<{ apolloClient: ApolloClient<InMemoryCache\> ; gql: *typeof* gql }\>
85
+
86
+ GraphQL query response
87
+
88
+ ___
89
+
57
90
  ### query
58
91
 
59
- ▸ **query**(`request`: [QueryRequest](network.queryrequest.md)): Promise\<Response>
92
+ ▸ **query**(`request`: [QueryRequest](network.queryrequest.md)): Promise<Response\>
60
93
 
61
94
  Provides an interface for querying resources via GraphqQL.
62
95
  In order to consume query, please make sure the respective query resolver is
@@ -94,6 +127,6 @@ Name | Type | Description |
94
127
  ------ | ------ | ------ |
95
128
  `request` | [QueryRequest](network.queryrequest.md) | Query request containing desired GQL Query. |
96
129
 
97
- **Returns:** Promise\<Response>
130
+ **Returns:** Promise<Response\>
98
131
 
99
132
  The promise for the response to the query operation.
@@ -37,7 +37,7 @@ ___
37
37
 
38
38
  ### data
39
39
 
40
- • **data**: [GraphQLQuery](network.graphqlquery.md) \| Array\<[GraphQLQuery](network.graphqlquery.md)>
40
+ • **data**: [GraphQLQuery](network.graphqlquery.md) \| Array<[GraphQLQuery](network.graphqlquery.md)\>
41
41
 
42
42
  Data containing single or multiple GQL queries.
43
43
 
@@ -0,0 +1,21 @@
1
+ **[@adobe/exc-app](../README.md)**
2
+
3
+ > [Globals](../README.md) / [page](../modules/page.md) / Callback
4
+
5
+ # Interface: Callback
6
+
7
+ ## Hierarchy
8
+
9
+ * **Callback**
10
+
11
+ ## Callable
12
+
13
+ ▸ (`value?`: any): void
14
+
15
+ #### Parameters:
16
+
17
+ Name | Type |
18
+ ------ | ------ |
19
+ `value?` | any |
20
+
21
+ **Returns:** void
@@ -27,6 +27,8 @@ Defines page-level APIs available to solutions.
27
27
 
28
28
  ### Methods
29
29
 
30
+ * [afterPrintHandler](page.pageapi.md#afterprinthandler)
31
+ * [beforePrintHandler](page.pageapi.md#beforeprinthandler)
30
32
  * [blockNavigation](page.pageapi.md#blocknavigation)
31
33
  * [clipboardWrite](page.pageapi.md#clipboardwrite)
32
34
  * [done](page.pageapi.md#done)
@@ -35,6 +37,7 @@ Defines page-level APIs available to solutions.
35
37
  * [iframeReload](page.pageapi.md#iframereload)
36
38
  * [notFound](page.pageapi.md#notfound)
37
39
  * [openInNewTab](page.pageapi.md#openinnewtab)
40
+ * [print](page.pageapi.md#print)
38
41
  * [setModalQuerySelectors](page.pageapi.md#setmodalqueryselectors)
39
42
  * [shellRedirect](page.pageapi.md#shellredirect)
40
43
 
@@ -184,6 +187,52 @@ page.unloadPromptMessage = 'Are you sure you want to leave?';
184
187
 
185
188
  ## Methods
186
189
 
190
+ ### afterPrintHandler
191
+
192
+ ▸ **afterPrintHandler**(`callback`: [Callback](page.callback.md)): void
193
+
194
+ A function that listens and handles the afterPrint event.
195
+
196
+ ```typescript
197
+ ***Example:***
198
+ page.afterPrintHandler = function () {
199
+ // Revert temporary CSS changes
200
+ };
201
+ ````
202
+
203
+ #### Parameters:
204
+
205
+ Name | Type | Description |
206
+ ------ | ------ | ------ |
207
+ `callback` | [Callback](page.callback.md) | The function that results in printing. |
208
+
209
+ **Returns:** void
210
+
211
+ ___
212
+
213
+ ### beforePrintHandler
214
+
215
+ ▸ **beforePrintHandler**(`callback`: [Callback](page.callback.md)): void
216
+
217
+ A function that listens and handles the beforePrint event.
218
+
219
+ ```typescript
220
+ ***Example:***
221
+ page.beforePrintHandler = function () {
222
+ // Temporary CSS changes, like unsetting height
223
+ };
224
+ ````
225
+
226
+ #### Parameters:
227
+
228
+ Name | Type | Description |
229
+ ------ | ------ | ------ |
230
+ `callback` | [Callback](page.callback.md) | The function that results in printing. |
231
+
232
+ **Returns:** void
233
+
234
+ ___
235
+
187
236
  ### blockNavigation
188
237
 
189
238
  ▸ **blockNavigation**(`enabled`: boolean, `options?`: [BlockNavigationOptions](page.blocknavigationoptions.md)): void
@@ -309,7 +358,7 @@ ___
309
358
 
310
359
  ### getModalQuerySelectors
311
360
 
312
- ▸ **getModalQuerySelectors**(): Array\<string>
361
+ ▸ **getModalQuerySelectors**(): Array<string\>
313
362
 
314
363
  Get the list of selectors presently being used by modalAutoDetect.
315
364
 
@@ -319,7 +368,7 @@ Get the list of selectors presently being used by modalAutoDetect.
319
368
  page.getModalQuerySelectors({path: '/abc'});
320
369
  ```
321
370
 
322
- **Returns:** Array\<string>
371
+ **Returns:** Array<string\>
323
372
 
324
373
  The list of selectors presently being used by modalAutoDetect.
325
374
 
@@ -388,13 +437,41 @@ Name | Type | Description |
388
437
 
389
438
  ___
390
439
 
440
+ ### print
441
+
442
+ ▸ **print**(`callback`: [Callback](page.callback.md)): void
443
+
444
+ A function to control printing. The callback function should call `window.print()`
445
+ at some point. It's important that the callback not be an arrow function if you
446
+ want the `window` object to be the iframe contents. Feel free to adjust your
447
+ CSS or UI before `window.print()` and reverse those changes afterwards.
448
+
449
+ ```typescript
450
+ ***Example:***
451
+ page.print = function () {
452
+ window.print();
453
+ };
454
+ ````
455
+
456
+ #### Parameters:
457
+
458
+ Name | Type | Description |
459
+ ------ | ------ | ------ |
460
+ `callback` | [Callback](page.callback.md) | The function that results in printing. |
461
+
462
+ **Returns:** void
463
+
464
+ ___
465
+
391
466
  ### setModalQuerySelectors
392
467
 
393
- ▸ **setModalQuerySelectors**(`selectors`: Array\<string>): void
468
+ ▸ **setModalQuerySelectors**(`selectors`: Array<string\>): void
394
469
 
395
470
  Set the list of selectors presently being used by modalAutoDetect. If set to an empty
396
471
  array, the default selectors used by runtime will be used instead. To stop observing changes
397
- unset modalAutoDetect.
472
+ unset modalAutoDetect. Setting additonal selectors replaces the currently set selectors, use
473
+ page.getModalQuerySelectors and append new selectors to the returned list before resetting
474
+ to modify the existing list of selectors.
398
475
 
399
476
  ***Example:***
400
477
 
@@ -406,7 +483,7 @@ page.setModalQuerySelectors(['.someSpecialCaseModal', '.yourNormalModal']);
406
483
 
407
484
  Name | Type | Description |
408
485
  ------ | ------ | ------ |
409
- `selectors` | Array\<string> | The list of selectors for modalAutoDetect to use. |
486
+ `selectors` | Array<string\> | The list of selectors for modalAutoDetect to use. |
410
487
 
411
488
  **Returns:** void
412
489
 
@@ -20,7 +20,7 @@ APIs to get permissions. An app in unified shell can consume PALM ACL service.
20
20
 
21
21
  ### get
22
22
 
23
- ▸ **get**\<T>(`params`: [Parameters](permissions.parameters.md)): Promise\<[PermissionsResponse](permissions.permissionsresponse.md)\<T>>
23
+ ▸ **get**<T\>(`params`: [Parameters](permissions.parameters.md)): Promise<[PermissionsResponse](permissions.permissionsresponse.md)<T\>\>
24
24
 
25
25
  Gets permissions based on the specified parameters.
26
26
 
@@ -36,6 +36,6 @@ Name | Type | Description |
36
36
  ------ | ------ | ------ |
37
37
  `params` | [Parameters](permissions.parameters.md) | Parameters used to identify permissions to retrieve. |
38
38
 
39
- **Returns:** Promise\<[PermissionsResponse](permissions.permissionsresponse.md)\<T>>
39
+ **Returns:** Promise<[PermissionsResponse](permissions.permissionsresponse.md)<T\>\>
40
40
 
41
41
  A promise for the specified permissions.
@@ -2,7 +2,7 @@
2
2
 
3
3
  > [Globals](../README.md) / [permissions](../modules/permissions.md) / PermissionsResponse
4
4
 
5
- # Interface: PermissionsResponse\<T>
5
+ # Interface: PermissionsResponse<T\>
6
6
 
7
7
  The response from the permissions service.
8
8
 
@@ -13,12 +13,14 @@
13
13
  ### Methods
14
14
 
15
15
  * [send](pulse.pulseapi.md#send)
16
+ * [setButton](pulse.pulseapi.md#setbutton)
17
+ * [setCount](pulse.pulseapi.md#setcount)
16
18
 
17
19
  ## Methods
18
20
 
19
21
  ### send
20
22
 
21
- ▸ **send**(`notifications`: [PulseNotification](pulse.pulsenotification.md)[]): Promise\<[PulseResponse](pulse.pulseresponse.md)>
23
+ ▸ **send**(`notifications`: [PulseNotification](pulse.pulsenotification.md)[]): Promise<[PulseResponse](pulse.pulseresponse.md)\>
22
24
 
23
25
  Method to send a pulse notification.
24
26
 
@@ -28,4 +30,38 @@ Name | Type |
28
30
  ------ | ------ |
29
31
  `notifications` | [PulseNotification](pulse.pulsenotification.md)[] |
30
32
 
31
- **Returns:** Promise\<[PulseResponse](pulse.pulseresponse.md)>
33
+ **Returns:** Promise<[PulseResponse](pulse.pulseresponse.md)\>
34
+
35
+ ___
36
+
37
+ ### setButton
38
+
39
+ ▸ **setButton**(`buttonConfig`: [PulseButtonConfig](pulse.pulsebuttonconfig.md)): void
40
+
41
+ Adds an additional custom button to the bottom of the Pulse container.
42
+ Will fire the attached callback when a user presses the button.
43
+
44
+ #### Parameters:
45
+
46
+ Name | Type | Description |
47
+ ------ | ------ | ------ |
48
+ `buttonConfig` | [PulseButtonConfig](pulse.pulsebuttonconfig.md) | The button configuration |
49
+
50
+ **Returns:** void
51
+
52
+ ___
53
+
54
+ ### setCount
55
+
56
+ ▸ **setCount**(`count`: number): void
57
+
58
+ Adds additional values to the notification.
59
+ If Pulse has 3 internally and this is set to 2, the UI will show 5.
60
+
61
+ #### Parameters:
62
+
63
+ Name | Type | Description |
64
+ ------ | ------ | ------ |
65
+ `count` | number | Additional values to add to the pulse notification. |
66
+
67
+ **Returns:** void
@@ -0,0 +1,32 @@
1
+ **[@adobe/exc-app](../README.md)**
2
+
3
+ > [Globals](../README.md) / [pulse](../modules/pulse.md) / PulseButtonConfig
4
+
5
+ # Interface: PulseButtonConfig
6
+
7
+ ## Hierarchy
8
+
9
+ * **PulseButtonConfig**
10
+
11
+ ## Index
12
+
13
+ ### Properties
14
+
15
+ * [callback](pulse.pulsebuttonconfig.md#callback)
16
+ * [label](pulse.pulsebuttonconfig.md#label)
17
+
18
+ ## Properties
19
+
20
+ ### callback
21
+
22
+ • `Optional` **callback**: undefined \| (value?: any) => void
23
+
24
+ Callback function to be automatically executed on click.
25
+
26
+ ___
27
+
28
+ ### label
29
+
30
+ • **label**: string
31
+
32
+ Text of the button.
@@ -39,7 +39,7 @@ ___
39
39
 
40
40
  ### metadata
41
41
 
42
- • `Optional` **metadata**: Record\<string, string>
42
+ • `Optional` **metadata**: Record<string, string\>
43
43
 
44
44
  A map of key value pairs which can be provided by publisher of notification for the consumer.
45
45
 
@@ -55,7 +55,7 @@ ___
55
55
 
56
56
  ### templateParams
57
57
 
58
- • **templateParams**: Record\<string, any>
58
+ • **templateParams**: Record<string, any\>
59
59
 
60
60
  Templated parameters.
61
61
 
@@ -0,0 +1,161 @@
1
+ **[@adobe/exc-app](../README.md)**
2
+
3
+ > [Globals](../README.md) / [root](../modules/root.md) / Modules
4
+
5
+ # Interface: Modules
6
+
7
+ ## Hierarchy
8
+
9
+ * **Modules**
10
+
11
+ ## Index
12
+
13
+ ### Properties
14
+
15
+ * [appApi](root.modules.md#appapi)
16
+ * [capabilityApi](root.modules.md#capabilityapi)
17
+ * [default](root.modules.md#default)
18
+ * [helpCenter](root.modules.md#helpcenter)
19
+ * [internal](root.modules.md#internal)
20
+ * [metrics](root.modules.md#metrics)
21
+ * [network](root.modules.md#network)
22
+ * [nps](root.modules.md#nps)
23
+ * [orgSwitcher](root.modules.md#orgswitcher)
24
+ * [page](root.modules.md#page)
25
+ * [permissions](root.modules.md#permissions)
26
+ * [pulse](root.modules.md#pulse)
27
+ * [runtime](root.modules.md#runtime)
28
+ * [session](root.modules.md#session)
29
+ * [settings](root.modules.md#settings)
30
+ * [shell](root.modules.md#shell)
31
+ * [sidebar](root.modules.md#sidebar)
32
+ * [sidenav](root.modules.md#sidenav)
33
+ * [topbar](root.modules.md#topbar)
34
+ * [user](root.modules.md#user)
35
+ * [userProfile](root.modules.md#userprofile)
36
+
37
+ ## Properties
38
+
39
+ ### appApi
40
+
41
+ • `Readonly` **appApi**: () => [AppApi](appapi.appapi-1.md)
42
+
43
+ ___
44
+
45
+ ### capabilityApi
46
+
47
+ • `Readonly` **capabilityApi**: () => [CapabilityApi](capabilityapi.capabilityapi-1.md)
48
+
49
+ ___
50
+
51
+ ### default
52
+
53
+ • `Readonly` **default**: (options?: any) => [Runtime](root.runtime.md)
54
+
55
+ ___
56
+
57
+ ### helpCenter
58
+
59
+ • `Readonly` **helpCenter**: [HelpCenterApi](helpcenter.helpcenterapi.md)
60
+
61
+ ___
62
+
63
+ ### internal
64
+
65
+ • `Readonly` **internal**: InternalApi
66
+
67
+ ___
68
+
69
+ ### metrics
70
+
71
+ • `Readonly` **metrics**: [MetricsApi](metrics.metricsapi.md)
72
+
73
+ ___
74
+
75
+ ### network
76
+
77
+ • `Readonly` **network**: [NetworkApi](network.networkapi.md)
78
+
79
+ ___
80
+
81
+ ### nps
82
+
83
+ • `Readonly` **nps**: [Nps](nps.nps-1.md)
84
+
85
+ ___
86
+
87
+ ### orgSwitcher
88
+
89
+ • `Readonly` **orgSwitcher**: OrgSwitcherApi
90
+
91
+ ___
92
+
93
+ ### page
94
+
95
+ • `Readonly` **page**: [PageApi](page.pageapi.md)
96
+
97
+ ___
98
+
99
+ ### permissions
100
+
101
+ • `Readonly` **permissions**: () => [PermissionsApi](permissions.permissionsapi.md)
102
+
103
+ ___
104
+
105
+ ### pulse
106
+
107
+ • `Readonly` **pulse**: () => [PulseApi](pulse.pulseapi.md)
108
+
109
+ ___
110
+
111
+ ### runtime
112
+
113
+ • **runtime**: [Runtime](root.runtime.md)
114
+
115
+ ___
116
+
117
+ ### session
118
+
119
+ • `Readonly` **session**: () => [SessionApi](session.sessionapi.md)
120
+
121
+ ___
122
+
123
+ ### settings
124
+
125
+ • `Readonly` **settings**: () => [SettingsApi](settings.settingsapi.md)
126
+
127
+ ___
128
+
129
+ ### shell
130
+
131
+ • `Readonly` **shell**: () => [ShellApi](shell.shellapi.md)
132
+
133
+ ___
134
+
135
+ ### sidebar
136
+
137
+ • `Readonly` **sidebar**: SidebarApi
138
+
139
+ ___
140
+
141
+ ### sidenav
142
+
143
+ • `Readonly` **sidenav**: () => SidenavApi
144
+
145
+ ___
146
+
147
+ ### topbar
148
+
149
+ • `Readonly` **topbar**: [TopbarApi](topbar.topbarapi.md)
150
+
151
+ ___
152
+
153
+ ### user
154
+
155
+ • `Readonly` **user**: () => [UserApi](user.userapi.md)
156
+
157
+ ___
158
+
159
+ ### userProfile
160
+
161
+ • `Readonly` **userProfile**: [UserProfileApi](userprofile.userprofileapi.md)
@@ -0,0 +1,102 @@
1
+ **[@adobe/exc-app](../README.md)**
2
+
3
+ > [Globals](../README.md) / [root](../modules/root.md) / Runtime
4
+
5
+ # Interface: Runtime<T\>
6
+
7
+ Defines the runtime object providing all unified-shell APIs for solution authors.
8
+
9
+ ## Type parameters
10
+
11
+ Name | Default |
12
+ ------ | ------ |
13
+ `T` | Record<string, any\\> |
14
+
15
+ ## Hierarchy
16
+
17
+ * EventEmitter
18
+
19
+ ↳ **Runtime**
20
+
21
+ ## Index
22
+
23
+ ### EventEmitter Methods
24
+
25
+ * [emit](root.runtime.md#emit)
26
+ * [off](root.runtime.md#off)
27
+ * [on](root.runtime.md#on)
28
+
29
+ ## EventEmitter Methods
30
+
31
+ ### emit
32
+
33
+ ▸ **emit**<K\>(`type`: K, `event?`: T[K]): void
34
+
35
+ *Inherited from void*
36
+
37
+ Invoke all handlers for the given type.
38
+
39
+ #### Type parameters:
40
+
41
+ Name | Type |
42
+ ------ | ------ |
43
+ `K` | keyof T |
44
+
45
+ #### Parameters:
46
+
47
+ Name | Type | Description |
48
+ ------ | ------ | ------ |
49
+ `type` | K | The event type to invoke. |
50
+ `event?` | T[K] | Any value (object is recommended and powerful), passed to each handler. |
51
+
52
+ **Returns:** void
53
+
54
+ ___
55
+
56
+ ### off
57
+
58
+ ▸ **off**<K\>(`type`: K, `handler`: (event?: T[K]) => void): void
59
+
60
+ *Inherited from void*
61
+
62
+ Remove an event handler for the given type.
63
+
64
+ #### Type parameters:
65
+
66
+ Name | Type |
67
+ ------ | ------ |
68
+ `K` | keyof T |
69
+
70
+ #### Parameters:
71
+
72
+ Name | Type | Description |
73
+ ------ | ------ | ------ |
74
+ `type` | K | Type of event to unregister `handler` from. |
75
+ `handler` | (event?: T[K]) => void | Handler function to remove. |
76
+
77
+ **Returns:** void
78
+
79
+ ___
80
+
81
+ ### on
82
+
83
+ ▸ **on**<K\>(`type`: K, `handler`: (event?: T[K]) => void): void
84
+
85
+ *Inherited from void*
86
+
87
+ Register an event handler for the given type.
88
+
89
+ #### Type parameters:
90
+
91
+ Name | Type |
92
+ ------ | ------ |
93
+ `K` | keyof T |
94
+
95
+ #### Parameters:
96
+
97
+ Name | Type | Description |
98
+ ------ | ------ | ------ |
99
+ `type` | K | Type of event to listen for. |
100
+ `handler` | (event?: T[K]) => void | Function to call in response to given event. |
101
+
102
+ **Returns:** void