@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
21 lines (20 loc) • 569 B
TypeScript
import { Device } from '../models';
import { IDevicesContext } from './internalDataStores';
/**
* A hook for hardware devices.
* @example
* ```
* const { devices, isLoaded, error } = useDevicesState();
*
* if (!isLoaded) return <Loading />;
* if (error) return <ErrorView error={error} />;
* // devices value is now safe to use
* ```
* @returns The devices state.
*/
export declare const useDevicesState: () => IDevicesContext;
/**
* A hook for hardware devices.
* @returns The hardware devices.
*/
export declare const useDevices: () => Device[] | null;