look at the plug-in source code and stumble upon this writing:
type Axis = "both" |" x" | "none";
import type {Element as ReactElement, Node as ReactNode} from" react";
what does type mean?
import React from "react";
import PropTypes from "prop-types";
import {DraggableCore} from "react-draggable";
import cloneElement from "./cloneElement";
import type {Element as ReactElement, Node as ReactNode} from "react";
type Axis = "both" | "x" | "y" | "none";
type State = {
resizing: boolean,
width: number, height: number,
slackW: number, slackH: number
};
type DragCallbackData = {
node: HTMLElement,
x: number, y: number,
deltaX: number, deltaY: number,
lastX: number, lastY: number
};
export type ResizeCallbackData = {
node: HTMLElement,
size: {width: number, height: number}
};
//...