UNPKG

973 BTypeScriptView Raw
1import { Except } from 'type-fest';
2export type CoordType = 'rect' | 'polar';
3
4export interface CoordCommonProps<TCoordType extends CoordType> {
5 /**
6 * 度量类型。
7 */
8 type: TCoordType;
9}
10
11export interface CoordRectProps extends CoordCommonProps<'rect'> {
12 /**
13 * 坐标系翻转。
14 */
15 transposed?: boolean;
16}
17
18export interface CoordPolarProps extends CoordCommonProps<'polar'> {
19 /**
20 * 坐标系翻转。
21 */
22 transposed?: boolean;
23 /**
24 * 起始弧度。
25 */
26 startAngle?: number;
27
28 /**
29 * 结束弧度。
30 */
31 endAngle?: number;
32
33 /**
34 * 内环半径,数值为 0 - 1 范围。
35 */
36 innerRadius?: number;
37
38 /**
39 * @deprecated 请使用 innerRadius 代替
40 */
41 inner?: number;
42
43 /**
44 * 半径,数值为 0 - 1 范围。
45 */
46 radius?: number;
47}
48
49/**
50 * 坐标系参数。
51 */
52export type CoordProps =
53 | CoordRectProps
54 | CoordPolarProps
55 // type 可不填,默认为 Rect
56 | Except<CoordRectProps, 'type'>;