@metamask-previews/base-controller 3.2.3-preview.ce06456 → 3.2.3-preview.eb58a59

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.
@@ -1,26 +1,27 @@
1
- export declare type ActionHandler<Action, ActionType> = (...args: ExtractActionParameters<Action, ActionType>) => ExtractActionResponse<Action, ActionType>;
2
- export declare type ExtractActionParameters<Action, T> = Action extends {
3
- type: T;
4
- handler: (...args: infer H) => any;
5
- } ? H : never;
6
- export declare type ExtractActionResponse<Action, T> = Action extends {
7
- type: T;
8
- handler: (...args: any) => infer H;
9
- } ? H : never;
10
- export declare type ExtractEventHandler<Event, T> = Event extends {
11
- type: T;
12
- payload: infer P;
13
- } ? P extends unknown[] ? (...payload: P) => void : never : never;
14
- export declare type ExtractEventPayload<Event, T> = Event extends {
15
- type: T;
16
- payload: infer P;
17
- } ? P : never;
1
+ import { RestrictedControllerMessenger } from './RestrictedControllerMessenger';
2
+ export declare type ActionHandler<Action extends ActionConstraint, ActionType = Action['type']> = (...args: ExtractActionParameters<Action, ActionType>) => ExtractActionResponse<Action, ActionType>;
3
+ export declare type ExtractActionParameters<Action extends ActionConstraint, ActionType = Action['type']> = Action extends {
4
+ type: ActionType;
5
+ handler: (...args: infer HandlerArgs) => unknown;
6
+ } ? HandlerArgs : never;
7
+ export declare type ExtractActionResponse<Action extends ActionConstraint, ActionType = Action['type']> = Action extends {
8
+ type: ActionType;
9
+ handler: (...args: infer _) => infer HandlerReturnValue;
10
+ } ? HandlerReturnValue : never;
11
+ export declare type ExtractEventHandler<Event extends EventConstraint, EventType = Event['type']> = Event extends {
12
+ type: EventType;
13
+ payload: infer Payload;
14
+ } ? Payload extends unknown[] ? (...payload: Payload) => void : never : never;
15
+ export declare type ExtractEventPayload<Event extends EventConstraint, EventType = Event['type']> = Event extends {
16
+ type: EventType;
17
+ payload: infer Payload;
18
+ } ? Payload extends unknown[] ? Payload : never : never;
18
19
  export declare type GenericEventHandler = (...args: unknown[]) => void;
19
- export declare type SelectorFunction<Args extends unknown[], ReturnValue> = (...args: Args) => ReturnValue;
20
+ export declare type SelectorFunction<Event extends EventConstraint, ReturnValue> = (...args: ExtractEventPayload<Event>) => ReturnValue;
20
21
  export declare type SelectorEventHandler<SelectorReturnValue> = (newValue: SelectorReturnValue, previousValue: SelectorReturnValue | undefined) => void;
21
22
  export declare type ActionConstraint = {
22
23
  type: string;
23
- handler: (...args: any) => unknown;
24
+ handler: ((...args: never) => unknown) | ((...args: never[]) => unknown);
24
25
  };
