UNPKG

@kvaser/canking-api

Version:

CanKing API to communicate with the CanKing service using Node.js.

46 lines (45 loc) 2.08 kB
/** * This module includes UI control for selecting a CAN channel from the current measurement setup. * * To be able to use these controls the CanKingDataProvider component must be present in the * component tree above your component. Normally the CanKingDataProvider is added * at the root of the component tree. * * @packageDocumentation */ import { JSX } from 'react'; /** * Properties of the CanChannelSelectControl React component. */ export interface CanChannelSelectControlProps { /** Identifier of the selected channel. */ channelIdentifier: string; /** * Callback that will be called when a new channel has been selected. * @param identifier - The new channel identifier. * @param canFdSupport - True if the new CAN channel supports CAN-FD. */ onChannelIdentifierChange: (identifier: string, canFdSupport: boolean) => void; /** Set to true to hide all silent channels e.g., when the control is used for selecting output channel. */ hideSilentChannels?: boolean; /** Set to true if this control shouldn't be encapsulated inside a SectionControl. */ hideSectionControl?: boolean; /** Set to true to disable this control. */ disabled?: boolean; /** Set to true if the SectionControl should be collapsible, ignored if hideSectionControl is true. */ collapsible?: boolean; /** Current collapse state of the SectionControl. */ collapsed?: boolean; /** * Callback that will be called when collapse state has changed. * @param value - The new collapse state. */ collapsedChange?: (value: boolean) => void; } /** * Creates an UI control for selecting a CAN channel from the current measurement setup. * @param props - Component properties. * @returns The CanChannelSelectControl React component. */ declare function CanChannelSelectControl({ channelIdentifier, onChannelIdentifierChange, hideSilentChannels, hideSectionControl, disabled, collapsible, collapsed, collapsedChange, }: CanChannelSelectControlProps): JSX.Element; export default CanChannelSelectControl;