/**
 * Static legend rendering for server-side SVG.
 *
 * Builds legend SVG elements from data + colorScheme without React hooks.
 * Used by renderToStaticSVG when showLegend is true.
 */
import * as React from "react";
import type { SemioticTheme } from "../store/ThemeStore";
import type { Datum } from "../charts/shared/datumTypes";
import type { GradientLegendConfig, LegendGroup, LegendLayout } from "../types/legendTypes";
interface LegendItemLayout {
    category: string;
    width: number;
    x: number;
    y: number;
}
interface StaticLegendMetrics {
    items: LegendItemLayout[];
    width: number;
    height: number;
    swatchSize: number;
    labelOffset: number;
    swatchRadius: number;
}
export interface StaticLegendConfig {
    /** Category labels to show in legend */
    categories: string[];
    /** Color scheme — array of colors or d3-scale-chromatic name */
    colorScheme?: string | string[];
    /** Theme for text/font colors */
    theme: SemioticTheme;
    /** Legend position */
    position?: "right" | "left" | "top" | "bottom";
    /** Chart dimensions for positioning */
    totalWidth: number;
    totalHeight: number;
    /** Chart margins */
    margin: {
        top: number;
        right: number;
        bottom: number;
        left: number;
    };
    /** Title presence (affects top-position offset) */
    hasTitle?: boolean;
    /** SSR legend layout controls */
    legendLayout?: LegendLayout;
    /** Optional id namespace used for generated SVG ids */
    idPrefix?: string;
}
export interface StaticLegendGroupsConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
    legendGroups: LegendGroup[];
}
export interface StaticGradientLegendConfig extends Omit<StaticLegendConfig, "categories" | "colorScheme"> {
    gradient: GradientLegendConfig;
}
export declare function measureStaticLegend(config: StaticLegendConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
export declare function measureStaticLegendGroups(config: StaticLegendGroupsConfig): Omit<StaticLegendMetrics, "items" | "labelOffset" | "swatchRadius">;
export declare function measureStaticGradientLegend(config: StaticGradientLegendConfig): {
    width: number;
    height: number;
    swatchSize: number;
};
/**
 * Render a static legend as SVG elements.
 * Returns null if no categories to show.
 */
export declare function renderStaticLegend(config: StaticLegendConfig): React.ReactNode;
export declare function renderStaticLegendGroups(config: StaticLegendGroupsConfig): React.ReactNode;
export declare function renderStaticGradientLegend(config: StaticGradientLegendConfig): React.ReactNode;
/**
 * Extract unique categories from data using an accessor.
 */
export declare function extractCategories(data: any[], accessor: string | ((d: Datum) => string) | undefined): string[];
export {};
