homebridge-virtual-accessories
Version:
Virtual HomeKit accessories for Homebridge.
97 lines (96 loc) • 4.01 kB
TypeScript
import { VirtualLogger } from './virtualLogger.js';
/**
* TLV8
*
* https://github.com/kupa22/apple-homekey
*/
export declare class TLVUtils {
static readonly OPERATION: number;
static readonly DEVICE_CREDENTIAL_REQUEST: number;
static readonly DEVICE_CREDENTIAL_RESPONSE: number;
static readonly READER_KEY_REQUEST: number;
static readonly READER_KEY_RESPONSE: number;
static readonly REQUESTS: number[];
static readonly OPERATION_GET: number;
static readonly OPERATION_ADD: number;
static readonly OPERATION_REMOVE: number;
static readonly OPERATIONS: number[];
static readonly DEVICE_CREDENTIAL_REQUEST_KEY_TYPE: number;
static readonly DEVICE_CREDENTIAL_REQUEST_DEVICE_CREDENTIAL_PUBLIC_KEY: number;
static readonly DEVICE_CREDENTIAL_REQUEST_ISSUER_KEY_IDENTIFIER: number;
static readonly DEVICE_CREDENTIAL_REQUEST_KEY_STATE: number;
static readonly DEVICE_CREDENTIAL_REQUEST_KEY_IDENTIFIER: number;
static readonly DEVICE_CREDENTIAL_RESPONSE_KEY_IDENTIFIER: number;
static readonly DEVICE_CREDENTIAL_RESPONSE_ISSUER_KEY_IDENTIFIER: number;
static readonly DEVICE_CREDENTIAL_RESPONSE_STATUS: number;
static readonly READER_KEY_REQUEST_KEY_TYPE: number;
static readonly READER_KEY_REQUEST_READER_PRIVATE_KEY: number;
static readonly READER_KEY_REQUEST_UNKNOWN: number;
static readonly READER_KEY_REQUEST_KEY_IDENTIFIER: number;
static readonly READER_KEY_RESPONSE_KEY_IDENTIFIER: number;
static readonly READER_KEY_RESPONSE_STATUS: number;
static readonly KEY_TYPE_CURVE25519: number;
static readonly KEY_TYPE_SECP256R1: number;
static readonly STATUS_SUCCESS: number;
static readonly STATUS_OUT_OF_RESOURCES: number;
static readonly STATUS_DUPLICATE: number;
static readonly STATUS_DOES_NOT_EXIST: number;
static readonly STATUS_NOT_SUPPORTED: number;
static readonly KEY_STATE_INACTIVE: number;
static readonly KEY_STATE_ACTIVE: number;
static parseTLVs(tlvString: string): Set<TLV>;
static toHexString(number: number): string;
static getReaderIdentifier(readerPrivateKey: string): string;
}
export declare class TLV {
type: number;
length: number;
value: number | string;
static new(type: number, length: number, value: number | string): TLV;
static fromHexString(tlvHexString: string): TLV;
private constructor();
toHexString(): string;
toFormattedHexString(): string;
}
export declare class TLVRequest {
operation: TLV;
request: TLV;
requestPayload?: TLVDeviceCredentialRequest | TLVReaderKeyRequest;
constructor(tlvString: string, log: VirtualLogger);
}
export declare class TLVDeviceCredentialRequest {
keyType?: TLV;
deviceCredentialPublicKey?: TLV;
issuerKeyIdentifier?: TLV;
keyState?: TLV;
keyIdentifier?: TLV;
constructor(tlvString: string, log: VirtualLogger);
}
export declare class TLVDeviceCredentialResponse {
private operation;
private keyIdentifier?;
private issuerKeyIdentifier?;
private status?;
private constructor();
toHexString(): string;
static getResponseForGetOperation(keyIdentifier: string): TLVDeviceCredentialResponse;
static getResponseForAddOperation(issuerKeyIdentifier: string, status: number): TLVDeviceCredentialResponse;
static getResponseForRemoveOperation(status: number): TLVDeviceCredentialResponse;
}
export declare class TLVReaderKeyRequest {
keyType?: TLV;
readerPrivateKey?: TLV;
unknown?: TLV;
keyIdentifier?: TLV;
constructor(tlvString: string, log: VirtualLogger);
}
export declare class TLVReaderKeyResponse {
private operation;
private keyIdentifier?;
private status?;
private constructor();
toHexString(): string;
static getResponseForGetOperation(keyIdentifier: string): TLVReaderKeyResponse;
static getResponseForAddOperation(status: number): TLVReaderKeyResponse;
static getResponseForRemoveOperation(status: number): TLVReaderKeyResponse;
}