capacitor-plugin-nsd
v0.0.3
Published
capacitor plugin nsd
Readme
capacitor-plugin-nsd
capacitor plugin nsd
Install
npm install capacitor-plugin-nsd
npx cap syncAPI
stopNetworkService()startFindNewtworkService(...)addListener('onServiceResolved', ...)addListener('onServiceRemoved', ...)addListener('onDiscoveryStopped', ...)addListener('onServiceError', ...)- Interfaces
stopNetworkService()
stopNetworkService() => Promise<void>startFindNewtworkService(...)
startFindNewtworkService(params: DiscoveryParam) => Promise<void>| Param | Type |
| ------------ | --------------------------------------------------------- |
| params | DiscoveryParam |
addListener('onServiceResolved', ...)
addListener(eventName: "onServiceResolved", listenerFunc: (data: NetService) => void) => Promise<PluginListenerHandle> & PluginListenerHandleCalled when a service is resolved and result received.
Provides NetService result.
| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| 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> & PluginListenerHandleCalled when a service is removed and result received.
Provides NetService result.
| Param | Type |
| ------------------ | -------------------------------------------------------------------- |
| 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> & PluginListenerHandleCalled when a service discovery is stopped.
Provides no result.
| Param | Type |
| ------------------ | ----------------------------------- |
| 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> & PluginListenerHandleCalled on a service error and error received.
Provides NetServiceError result.
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------ |
| eventName | 'onServiceError' |
| listenerFunc | (data: NetServiceError) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 0.0.1
Interfaces
DiscoveryParam
| Prop | Type |
| ------------ | ------------------- |
| type | string |
| domain | string |
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
NetService
| Prop | Type |
| --------------------- | -------------------- |
| printerCount | number |
| serviceName | string |
| isUntrustedCert | boolean |
| isSearchable | boolean |
| serviceType | number |
| serviceID | string |
| serviceURL | string |
NetServiceError
| Prop | Type |
| ----------- | ------------------- |
| code | string |
| error | string |
