-
-
Notifications
You must be signed in to change notification settings - Fork 632
/
bonjour-hap.d.ts
66 lines (55 loc) · 1.45 KB
/
bonjour-hap.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
declare module "bonjour-hap" {
export const enum Protocols {
TCP = "tcp",
UDP = "udp",
}
export type Nullable<T> = T | null;
export type TxtRecord = Record<string, string>;
export class BonjourHAPService {
name: string;
type: string;
subtypes: Nullable<string[]>;
protocol: Protocols;
host: string;
port: number;
fqdn: string;
txt: Nullable<Record<string, string>>;
published: boolean;
start(): void;
stop(callback?: () => void): void;
destroy(): void;
updateTxt(txt: TxtRecord, silent?: boolean): void;
}
export type PublishOptions = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
category?: any,
host?: string;
name?: string;
pincode?: string;
port: number;
protocol?: Protocols;
subtypes?: string[];
txt?: Record<string, string>;
type?: string;
username?: string;
addUnsafeServiceEnumerationRecord?: boolean,
restrictedAddresses?: string[];
disabledIpv6?: boolean;
};
export class BonjourHAP {
publish(options: PublishOptions): BonjourHAPService;
unpublishAll(callback: () => void): void;
destroy(): void;
}
export type MulticastOptions = {
multicast?: boolean;
interface?: string;
port?: number;
ip?: string;
ttl?: number;
loopback?: boolean;
reuseAddr?: boolean;
};
function createWithOptions(options?: MulticastOptions): BonjourHAP;
export default createWithOptions;
}