Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(accouncement): Rename ControllerMessenger to Messenger #5092

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ControllerMessenger } from '@metamask/base-controller';
import { Messenger } from '@metamask/base-controller';

import type {
AnnouncementControllerState,
Expand All @@ -17,11 +17,11 @@ const name = 'AnnouncementController';
* @returns A restricted controller messenger.
*/
function getRestrictedMessenger() {
const controllerMessenger = new ControllerMessenger<
const messenger = new Messenger<
AnnouncementControllerActions,
AnnouncementControllerEvents
>();
return controllerMessenger.getRestricted({
return messenger.getRestricted({
name,
allowedActions: [],
allowedEvents: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {
ControllerGetStateAction,
ControllerStateChangeEvent,
RestrictedControllerMessenger,
RestrictedMessenger,
} from '@metamask/base-controller';
import { BaseController } from '@metamask/base-controller';

Expand Down Expand Up @@ -66,7 +66,7 @@ const metadata = {
},
};

export type AnnouncementControllerMessenger = RestrictedControllerMessenger<
export type AnnouncementControllerMessenger = RestrictedMessenger<
typeof controllerName,
AnnouncementControllerActions,
AnnouncementControllerEvents,
Expand Down
12 changes: 11 additions & 1 deletion packages/announcement-controller/src/index.ts
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No export changes, they are all preserved. The export was converted to a map in order to more easily add an alias. This way is easier to read anyway.

Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
export * from './AnnouncementController';
export type {
AnnouncementMap,
StateAnnouncementMap,
AnnouncementControllerState,
AnnouncementControllerActions,
AnnouncementControllerEvents,
AnnouncementControllerGetStateAction,
AnnouncementControllerStateChangeEvent,
AnnouncementControllerMessenger,
} from './AnnouncementController';
export { AnnouncementController } from './AnnouncementController';
Loading