-
Notifications
You must be signed in to change notification settings - Fork 76
/
types.ts
75 lines (70 loc) · 2.23 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React, { ReactSVG } from 'react';
import { cAnchorEdge, cArrowShapes, cPaths, cSvgElems } from './constants';
export type xarrowPropsType = {
start: refType;
end: refType;
startAnchor?: anchorType;
endAnchor?: anchorType;
labels?: labelType | labelsType;
color?: string;
lineColor?: string | null;
headColor?: string | null;
tailColor?: string | null;
strokeWidth?: number;
showHead?: boolean;
headSize?: number;
showTail?: boolean;
tailSize?: number;
path?: pathType;
showXarrow?: boolean;
curveness?: number;
gridBreak?: string;
// gridRadius?: number;
dashness?:
| boolean
| {
strokeLen?: number;
nonStrokeLen?: number;
animation?: boolean | number;
};
headShape?: svgEdgeShapeType | svgCustomEdgeType;
tailShape?: svgEdgeShapeType | svgCustomEdgeType;
animateDrawing?: boolean | number;
zIndex?: number;
passProps?: JSX.IntrinsicElements[svgElemType];
SVGcanvasProps?: React.SVGAttributes<SVGSVGElement>;
arrowBodyProps?: React.SVGProps<SVGPathElement>;
arrowHeadProps?: JSX.IntrinsicElements[svgElemType];
arrowTailProps?: JSX.IntrinsicElements[svgElemType];
divContainerProps?: React.HTMLProps<HTMLDivElement>;
SVGcanvasStyle?: React.CSSProperties;
divContainerStyle?: React.CSSProperties;
_extendSVGcanvas?: number;
_debug?: boolean;
_cpx1Offset?: number;
_cpy1Offset?: number;
_cpx2Offset?: number;
_cpy2Offset?: number;
};
export type pathType = typeof cPaths[number];
export type _anchorType = anchorNamedType | anchorCustomPositionType;
export type anchorType = _anchorType | _anchorType[];
export type anchorNamedType = typeof cAnchorEdge[number];
export type anchorCustomPositionType = {
position: anchorNamedType;
offset: { x?: number; y?: number };
};
export type refType = React.MutableRefObject<any> | string;
export type labelsType = {
start?: labelType;
middle?: labelType;
end?: labelType;
};
export type labelType = JSX.Element | string;
export type svgCustomEdgeType = {
svgElem: JSX.IntrinsicElements[keyof ReactSVG];
offsetForward?: number;
};
export type svgEdgeShapeType = typeof cArrowShapes[number];
export type svgEdgeType = svgEdgeShapeType | svgCustomEdgeType;
export type svgElemType = typeof cSvgElems[number];