refactor(types): only export HandleProps but not HandleComponentProps

This commit is contained in:
moklick
2024-05-07 16:22:26 +02:00
parent 5093213116
commit 2b0d75ddaa
8 changed files with 19 additions and 41 deletions
@@ -13,9 +13,9 @@
} from '@xyflow/system';
import { useStore } from '$lib/store';
import type { HandleComponentProps } from '$lib/types';
import type { HandleProps } from '$lib/types';
type $$Props = HandleComponentProps;
type $$Props = HandleProps;
export let id: $$Props['id'] = undefined;
export let type: $$Props['type'] = 'source';
+1 -1
View File
@@ -46,7 +46,7 @@ export type {
EdgeTypes,
DefaultEdgeOptions
} from '$lib/types/edges';
export type { HandleComponentProps, FitViewOptions } from '$lib/types/general';
export type { HandleProps, FitViewOptions } from '$lib/types/general';
export type {
Node,
NodeTypes,
+3 -27
View File
@@ -1,12 +1,11 @@
import type { ShortcutModifierDefinition } from '@svelte-put/shortcut';
import type {
FitViewOptionsBase,
HandleType,
Position,
XYPosition,
ConnectingHandle,
Connection,
OnBeforeDeleteBase
OnBeforeDeleteBase,
HandleProps as HandlePropsSystem
} from '@xyflow/system';
import type { Node } from './nodes';
@@ -23,32 +22,9 @@ export type ConnectionData = {
connectionStatus: string | null;
};
export type HandleComponentProps = {
/** Type of the handle
* @example HandleType.Source, HandleType.Target
*/
type: HandleType;
/** Position of the handle
* @example Position.TopLeft, Position.TopRight,
* Position.BottomLeft, Position.BottomRight
*/
position?: Position;
/** Id of the handle
* @remarks optional if there is only one handle of this type
*/
id?: string;
export type HandleProps = HandlePropsSystem & {
class?: string;
style?: string;
/** Should you be able to connect from/to this handle */
isConnectable?: boolean;
/** Shoould you be able to connect from this handle */
isConnectableStart?: boolean;
/** Should you be able to connect to this handle */
isConnectableEnd?: boolean;
/** Function that is called when checking if connection is valid.
* Overrides the isValidConnection on the Flow component.
*/
isValidConnection?: IsValidConnection;
onconnect?: (connections: Connection[]) => void;
ondisconnect?: (connections: Connection[]) => void;
};