chore(types): cleanup

This commit is contained in:
moklick
2024-02-17 16:32:59 +01:00
parent ad7403cc75
commit a16c5c9bd5
7 changed files with 8 additions and 13 deletions
@@ -14,7 +14,7 @@ const initialNodes: Node[] = [
dragHandle: '.custom-drag-handle', dragHandle: '.custom-drag-handle',
style: { border: '1px solid #ddd', padding: '20px 40px' }, style: { border: '1px solid #ddd', padding: '20px 40px' },
position: { x: 200, y: 200 }, position: { x: 200, y: 200 },
data: null, data: {},
}, },
]; ];
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { XYPosition, Dimensions } from '@xyflow/system'; import type { XYPosition, Dimensions } from '@xyflow/system';
import type { Node, Edge } from '.'; import type { Node, Edge } from '.';
+7 -7
View File
@@ -45,22 +45,22 @@ export type Edge<
focusable?: boolean; focusable?: boolean;
}; };
type SmoothStepEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & { type SmoothStepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<
type: 'smoothstep'; EdgeData,
'smoothstep'
> & {
pathOptions?: SmoothStepPathOptions; pathOptions?: SmoothStepPathOptions;
}; };
type BezierEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & { type BezierEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'default'> & {
type: 'default';
pathOptions?: BezierPathOptions; pathOptions?: BezierPathOptions;
}; };
type StepEdgeType<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData> & { type StepEdge<EdgeData extends Record<string, unknown> = Record<string, unknown>> = Edge<EdgeData, 'step'> & {
type: 'step';
pathOptions?: StepPathOptions; 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; export type EdgeMouseHandler<EdgeType extends Edge = Edge> = (event: ReactMouseEvent, edge: EdgeType) => void;
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { import {
FitViewParamsBase, FitViewParamsBase,
FitViewOptionsBase, FitViewOptionsBase,
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-namespace */ /* eslint-disable @typescript-eslint/no-namespace */
import type { Rect, Viewport } from '@xyflow/system'; import type { Rect, Viewport } from '@xyflow/system';
import type { Node, Edge, ViewportHelperFunctions } from '.'; import type { Node, Edge, ViewportHelperFunctions } from '.';
-1
View File
@@ -1,4 +1,3 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { ComponentType, SvelteComponent } from 'svelte'; import type { ComponentType, SvelteComponent } from 'svelte';
import type { NodeBase, NodeProps } from '@xyflow/system'; import type { NodeBase, NodeProps } from '@xyflow/system';
-1
View File
@@ -1,6 +1,5 @@
import { Position } from './utils'; import { Position } from './utils';
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type EdgeBase< export type EdgeBase<
EdgeData extends Record<string, unknown> = Record<string, unknown>, EdgeData extends Record<string, unknown> = Record<string, unknown>,
EdgeType extends string | undefined = string | undefined EdgeType extends string | undefined = string | undefined