import { Selection } from 'd3-selection'; import { CoreDataModel } from '../../data-models/core'; import { ComponentType, Sizing } from '../../types/component'; import { Spacing } from '../../types/spacing'; import { ColorFunction } from '../../types/accessor'; import { VisEventCallback, VisEventType } from './types'; import { ComponentConfigInterface } from './config'; export declare class ComponentCore { element: SVGGElement | HTMLElement; type: ComponentType; g: Selection | Selection; config: ConfigInterface; prevConfig: ConfigInterface; datamodel: CoreDataModel; sizing: Sizing | string; uid: string; protected events: { [selector: string]: { [eventType in VisEventType]?: VisEventCallback; }; }; /** Default configuration */ protected _defaultConfig: ConfigInterface; /** Component width in pixels. This property is set automatically by the container. */ protected _width: number; /** Component height in pixels. This property is set automatically by the container. */ protected _height: number; /** Container width in pixels. This property is set automatically by the container. */ protected _containerWidth: number | undefined; /** Container height in pixels. This property is set automatically by the container. */ protected _containerHeight: number | undefined; /** Container margin in pixels. This property is set automatically by the container. */ protected _containerMargin: Spacing; /** Color scale for the component. This property is set automatically by the container. */ protected _colorFunction: ColorFunction | undefined; /** Re-binds the component's event listeners so that newly rendered elements get them too. * Throttled because the components that render a lot of elements call it on every frame of a * pan / zoom / layout interaction (see Graph, LeafletMap and TopoJSONMap). Delaying a re-bind * does not delay a configuration change: `_bindEvents` resolves the callbacks at dispatch time. */ _setUpComponentEventsThrottled: import('throttle-debounce').throttle<() => void>; /** Set the container margin. Called automatically by containers. */ setContainerMargin(margin: Spacing): void; /** Set the color scale for the component. Called automatically by containers. */ setColorFunction(colorFunction: ColorFunction): void; _setCustomAttributesThrottled: import('throttle-debounce').throttle<() => void>; constructor(type?: ComponentType); setConfig(config: ConfigInterface): void; setData(data: CoreDatum): void; setSize(width: number, height: number, containerWidth: number, containerHeight: number): void; render(duration?: number): void; get bleed(): Spacing; _render(duration?: number): void; private _setCustomAttributes; private _setUpComponentEvents; protected _mapEventDatum(datum: unknown, index: number): { datum: unknown; index: number; }; /** Attaches a listener for every selector / event type of the provided events map. * The map is passed as a getter and the callback is resolved when the event fires instead of * being captured here: `setConfig` replaces `this.config` with a newly merged object, so a * captured map would keep invoking the callbacks of an outdated configuration until the next * re-bind — which `render()` throttles by 500ms. */ private _bindEvents; /** Override to release component-specific resources (timers, animation frames, global event * listeners, observers). Called by `destroy()` before the component's DOM node is removed. */ protected _onDestroy(): void; destroy(): void; isDestroyed(): boolean; }