import { DisplayObject, IDocument, IAnimation as GAnimation } from '@antv/g'; export type G2Element = DisplayObject & { __data__?: any; __toData__?: any[]; __fromElements__?: DisplayObject[]; __facet__?: boolean; __removed__?: boolean; }; export declare function select(node: DisplayObject): Selection; /** * A simple implementation of d3-selection for @antv/g. * It has the core features of d3-selection and extended ability. * Every methods of selection returns new selection if elements * are mutated(e.g. append, remove), otherwise return the selection itself(e.g. attr, style). * @see https://github.com/d3/d3-selection * @see https://github.com/antvis/g * @todo Nested selections. * @todo More useful functor. */ export declare class Selection { static registry: Record G2Element>; private _elements; private _parent; private _data; private _enter; private _exit; private _update; private _merge; private _split; private _document; private _transitions; private _facetElements; constructor(elements?: Iterable, data?: T[] | [T, G2Element[]][], parent?: G2Element, document?: IDocument | null, selections?: [Selection, Selection, Selection, Selection, Selection], transitions?: (GAnimation | GAnimation[])[], updateElements?: G2Element[]); selectAll(selector: string | G2Element[]): Selection; selectFacetAll(selector: string | G2Element[]): Selection; /** * @todo Replace with querySelector which has bug now. */ select(selector: string | G2Element): Selection; append(node: string | ((data: T, i: number) => G2Element)): Selection; maybeAppend(id: string, node: string | (() => G2Element), className?: string): Selection; /** * Bind data to elements, and produce three selection: * Enter: Selection with empty elements and data to be bind to elements. * Update: Selection with elements to be updated. * Exit: Selection with elements to be removed. */ data(data: T[], id?: (d: T, index?: number) => any, groupId?: (d: T, index?: number) => any): Selection; merge(other: Selection): Selection; createElement(type: string): G2Element; /** * Apply callback for each selection(enter, update, exit) * and merge them into one selection. */ join(enter?: (selection: Selection) => any, update?: (selection: Selection) => any, exit?: (selection: Selection) => any, merge?: (selection: Selection) => any, split?: (selection: Selection) => any): Selection; remove(): Selection; each(callback: (datum: T, index: number, element: any) => any): Selection; attr(key: string, value: any): Selection; style(key: string, value: any): Selection; transition(value: any): Selection; on(event: string, handler: any): this; call(callback: (selection: Selection, ...args: any[]) => any, ...args: any[]): Selection; node(): G2Element; nodes(): G2Element[]; transitions(): (GAnimation | GAnimation[])[]; parent(): DisplayObject; }