import { IPerspectiveViewerPlugin, ColumnConfigValues } from "@perspective-dev/viewer"; export interface Element { msMatchesSelector(selectors: string): boolean; } export type Type = "integer" | "string" | "boolean" | "date" | "datetime" | "float"; export interface Chart { (container: HTMLSelection, settings: Settings): void; plugin?: { name: string; category: string; max_cells: number; max_columns: number; render_warning: boolean; initial: { type?: string; count?: number; names: string[]; }; selectMode?: string; }; can_render_column_styles?: (type: Type, group?: string) => boolean; column_style_controls?: (type: Type, group?: string) => unknown; } export type PadUnit = "percent" | "domain"; export type Pad = [number, number]; export interface PaddingStrategy { (extent: any): any; pad(): Pad; pad(nextPad: Pad): this; padUnit(): PadUnit; padUnit(nextPadUnit: PadUnit): this; } export type Axis = [number, number]; export type GradientPair = [number, string]; export type GradientKey = string; export type ColorStyles = { scheme: string[]; gradient?: Record; interpolator: { [key: string]: (value: number) => string; }; grid: { gridLineColor?: string; }; opacity?: number; series?: string; [key: `series-${number}`]: string; }; export type TextStyles = Record; export type DataRowsWithKey = any[] & { key?: string; }; export type MainValue = { name: string; type: any; }; export type TreemapValue = { treemapLevel?: number; treemapRoute?: any[]; }; export type Settings = { hideKeys?: any[]; agg_paths?: any; axisMemo: Axis[]; colorStyles?: ColorStyles; crossValues: any[]; data: any[]; filter: any[]; mainValues: MainValue[]; splitMainValues?: string[]; realValues: string[]; size: DOMRect; splitValues: any[]; textStyles: TextStyles; sunburstLevel?: any; columns_config?: ColumnConfigValues; treemaps?: Record; }; export type Orientation = "vertical" | "horizontal" | "both"; export type Orient = "left" | "right" | "top" | "bottom"; export type SettingNameValues = "crossValues" | "mainValues" | "splitValues"; export type ValueName = "crossValue" | "mainValue" | "lowValue" | "highValue" | "colorValue"; export interface Domain { (data: any[]): any; valueName(): ValueName; valueName(nextValueName: ValueName): this; valueNames(): ValueName[]; valueNames(nextValueNames: ValueName[]): this; orient(): Orientation; orient(nextOrient: Orientation): this; pad(): Pad; pad(nextPad: Pad): this; padUnit(): PadUnit; padUnit(nextPadUnit: PadUnit): this; } export type DomainTuple = [number, number]; export interface ComponentData { bottom: any; left: any; top: any; right: any; size?: string; decorate?: (s: any, data: any, index: any) => void; } export interface Component { (): ComponentData; domain(): Domain; domain(nextDomain: Domain): this; orient(): Orientation; orient(nextOrient: Orientation): this; settingName(): SettingNameValues; settingName(nextSettingName: SettingNameValues): this; } export interface ScaleSequential extends d3.ScaleSequential { (arg: any): any; } export type D3Scale = d3.ScaleOrdinal | ScaleSequential; export type NodeRect = { top: number; right: number; bottom: number; left: number; }; export type HTMLSelection = d3.Selection; export interface ChartElement extends IPerspectiveViewerPlugin { _chart: Chart | null; _settings: Settings | null; render_warning: boolean; _initialized: boolean; _container: HTMLElement; get category(): string; get max_cells(): number; set max_cells(value: number); get max_columns(): number; set max_columns(value: number); _draw(): void; getContainer(): HTMLElement; }