Skip to content

Commit 0b6e5a0

Browse files
authored
export NotificationController and fix types (#815)
1 parent 654e5dc commit 0b6e5a0

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ export * from './assets/CollectibleDetectionController';
3838
export * from './permissions';
3939
export * from './subject-metadata';
4040
export * from './ratelimit/RateLimitController';
41+
export * from './notification/NotificationController';
4142
export { util };

src/notification/NotificationController.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ControllerMessenger } from '../ControllerMessenger';
22
import {
3-
ControllerActions,
3+
NotificationControllerActions,
44
NotificationController,
55
NotificationControllerStateChange,
66
} from './NotificationController';
@@ -14,7 +14,7 @@ const name = 'NotificationController';
1414
*/
1515
function getUnrestrictedMessenger() {
1616
return new ControllerMessenger<
17-
ControllerActions,
17+
NotificationControllerActions,
1818
NotificationControllerStateChange
1919
>();
2020
}

src/notification/NotificationController.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ export type MarkNotificationRead = {
5757
handler: NotificationController['markRead'];
5858
};
5959

60-
export type ControllerActions =
60+
export type NotificationControllerActions =
6161
| GetNotificationControllerState
6262
| ShowNotification
6363
| DismissNotification
6464
| MarkNotificationRead;
6565

6666
export type NotificationControllerMessenger = RestrictedControllerMessenger<
6767
typeof name,
68-
ControllerActions,
68+
NotificationControllerActions,
6969
NotificationControllerStateChange,
7070
never,
7171
never

src/ratelimit/RateLimitController.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ControllerMessenger } from '../ControllerMessenger';
22
import {
3-
ControllerActions,
3+
RateLimitControllerActions,
44
RateLimitStateChange,
55
RateLimitController,
66
RateLimitMessenger,
@@ -39,7 +39,7 @@ function getRestrictedMessenger(
3939
) {
4040
return controllerMessenger.getRestricted<
4141
typeof name,
42-
ControllerActions<RateLimitedApis>['type'],
42+
RateLimitControllerActions<RateLimitedApis>['type'],
4343
never
4444
>({
4545
name,

src/ratelimit/RateLimitController.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ export type CallApi<
3838
handler: RateLimitController<RateLimitedApis>['call'];
3939
};
4040

41-
export type ControllerActions<
41+
export type RateLimitControllerActions<
4242
RateLimitedApis extends Record<string, (...args: any[]) => any>,
4343
> = GetRateLimitState<RateLimitedApis> | CallApi<RateLimitedApis>;
4444

4545
export type RateLimitMessenger<
4646
RateLimitedApis extends Record<string, (...args: any[]) => any>,
4747
> = RestrictedControllerMessenger<
4848
typeof name,
49-
ControllerActions<RateLimitedApis>,
49+
RateLimitControllerActions<RateLimitedApis>,
5050
RateLimitStateChange<RateLimitedApis>,
5151
never,
5252
never

0 commit comments

Comments
 (0)