8889841cREADME.md000066600000001034150476754300006040 0ustar00# Installation > `npm install --save @types/bonjour` # Summary This package contains type definitions for bonjour (https://github.com/watson/bonjour). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bonjour. ### Additional Details * Last updated: Thu, 23 Dec 2021 23:34:20 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) * Global values: none # Credits These definitions were written by [Quentin Lampin](https://github.com/quentin-ol). index.d.ts000066600000006347150476754300006476 0ustar00// Type definitions for bonjour 3.5 // Project: https://github.com/watson/bonjour // Definitions by: Quentin Lampin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// import { RemoteInfo } from 'dgram'; declare function bonjour(opts?: bonjour.BonjourOptions): bonjour.Bonjour; export = bonjour; declare namespace bonjour { /** * 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. */ interface Browser extends NodeJS.EventEmitter { services: RemoteService[]; start(): void; update(): void; stop(): void; on(event: 'up' | 'down', listener: (service: RemoteService) => void): this; once(event: 'up' | 'down', listener: (service: RemoteService) => void): this; removeListener(event: 'up' | 'down', listener: (service: RemoteService) => void): this; removeAllListeners(event?: 'up' | 'down'): this; } interface BrowserOptions { type?: string | undefined; subtypes?: string[] | undefined; protocol?: string | undefined; txt?: { [key: string]: string } | undefined; } interface ServiceOptions { name: string; host?: string | undefined; port: number; type: string; subtypes?: string[] | undefined; protocol?: 'udp'|'tcp' | undefined; txt?: { [key: string]: string } | undefined; probe?: boolean | undefined; } interface BaseService { name: string; fqdn: string; host: string; port: number; type: string; protocol: string; subtypes: string[]; txt: { [key: string]: string }; } interface RemoteService extends BaseService { referer: RemoteInfo; rawTxt: Buffer; addresses: string[]; } interface Service extends BaseService, NodeJS.EventEmitter { published: boolean; addresses: string[]; stop(cb?: () => void): void; start(): void; } interface BonjourOptions { type?: 'udp4' | 'udp6' | undefined; multicast?: boolean | undefined; interface?: string | undefined; port?: number | undefined; ip?: string | undefined; ttl?: number | undefined; loopback?: boolean | undefined; reuseAddr?: boolean | undefined; } interface Bonjour { (opts?: BonjourOptions): Bonjour; publish(options: ServiceOptions): Service; unpublishAll(cb?: () => void): void; find(options: BrowserOptions, onUp?: (service: RemoteService) => void): Browser; findOne(options: BrowserOptions, cb?: (service: RemoteService) => void): Browser; destroy(): void; } } LICENSE000066600000002165150476754300005574 0ustar00 MIT License Copyright (c) Microsoft Corporation. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE package.json000066600000001471150476754300007054 0ustar00{ "name": "@types/bonjour", "version": "3.5.10", "description": "TypeScript definitions for bonjour", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bonjour", "license": "MIT", "contributors": [ { "name": "Quentin Lampin", "url": "https://github.com/quentin-ol", "githubUsername": "quentin-ol" } ], "main": "", "types": "index.d.ts", "repository": { "type": "git", "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", "directory": "types/bonjour" }, "scripts": {}, "dependencies": { "@types/node": "*" }, "typesPublisherContentHash": "5613f9d9eb2d0d132e0af9cbafeadfe263bf7c525c715d0db37ba47fb96ccc45", "typeScriptVersion": "3.8" }