// ag-grid-enterprise v20.2.0 import { Node } from "./node"; import { Scene } from "./scene"; declare type ValueFn = (parent: P, data: PDatum, index: number, groups: (P | undefined)[]) => GDatum[]; declare type KeyFn = (node: N, datum: GDatum, index: number, groups: (G | undefined)[]) => string; export declare class EnterNode { constructor(parent: Node | EnterNode, datum: any); scene: Scene | null; parent: Node | EnterNode; datum: any; next: Node | EnterNode | null; appendChild(node: T): T; insertBefore(node: T, nextNode?: Node | null): T; } /** * G - type of the selected node(s). * GDatum - type of the datum of the selected node(s). * P - type of the parent node(s). * PDatum - type of the datum of the parent node(s). */ export declare class Selection { constructor(groups: (G | undefined)[][], parents: (P | undefined)[]); groups: (G | undefined)[][]; parents: (P | undefined)[]; static select(node: G | (() => G)): Selection; static selectAll(nodes?: G[] | null): Selection; /** * Creates new nodes, appends them to the nodes of this selection and returns them * as a new selection. The created nodes inherit the datums and the parents of the nodes * they replace. * @param Class The constructor function to use to create the new nodes. */ append(Class: new () => N): Selection; /** * Same as the {@link append}, but accepts a custom creator function with the * {@link NodeSelector} signature rather than a constructor function. * @param creator */ private appendFn; /** * Runs the given selector that returns a single node for every node in each group. * The original nodes are then replaced by the nodes returned by the selector * and returned as a new selection. * The selected nodes inherit the datums and the parents of the original nodes. */ select(selector: (node: G, datum: GDatum, index: number, group: (G | undefined)[]) => N | undefined): Selection; /** * Same as {@link select}, but uses the given {@param Class} (constructor) as a selector. * @param Class The constructor function to use to find matching nodes. */ selectByClass(Class: new () => N): Selection; selectByTag(tag: number): Selection; selectAllByClass(Class: new () => N): Selection; selectAllByTag(tag: number): Selection; private selectNone; /** * Runs the given selector that returns a group of nodes for every node in each group. * The original nodes are then replaced by the groups of nodes returned by the selector * and returned as a new selection. The original nodes become the parent nodes for each * group in the new selection. The selected nodes do not inherit the datums of the original nodes. * If called without any parameters, creates a new selection with an empty group for each * node in this selection. */ selectAll(selectorAll?: (node: G, datum: GDatum, index: number, group: (G | undefined)[]) => N[]): Selection; /** * Runs the given callback for every node in this selection and returns this selection. * @param cb */ each(cb: (node: G, datum: GDatum, index: number, group: (G | undefined)[]) => void): this; remove(): this; merge(other: Selection): Selection; /** * Return the first non-null element in this selection. * If the selection is empty, returns null. */ node(): G | null; attr(name: K, value: Exclude): this; attrFn(name: K, value: (node: G, datum: GDatum, index: number, group: (G | undefined)[]) => Exclude): this; /** * Invokes the given function once, passing in this selection. * Returns this selection. Facilitates method chaining. * @param cb */ call(cb: (selection: this) => void): this; /** * Returns the total number of nodes in this selection. */ readonly size: number; /** * Returns the array of data for the selected elements. */ readonly data: GDatum[]; private enterGroups?; private exitGroups?; readonly enter: Selection; readonly exit: Selection; /** * Binds the given value to each selected node and returns this selection * with its {@link GDatum} type changed to the type of the given value. * This method doesn't compute a join and doesn't affect indexes or the enter and exit selections. * This method can also be used to clear bound data. * @param value */ setDatum(value: GDatum): Selection; /** * Returns the bound datum for the first non-null element in the selection. * This is generally useful only if you know the selection contains exactly one element. */ readonly datum: GDatum; /** * Binds the specified array of values with the selected nodes, returning a new selection * that represents the _update_ selection: the nodes successfully bound to the values. * Also defines the {@link enter} and {@link exit} selections on the returned selection, * which can be used to add or remove the nodes to correspond to the new data. * The `values` is an array of values of a particular type, or a function that returns * an array of values for each group. * When values are assigned to the nodes, they are stored in the {@link Node.datum} property. * @param values * @param key */ setData(values: GDatum[] | ValueFn, key?: KeyFn): Selection; private bindIndex; private static keyPrefix; private bindKey; } export {};