Skip to content

Instantly share code, notes, and snippets.

@NeoLSN
Created October 12, 2016 07:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NeoLSN/b8a598dd3bcdbef9115d6d84d6ae6049 to your computer and use it in GitHub Desktop.
Save NeoLSN/b8a598dd3bcdbef9115d6d84d6ae6049 to your computer and use it in GitHub Desktop.
ionic-native plugin file
import { Cordova, Plugin } from 'ionic-native';
import { Observable } from 'rxjs/Observable';
export interface DnssdRecord {
action: string;
service: BonjourService;
}
export interface BonjourService {
domain: string;
port: number;
name: string;
hostname: string;
type: string;
txtRecord;
addresses: Array<string>;
}
@Plugin({
pluginRef: 'cordova.plugins.zeroconf',
plugin: 'cordova-plugin-zeroconf',
repo: 'https://github.com/becvert/cordova-plugin-zeroconf'
})
export class Dnssd {
@Cordova()
static register(type: string, domain: string, name: string, port: number, props): Promise<DnssdRecord> { return; }
@Cordova()
static unregister(type: string, domain: string, name: string): Promise<any> { return; }
@Cordova()
static stop(): Promise<any> { return; }
@Cordova({
observable: true,
clearFunction: 'close',
clearWithArgs: true
})
static watch(type: string, domain: string): Observable<DnssdRecord> { return; }
@Cordova()
static unwatch(type: string, domain: string): Promise<any> { return; }
@Cordova()
static close(): Promise<any> { return; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment