@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
107 lines (106 loc) • 3.99 kB
TypeScript
import { Device, Frame, LogMessage, MeasurementSetup, NodeStatus, OnlineStatus, SerializableFrame } from '../models';
/**
* Device context value.
*/
export interface IDevicesContext {
/** Can be null if the devices have not been loaded yet or if there was an error loading them */
devices: Device[] | null;
/** Indicates whether the devices have been loaded (either successfully or with an error) */
isLoaded: boolean;
/** If there was an error loading the devices, this can contain the error details */
error: Error | null;
}
/**
* Measurement setup context value.
*/
export interface IMeasurementSetupContext {
/** Can be null if the measurement setup has not been loaded yet or if there was an error loading it */
measurementSetup: MeasurementSetup | null;
/** Indicates whether the measurement setup has been loaded (either successfully or with an error) */
isLoaded: boolean;
/** If there was an error loading the measurement setup, this can contain the error details */
error: Error | null;
}
/**
* Node status context value.
*/
export interface IMeasurementStatusContext {
/** Can be null if the node statuses have not been loaded yet or if there was an error loading them */
nodeStatuses: NodeStatus[] | null;
/** Indicates whether the node statuses have been loaded (either successfully or with an error) */
isLoaded: boolean;
/** If there was an error loading the node statuses, this can contain the error details */
error: Error | null;
}
/**
* Online status context value.
*/
export interface IOnlineStatusContext {
/** Can be null if the online status has not been determined yet or if there was an error determining it */
onlineStatus: OnlineStatus | null;
/** Indicates whether the online status has been loaded (either successfully or with an error) */
isLoaded: boolean;
/** If there was an error determining the online status, this can contain the error details */
error: Error | null;
}
/**
* Measurement subscription data interface.
* @internal
*/
export interface IMeasurementSubscriptionData {
/** Map of subscribed data, keyed by subscription identifier. */
subscribedData: Map<string, Frame[]>;
}
type ISerializableMeasurementTraceData = {
scrollData: SerializableFrame[];
fixedPositionData: SerializableFrame[];
};
/**
* Accessor hook for the devices store state.
* @internal
* @returns The available devices.
*/
export declare const useDevicesStoreState: () => IDevicesContext;
/**
* Accessor hook for the measurement setup store state.
* @internal
* @returns The current measurement setup.
*/
export declare const useMeasurementSetupStoreState: () => IMeasurementSetupContext;
/**
* Accessor hook for the measurement status store state.
* @internal
* @returns The current measurement status.
*/
export declare const useMeasurementStatusStoreState: () => IMeasurementStatusContext;
/**
* Accessor hook for the online status store state.
* @internal
* @returns The current online status.
*/
export declare const useOnlineStatusStoreState: () => IOnlineStatusContext;
/**
* Accessor hook for the running periodic transmissions store state.
* @internal
* @returns The list of running periodic transmissions.
*/
export declare const useRunningPeriodicTransmissionsStore: () => string[];
/**
* Accessor hook for the log messages store state.
* @internal
* @returns The list of log messages.
*/
export declare const useLogMessagesStore: () => LogMessage[];
/**
* Accessor hook for the measurement subscription store state.
* @internal
* @returns The current measurement subscription data.
*/
export declare const useMeasurementSubscriptionStoreState: () => IMeasurementSubscriptionData;
/**
* Accessor hook for the measurement trace store state.
* @internal
* @returns The current measurement trace data.
*/
export declare const useMeasurementTraceStoreState: () => ISerializableMeasurementTraceData;
export {};