UNPKG

@kvaser/canking-api

Version:

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

58 lines (57 loc) 2.67 kB
/** * This module includes a Signal Selection. * * 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 { SelectedSignalInfo, SelectedSignalInfoChangeArgs } from '.'; import { JSX } from 'react'; /** * Properties of the SelectSignalsControl component. */ export interface SelectSignalsControlProps { /** * Currently selected signals. * @deprecated Use selectedSignalInfos instead. */ selectedSignals?: string[]; /** Currently selected signal infos. */ selectedSignalInfos?: SelectedSignalInfo[]; /** * Event fired when selected signals change. * @deprecated Use onSelectedSignalInfosChange instead. */ onSelectedSignalsChange?: (selectedSignals: string[]) => void; /** Event fired when selected signal infos change. */ onSelectedSignalInfosChange?: (infos: SelectedSignalInfoChangeArgs[]) => void; /** Event fired when there are errors in the selection. */ onErrorsChange?: (errors: boolean) => void; /** Title of the parent dialog, if any. */ parentDialogTitle?: string; /** Node identifier to use when retrieving messages and signals. */ nodeIdentifier?: string; /** Whether the control is disabled. */ disabled?: boolean; } /** * A control for selecting signals from DBC files. * * The control includes an autocomplete field where the user can type to search for signals, and a button that opens a dialog * for selecting signals. The selected signals are shown in the autocomplete field, and the user can remove selected signals * from the field as well. * * The control uses the message databases available in the system to find signals and their qualified names. When a signal is * selected, its qualified name is used as the identifier for the signal. * * The onSelectedSignalInfosChange callback provides detailed information about the selected signals, including their qualified * names, source identifiers, and the messages they belong to. * * The onErrorsChange callback is called with true if there are errors in the selection (e.g. no signals selected) and false otherwise. * @param props - Component properties. * @returns The SelectSignalsControl React component. */ declare function SelectSignalsControl({ selectedSignals, selectedSignalInfos, onSelectedSignalsChange, onSelectedSignalInfosChange, onErrorsChange, parentDialogTitle, nodeIdentifier, disabled, }: SelectSignalsControlProps): JSX.Element; export default SelectSignalsControl;