chore(types): cleanup
This commit is contained in:
@@ -14,7 +14,7 @@ const initialNodes: Node[] = [
|
||||
dragHandle: '.custom-drag-handle',
|
||||
style: { border: '1px solid #ddd', padding: '20px 40px' },
|
||||
position: { x: 200, y: 200 },
|
||||
data: null,
|
||||
data: {},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import type { XYPosition, Dimensions } from '@xyflow/system';
|
||||
|
||||
import type { Node, Edge } from '.';
|
||||
|
||||
@@ -45,22 +45,22 @@ export type Edge<
|
||||
focusable?: boolean;
|
||||
};
|
||||
|
||||
type SmoothStepEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & {
|
||||
type: 'smoothstep';
|
||||
type SmoothStepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<
|
||||
EdgeData,
|
||||
'smoothstep'
|
||||
> & {
|
||||
pathOptions?: SmoothStepPathOptions;
|
||||
};
|
||||
|
||||
type BezierEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & {
|
||||
type: 'default';
|
||||
type BezierEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'default'> & {
|
||||
pathOptions?: BezierPathOptions;
|
||||
};
|
||||
|
||||
type StepEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & {
|
||||
type: 'step';
|
||||
type StepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'step'> & {
|
||||
pathOptions?: StepPathOptions;
|
||||
};
|
||||
|
||||
export type BuiltInEdge = SmoothStepEdgeType | BezierEdgeType | StepEdgeType;
|
||||
export type BuiltInEdge = SmoothStepEdge | BezierEdge | StepEdge;
|
||||
|
||||
export type EdgeMouseHandler<EdgeType extends Edge = Edge> = (event: ReactMouseEvent, edge: EdgeType) => void;
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import {
|
||||
FitViewParamsBase,
|
||||
FitViewOptionsBase,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
import type { Rect, Viewport } from '@xyflow/system';
|
||||
import type { Node, Edge, ViewportHelperFunctions } from '.';
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
import type { ComponentType, SvelteComponent } from 'svelte';
|
||||
import type { NodeBase, NodeProps } from '@xyflow/system';
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Position } from './utils';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export type EdgeBase<
|
||||
EdgeData extends Record<string, unknown> = Record<string, unknown>,
|
||||
EdgeType extends string | undefined = string | undefined
|
||||
|
||||
Reference in New Issue
Block a user