Change enum declaration in index.d.ts to UnionType (#1800)

Co-authored-by: Avery Pierce <avery.pierce@spin.pm>
This commit is contained in:
tainakanchu
2022-07-22 22:31:47 +09:00
committed by GitHub
parent 1a752999d9
commit a7a31ca806
2 changed files with 10 additions and 41 deletions
+4 -21
View File
@@ -12,6 +12,8 @@ export type NumberArray = NumberProp[] | NumberProp;
export type FillRule = 'evenodd' | 'nonzero';
export type Units = 'userSpaceOnUse' | 'objectBoundingBox';
export type MarkerUnits = 'strokeWidth' | 'userSpaceOnUse';
export type Orient = 'auto' | 'auto-start-reverse';
export type TextAnchor = 'start' | 'middle' | 'end';
export type FontStyle = 'normal' | 'italic' | 'oblique';
@@ -464,15 +466,6 @@ export interface UseProps extends CommonPathProps {
export const Use: React.ComponentClass<UseProps>;
export type Use = React.ComponentClass<UseProps>;
export enum EMaskUnits {
USER_SPACE_ON_USE = 'userSpaceOnUse',
OBJECT_BOUNDING_BOX = 'objectBoundingBox',
}
export type TMaskUnits =
| EMaskUnits.USER_SPACE_ON_USE
| EMaskUnits.OBJECT_BOUNDING_BOX;
export interface MaskProps extends CommonPathProps {
id?: string;
x?: NumberProp;
@@ -480,22 +473,12 @@ export interface MaskProps extends CommonPathProps {
width?: NumberProp;
height?: NumberProp;
maskTransform?: ColumnMajorTransformMatrix | string;
maskUnits?: TMaskUnits;
maskContentUnits?: TMaskUnits;
maskUnits?: Units;
maskContentUnits?: Units;
}
export const Mask: React.ComponentClass<MaskProps>;
export type Mask = React.ComponentClass<MaskProps>;
export enum MarkerUnits {
STROKE_WIDTH = 'strokeWidth',
USER_SPACE_ON_USE = 'userSpaceOnUse',
}
export enum Orient {
AUTO = 'auto',
AUTO_START_REVERSE = 'auto-start-reverse',
}
export interface MarkerProps {
id?: string;
viewBox?: string;
+6 -20
View File
@@ -15,6 +15,8 @@ export type NumberProp = string | number;
export type NumberArray = NumberProp[] | NumberProp;
export type FillRule = "evenodd" | "nonzero";
export type Units = "userSpaceOnUse" | "objectBoundingBox";
export type MarkerUnits = "strokeWidth" | "userSpaceOnUse";
export type Orient = "auto" | "auto-start-reverse";
export type TextAnchor = "start" | "middle" | "end";
export type FontStyle = "normal" | "italic" | "oblique";
export type FontVariant = "normal" | "small-caps";
@@ -429,13 +431,6 @@ export type UseProps = {
} & CommonPathProps;
declare export var Use: React.ComponentClass<UseProps>;
export type UseType = React.ComponentClass<UseProps>;
declare export var EMaskUnits: {|
+USER_SPACE_ON_USE: "userSpaceOnUse", // "userSpaceOnUse"
+OBJECT_BOUNDING_BOX: "objectBoundingBox", // "objectBoundingBox"
|};
export type TMaskUnits =
| typeof EMaskUnits.USER_SPACE_ON_USE
| typeof EMaskUnits.OBJECT_BOUNDING_BOX;
export type MaskProps = {
id?: string,
x?: NumberProp,
@@ -443,21 +438,12 @@ export type MaskProps = {
width?: NumberProp,
height?: NumberProp,
maskTransform?: ColumnMajorTransformMatrix | string,
maskUnits?: TMaskUnits,
maskContentUnits?: TMaskUnits,
maskUnits?: Units,
maskContentUnits?: Units,
...
} & CommonPathProps;
declare export var Mask: React.ComponentClass<MaskProps>;
export type MaskType = React.ComponentClass<MaskProps>;
declare export var MarkerUnits: {|
+STROKE_WIDTH: "strokeWidth", // "strokeWidth"
+USER_SPACE_ON_USE: "userSpaceOnUse", // "userSpaceOnUse"
|};
declare export var Orient: {|
+AUTO: "auto", // "auto"
+AUTO_START_REVERSE: "auto-start-reverse", // "auto-start-reverse"
|};
export interface MarkerProps {
id?: string;
viewBox?: string;
@@ -466,8 +452,8 @@ export interface MarkerProps {
refY?: NumberProp;
markerWidth?: NumberProp;
markerHeight?: NumberProp;
markerUnits?: $Values<typeof MarkerUnits>;
orient?: $Values<typeof Orient> | NumberProp;
markerUnits?: MarkerUnits;
orient?: Orient | NumberProp;
}
declare export var Marker: React.ComponentClass<MarkerProps>;
export type MarkerType = React.ComponentClass<MarkerProps>;