11<!-- GENERATED FILE, DO NOT EDIT -->
22
3- # API Reference
3+ ---
4+ description: ""
5+ ---
46
57:: alert
68
@@ -19,7 +21,7 @@ interface BaseMessagingConfig {
1921
2022Shared configuration between all the different messengers.
2123
22- ### Properties
24+ ### Properties
2325
2426- *** ` logger?: Logger ` *** (default: ` console ` )<br />The logger to use when logging messages. Set to ` null ` to disable logging.
2527
@@ -35,7 +37,7 @@ interface CustomEventMessage {
3537
3638Additional fields available on the ` Message ` from a ` CustomEventMessenger ` .
3739
38- ### Properties
40+ ### Properties
3941
4042- *** ` event: CustomEvent ` *** <br />The event that was fired, resulting in the message being passed.
4143
@@ -153,7 +155,7 @@ interface ExtensionMessage {
153155
154156Additional fields available on the ` Message ` from an ` ExtensionMessenger ` .
155157
156- ### Properties
158+ ### Properties
157159
158160- *** ` sender: Runtime.MessageSender ` *** <br />Information about where the message came from. See
159161[ ` Runtime.MessageSender ` ] ( https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender ) .
@@ -196,6 +198,12 @@ interface GenericMessenger<
196198 TMessageExtension ,
197199 TSendMessageArgs extends any [],
198200> {
201+ sendMessage<TType extends keyof TProtocolMap >(
202+ type : TType ,
203+ ... args : GetDataType <TProtocolMap [TType ]> extends undefined
204+ ? [data ? : undefined , ... args : TSendMessageArgs ]
205+ : never
206+ ): Promise <GetReturnType <TProtocolMap [TType ]>>;
199207 sendMessage<TType extends keyof TProtocolMap >(
200208 type : TType ,
201209 data : GetDataType <TProtocolMap [TType ]>,
@@ -283,7 +291,7 @@ interface Message<
283291
284292Contains information about the message received.
285293
286- ### Properties
294+ ### Properties
287295
288296- *** ` id: number ` *** <br />A semi-unique, auto-incrementing number used to trace messages being sent.
289297
@@ -306,7 +314,7 @@ interface MessageSender {
306314
307315An object containing information about the script context that sent a message or request.
308316
309- ### Properties
317+ ### Properties
310318
311319- *** ` tab?: Tabs.Tab ` *** <br />The $(ref: tabs .Tab) which opened the connection, if any. This property will <strong >only</strong >
312320be present when the connection was opened from a tab (including content scripts), and <strong >only</strong >
@@ -332,7 +340,7 @@ interface NamespaceMessagingConfig extends BaseMessagingConfig {
332340}
333341```
334342
335- ### Properties
343+ ### Properties
336344
337345- *** ` namespace: string ` *** <br />A string used to ensure the messenger only sends messages to and listens for messages from
338346other messengers of the same type, with the same namespace.
@@ -354,7 +362,7 @@ Used to add a return type to a message in the protocol map.
354362
355363> Internally, this is just an object with random keys for the data and return types.
356364
357- ### Properties
365+ ### Properties
358366
359367- *** ` BtVgCTPYZu: TData ` *** <br />Stores the data type. Randomly named so that it isn't accidentally implemented.
360368
@@ -392,7 +400,7 @@ interface SendMessageOptions {
392400
393401Options for sending a message to a specific tab/frame
394402
395- ### Properties
403+ ### Properties
396404
397405- *** ` tabId: number ` *** <br />The tab to send a message to
398406
@@ -429,4 +437,4 @@ details.
429437
430438---
431439
432- _ API reference generated by [ ` docs/generate-api-references.ts ` ] ( https://github.com/aklinker1/webext-core/blob/main/docs/generate-api-references.ts ) _
440+ _ API reference generated by [ ` docs/generate-api-references.ts ` ] ( https://github.com/aklinker1/webext-core/blob/main/docs/generate-api-references.ts ) _
0 commit comments