1 | import { AccessoryJsonObject, MacAddress } from "../../types";
|
2 | import { Categories } from "../Accessory";
|
3 | import { HAPConnection, HAPUsername } from "../util/eventedhttp";
|
4 |
|
5 |
|
6 |
|
7 | export declare const enum PermissionTypes {
|
8 | USER = 0,
|
9 | ADMIN = 1
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 | export interface PairingInformation {
|
15 | username: HAPUsername;
|
16 | publicKey: Buffer;
|
17 | permission: PermissionTypes;
|
18 | }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare class AccessoryInfo {
|
25 | static readonly deviceIdPattern: RegExp;
|
26 | username: MacAddress;
|
27 | displayName: string;
|
28 | model: string;
|
29 | category: Categories;
|
30 | pincode: string;
|
31 | signSk: Buffer;
|
32 | signPk: Buffer;
|
33 | pairedClients: Record<HAPUsername, PairingInformation>;
|
34 | pairedAdminClients: number;
|
35 | private configVersion;
|
36 | private configHash;
|
37 | setupID: string;
|
38 | private lastFirmwareVersion;
|
39 | private constructor();
|
40 | /**
|
41 | * Add a paired client to memory.
|
42 | * @param {HAPUsername} username
|
43 | * @param {Buffer} publicKey
|
44 | * @param {PermissionTypes} permission
|
45 | */
|
46 | addPairedClient(username: HAPUsername, publicKey: Buffer, permission: PermissionTypes): void;
|
47 | updatePermission(username: HAPUsername, permission: PermissionTypes): void;
|
48 | listPairings(): PairingInformation[];
|
49 | |
50 |
|
51 |
|
52 |
|
53 |
|
54 | removePairedClient(connection: HAPConnection, username: HAPUsername): void;
|
55 | private _removePairedClient0;
|
56 | |
57 |
|
58 |
|
59 |
|
60 | isPaired(username: HAPUsername): boolean;
|
61 | hasAdminPermissions(username: HAPUsername): boolean;
|
62 | getClientPublicKey(username: HAPUsername): Buffer | undefined;
|
63 | paired: () => boolean;
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | checkForCurrentConfigurationNumberIncrement(configuration: AccessoryJsonObject[], checkFirmwareIncrement?: boolean): boolean;
|
73 | getConfigVersion(): number;
|
74 | private ensureConfigVersionBounds;
|
75 | save(): void;
|
76 | static persistKey(username: MacAddress): string;
|
77 | static create(username: MacAddress): AccessoryInfo;
|
78 | static load(username: MacAddress): AccessoryInfo | null;
|
79 | static remove(username: MacAddress): void;
|
80 | static assertValidUsername(username: MacAddress): void;
|
81 | }
|
82 |
|
\ | No newline at end of file |