/**
 * D3 Selection Polyfill - A lightweight DOM selection and manipulation utility.
 *
 * This is a drop-in replacement for d3-selection, implementing only the methods
 * used in the Vega chart rendering system.
 *
 * Supported methods: select, selectAll, append, attr, property, text, datum,
 * call, node, nodes, each, remove, clone, transition, duration.
 *
 * @see VD-5022 - [Zero Dependencies] remove d3 dependency
 */
declare type SelectionCallback<GElement, Datum> = (this: GElement, d?: Datum, i?: number, nodes?: GElement[]) => any;
/**
 * A lightweight selection class mimicking d3-selection's chainable API.
 * Wraps an array of DOM elements and provides attribute/property/child manipulation.
 */
export declare class D3SelectionPolyfill<GElement extends Element = Element, Datum = unknown, PElement extends Element = Element, PDatum = unknown> {
  private _groups;
  private _datum;
  /**
   * @param {Element[]} elements - Array of DOM elements to wrap.
   * @param {*} [datum] - Optional bound datum for the selection.
   */
  constructor(elements: GElement[], datum?: Datum);
  /**
   * Selects the first descendant element matching the selector.
   *
   * @template DescElement
   * @template Datum
   * @template GElement
   * @param {string} selector - CSS selector string.
   * @returns {D3SelectionPolyfill<DescElement, Datum, GElement, Datum>} A new selection wrapping the matched element.
   */
  select<DescElement extends Element = Element>(selector: string): D3SelectionPolyfill<DescElement, Datum, GElement, Datum>;
  /**
   * Selects all descendant elements matching the selector.
   *
   * @template DescElement
   * @template NewDatum
   * @template GElement
   * @template Datum
   * @param {string} selector - CSS selector string.
   * @returns {D3SelectionPolyfill<DescElement, NewDatum, GElement, Datum>} A new selection wrapping all matched elements.
   */
  selectAll<DescElement extends Element = Element, NewDatum = unknown>(selector: string): D3SelectionPolyfill<DescElement, NewDatum, GElement, Datum>;
  /**
   * Appends a new child element to each element in the selection.
   * Accepts either a tag name string or a factory function that returns a DOM element.
   *
   * @template ChildElement
   * @template Datum
   * @template GElement
   * @param {string | Function} tagOrFactory - Tag name (e.g. 'g', 'path') or a factory function.
   * @returns {D3SelectionPolyfill<ChildElement, Datum, GElement, Datum>} A new selection wrapping the appended elements.
   */
  append<ChildElement extends Element = Element>(tagOrFactory: string | (() => ChildElement)): D3SelectionPolyfill<ChildElement, Datum, GElement, Datum>;
  /**
   * Sets or gets an attribute on each element.
   * If value is a function, it is called with the bound datum.
   *
   * @param {...*} args - Attribute name, and optionally a value or function returning a value.
   * @returns {any} This selection for chaining, or the attribute value if getting.
   */
  attr(...args: any[]): any;
  /**
   * Sets a JavaScript property on each element.
   *
   * @param {string} name - Property name.
   * @param {unknown} value - Property value.
   * @returns {this} This selection for chaining.
   */
  property(name: string, value: unknown): this;
  /**
   * Sets the text content of each element.
   *
   * @param {string} value - Text content string.
   * @returns {this} This selection for chaining.
   */
  text(value: string): this;
  /**
   * Binds a datum to the selection.
   *
   * @template NewDatum
   * @template GElement
   * @template PElement
   * @template PDatum
   * @param {*} data - The datum to bind.
   * @returns {D3SelectionPolyfill<GElement, NewDatum, PElement, PDatum>} A new selection with the bound datum.
   */
  datum<NewDatum>(data: NewDatum): D3SelectionPolyfill<GElement, NewDatum, PElement, PDatum>;
  /**
   * Calls a function with this selection as argument. Used for grouping operations.
   *
   * @param {Function} fn - Function to call.
   * @param {...*} args - Additional arguments.
   * @returns {this} This selection for chaining.
   */
  call(fn: (selection: this, ...args: any[]) => void, ...args: any[]): this;
  /**
   * Returns the first DOM node in the selection, or null.
   *
   * @template GElement
   * @returns {GElement | null} The first element or null.
   */
  node(): GElement | null;
  /**
   * Returns all DOM nodes in the selection as an array.
   *
   * @template GElement
   * @returns {GElement[]} Array of elements.
   */
  nodes(): GElement[];
  /**
   * Iterates over each element, calling the provided function.
   * The function is called with `this` set to the current DOM element.
   *
   * @param {Function} fn - Callback function.
   * @returns {this} This selection for chaining.
   */
  each(fn: SelectionCallback<GElement, Datum>): this;
  /**
   * Removes all elements in the selection from the DOM.
   *
   * @returns {this} This selection for chaining.
   */
  remove(): this;
  /**
   * Clones each element in the selection (shallow clone) and inserts after the original.
   *
   * @template GElement
   * @template Datum
   * @template PElement
   * @template PDatum
   * @returns {D3SelectionPolyfill<GElement, Datum, PElement, PDatum>} A new selection wrapping the cloned elements.
   */
  clone(): D3SelectionPolyfill<GElement, Datum, PElement, PDatum>;
  /**
   * Creates a transition-like object. This is a simplified polyfill that
   * applies attribute changes immediately (no actual animation), which is
   * sufficient for Vega's usage of hover path swapping.
   *
   * @param {*} [_name] - Transition name (ignored in polyfill).
   * @returns {this} This selection for chaining (acts as a no-op).
   */
  transition(_name?: unknown): this;
  /**
   * Sets the transition duration. No-op in this polyfill since
   * transitions are applied immediately.
   *
   * @param {number} _ms - Duration in milliseconds (ignored).
   * @returns {this} This selection for chaining.
   */
  duration(_ms: number): this;
}
/**
 * Selects a DOM element by wrapping it in a D3SelectionPolyfill.
 * Mimics d3.select().
 *
 * @template GElement
 * @param {Element | EventTarget} element - A DOM element or EventTarget to wrap.
 * @returns {D3SelectionPolyfill<GElement>} A new D3SelectionPolyfill wrapping the element.
 */
export declare function select<GElement extends Element = Element>(element: GElement | EventTarget): D3SelectionPolyfill<GElement>;
/**
 * Creates a detached SVG element (e.g., 'svg:text', 'svg:circle', 'svg:path').
 * Mimics d3.create().
 *
 * @template GElement
 * @param {string} qualifiedName - A qualified name like 'svg:text' or 'svg:circle'.
 * @returns {D3SelectionPolyfill<GElement>} A new D3SelectionPolyfill wrapping the created element.
 */
export declare function create<GElement extends Element = Element>(qualifiedName: string): D3SelectionPolyfill<GElement>;
export {};
