import { SliderRangeProps } from 'antd/lib/slider'; import { BaseSyntheticEvent, CSSProperties, MouseEvent } from 'react'; export type WellTootipContent = JSX.Element | string | null; export type WellContent = JSX.Element | string | number | null; export type DisableWellConfig = { disabled?: boolean; disabledMessage?: string; }; export type DisableWellClick = | ((position: number, positionLabel: string) => boolean | DisableWellConfig) | boolean | DisableWellConfig; export type WellSelectionConfiguration = { enabled?: boolean; defaultSelectedPositions?: number[]; onWellSelectionChange?: (positions: number[], positionLabels: string[]) => void; multiple?: boolean; labelSelectionEnabled?: boolean; showCount?: boolean; }; export type SliderConfiguration = { enabled?: boolean; minValue: number; maxValue: number; initialMin?: number; initialMax?: number; sliderProps?: SliderRangeProps; valueFormatter?(value: number): string; onChange?(newMinValue: number, newMaxValue: number): void; enableSelectAll?: boolean; }; export type LabelConfiguration = { /** * Whether or not to show the position labels */ show?: boolean; /** * Any style overrides for the labels */ style?: CSSProperties; }; export type PlateViewerProps = { /** * The number of rows in the plate to display. */ rowCount: number; /** * The number of columns in the plate to display. */ columnCount: number; /** * Any configuration for the row and column labels on the plate. The following keys are permitted:
* - show? `boolean` Whether or not to show the labels. @default `true`
* - style? `React.CSSProperties` Any CSS overrides to the label display. @default `{}` */ labelConfiguration?: LabelConfiguration; /** * A callback function which is triggered once a well has been clicked. If you are trying to implement well selection, please check out the wellSelection prop. */ wellClick?: (position: number, positionLabel: string, inRange: boolean, event: BaseSyntheticEvent) => void; /** * This property allows you to enable or disable the clicking of a well either for all wells or on a well-by-well basis. `DisableWellClick` can be one of three elements:
* - A `boolean` value to disable well clicking for all wells
* - A `DisableWellConfig` value which disables all wells with a tooltip
* - A `function` which is called on a well-by-well basis that returns one of the above two options */ disableWellClick?: DisableWellClick; /** * `CSSProperties` can be used to set the style for every well or on a well-by-well basis. */ wellStyle?: (position: number, positionLabel: string, inRange: boolean) => CSSProperties | CSSProperties; /** * A function that returns (or constant that is) the content to display within a well. If the function is, or returns, a falsy value then no content will be shown. */ wellContent?: (position: number, positionLabel: string, inRange: boolean) => WellContent | WellContent; /** * A function that returns (or constant that is) the content to display as a tooltip when hovering over a well. If the function is, or returns, a falsy value then no tooltip will be shown. */ wellTootipContent?: ( position: number, positionLabel: string, inRange: boolean, ) => WellTootipContent | WellTootipContent; /** * The number of pixels to display between each well. * @default 10 */ spaceBetweenWells?: number; /** * This component can automatically handle well selection with callbacks which can be configured with the following properties:
* - enabled? `boolean` Whether or not to enable well selection. @default `false`
* - multiple? `boolean` Whether or not multiple wells can be selected. @default `false`
* - labelSelectionEnabled? `boolean` Whether or not to enable rows or columns to be selected by their header. @default `false`
* - defaultSelectedPositions? `number[]` Any wells to be selected by default. @default `[]`
* - onWellSelectionChange? `(positions: number[], positionLabels: string[]) => void` A callback function for when the wells have been selected or deselected. * - showCount? `boolean` Whether or not to show the number of wells selected within the component. */ wellSelectionConfiguration?: WellSelectionConfiguration; /** * A slider can be used to perform actions or color wells within a certain range. * This prop can only be used if `wellValueGetter` is defined and will result in the `inRange` value being defined in various callback functions. * The slider can be configured with the folowing properties:
* - enabled `boolean` Whether or not to enable the slider
* - enableSelectAll `boolean` Whether or not to enable the select all button using the slider range
* - minValue `number` The minimum value for the slider
* - maxValue `number` The maximum value for the slider
* - initialMin `number` The initial minimum value for the slider which defaults to the `minValue` prop
* - initialMax `number` The initial maximum value for the slider which defaults to the `maxValue` prop
* - sliderProps `SliderRangeProps` Any override props that will be sent to the AntD Slider component
* - onChange `(newMinValue: number, newMaxValue: number): void` A callback for when the slider range changes
*/ sliderConfiguration?: SliderConfiguration; /** * This function can be defined to tell the component the value of a well. This is a required prop if sliderConfiguration.enabled is defined */ wellValueGetter?(position: number, positionLabel: string): number; };