///
import { NumberFormat } from "./buffer";
/**
* Override built-in service specifications
* @param specs * @category Specification
*/
export declare function loadServiceSpecifications(specifications: jdspec.ServiceSpec[]): {
added: jdspec.ServiceSpec[];
errors: {
message: string;
spec: jdspec.ServiceSpec;
}[];
changed: boolean;
};
/**
* Returns a map from service short ids to service specifications
* @category Specification
*/
export declare function serviceMap(): Record;
/**
* Returns the list of service specifications
* @category Specification
*/
export declare function serviceSpecifications(): jdspec.ServiceSpec[];
/**
* Checks if classIdentifier is compatible with requiredClassIdentifier
* @category Specification
*/
export declare function isInstanceOf(classIdentifier: number, requiredClassIdentifier: number): boolean;
/**
* Checks if the service supports the Jacdac infrastructure
* @param spec
* @returns
* @category Specification
*/
export declare function isInfrastructure(spec: jdspec.ServiceSpec): boolean;
/**
* Looks up a service specification by name
* @param shortId
* @category Specification
*/
export declare function serviceSpecificationFromName(shortId: string): jdspec.ServiceSpec;
/**
* Looks up a service specification by class
* @param classIdentifier
* @category Specification
*/
export declare function serviceSpecificationFromClassIdentifier(classIdentifier: number): jdspec.ServiceSpec;
/**
* Indicates if the specified service is a sensor
* @param spec
* @returns
* @category Specification
*/
export declare function isSensor(spec: jdspec.ServiceSpec): boolean;
/**
* Indicates if the specified service is an actuator
* @param spec
* @returns
* @category Specification
*/
export declare function isActuator(spec: jdspec.ServiceSpec): boolean;
/**
* Indicates if the packet information is a register
* @param spec
* @returns
* @category Specification
*/
export declare function isRegister(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet information is a ``reading`` register
* @param spec
* @returns
* @category Specification
*/
export declare function isReading(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the register is usable from a high-level programming environment.
* @category Specification
*/
export declare function isHighLevelRegister(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the event is usable from a high-level programming environment.
* @category Specification
*/
export declare function isHighLevelEvent(pkt: jdspec.PacketInfo): boolean;
/**
* Indicate if the register code is an auxilliary register to support streaming.
* @param code
* @returns
* @category Specification
*/
export declare function isOptionalReadingRegisterCode(code: number): boolean;
/**
* Indicates if the packet info represents an ``intensity`` register
* @category Specification
*/
export declare function isIntensity(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents a ``value`` register
* @category Specification
*/
export declare function isValue(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents a ``intensity`` or a ``value`` register
* @category Specification
*/
export declare function isValueOrIntensity(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents an ``const`` register
* @category Specification
*/
export declare function isConstRegister(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info is not rw
*/
export declare function isReadOnlyRegister(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents an ``event``
* @category Specification
*/
export declare function isEvent(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents a ``command``
* @category Specification
*/
export declare function isCommand(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the packet info represents a ``pipe_report``
* @category Specification
*/
export declare function isPipeReport(pkt: jdspec.PacketInfo): boolean;
/**
* Indicates if the `report` packet is the report specication of the `cmd` command.
* @category Specification
*/
export declare function isReportOf(cmd: jdspec.PacketInfo, report: jdspec.PacketInfo): boolean;
/**
* Indicates if the `report` packet is the *pipe* report specication of the `cmd` command.
* @category Specification
*/
export declare function isPipeReportOf(cmd: jdspec.PacketInfo, pipeReport: jdspec.PacketInfo): boolean;
/**
* @internal
*/
export declare function isIntegerType(tp: string): boolean;
/**
* @internal
*/
export declare function numberFormatFromStorageType(tp: jdspec.StorageType): NumberFormat.Int8LE | NumberFormat.UInt8LE | NumberFormat.Int16LE | NumberFormat.UInt16LE | NumberFormat.Int32LE | NumberFormat.UInt32LE | NumberFormat.UInt64LE | NumberFormat.Int64LE;
/**
* @internal
*/
export declare function numberFormatToStorageType(nf: NumberFormat): 1 | 2 | 4 | 8 | -1 | -2 | -4 | -8;
/**
* @internal
*/
export declare function scaleIntToFloat(v: number, info: jdspec.PacketMember): number;
/**
* @internal
*/
export declare function scaleFloatToInt(v: number, info: jdspec.PacketMember): number;
/**
* @internal
*/
export declare function storageTypeRange(tp: jdspec.StorageType): [number, number];
/**
* @internal
*/
export declare function clampToStorage(v: number, tp: jdspec.StorageType): number;
/**
* @internal
*/
export declare function memberValueToString(value: any, info: jdspec.PacketMember): string;
/**
* @internal
*/
export declare function tryParseMemberValue(text: string, info: jdspec.PacketMember): {
value?: any;
error?: string;
};
/**
* Parses a device identifier into a buffer, returns undefined if invalid
* @param id
* @returns
* @category Specification
*/
export declare function parseDeviceId(id: string): Uint8Array;
export declare function parseDualDeviceId(id: string): Uint8Array;
export declare function dualDeviceId(id: string): string;
/**
* Check if the left device identifier is a bootloader dual of the right identifier
* @param left
* @param right
* @returns
*/
export declare function isDualDeviceId(left: string, right: string): boolean;
//# sourceMappingURL=spec.d.ts.map