25
26
  export declare type EventConstraint = {
26
27
  type: string;
@@ -29,173 +30,19 @@ export declare type EventConstraint = {
29
30
  /**
30
31
  * A namespaced string
31
32
  *
32
- * This type verifies that the string T is prefixed by the string Name followed by a colon.
33
+ * This type verifies that the string Name is prefixed by the string Name followed by a colon.
33
34
  *
34
- * @template Name - The namespace we're checking for.
35
- * @template T - The full string, including the namespace.
35
+ * @template Namespace - The namespace we're checking for.
36
+ * @template Name - The full string, including the namespace.
36
37
  */
37
- export declare type Namespaced<Name extends string, T> = T extends `${Name}:${string}` ? T : never;
38
- declare type NarrowToNamespace<T, Namespace extends string> = T extends {
38
+ export declare type Namespaced<Namespace extends string, Name> = Name extends `${Namespace}:${string}` ? Name : never;
39
+ export declare type NamespacedName<Namespace extends string = string> = `${Namespace}:${string}`;
40
+ declare type NarrowToNamespace<Name, Namespace extends string> = Name extends {
39
41
  type: `${Namespace}:${string}`;
40
- } ? T : never;
41
- declare type NarrowToAllowed<T, Allowed extends string> = T extends {
42
+ } ? Name : never;
43
+ declare type NarrowToAllowed<Name, Allowed extends string> = Name extends {
42
44
  type: Allowed;
43
- } ? T : never;
44
- /**
45
- * A restricted controller messenger.
46
- *
47
- * This acts as a wrapper around the controller messenger instance that restricts access to actions
48
- * and events.
49
- *
50
- * @template N - The namespace for this messenger. Typically this is the name of the controller or
51
- * module that this messenger has been created for. The authority to publish events and register
52
- * actions under this namespace is granted to this restricted messenger instance.
53
- * @template Action - A type union of all Action types.
54
- * @template Event - A type union of all Event types.
55
- * @template AllowedAction - A type union of the 'type' string for any allowed actions.
56
- * @template AllowedEvent - A type union of the 'type' string for any allowed events.
57
- */
58
- export declare class RestrictedControllerMessenger<N extends string, Action extends ActionConstraint, Event extends EventConstraint, AllowedAction extends string, AllowedEvent extends string> {
59
- private readonly controllerMessenger;
60
- private readonly controllerName;
61
- private readonly allowedActions;
62
- private readonly allowedEvents;
63
- /**
64
- * Constructs a restricted controller messenger
65
- *
66
- * The provided allowlists grant the ability to call the listed actions and subscribe to the
67
- * listed events. The "name" provided grants ownership of any actions and events under that
68
- * namespace. Ownership allows registering actions and publishing events, as well as
69
- * unregistering actions and clearing event subscriptions.
70
- *
71
- * @param options - The controller options.
72
- * @param options.controllerMessenger - The controller messenger instance that is being wrapped.
73
- * @param options.name - The name of the thing this messenger will be handed to (e.g. the
74
- * controller name). This grants "ownership" of actions and events under this namespace to the
75
- * restricted controller messenger returned.
76
- * @param options.allowedActions - The list of actions that this restricted controller messenger
77
- * should be alowed to call.
78
- * @param options.allowedEvents - The list of events that this restricted controller messenger
79
- * should be allowed to subscribe to.
80
- */
81
- constructor({ controllerMessenger, name, allowedActions, allowedEvents, }: {
82
- controllerMessenger: ControllerMessenger<ActionConstraint, EventConstraint>;
83
- name: N;
84
- allowedActions?: AllowedAction[];
85
- allowedEvents?: AllowedEvent[];
86
- });
87
- /**
88
- * Register an action handler.
89
- *
90
- * This will make the registered function available to call via the `call` method.
91
- *
92
- * The action type this handler is registered under *must* be in the current namespace.
93
- *
94
- * @param action - The action type. This is a unqiue identifier for this action.
95
- * @param handler - The action handler. This function gets called when the `call` method is
96
- * invoked with the given action type.
97
- * @throws Will throw when a handler has been registered for this action type already.
98
- * @template T - A type union of Action type strings that are namespaced by N.
99
- */
100
- registerActionHandler<T extends Namespaced<N, Action['type']>>(action: T, handler: ActionHandler<Action, T>): void;
101
- /**
102
- * Unregister an action handler.
103
- *
104
- * This will prevent this action from being called.
105
- *
106
- * The action type being unregistered *must* be in the current namespace.
107
- *
108
- * @param action - The action type. This is a unqiue identifier for this action.
109
- * @template T - A type union of Action type strings that are namespaced by N.
110
- */
111
- unregisterActionHandler<T extends Namespaced<N, Action['type']>>(action: T): void;
112
- /**
113
- * Call an action.
114
- *
115
- * This function will call the action handler corresponding to the given action type, passing
116
- * along any parameters given.
117
- *
118
- * The action type being called must be on the action allowlist.
119
- *
120
- * @param action - The action type. This is a unqiue identifier for this action.
121
- * @param params - The action parameters. These must match the type of the parameters of the
122
- * registered action handler.
123
- * @throws Will throw when no handler has been registered for the given type.
124
- * @template T - A type union of allowed Action type strings.
125
- * @returns The action return value.
126
- */
127
- call<T extends AllowedAction & string>(action: T, ...params: ExtractActionParameters<Action, T>): ExtractActionResponse<Action, T>;
128
- /**
129
- * Publish an event.
130
- *
131
- * Publishes the given payload to all subscribers of the given event type.
132
- *
133
- * The event type being published *must* be in the current namespace.
134
- *
135
- * @param event - The event type. This is a unique identifier for this event.
136
- * @param payload - The event payload. The type of the parameters for each event handler must
137
- * match the type of this payload.
138
- * @template E - A type union of Event type strings that are namespaced by N.
139
- */
140
- publish<E extends Namespaced<N, Event['type']>>(event: E, ...payload: ExtractEventPayload<Event, E>): void;
141
- /**
142
- * Subscribe to an event.
143
- *
144
- * Registers the given function as an event handler for the given event type.
145
- *
146
- * The event type being subscribed to must be on the event allowlist.
147
- *
148
- * @param eventType - The event type. This is a unique identifier for this event.
149
- * @param handler - The event handler. The type of the parameters for this event handler must
150
- * match the type of the payload for this event type.
151
- * @template E - A type union of Event type strings.
152
- */
153
- subscribe<E extends AllowedEvent & string>(eventType: E, handler: ExtractEventHandler<Event, E>): void;
154
- /**
155
- * Subscribe to an event, with a selector.
156
- *
157
- * Registers the given handler function as an event handler for the given
158
- * event type. When an event is published, its payload is first passed to the
159
- * selector. The event handler is only called if the selector's return value
160
- * differs from its last known return value.
161
- *
162
- * The event type being subscribed to must be on the event allowlist.
163
- *
164
- * @param eventType - The event type. This is a unique identifier for this event.
165
- * @param handler - The event handler. The type of the parameters for this event
166
- * handler must match the return type of the selector.
167
- * @param selector - The selector function used to select relevant data from
168
- * the event payload. The type of the parameters for this selector must match
169
- * the type of the payload for this event type.
170
- * @template E - A type union of Event type strings.
171
- * @template V - The selector return value.
172
- */
173
- subscribe<E extends AllowedEvent & string, V>(eventType: E, handler: SelectorEventHandler<V>, selector: SelectorFunction<ExtractEventPayload<Event, E>, V>): void;
174
- /**
175
- * Unsubscribe from an event.
176
- *
177
- * Unregisters the given function as an event handler for the given event.
178
- *
179
- * The event type being unsubscribed to must be on the event allowlist.
180
- *
181
- * @param event - The event type. This is a unique identifier for this event.
182
- * @param handler - The event handler to unregister.
183
- * @throws Will throw when the given event handler is not registered for this event.
184
- * @template T - A type union of allowed Event type strings.
185
- */
186
- unsubscribe<E extends AllowedEvent & string>(event: E, handler: ExtractEventHandler<Event, E>): void;
187
- /**
188
- * Clear subscriptions for a specific event.
189
- *
190
- * This will remove all subscribed handlers for this event.
191
- *
192
- * The event type being cleared *must* be in the current namespace.
193
- *
194
- * @param event - The event type. This is a unique identifier for this event.
195
- * @template E - A type union of Event type strings that are namespaced by N.
196
- */
197
- clearEventSubscriptions<E extends Namespaced<N, Event['type']>>(event: E): void;
198
- }
45
+ } ? Name : never;
199
46
  /**
200
47
  * A messaging system for controllers.
201
48
  *
@@ -207,12 +54,7 @@ export declare class RestrictedControllerMessenger<N extends string, Action exte
207
54
  * @template Event - A type union of all Event types.
208
55
  */
209
56
  export declare class ControllerMessenger<Action extends ActionConstraint, Event extends EventConstraint> {
210
- private readonly actions;
211
- private readonly events;
212
- /**
213
- * A cache of selector return values for their respective handlers.
214
- */
215
- private readonly eventPayloadCache;
57
+ #private;
216
58
  /**
217
59
  * Register an action handler.
218
60
  *
@@ -222,18 +64,18 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
222
64
  * @param handler - The action handler. This function gets called when the `call` method is
223
65
  * invoked with the given action type.
224
66
  * @throws Will throw when a handler has been registered for this action type already.
225
- * @template T - A type union of Action type strings.
67
+ * @template ActionType - A type union of Action type strings.
226
68
  */
227
- registerActionHandler<T extends Action['type']>(actionType: T, handler: ActionHandler<Action, T>): void;
69
+ registerActionHandler<ActionType extends Action['type']>(actionType: ActionType, handler: ActionHandler<Action, ActionType>): void;
228
70
  /**
229
71
  * Unregister an action handler.
230
72
  *
231
73
  * This will prevent this action from being called.
232
74
  *
233
75
  * @param actionType - The action type. This is a unqiue identifier for this action.
234
- * @template T - A type union of Action type strings.
76
+ * @template ActionType - A type union of Action type strings.
235
77
  */
236
- unregisterActionHandler<T extends Action['type']>(actionType: T): void;
78
+ unregisterActionHandler<ActionType extends Action['type']>(actionType: ActionType): void;
237
79
  /**
238
80
  * Unregister all action handlers.
239
81
  *
@@ -250,10 +92,10 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
250
92
  * @param params - The action parameters. These must match the type of the parameters of the
251
93
  * registered action handler.
252
94
  * @throws Will throw when no handler has been registered for the given type.
253
- * @template T - A type union of Action type strings.
95
+ * @template ActionType - A type union of Action type strings.
254
96
  * @returns The action return value.
255
97
  */
256
- call<T extends Action['type']>(actionType: T, ...params: ExtractActionParameters<Action, T>): ExtractActionResponse<Action, T>;
98
+ call<ActionType extends Action['type']>(actionType: ActionType, ...params: ExtractActionParameters<Action, ActionType>): ExtractActionResponse<Action, ActionType>;
257
99
  /**
258
100
  * Publish an event.
259
101
  *
@@ -265,9 +107,9 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
265
107
  * @param eventType - The event type. This is a unique identifier for this event.
266
108
  * @param payload - The event payload. The type of the parameters for each event handler must
267
109
  * match the type of this payload.
268
- * @template E - A type union of Event type strings.
110
+ * @template EventType - A type union of Event type strings.
269
111
  */
270
- publish<E extends Event['type']>(eventType: E, ...payload: ExtractEventPayload<Event, E>): void;
112
+ publish<EventType extends Event['type']>(eventType: EventType, ...payload: ExtractEventPayload<Event, EventType>): void;
271
113
  /**
272
114
  * Subscribe to an event.
273
115
  *
@@ -276,9 +118,9 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
276
118
  * @param eventType - The event type. This is a unique identifier for this event.
277
119
  * @param handler - The event handler. The type of the parameters for this event handler must
278
120
  * match the type of the payload for this event type.
279
- * @template E - A type union of Event type strings.
121
+ * @template EventType - A type union of Event type strings.
280
122
  */
281
- subscribe<E extends Event['type']>(eventType: E, handler: ExtractEventHandler<Event, E>): void;
123
+ subscribe<EventType extends Event['type']>(eventType: EventType, handler: ExtractEventHandler<Event, EventType>): void;
282
124
  /**
283
125
  * Subscribe to an event, with a selector.
284
126
  *
@@ -293,10 +135,10 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
293
135
  * @param selector - The selector function used to select relevant data from
294
136
  * the event payload. The type of the parameters for this selector must match
295
137
  * the type of the payload for this event type.
296
- * @template E - A type union of Event type strings.
297
- * @template V - The selector return value.
138
+ * @template EventType - A type union of Event type strings.
139
+ * @template SelectorReturnValue - The selector return value.
298
140
  */
299
- subscribe<E extends Event['type'], V>(eventType: E, handler: SelectorEventHandler<V>, selector: SelectorFunction<ExtractEventPayload<Event, E>, V>): void;
141
+ subscribe<EventType extends Event['type'], SelectorReturnValue>(eventType: EventType, handler: SelectorEventHandler<SelectorReturnValue>, selector: SelectorFunction<ExtractEventPayload<Event, EventType>, SelectorReturnValue>): void;
300
142
  /**
301
143
  * Unsubscribe from an event.
302
144
  *
@@ -305,18 +147,18 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
305
147
  * @param eventType - The event type. This is a unique identifier for this event.
306
148
  * @param handler - The event handler to unregister.
307
149
  * @throws Will throw when the given event handler is not registered for this event.
308
- * @template E - A type union of Event type strings.
150
+ * @template EventType - A type union of Event type strings.
309
151
  */
310
- unsubscribe<E extends Event['type']>(eventType: E, handler: ExtractEventHandler<Event, E>): void;
152
+ unsubscribe<EventType extends Event['type']>(eventType: EventType, handler: ExtractEventHandler<Event, EventType>): void;
311
153
  /**
312
154
  * Clear subscriptions for a specific event.
313
155
  *
314
156
  * This will remove all subscribed handlers for this event.
315
157
  *
316
158
  * @param eventType - The event type. This is a unique identifier for this event.
317
- * @template E - A type union of Event type strings.
159
+ * @template EventType - A type union of Event type strings.
318
160
  */
319
- clearEventSubscriptions<E extends Event['type']>(eventType: E): void;
161
+ clearEventSubscriptions<EventType extends Event['type']>(eventType: EventType): void;
320
162
  /**
321
163
  * Clear all subscriptions.
322
164
  *
@@ -340,18 +182,18 @@ export declare class ControllerMessenger<Action extends ActionConstraint, Event
340
182
  * should be alowed to call.
341
183
  * @param options.allowedEvents - The list of events that this restricted controller messenger
342
184
  * should be allowed to subscribe to.
343
- * @template N - The namespace for this messenger. Typically this is the name of the controller or
185
+ * @template Namespace - The namespace for this messenger. Typically this is the name of the controller or
344
186
  * module that this messenger has been created for. The authority to publish events and register
345
187
  * actions under this namespace is granted to this restricted messenger instance.
346
188
  * @template AllowedAction - A type union of the 'type' string for any allowed actions.
347
189
  * @template AllowedEvent - A type union of the 'type' string for any allowed events.
348
190
  * @returns The restricted controller messenger.
349
191
  */
350
- getRestricted<N extends string, AllowedAction extends string, AllowedEvent extends string>({ name, allowedActions, allowedEvents, }: {
351
- name: N;
192
+ getRestricted<Namespace extends string, AllowedAction extends string, AllowedEvent extends string>({ name, allowedActions, allowedEvents, }: {
193
+ name: Namespace;
352
194
  allowedActions?: Extract<Action['type'], AllowedAction>[];
353
195
  allowedEvents?: Extract<Event['type'], AllowedEvent>[];
354
- }): RestrictedControllerMessenger<N, NarrowToNamespace<Action, N> | NarrowToAllowed<Action, AllowedAction>, NarrowToNamespace<Event, N> | NarrowToAllowed<Event, AllowedEvent>, AllowedAction, AllowedEvent>;
196
+ }): RestrictedControllerMessenger<Namespace, NarrowToNamespace<Action, Namespace> | NarrowToAllowed<Action, AllowedAction>, NarrowToNamespace<Event, Namespace> | NarrowToAllowed<Event, AllowedEvent>, AllowedAction, AllowedEvent>;
355
197
  }
356
198
  export {};
357
199
  //# sourceMappingURL=ControllerMessenger.d.ts.map
@@ -1 +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