jack-detection
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

jack-detection

should detect when jack is plugged or unplugged

Install

npm install jack-detection
npx cap sync

API

getStatus()

getStatus() => Promise<JackStatus>

Query the current status of the jack.

Returns: Promise<JackStatus>

Since: 1.0.0


addListener('jackStatusChange', ...)

addListener(eventName: 'jackStatusChange', listenerFunc: JackStatusChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for changes of the jack status.

Param Type
eventName 'jackStatusChange'
listenerFunc JackStatusChangeListener

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 1.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0


Interfaces

JackStatus

Represents the state and type of the jack connection.

Prop Type Description Since
connected boolean Whether the jack is plugged or not. 1.0.0

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

JackStatusChangeListener

Callback to receive the status change notifications.

(status: JackStatus): void

/jack-detection/

    Package Sidebar

    Install

    npm i jack-detection

    Weekly Downloads

    6

    Version

    0.0.6

    License

    MIT

    Unpacked Size

    26.1 kB

    Total Files

    22

    Last publish

    Collaborators

    • guitarooman14