UNPKG

950 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 };
13}
14export interface SelectionState {
15 selected: any[];
16}
17declare class Selection<P extends SelectionProps = SelectionProps, S extends SelectionState = SelectionState> extends Component<P & ChartChildProps, S> {
18 constructor(props: P, context: any);
19 didMount(): void;
20 willReceiveProps(nextProps: P): void;
21 getSnapRecords(_point: any): any;
22 isSelected(record: any): boolean;
23 getSelectionStyle(record: any): ShapeStyleProps;
24}
25export default Selection;