@types/bonjour

  • Version 3.5.13
  • Published
  • 5.57 kB
  • 1 dependency
  • MIT license

Install

npm i @types/bonjour
yarn add @types/bonjour
pnpm add @types/bonjour

Overview

TypeScript definitions for bonjour

Index

Functions

function bonjour

bonjour: (opts?: bonjour.BonjourOptions) => bonjour.Bonjour;

    Interfaces

    interface BaseService

    interface BaseService {}

      property fqdn

      fqdn: string;

        property host

        host: string;

          property name

          name: string;

            property port

            port: number;

              property protocol

              protocol: string;

                property subtypes

                subtypes: string[];

                  property txt

                  txt: { [key: string]: string };

                    property type

                    type: string;

                      interface Bonjour

                      interface Bonjour {}

                        method destroy

                        destroy: () => void;

                          method find

                          find: (
                          options: BrowserOptions,
                          onUp?: (service: RemoteService) => void
                          ) => Browser;

                            method findOne

                            findOne: (
                            options: BrowserOptions,
                            cb?: (service: RemoteService) => void
                            ) => Browser;

                              method publish

                              publish: (options: ServiceOptions) => Service;

                                method unpublishAll

                                unpublishAll: (cb?: () => void) => void;

                                  call signature

                                  (opts?: BonjourOptions): Bonjour;

                                    interface BonjourOptions

                                    interface BonjourOptions {}

                                      property interface

                                      interface?: string | undefined;

                                        property ip

                                        ip?: string | undefined;

                                          property loopback

                                          loopback?: boolean | undefined;

                                            property multicast

                                            multicast?: boolean | undefined;

                                              property port

                                              port?: number | undefined;

                                                property reuseAddr

                                                reuseAddr?: boolean | undefined;

                                                  property ttl

                                                  ttl?: number | undefined;

                                                    property type

                                                    type?: 'udp4' | 'udp6' | undefined;

                                                      interface Browser

                                                      interface Browser extends NodeJS.EventEmitter {}
                                                      • Start a browser

                                                        The browser listens for services by querying for PTR records of a given type, protocol and domain, e.g. _http._tcp.local.

                                                        If no type is given, a wild card search is performed.

                                                        An internal list of online services is kept which starts out empty. When ever a new service is discovered, it's added to the list and an "up" event is emitted with that service. When it's discovered that the service is no longer available, it is removed from the list and a "down" event is emitted with that service.

                                                      property services

                                                      services: RemoteService[];

                                                        method on

                                                        on: (event: 'up' | 'down', listener: (service: RemoteService) => void) => this;

                                                          method once

                                                          once: (event: 'up' | 'down', listener: (service: RemoteService) => void) => this;

                                                            method removeAllListeners

                                                            removeAllListeners: (event?: 'up' | 'down') => this;

                                                              method removeListener

                                                              removeListener: (
                                                              event: 'up' | 'down',
                                                              listener: (service: RemoteService) => void
                                                              ) => this;

                                                                method start

                                                                start: () => void;

                                                                  method stop

                                                                  stop: () => void;

                                                                    method update

                                                                    update: () => void;

                                                                      interface BrowserOptions

                                                                      interface BrowserOptions {}

                                                                        property protocol

                                                                        protocol?: string | undefined;

                                                                          property subtypes

                                                                          subtypes?: string[] | undefined;

                                                                            property txt

                                                                            txt?: { [key: string]: string } | undefined;

                                                                              property type

                                                                              type?: string | undefined;

                                                                                interface RemoteService

                                                                                interface RemoteService extends BaseService {}

                                                                                  property addresses

                                                                                  addresses: string[];

                                                                                    property rawTxt

                                                                                    rawTxt: Buffer;

                                                                                      property referer

                                                                                      referer: RemoteInfo;

                                                                                        interface Service

                                                                                        interface Service extends BaseService, NodeJS.EventEmitter {}

                                                                                          property addresses

                                                                                          addresses: string[];

                                                                                            property published

                                                                                            published: boolean;

                                                                                              method start

                                                                                              start: () => void;

                                                                                                method stop

                                                                                                stop: (cb?: () => void) => void;

                                                                                                  interface ServiceOptions

                                                                                                  interface ServiceOptions {}

                                                                                                    property host

                                                                                                    host?: string | undefined;

                                                                                                      property name

                                                                                                      name: string;

                                                                                                        property port

                                                                                                        port: number;

                                                                                                          property probe

                                                                                                          probe?: boolean | undefined;

                                                                                                            property protocol

                                                                                                            protocol?: 'udp' | 'tcp' | undefined;

                                                                                                              property subtypes

                                                                                                              subtypes?: string[] | undefined;

                                                                                                                property txt

                                                                                                                txt?: { [key: string]: string } | undefined;

                                                                                                                  property type

                                                                                                                  type: string;

                                                                                                                    Package Files (1)

                                                                                                                    Dependencies (1)

                                                                                                                    Dev Dependencies (0)

                                                                                                                    No dev dependencies.

                                                                                                                    Peer Dependencies (0)

                                                                                                                    No peer dependencies.

                                                                                                                    Badge

                                                                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/bonjour.

                                                                                                                    • Markdown
                                                                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/bonjour)
                                                                                                                    • HTML
                                                                                                                      <a href="https://www.jsdocs.io/package/@types/bonjour"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>