@cygnus-reach/reach-protocol
Version:
Improve the Reachâ„ remote support experience with straightforward device interactions via the Reach Protocol.
163 lines (162 loc) • 5.12 kB
TypeScript
import { AccessLevel, BitfieldParameterInfo, BoolParameterInfo, BufferSizes, ByteArrayParameterInfo, DeviceInfoResponse, EnumParameterInfo, Float32ParameterInfo, Float64ParameterInfo, Int32ParameterInfo, Int64ParameterInfo, ParamExInfoResponse, ParameterDataType, ParameterInfo, StorageLocation, StringParameterInfo, Uint32ParameterInfo, Uint64ParameterInfo } from "../proto/reach";
export type ProtoVersion = {
semver: true;
version: {
major: number;
minor: number;
patch: number;
note?: string;
};
} | {
semver: false;
version: string;
};
export declare class DeviceInfo implements DeviceInfoResponse {
protocolVersionString: string;
deviceName: string;
manufacturer: string;
deviceDescription: string;
firmwareVersion: string;
services: number;
parameterMetadataHash: number;
applicationIdentifier?: Uint8Array | undefined;
endpoints: number;
sizesStruct: Uint8Array;
private _bufferSizes;
get bufferSizes(): BufferSizes;
parsedProtoVersion: ProtoVersion;
constructor(data: DeviceInfoResponse);
private setBufferSizes;
private parseBlock;
private parseProtoVersion;
}
export declare class ParsedParameterInfo implements ParameterInfo {
/**
* The ID used to reference the parameter
*/
id: number;
/**
* The human-readable name of the parameter
*/
name: string;
/**
* A human-readable description of the parameter
*/
description?: string;
/**
* The R/W access granted to the client
*/
access: AccessLevel;
/**
* The memory location of the parameter
*/
storageLocation: StorageLocation;
/**
* Type-specific description information
*/
desc: {
oneofKind: "uint32Desc";
/**
* @generated from protobuf field: cr.Uint32ParameterInfo uint32_desc = 6;
*/
uint32Desc: Uint32ParameterInfo;
} | {
oneofKind: "int32Desc";
/**
* @generated from protobuf field: cr.Int32ParameterInfo int32_desc = 7;
*/
int32Desc: Int32ParameterInfo;
} | {
oneofKind: "float32Desc";
/**
* @generated from protobuf field: cr.Float32ParameterInfo float32_desc = 8;
*/
float32Desc: Float32ParameterInfo;
} | {
oneofKind: "uint64Desc";
/**
* @generated from protobuf field: cr.Uint64ParameterInfo uint64_desc = 9;
*/
uint64Desc: Uint64ParameterInfo;
} | {
oneofKind: "int64Desc";
/**
* @generated from protobuf field: cr.Int64ParameterInfo int64_desc = 10;
*/
int64Desc: Int64ParameterInfo;
} | {
oneofKind: "float64Desc";
/**
* @generated from protobuf field: cr.Float64ParameterInfo float64_desc = 11;
*/
float64Desc: Float64ParameterInfo;
} | {
oneofKind: "boolDesc";
/**
* @generated from protobuf field: cr.BoolParameterInfo bool_desc = 12;
*/
boolDesc: BoolParameterInfo;
} | {
oneofKind: "stringDesc";
/**
* @generated from protobuf field: cr.StringParameterInfo string_desc = 13;
*/
stringDesc: StringParameterInfo;
} | {
oneofKind: "enumDesc";
/**
* @generated from protobuf field: cr.EnumParameterInfo enum_desc = 14;
*/
enumDesc: EnumParameterInfo;
} | {
oneofKind: "bitfieldDesc";
/**
* @generated from protobuf field: cr.BitfieldParameterInfo bitfield_desc = 15;
*/
bitfieldDesc: BitfieldParameterInfo;
} | {
oneofKind: "bytearrayDesc";
/**
* @generated from protobuf field: cr.ByteArrayParameterInfo bytearray_desc = 16;
*/
bytearrayDesc: ByteArrayParameterInfo;
};
dataType: ParameterDataType;
constructor(info: ParameterInfo);
}
/**
* Organized format for interacting with extended info for enums, bools, and bitfields
*/
export declare class ParameterExtendedInfo {
/**
* The data type being referenced by this extended info. Cross-type labels are discouraged (TODO).
*/
dataType: ParameterDataType;
/**
* The names associated with values (enums, bools) or positions (bitfields) of a parameter.
*/
names: Map<number, string>;
constructor(info: ParamExInfoResponse);
extendInfo(info: ParamExInfoResponse): void;
}
/**
* A user-friendly model for configuring parameter notifications
*/
export interface ParamNotifSettings {
/**
* The ID of the parameter to be notified
*/
parameterId: number;
/**
* The minimum interval allowed between notifications, irrespective of value changes.
*/
minInterval?: number;
/**
* The maximum interval allowed between notifications, irrespective of value changes.
*/
maxInterval?: number;
/**
* The change in value required for a notification to be generated. In the case of strings, any change will be notified.
*/
valueDelta?: number;
}