import { fill, grid, inset, layer } from './view-layout.js'; import type { ChartTheme, ChartValue, ResponsiveChartDefinition, StaticChartDefinition } from './types.js'; import type { ViewAnchor, ViewGridCell, ViewInsetOptions, ViewLayout, ViewLayoutPlaced, ViewLayoutReferenced, ViewTrack } from './view-layout.js'; export { fill, grid, inset, layer }; export type { ViewAnchor, ViewGridCell, ViewInsetOptions, ViewLayout, ViewTrack, }; type EmbeddedHostOption = 'maxFocusDistance' | 'focus' | 'focusRing' | 'cursor' | 'spatialIndex' | 'svgAnimation' | 'keyboard' | 'pointer' | 'selection' | 'controls' | 'tooltip' | 'motion'; type WithoutEmbeddedHostOptions = Omit & { [TOption in EmbeddedHostOption]?: never; }; /** A chart definition that can be embedded without creating a second host. */ export type ComposableStaticChartDefinition = Omit>, 'gradients' | 'theme'> & { gradients?: readonly []; theme?: Omit, 'background'> & { background?: never; }; }; /** A responsive chart definition whose resolved spec can be embedded in a view. */ export type ComposableResponsiveChartDefinition = WithoutEmbeddedHostOptions>; export type ComposableChartDefinition = ComposableStaticChartDefinition | ComposableResponsiveChartDefinition; type AnyComposableChartDefinition = ComposableChartDefinition; export type ViewDefinitions = Readonly>; export interface ViewLink { x?: string; y?: string; } export interface ViewGridItem { id: string; row: TRow; column: TColumn; chart: TChart; /** Share scale semantics and align the corresponding plot range. */ share?: ViewLink; /** Align a plot range without requiring equal scale domains. */ align?: ViewLink; } type TrackId = TTracks[number]['id']; export interface ViewGridOptions, TrackId>[] = readonly ViewGridItem, TrackId>[]> { id?: string; rows: TRows; columns: TColumns; views: TViews; gap?: number; rowGap?: number; columnGap?: number; } type ViewDefinition = TView extends ViewGridItem ? TDefinition : never; type DefinitionDatum = TDefinition extends ComposableChartDefinition ? TDatum : never; type DefinitionXValue = TDefinition extends ComposableChartDefinition ? TXValue : never; type DefinitionYValue = TDefinition extends ComposableChartDefinition ? TYValue : never; type ViewDatum = DefinitionDatum>; type ViewXValue = DefinitionXValue>; type ViewYValue = DefinitionYValue>; type NamedViewId = Extract; type NamedViewDefinition = TViews[NamedViewId]; type NamedViewDatum = DefinitionDatum>; type NamedViewXValue = DefinitionXValue>; type NamedViewYValue = DefinitionYValue>; type ValidViewLayout> = [Exclude, NamedViewId>] extends [never] ? [Exclude, NamedViewId>] extends [ never ] ? [Exclude, ViewLayoutPlaced>] extends [never] ? unknown : never : never : never; export type ViewAxis = 'x' | 'y'; export type ViewScaleLinkMode = 'share' | 'align'; export interface ViewScaleLink { readonly source: TView; readonly target: TView; readonly axis: ViewAxis; readonly mode: ViewScaleLinkMode; } export interface ComposeViewsOptions = ViewLayout> { id?: string; views: TViews; layout: TLayout; links?: readonly ViewScaleLink>>[]; } export declare function shareX(source: TSource, target: TTarget): ViewScaleLink; export declare function shareY(source: TSource, target: TTarget): ViewScaleLink; export declare function alignX(source: TSource, target: TTarget): ViewScaleLink; export declare function alignY(source: TSource, target: TTarget): ViewScaleLink; /** Composes named complete chart definitions through one deterministic layout. */ export declare function composeViews>(options: ComposeViewsOptions & { layout: TLayout & ValidViewLayout, TLayout>; }): StaticChartDefinition, NamedViewXValue, NamedViewYValue> & ComposableStaticChartDefinition, NamedViewXValue, NamedViewYValue>; /** Convenience syntax for non-overlapping row and column view composition. */ export declare function viewGrid, TrackId>[]>(options: ViewGridOptions): StaticChartDefinition, ViewXValue, ViewYValue> & ComposableStaticChartDefinition, ViewXValue, ViewYValue>;