-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
63 lines (63 loc) · 1.76 KB
/
index.d.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
import * as React from "react";
interface Props {
arrows: Arrow[];
defaultArrowStyle?: Partial<ArrowStyle>;
children: React.ReactNode;
}
export declare type Point = [number, number];
export interface DirectedPoint {
point: Point;
direction: Point;
}
export interface Arrows {
arrows: Arrow[];
defaultArrowStyle: ArrowStyle;
}
export interface Value {
value: number;
unit: "px" | "%";
}
export interface ExtraPoint {
x: Value;
y: Value;
absolute: boolean;
}
export interface MidPointSpec {
curved: boolean;
points: ExtraPoint[] | ((from: DirectedPoint, to: DirectedPoint) => ExtraPoint[]);
}
export interface HeadPointSpec {
size: number;
adjust: number;
hollow: boolean;
svgPath: string;
}
export declare type ArrowStyleAlias = "none" | "clipClockwise" | "clipCounterclockwise" | "arcClockwise" | "arcCounterclockwise" | "corners" | "smooth";
export declare type HeadStyleAlias = "default" | "hollow" | "filledDiamond" | "diamond" | "disk" | "circle" | "none";
export interface ArrowStyle {
width: number;
color: string;
arrow: ArrowStyleAlias | MidPointSpec;
head: HeadStyleAlias;
}
export declare type PosXLocation = "left" | "middle" | "right";
export declare type PosYLocation = "top" | "middle" | "bottom";
export interface ArrowLocation {
id: string;
posX?: PosXLocation;
posY?: PosYLocation;
}
export interface Arrow {
from: string | ArrowLocation;
to: string | ArrowLocation;
style?: Partial<ArrowStyle>;
}
export interface PathSpec {
points: Point[];
curved: boolean;
width: number;
color: string;
headPoints: HeadPointSpec | null;
}
export declare const ArrowArea: ({ arrows, children, defaultArrowStyle, }: Props) => JSX.Element;
export default ArrowArea;