chore(types): cleanup
This commit is contained in:
@@ -1,18 +1,10 @@
|
||||
import { FC, PropsWithChildren } from 'react';
|
||||
import type { FC, PropsWithChildren } from 'react';
|
||||
import cc from 'classcat';
|
||||
|
||||
import { ControlButtonProps } from './types';
|
||||
import type { ControlButtonProps } from './types';
|
||||
|
||||
const ControlButton: FC<PropsWithChildren<ControlButtonProps>> = ({
|
||||
children,
|
||||
className,
|
||||
...rest
|
||||
}) => (
|
||||
<button
|
||||
type="button"
|
||||
className={cc(['react-flow__controls-button', className])}
|
||||
{...rest}
|
||||
>
|
||||
const ControlButton: FC<PropsWithChildren<ControlButtonProps>> = ({ children, className, ...rest }) => (
|
||||
<button type="button" className={cc(['react-flow__controls-button', className])} {...rest}>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { memo, FC, useEffect, useState, PropsWithChildren } from 'react';
|
||||
import { memo, useEffect, useState } from 'react';
|
||||
import type { FC, PropsWithChildren } from 'react';
|
||||
import cc from 'classcat';
|
||||
import { useStore, useStoreApi, useReactFlow, ReactFlowState, Panel } from '@reactflow/core';
|
||||
import { useStore, useStoreApi, useReactFlow, Panel } from '@reactflow/core';
|
||||
import type { ReactFlowState } from '@reactflow/core';
|
||||
|
||||
import PlusIcon from './Icons/Plus';
|
||||
import MinusIcon from './Icons/Minus';
|
||||
@@ -9,7 +11,7 @@ import LockIcon from './Icons/Lock';
|
||||
import UnlockIcon from './Icons/Unlock';
|
||||
import ControlButton from './ControlButton';
|
||||
|
||||
import { ControlProps } from './types';
|
||||
import type { ControlProps } from './types';
|
||||
|
||||
const isInteractiveSelector = (s: ReactFlowState) => s.nodesDraggable && s.nodesConnectable && s.elementsSelectable;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
||||
import { FitViewOptions, PanelPosition } from '@reactflow/core';
|
||||
import type { ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
||||
import type { FitViewOptions, PanelPosition } from '@reactflow/core';
|
||||
|
||||
export interface ControlProps extends HTMLAttributes<HTMLDivElement> {
|
||||
export type ControlProps = HTMLAttributes<HTMLDivElement> & {
|
||||
showZoom?: boolean;
|
||||
showFitView?: boolean;
|
||||
showInteractive?: boolean;
|
||||
@@ -11,6 +11,6 @@ export interface ControlProps extends HTMLAttributes<HTMLDivElement> {
|
||||
onFitView?: () => void;
|
||||
onInteractiveChange?: (interactiveStatus: boolean) => void;
|
||||
position?: PanelPosition;
|
||||
}
|
||||
};
|
||||
|
||||
export type ControlButtonProps = ButtonHTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
Reference in New Issue
Block a user