import type { DataPoint } from "@d3plus/data";
import type { D3Selection } from "@d3plus/dom";
import { TextBox } from "../components/index.js";
import { BaseClass } from "../utils/index.js";
/**
    Creates an SVG legend based on an array of data.
*/
export default class Legend extends BaseClass {
    _titleClass: TextBox;
    _align: string;
    _data: DataPoint[];
    _direction: string;
    _duration: number;
    _height: number;
    _id: (d: DataPoint, i?: number) => unknown;
    _label: (d: DataPoint, i?: number) => unknown;
    _lineData: Record<string, unknown>[];
    _outerBounds: Record<string, number>;
    _padding: number;
    _shape: (d: DataPoint, i?: number) => unknown;
    _select: D3Selection;
    _shapes: unknown[];
    _shapeConfig: Record<string, unknown>;
    _titleConfig: Record<string, unknown>;
    _verticalAlign: string;
    _width: number;
    _rtl: boolean;
    _group: D3Selection;
    _titleGroup: D3Selection;
    _shapeGroup: D3Selection;
    _titleHeight: number;
    _titleWidth: number;
    _title: string | undefined;
    _wrapLines: (() => void) | undefined;
    _wrapRows: (() => void) | undefined;
    /**
        Invoked when creating a new class instance, and sets any default parameters.
        @private
  */
    constructor();
    /**
      @param key The configuration key.
      @param d The data point.
      @param i The data index.
      @private
    */
    _fetchConfig(key: string, d: DataPoint, i: number): unknown;
    /**
      @param row The legend row data.
      @private
    */
    _rowHeight(row: Record<string, unknown>[]): number;
    /**
      @param row The legend row data.
      @private
    */
    _rowWidth(row: Record<string, unknown>[]): number;
    /**
        Renders the current Legend to the page.
      @param callback Optional callback invoked after rendering completes.
  */
    render(callback?: (...args: unknown[]) => unknown): this;
    /**
        The active method for all shapes.
  */
    active(_: unknown): this;
    /**
        The horizontal alignment.
  */
    align(): string;
    align(_: string): this;
    /**
        The data array used to create shapes. A shape key will be drawn for each object in the array.
  */
    data(): DataPoint[];
    data(_: DataPoint[]): this;
    /**
        The flow direction of the legend items.
  */
    direction(): string;
    direction(_: string): this;
    /**
        Transition duration of the legend.
  */
    duration(): number;
    duration(_: number): this;
    /**
        Overall height of the legend.
  */
    height(): number;
    height(_: number): this;
    /**
        The hover method for all shapes.
  */
    hover(_: unknown): this;
    /**
        The unique id accessor for each legend entry.
  
  @example
  function value(d) {
    return d.id;
  }
  */
    id(): (d: DataPoint, i?: number) => unknown;
    id(_: (d: DataPoint, i?: number) => unknown): this;
    /**
        The label accessor for each legend entry. Uses the id accessor by default.
  */
    label(): (d: DataPoint, i?: number) => unknown;
    label(_: ((d: DataPoint, i?: number) => unknown) | unknown): this;
    /**
        Returns the outer bounds of the legend content. Must be called after rendering.
        @example
  {"width": 180, "height": 24, "x": 10, "y": 20}
  */
    outerBounds(): Record<string, number>;
    /**
        The padding between each key.
  */
    padding(): number;
    padding(_: number): this;
    /**
        The SVG container element as a d3 selector or DOM element.
  */
    select(): D3Selection;
    select(_: any): this;
    /**
        The shape type used for each legend entry.
  */
    shape(): (d: DataPoint, i?: number) => unknown;
    shape(_: ((d: DataPoint, i?: number) => unknown) | unknown): this;
    /**
        Methods that correspond to the key/value pairs for each shape.
  */
    shapeConfig(): Record<string, unknown>;
    shapeConfig(_: Record<string, unknown>): this;
    /**
        Title of the legend.
  */
    title(): string | undefined;
    title(_: string): this;
    /**
        Title configuration of the legend.
  */
    titleConfig(): Record<string, unknown>;
    titleConfig(_: Record<string, unknown>): this;
    /**
        The vertical alignment.
  */
    verticalAlign(): string;
    verticalAlign(_: string): this;
    /**
        Overall width of the legend.
  */
    width(): number;
    width(_: number): this;
}
