UNPKG

1.08 kBTypeScriptView Raw
1import React from 'react';
2import { CurveFactory } from 'victory-vendor/d3-shape';
3import { LayoutType, PresentationAttributesWithProps } from '../util/types';
4export type CurveType = 'basis' | 'basisClosed' | 'basisOpen' | 'bumpX' | 'bumpY' | 'bump' | 'linear' | 'linearClosed' | 'natural' | 'monotoneX' | 'monotoneY' | 'monotone' | 'step' | 'stepBefore' | 'stepAfter' | CurveFactory;
5export interface Point {
6 x: number;
7 y: number;
8}
9interface CurveProps {
10 className?: string;
11 type?: CurveType;
12 layout?: LayoutType;
13 baseLine?: number | Array<Point>;
14 points?: Array<Point>;
15 connectNulls?: boolean;
16 path?: string;
17 pathRef?: (ref: SVGPathElement) => void;
18}
19export type Props = Omit<PresentationAttributesWithProps<CurveProps, SVGPathElement>, 'type' | 'points'> & CurveProps;
20type GetPathProps = Pick<Props, 'type' | 'points' | 'baseLine' | 'layout' | 'connectNulls'>;
21export declare const getPath: ({ type, points, baseLine, layout, connectNulls, }: GetPathProps) => string | null;
22export declare const Curve: React.FC<Props>;
23export {};