Skip to content

Commit 9c00587

Browse files
committed
Fix and simplify aliases
1 parent f7f0b15 commit 9c00587

File tree

2 files changed

+2
-44
lines changed

2 files changed

+2
-44
lines changed

packages/base-controller/src/Messenger.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,4 @@ export class Messenger<
459459
}
460460
}
461461

462-
/**
463-
* A message broker for "actions" and "events".
464-
*
465-
* The messenger allows registering functions as 'actions' that can be called elsewhere,
466-
* and it allows publishing and subscribing to events. Both actions and events are identified by
467-
* unique strings.
468-
*
469-
* @template Action - A type union of all Action types.
470-
* @template Event - A type union of all Event types.
471-
* @deprecated This has been renamed to `Messenger`.
472-
*/
473-
export const ControllerMessenger = Messenger;
474-
export type ControllerMessenger<
475-
Action extends ActionConstraint,
476-
Event extends EventConstraint,
477-
> = Messenger<Action, Event>;
462+
export { Messenger as ControllerMessenger };

packages/base-controller/src/RestrictedMessenger.ts

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -430,31 +430,4 @@ export class RestrictedMessenger<
430430
}
431431
}
432432

433-
/**
434-
* Constructs a restricted messenger
435-
*
436-
* The provided allowlists grant the ability to call the listed actions and subscribe to the
437-
* listed events. The "name" provided grants ownership of any actions and events under that
438-
* namespace. Ownership allows registering actions and publishing events, as well as
439-
* unregistering actions and clearing event subscriptions.
440-
*
441-
* @param options - Options.
442-
* @param options.controllerMessenger - The messenger instance that is being wrapped. (deprecated)
443-
* @param options.messenger - The messenger instance that is being wrapped.
444-
* @param options.name - The name of the thing this messenger will be handed to (e.g. the
445-
* controller name). This grants "ownership" of actions and events under this namespace to the
446-
* restricted messenger returned.
447-
* @param options.allowedActions - The list of actions that this restricted messenger should be
448-
* allowed to call.
449-
* @param options.allowedEvents - The list of events that this restricted messenger should be
450-
* allowed to subscribe to.
451-
* @deprecated This has been renamed to `RestrictedMessenger`.
452-
*/
453-
export const RestrictedControllerMessenger = RestrictedMessenger;
454-
export type RestrictedControllerMessenger<
455-
Namespace extends string,
456-
Action extends ActionConstraint,
457-
Event extends EventConstraint,
458-
AllowedAction extends string,
459-
AllowedEvent extends string,
460-
> = RestrictedMessenger<Namespace, Action, Event, AllowedAction, AllowedEvent>;
433+
export { RestrictedMessenger as RestrictedControllerMessenger };

0 commit comments

Comments
 (0)