import * as React from 'react'; import { PureComponent } from 'react'; import { Props as TrapezoidProps } from '../shape/Trapezoid'; import { ImplicitLabelListType } from '../component/LabelList'; import { ActiveShape, AnimationDuration, AnimationTiming, ChartOffset, Coordinate, DataKey, LegendType, PresentationAttributesAdaptChildEvent, TooltipType } from '../util/types'; export interface FunnelTrapezoidItem extends TrapezoidProps { value?: number | string; payload?: any; isActive: boolean; tooltipPosition: Coordinate; } /** * Internal props, combination of external props + defaultProps + private Recharts state */ interface InternalFunnelProps { trapezoids?: ReadonlyArray; className?: string; dataKey: DataKey; nameKey?: DataKey; data?: any[]; hide?: boolean; shape?: ActiveShape; activeShape?: ActiveShape; legendType?: LegendType; tooltipType?: TooltipType; lastShapeType?: 'triangle' | 'rectangle'; reversed?: boolean; onAnimationStart?: () => void; onAnimationEnd?: () => void; isAnimationActive?: boolean; animationBegin?: number; animationDuration?: AnimationDuration; animationEasing?: AnimationTiming; id?: string; } /** * External props, intended for end users to fill in */ interface FunnelProps { activeShape?: ActiveShape; animationBegin?: number; animationDuration?: AnimationDuration; animationEasing?: AnimationTiming; className?: string; data?: any[]; dataKey: DataKey; hide?: boolean; id?: string; isAnimationActive?: boolean; label?: ImplicitLabelListType; lastShapeType?: 'triangle' | 'rectangle'; legendType?: LegendType; nameKey?: DataKey; onAnimationEnd?: () => void; onAnimationStart?: () => void; reversed?: boolean; shape?: ActiveShape; tooltipType?: TooltipType; } type FunnelSvgProps = Omit & TrapezoidProps, 'ref'>; type InternalProps = FunnelSvgProps & InternalFunnelProps; export type Props = FunnelSvgProps & FunnelProps; type RealFunnelData = any; type FunnelComposedData = { trapezoids: ReadonlyArray; data: RealFunnelData[]; }; export declare class FunnelWithState extends PureComponent { render(): React.JSX.Element; } export declare function computeFunnelTrapezoids({ dataKey, nameKey, displayedData, tooltipType, lastShapeType, reversed, offset, customWidth, }: { dataKey: Props['dataKey']; nameKey: Props['nameKey']; offset: ChartOffset; displayedData: RealFunnelData[]; tooltipType?: TooltipType; lastShapeType?: Props['lastShapeType']; reversed?: boolean; customWidth?: number | string; }): FunnelComposedData; export declare class Funnel extends PureComponent { static displayName: string; static defaultProps: { readonly stroke: "#fff"; readonly fill: "#808080"; readonly legendType: "rect"; readonly hide: false; readonly isAnimationActive: boolean; readonly animationBegin: 400; readonly animationDuration: 1500; readonly animationEasing: "ease"; readonly nameKey: "name"; readonly lastShapeType: "triangle"; }; render(): React.JSX.Element; } export {};