UNPKG

979 BTypeScriptView Raw
1import { Component, ShapeStyleProps } from '@antv/f-engine';
2import { ChartChildProps } from '../../chart';
3type StyleType = (record: any) => ShapeStyleProps;
4export interface SelectionProps {
5 selection?: {
6 triggerOn?: 'click' | 'press' | string;
7 type?: 'single' | 'multiple';
8 defaultSelected?: any[];
9 selectedStyle?: ShapeStyleProps | StyleType;
10 unSelectedStyle?: ShapeStyleProps | StyleType;
11 cancelable?: boolean;
12 onChange?: Function;
13 };
14}
15export interface SelectionState {
16 selected: any[];
17}
18declare class Selection<P extends SelectionProps = SelectionProps, S extends SelectionState = SelectionState> extends Component<P & ChartChildProps, S> {
19 constructor(props: P, context: any);
20 didMount(): void;
21 willReceiveProps(nextProps: P): void;
22 getSnapRecords(_point: any): any;
23 isSelected(record: any): boolean;
24 getSelectionStyle(record: any): ShapeStyleProps;
25}
26export default Selection;