0.0.3 • Published 2 years ago

capacitor-plugin-nsd v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

capacitor-plugin-nsd

capacitor plugin nsd

Install

npm install capacitor-plugin-nsd
npx cap sync

API

stopNetworkService()

stopNetworkService() => Promise<void>

startFindNewtworkService(...)

startFindNewtworkService(params: DiscoveryParam) => Promise<void>
ParamType
paramsDiscoveryParam

addListener('onServiceResolved', ...)

addListener(eventName: "onServiceResolved", listenerFunc: (data: NetService) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when a service is resolved and result received.

Provides NetService result.

ParamType
eventName'onServiceResolved'
listenerFunc(data: NetService) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


addListener('onServiceRemoved', ...)

addListener(eventName: "onServiceRemoved", listenerFunc: (data: NetService) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when a service is removed and result received.

Provides NetService result.

ParamType
eventName'onServiceRemoved'
listenerFunc(data: NetService) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


addListener('onDiscoveryStopped', ...)

addListener(eventName: "onDiscoveryStopped", listenerFunc: (data: any) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Called when a service discovery is stopped.

Provides no result.

ParamType
eventName'onDiscoveryStopped'
listenerFunc(data: any) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


addListener('onServiceError', ...)

addListener(eventName: "onServiceError", listenerFunc: (data: NetServiceError) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Called on a service error and error received.

Provides NetServiceError result.

ParamType
eventName'onServiceError'
listenerFunc(data: NetServiceError) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

Since: 0.0.1


Interfaces

DiscoveryParam

PropType
typestring
domainstring

PluginListenerHandle

PropType
remove() => Promise<void>

NetService

PropType
printerCountnumber
serviceNamestring
isUntrustedCertboolean
isSearchableboolean
serviceTypenumber
serviceIDstring
serviceURLstring

NetServiceError

PropType
codestring
errorstring
0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago