Skip to content

Commit

Permalink
Update index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdidon committed Apr 6, 2021
1 parent 0907970 commit 0d51bbf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export class Bonjour {
* @param opts
* @returns
*/
public publish(opts: ServiceConfig) {
public publish(opts: ServiceConfig): Service {
return this.registry.publish(opts)
}

Expand All @@ -32,7 +32,7 @@ export class Bonjour {
* @param callback
* @returns
*/
public unpublishAll(callback?: CallableFunction | undefined) {
public unpublishAll(callback?: CallableFunction | undefined): void {
return this.registry.unpublishAll(callback)
}

Expand All @@ -42,7 +42,7 @@ export class Bonjour {
* @param onup Callback when up event received
* @returns
*/
public find(opts: BrowserConfig, onup?: (...args: any[]) => void) {
public find(opts: BrowserConfig, onup?: (...args: any[]) => void): Browser {
return new Browser(this.server.mdns, opts, onup)
}

Expand All @@ -53,8 +53,8 @@ export class Bonjour {
* @param callback Callback when device found
* @returns
*/
public findOne(opts: BrowserConfig, timeout: number = 10000, callback: CallableFunction) {
let browser: Browser = new Browser(this.server.mdns, opts)
public findOne(opts: BrowserConfig, timeout = 10000, callback: CallableFunction): Browser {
const browser: Browser = new Browser(this.server.mdns, opts)
var timer: any
browser.once('up', (service: Service) => {
if(timer !== undefined) clearTimeout(timer)
Expand Down

0 comments on commit 0d51bbf

Please sign in to comment.