@@ -169,13 +169,13 @@ const removeAllListeners = async () => {
169169
170170<docgen-index >
171171
172- * [ ` addListener('interruption', ...) ` ] ( #addlistenerinterruption- )
173- * [ ` addListener('routeChange', ...) ` ] ( #addlistenerroutechange- )
174172* [ ` configure(...) ` ] ( #configure )
175173* [ ` getCurrentOutputs() ` ] ( #getcurrentoutputs )
176174* [ ` overrideOutput(...) ` ] ( #overrideoutput )
177- * [ ` removeAllListeners() ` ] ( #removealllisteners )
178175* [ ` setActive(...) ` ] ( #setactive )
176+ * [ ` addListener('interruption', ...) ` ] ( #addlistenerinterruption- )
177+ * [ ` addListener('routeChange', ...) ` ] ( #addlistenerroutechange- )
178+ * [ ` removeAllListeners() ` ] ( #removealllisteners )
179179* [ Interfaces] ( #interfaces )
180180* [ Type Aliases] ( #type-aliases )
181181
@@ -184,50 +184,6 @@ const removeAllListeners = async () => {
184184<docgen-api >
185185<!-- Update the source file JSDoc comments and rerun docgen to update the docs below-->
186186
187- ### addListener('interruption', ...)
188-
189- ``` typescript
190- addListener (eventName : ' interruption' , listenerFunc : (event : InterruptionEvent ) => void ) => Promise < PluginListenerHandle >
191- ```
192-
193- Called when the audio session is interrupted, e.g. by an incoming phone call.
194-
195- Only available on iOS.
196-
197- | Param | Type |
198- | ------------------ | ----------------------------------------------------------------------------------- |
199- | ** ` eventName ` ** | <code >'interruption'</code > |
200- | ** ` listenerFunc ` ** | <code >(event: <a href =" #interruptionevent " >InterruptionEvent</a >) => ; void</code > |
201-
202- ** Returns:** <code >Promise< ; <a href =" #pluginlistenerhandle " >PluginListenerHandle</a >> ; </code >
203-
204- ** Since:** 0.1.0
205-
206- --------------------
207-
208-
209- ### addListener('routeChange', ...)
210-
211- ``` typescript
212- addListener (eventName : ' routeChange' , listenerFunc : (event : RouteChangeEvent ) => void ) => Promise < PluginListenerHandle >
213- ```
214-
215- Called when the audio route changes, e.g. when headphones are plugged in or out.
216-
217- Only available on iOS.
218-
219- | Param | Type |
220- | ------------------ | --------------------------------------------------------------------------------- |
221- | ** ` eventName ` ** | <code >'routeChange'</code > |
222- | ** ` listenerFunc ` ** | <code >(event: <a href =" #routechangeevent " >RouteChangeEvent</a >) => ; void</code > |
223-
224- ** Returns:** <code >Promise< ; <a href =" #pluginlistenerhandle " >PluginListenerHandle</a >> ; </code >
225-
226- ** Since:** 0.1.0
227-
228- --------------------
229-
230-
231187### configure(...)
232188
233189``` typescript
@@ -283,72 +239,85 @@ Only available on iOS.
283239--------------------
284240
285241
286- ### removeAllListeners( )
242+ ### setActive(... )
287243
288244``` typescript
289- removeAllListeners ( ) => Promise < void >
245+ setActive ( options : SetActiveOptions ) => Promise < void >
290246```
291247
292- Remove all listeners for this plugin .
248+ Activate or deactivate the audio session .
293249
294250Only available on iOS.
295251
252+ | Param | Type |
253+ | ------------- | ------------------------------------------------------------- |
254+ | ** ` options ` ** | <code ><a href =" #setactiveoptions " >SetActiveOptions</a ></code > |
255+
296256** Since:** 0.1.0
297257
298258--------------------
299259
300260
301- ### setActive( ...)
261+ ### addListener('interruption', ...)
302262
303263``` typescript
304- setActive ( options : SetActiveOptions ) => Promise < void >
264+ addListener ( eventName : ' interruption ' , listenerFunc : ( event : InterruptionEvent ) => void ) => Promise < PluginListenerHandle >
305265```
306266
307- Activate or deactivate the audio session.
267+ Called when the audio session is interrupted, e.g. by an incoming phone call .
308268
309269Only available on iOS.
310270
311- | Param | Type |
312- | ------------- | ------------------------------------------------------------- |
313- | ** ` options ` ** | <code ><a href =" #setactiveoptions " >SetActiveOptions</a ></code > |
271+ | Param | Type |
272+ | ------------------ | ----------------------------------------------------------------------------------- |
273+ | ** ` eventName ` ** | <code >'interruption'</code > |
274+ | ** ` listenerFunc ` ** | <code >(event: <a href =" #interruptionevent " >InterruptionEvent</a >) => ; void</code > |
275+
276+ ** Returns:** <code >Promise< ; <a href =" #pluginlistenerhandle " >PluginListenerHandle</a >> ; </code >
314277
315278** Since:** 0.1.0
316279
317280--------------------
318281
319282
320- ### Interfaces
283+ ### addListener('routeChange', ...)
321284
285+ ``` typescript
286+ addListener (eventName : ' routeChange' , listenerFunc : (event : RouteChangeEvent ) => void ) => Promise < PluginListenerHandle >
287+ ```
322288
323- #### PluginListenerHandle
289+ Called when the audio route changes, e.g. when headphones are plugged in or out.
324290
325- | Prop | Type |
326- | ------------ | ----------------------------------------- |
327- | ** ` remove ` ** | <code >() => ; Promise< ; void> ; </code > |
291+ Only available on iOS.
328292
293+ | Param | Type |
294+ | ------------------ | --------------------------------------------------------------------------------- |
295+ | ** ` eventName ` ** | <code >'routeChange'</code > |
296+ | ** ` listenerFunc ` ** | <code >(event: <a href =" #routechangeevent " >RouteChangeEvent</a >) => ; void</code > |
329297
330- #### InterruptionEvent
298+ ** Returns: ** < code >Promise & lt ; < a href = " #pluginlistenerhandle " >PluginListenerHandle</ a > & gt ; </ code >
331299
332- | Prop | Type | Description | Since |
333- | ------------------ | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----- |
334- | ** ` shouldResume ` ** | <code >boolean</code > | Whether playback should resume after the interruption ended. Only ` true ` if ` type ` is ` ended ` . | 0.1.0 |
335- | ** ` type ` ** | <code ><a href =" #interruptiontype " >InterruptionType</a ></code > | The type of the interruption. | 0.1.0 |
300+ ** Since:** 0.1.0
336301
302+ --------------------
337303
338- #### RouteChangeEvent
339304
340- | Prop | Type | Description | Since |
341- | ------------- | --------------------------------------------------------------- | ------------------------------------------------------ | ----- |
342- | ** ` outputs ` ** | <code >AudioSessionOutput[ ] </code > | The audio outputs of the audio route after the change. | 0.1.0 |
343- | ** ` reason ` ** | <code ><a href =" #routechangereason " >RouteChangeReason</a ></code > | The reason why the audio route changed. | 0.1.0 |
305+ ### removeAllListeners()
344306
307+ ``` typescript
308+ removeAllListeners () => Promise < void >
309+ ```
345310
346- #### AudioSessionOutput
311+ Remove all listeners for this plugin.
347312
348- | Prop | Type | Description | Since |
349- | -------------- | ------------------- | ------------------------------------------------- | ----- |
350- | ** ` portName ` ** | <code >string</code > | The human-readable name of the audio output port. | 0.1.0 |
351- | ** ` portType ` ** | <code >string</code > | The type of the audio output port. | 0.1.0 |
313+ Only available on iOS.
314+
315+ ** Since:** 0.1.0
316+
317+ --------------------
318+
319+
320+ ### Interfaces
352321
353322
354323#### ConfigureOptions
@@ -380,6 +349,14 @@ Only available on iOS.
380349| ** ` outputs ` ** | <code >AudioSessionOutput[ ] </code > | The audio outputs of the current audio route. | 0.1.0 |
381350
382351
352+ #### AudioSessionOutput
353+
354+ | Prop | Type | Description | Since |
355+ | -------------- | ------------------- | ------------------------------------------------- | ----- |
356+ | ** ` portName ` ** | <code >string</code > | The human-readable name of the audio output port. | 0.1.0 |
357+ | ** ` portType ` ** | <code >string</code > | The type of the audio output port. | 0.1.0 |
358+
359+
383360#### OverrideOutputOptions
384361
385362| Prop | Type | Description | Since |
@@ -395,21 +372,30 @@ Only available on iOS.
395372| ** ` notifyOthersOnDeactivation ` ** | <code >boolean</code > | Whether other audio sessions are notified when this session is deactivated, so they can resume playback. | <code >true</code > | 0.1.0 |
396373
397374
398- ### Type Aliases
375+ #### PluginListenerHandle
399376
377+ | Prop | Type |
378+ | ------------ | ----------------------------------------- |
379+ | ** ` remove ` ** | <code >() => ; Promise< ; void> ; </code > |
400380
401- #### InterruptionType
402381
403- The type of an audio session interruption.
382+ #### InterruptionEvent
404383
405- <code >'began' | 'ended'</code >
384+ | Prop | Type | Description | Since |
385+ | ------------------ | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ----- |
386+ | ** ` shouldResume ` ** | <code >boolean</code > | Whether playback should resume after the interruption ended. Only ` true ` if ` type ` is ` ended ` . | 0.1.0 |
387+ | ** ` type ` ** | <code ><a href =" #interruptiontype " >InterruptionType</a ></code > | The type of the interruption. | 0.1.0 |
406388
407389
408- #### RouteChangeReason
390+ #### RouteChangeEvent
409391
410- The reason why the audio route changed.
392+ | Prop | Type | Description | Since |
393+ | ------------- | --------------------------------------------------------------- | ------------------------------------------------------ | ----- |
394+ | ** ` outputs ` ** | <code >AudioSessionOutput[ ] </code > | The audio outputs of the audio route after the change. | 0.1.0 |
395+ | ** ` reason ` ** | <code ><a href =" #routechangereason " >RouteChangeReason</a ></code > | The reason why the audio route changed. | 0.1.0 |
411396
412- <code >'categoryChange' | 'newDeviceAvailable' | 'noSuitableRouteForCategory' | 'oldDeviceUnavailable' | 'override' | 'routeConfigurationChange' | 'unknown' | 'wakeFromSleep'</code >
397+
398+ ### Type Aliases
413399
414400
415401#### AudioSessionCategory
@@ -432,6 +418,20 @@ The audio output port to route playback to.
432418
433419<code >'default' | 'speaker'</code >
434420
421+
422+ #### InterruptionType
423+
424+ The type of an audio session interruption.
425+
426+ <code >'began' | 'ended'</code >
427+
428+
429+ #### RouteChangeReason
430+
431+ The reason why the audio route changed.
432+
433+ <code >'categoryChange' | 'newDeviceAvailable' | 'noSuitableRouteForCategory' | 'oldDeviceUnavailable' | 'override' | 'routeConfigurationChange' | 'unknown' | 'wakeFromSleep'</code >
434+
435435</docgen-api >
436436
437437## Session Ownership
0 commit comments