@vue-flow/core
Advanced tools
Comparing version 1.10.1 to 1.10.2
@@ -25,4 +25,4 @@ import type { GraphNode } from '../../types' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -29,0 +29,0 @@ ? { |
import type { FunctionalComponent } from 'vue' | ||
import type { BaseEdgeProps } from '~/types' | ||
import type { BaseEdgeProps } from '../../types' | ||
/** | ||
@@ -4,0 +4,0 @@ * The base edge is a simple wrapper for svg path |
import type { FunctionalComponent } from 'vue' | ||
import type { BezierEdgeProps } from '~/types' | ||
import type { BezierEdgeProps } from '../../types' | ||
declare const BezierEdge: FunctionalComponent<BezierEdgeProps> | ||
export default BezierEdge |
import type { FunctionalComponent, HTMLAttributes } from 'vue' | ||
import type { Position } from '~/types' | ||
import type { Position } from '../../types' | ||
interface Props extends HTMLAttributes { | ||
@@ -4,0 +4,0 @@ position: Position |
@@ -153,4 +153,4 @@ import type { EdgeTextProps } from '../../types/components' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -157,0 +157,0 @@ ? { |
declare const EdgeWrapper: import('vue').DefineComponent< | ||
Readonly<{ | ||
type?: any | ||
name?: any | ||
type?: any | ||
id?: any | ||
@@ -33,4 +33,4 @@ sourceNode?: any | ||
Readonly<{ | ||
type?: any | ||
name?: any | ||
type?: any | ||
id?: any | ||
@@ -47,4 +47,4 @@ sourceNode?: any | ||
{ | ||
readonly type?: any | ||
readonly name?: any | ||
readonly type?: any | ||
readonly id?: any | ||
@@ -51,0 +51,0 @@ readonly sourceNode?: any |
import type { FunctionalComponent } from 'vue' | ||
import type { SimpleBezierEdgeProps } from '~/types' | ||
import type { SimpleBezierEdgeProps } from '../../types' | ||
declare const SimpleBezierEdge: FunctionalComponent<SimpleBezierEdgeProps> | ||
export default SimpleBezierEdge |
import type { FunctionalComponent } from 'vue' | ||
import type { SmoothStepEdgeProps } from '~/types' | ||
import type { SmoothStepEdgeProps } from '../../types' | ||
declare const SmoothStepEdge: FunctionalComponent<SmoothStepEdgeProps> | ||
export default SmoothStepEdge |
import type { FunctionalComponent } from 'vue' | ||
import type { StepEdgeProps } from '~/types' | ||
import type { StepEdgeProps } from '../../types' | ||
declare const StepEdge: FunctionalComponent<StepEdgeProps> | ||
export default StepEdge |
import type { FunctionalComponent } from 'vue' | ||
import type { StraightEdgeProps } from '~/types' | ||
import type { StraightEdgeProps } from '../../types' | ||
declare const StraightEdge: FunctionalComponent<StraightEdgeProps> | ||
export default StraightEdge |
@@ -1,2 +0,2 @@ | ||
import type { Position } from '~/types' | ||
import type { Position } from '../../../types' | ||
export interface GetBezierPathParams { | ||
@@ -3,0 +3,0 @@ sourceX: number |
@@ -1,2 +0,2 @@ | ||
import type { Position } from '~/types' | ||
import type { Position } from '../../../types' | ||
export interface GetSimpleBezierPathParams { | ||
@@ -3,0 +3,0 @@ sourceX: number |
@@ -1,2 +0,2 @@ | ||
import type { Position } from '~/types' | ||
import type { Position } from '../../../types' | ||
export interface GetSmoothStepPathParams { | ||
@@ -3,0 +3,0 @@ sourceX: number |
@@ -153,4 +153,4 @@ import type { HandleProps } from '../../types/handle' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -157,0 +157,0 @@ ? { |
import type { FunctionalComponent } from 'vue' | ||
import type { NodeProps } from '~/types' | ||
import type { NodeProps } from '../../types' | ||
declare const DefaultNode: FunctionalComponent<NodeProps> | ||
export default DefaultNode |
import type { FunctionalComponent } from 'vue' | ||
import type { NodeProps } from '~/types' | ||
import type { NodeProps } from '../../types' | ||
declare const InputNode: FunctionalComponent<NodeProps> | ||
export default InputNode |
@@ -41,4 +41,4 @@ import type { GraphNode, HandleConnectable, NodeComponent } from '../../types' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -45,0 +45,0 @@ ? { |
import type { FunctionalComponent } from 'vue' | ||
import type { NodeProps } from '~/types' | ||
import type { NodeProps } from '../../types' | ||
declare const OutputNode: FunctionalComponent<NodeProps> | ||
export default OutputNode |
@@ -153,4 +153,4 @@ import type { PanelProps } from '../../types' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -157,0 +157,0 @@ ? { |
import type { D3DragEvent, SubjectPosition } from 'd3-drag' | ||
import type { Ref } from 'vue' | ||
import type { MaybeRef } from '@vueuse/core' | ||
import type { NodeDragEvent } from '~/types' | ||
export type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition> | ||
import type { NodeDragEvent } from '../types' | ||
export declare type UseDragEvent = D3DragEvent<HTMLDivElement, null, SubjectPosition> | ||
interface UseDragParams { | ||
@@ -7,0 +7,0 @@ onStart: (event: NodeDragEvent['event'], currentNode: NodeDragEvent['node'], nodes: NodeDragEvent['nodes']) => void |
@@ -1,2 +0,2 @@ | ||
import type { CustomEvent, ElementData } from '~/types' | ||
import type { CustomEvent, ElementData } from '../types' | ||
/** | ||
@@ -13,4 +13,4 @@ * Access an edge | ||
id: string | ||
edge: import('~/types').GraphEdge<Data, CustomEvents> | ||
edge: import('../types').GraphEdge<Data, CustomEvents> | ||
edgeEl: import('vue').Ref<SVGElement> | null | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { EdgeEventsEmit, EdgeEventsOn, GraphEdge, VueFlowStore } from '~/types' | ||
import type { EdgeEventsEmit, EdgeEventsOn, GraphEdge, VueFlowStore } from '../types' | ||
export default function useEdgeHooks( | ||
@@ -3,0 +3,0 @@ edge: GraphEdge, |
@@ -0,3 +1,3 @@ | ||
import type { SnapGrid } from '../types' | ||
import type { UseDragEvent } from './useDrag' | ||
import type { SnapGrid } from '~/types' | ||
export declare function useGetPointerPosition(): ( | ||
@@ -4,0 +4,0 @@ { sourceEvent }: UseDragEvent, |
import type { MaybeRef } from '@vueuse/core' | ||
import type { Connection, Getters, GraphEdge, HandleType, ValidConnectionFunc } from '~/types' | ||
import type { ConnectionMode } from '~/types' | ||
import type { Connection, Getters, GraphEdge, HandleType, ValidConnectionFunc } from '../types' | ||
import type { ConnectionMode } from '../types' | ||
interface Result { | ||
@@ -5,0 +5,0 @@ elementBelow: Element | null |
@@ -1,2 +0,2 @@ | ||
import type { CustomEvent, ElementData } from '~/types' | ||
import type { CustomEvent, ElementData } from '../types' | ||
/** | ||
@@ -14,5 +14,5 @@ * Access a node, it's parent (if one exists) and connected edges | ||
nodeEl: import('vue').Ref<HTMLDivElement> | null | ||
node: import('~/types').GraphNode<Data, CustomEvents> | ||
parentNode: import('vue').ComputedRef<import('~/types').GraphNode<any, any> | undefined> | ||
connectedEdges: import('vue').ComputedRef<import('~/types').GraphEdge<any, any>[]> | ||
node: import('../types').GraphNode<Data, CustomEvents> | ||
parentNode: import('vue').ComputedRef<import('../types').GraphNode<any, any> | undefined> | ||
connectedEdges: import('vue').ComputedRef<import('../types').GraphEdge<any, any>[]> | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { GraphNode, NodeEventsEmit, NodeEventsOn, VueFlowStore } from '~/types' | ||
import type { GraphNode, NodeEventsEmit, NodeEventsOn, VueFlowStore } from '../types' | ||
export default function useNodeHooks( | ||
@@ -3,0 +3,0 @@ node: GraphNode, |
@@ -1,3 +0,3 @@ | ||
import type { XYPosition } from '~/types' | ||
import type { XYPosition } from '../types' | ||
declare function useUpdateNodePositions(): (positionDiff: XYPosition, isShiftPressed?: boolean) => void | ||
export default useUpdateNodePositions |
@@ -1,2 +0,2 @@ | ||
import type { FlowOptions, FlowProps, VueFlowStore } from '~/types' | ||
import type { FlowOptions, FlowProps, VueFlowStore } from '../types' | ||
/** | ||
@@ -3,0 +3,0 @@ * Stores all currently created store instances |
@@ -1,2 +0,2 @@ | ||
type UseWindow = Window & | ||
declare type UseWindow = Window & | ||
typeof globalThis & { | ||
@@ -3,0 +3,0 @@ chrome?: any |
@@ -1,2 +0,2 @@ | ||
import type { ViewportFunctions } from '~/types' | ||
import type { ViewportFunctions } from '../types' | ||
/** | ||
@@ -3,0 +3,0 @@ * @deprecated use {@link useVueFlow} instead (all viewport functions are also available in {@link useVueFlow}) |
@@ -17,4 +17,4 @@ import type { MarkerProps } from '../../types/edge' | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -21,0 +21,0 @@ ? { |
@@ -176,4 +176,4 @@ declare const _default: { | ||
export default _default | ||
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
type __VLS_TypePropsToRuntimeProps<T> = { | ||
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T | ||
declare type __VLS_TypePropsToRuntimeProps<T> = { | ||
[K in keyof T]-?: {} extends Pick<T, K> | ||
@@ -180,0 +180,0 @@ ? { |
@@ -1,2 +0,2 @@ | ||
import type { XYPosition } from '~/types' | ||
import type { XYPosition } from '../../types' | ||
export declare function getMousePosition(event: MouseEvent, containerBounds: DOMRect): XYPosition |
import type { InjectionKey, Ref, Slots as TSlots } from 'vue' | ||
import type { VueFlowStore } from '~/types' | ||
import type { VueFlowStore } from '../types' | ||
export declare const VueFlow: InjectionKey<VueFlowStore> | ||
@@ -4,0 +4,0 @@ export declare const NodeId: InjectionKey<string> |
@@ -1,2 +0,2 @@ | ||
import type { Actions, ComputedGetters, State } from '~/types' | ||
import type { Actions, ComputedGetters, State } from '../types' | ||
export declare function useActions(state: State, getters: ComputedGetters): Actions |
@@ -1,2 +0,2 @@ | ||
import type { ComputedGetters, State } from '~/types' | ||
import type { ComputedGetters, State } from '../types' | ||
export declare function useGetters(state: State): ComputedGetters |
import type { Ref } from 'vue' | ||
import type { Emits, FlowHooks } from '~/types' | ||
import type { Emits, FlowHooks } from '../types' | ||
export declare const createHooks: () => FlowHooks | ||
export declare function useHooks(emit: Emits, hooks: Ref<FlowHooks>): void |
@@ -1,4 +0,4 @@ | ||
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '~/types' | ||
import type { DefaultEdgeTypes, DefaultNodeTypes, FlowOptions, State } from '../types' | ||
export declare const defaultNodeTypes: DefaultNodeTypes | ||
export declare const defaultEdgeTypes: DefaultEdgeTypes | ||
export declare function useState(opts?: FlowOptions): State |
@@ -41,5 +41,5 @@ import type { Dimensions, ElementData, XYPosition } from './flow' | ||
} | ||
export type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | ||
export type EdgeSelectionChange = NodeSelectionChange | ||
export type EdgeRemoveChange = NodeRemoveChange | ||
export declare type NodeChange = NodeDimensionChange | NodePositionChange | NodeSelectionChange | NodeRemoveChange | NodeAddChange | ||
export declare type EdgeSelectionChange = NodeSelectionChange | ||
export declare type EdgeRemoveChange = NodeRemoveChange | ||
export interface EdgeAddChange<Data = ElementData> { | ||
@@ -49,3 +49,3 @@ item: GraphEdge<Data> | ||
} | ||
export type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | ||
export type ElementChange = NodeChange | EdgeChange | ||
export declare type EdgeChange = EdgeSelectionChange | EdgeRemoveChange | EdgeAddChange | ||
export declare type ElementChange = NodeChange | EdgeChange |
import type { CSSProperties, Component, DefineComponent, SVGAttributes, VNode } from 'vue' | ||
import type BezierEdge from '../components/Edges/BezierEdge' | ||
import type { SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '../components' | ||
import type { NodeProps } from './node' | ||
import type { EdgeProps } from './edge' | ||
import type BezierEdge from '~/components/Edges/BezierEdge' | ||
import type { SimpleBezierEdge, SmoothStepEdge, StepEdge, StraightEdge } from '~/components' | ||
/** Global component names are components registered to the vue instance and are "autoloaded" by their string name */ | ||
type GlobalComponentName = string | ||
declare type GlobalComponentName = string | ||
/** Node Components can either be a component definition or a string name */ | ||
export type NodeComponent = Component<NodeProps> | DefineComponent<NodeProps, any, any, any, any> | GlobalComponentName | ||
export type NodeTypesObject = { | ||
export declare type NodeComponent = Component<NodeProps> | DefineComponent<NodeProps, any, any, any, any> | GlobalComponentName | ||
export declare type NodeTypesObject = { | ||
[key in keyof DefaultNodeTypes]?: NodeComponent | ||
} & Record<string, NodeComponent> | ||
export type EdgeTypesObject = { | ||
export declare type EdgeTypesObject = { | ||
[key in keyof DefaultEdgeTypes]?: EdgeComponent | ||
} & Record<string, EdgeComponent> | ||
/** Edge Components can either be a component definition or a string name */ | ||
export type EdgeComponent = Component<EdgeProps> | DefineComponent<EdgeProps, any, any, any, any, any> | GlobalComponentName | ||
export declare type EdgeComponent = | ||
| Component<EdgeProps> | ||
| DefineComponent<EdgeProps, any, any, any, any, any> | ||
| GlobalComponentName | ||
export interface DefaultEdgeTypes { | ||
@@ -25,3 +28,3 @@ default: typeof BezierEdge | ||
} | ||
export type DefaultNodeTypes = { | ||
export declare type DefaultNodeTypes = { | ||
[key in 'input' | 'output' | 'default']: NodeComponent | ||
@@ -28,0 +31,0 @@ } |
@@ -32,3 +32,3 @@ import type { CSSProperties } from 'vue' | ||
} | ||
export type Connector = ( | ||
export declare type Connector = ( | ||
params: Connection, | ||
@@ -35,0 +35,0 @@ ) => Promise<(Connection & Partial<Edge>) | false> | ((Connection & Partial<Edge>) | false) |
@@ -40,4 +40,4 @@ import type { CSSProperties, Component, VNode } from 'vue' | ||
} | ||
export type EdgeMarkerType = string | MarkerType | EdgeMarker | ||
export type EdgeUpdatable = boolean | 'target' | 'source' | ||
export declare type EdgeMarkerType = string | MarkerType | EdgeMarker | ||
export declare type EdgeUpdatable = boolean | 'target' | 'source' | ||
export interface EdgeLabelOptions { | ||
@@ -104,3 +104,3 @@ /** Label styles (CSSProperties) */ | ||
} | ||
export type SmoothStepEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge< | ||
export declare type SmoothStepEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge< | ||
Data, | ||
@@ -115,3 +115,3 @@ CustomEvents | ||
} | ||
export type BezierEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge< | ||
export declare type BezierEdgeType<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = DefaultEdge< | ||
Data, | ||
@@ -123,7 +123,7 @@ CustomEvents | ||
} | ||
export type Edge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = | ||
export declare type Edge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = | ||
| DefaultEdge<Data, CustomEvents> | ||
| SmoothStepEdgeType<Data, CustomEvents> | ||
| BezierEdgeType<Data, CustomEvents> | ||
export type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle'> | ||
export declare type DefaultEdgeOptions = Omit<Edge, 'id' | 'source' | 'target' | 'sourceHandle' | 'targetHandle'> | ||
export interface EdgePositions { | ||
@@ -136,3 +136,6 @@ sourceX: number | ||
/** Internal edge type */ | ||
export type GraphEdge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = Edge<Data, CustomEvents> & { | ||
export declare type GraphEdge<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> = Edge< | ||
Data, | ||
CustomEvents | ||
> & { | ||
selected?: boolean | ||
@@ -179,16 +182,16 @@ z?: number | ||
} | ||
export type BezierEdgeProps = EdgePositions & | ||
export declare type BezierEdgeProps = EdgePositions & | ||
BezierPathOptions & | ||
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> & | ||
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'> | ||
export type SimpleBezierEdgeProps = EdgePositions & | ||
export declare type SimpleBezierEdgeProps = EdgePositions & | ||
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> & | ||
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'> | ||
export type StraightEdgeProps = EdgePositions & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> | ||
export type StepEdgeProps = EdgePositions & | ||
export declare type StraightEdgeProps = EdgePositions & Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> | ||
export declare type StepEdgeProps = EdgePositions & | ||
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> & | ||
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'> | ||
export type SmoothStepEdgeProps = EdgePositions & | ||
export declare type SmoothStepEdgeProps = EdgePositions & | ||
Omit<BaseEdgeProps, 'labelX' | 'labelY' | 'path'> & | ||
Pick<EdgeProps, 'sourcePosition' | 'targetPosition'> & | ||
SmoothStepPathOptions |
@@ -9,5 +9,5 @@ import type { CSSProperties } from 'vue' | ||
import type { CustomEvent } from './hooks' | ||
export type ElementData = any | ||
export declare type ElementData = any | ||
/** A flow element (after parsing into state) */ | ||
export type FlowElement< | ||
export declare type FlowElement< | ||
NodeData = ElementData, | ||
@@ -18,3 +18,3 @@ EdgeData = ElementData, | ||
> = GraphNode<NodeData, NodeEvents> | GraphEdge<EdgeData, EdgeEvents> | ||
export type FlowElements< | ||
export declare type FlowElements< | ||
NodeData = ElementData, | ||
@@ -26,3 +26,3 @@ EdgeData = ElementData, | ||
/** Initial elements (before parsing into state) */ | ||
export type Element< | ||
export declare type Element< | ||
NodeData = ElementData, | ||
@@ -33,3 +33,3 @@ EdgeData = ElementData, | ||
> = Node<NodeData, NodeEvents> | Edge<EdgeData, EdgeEvents> | ||
export type Elements< | ||
export declare type Elements< | ||
NodeData = ElementData, | ||
@@ -43,3 +43,3 @@ EdgeData = ElementData, | ||
} | ||
export type CSSVars = | ||
export declare type CSSVars = | ||
| '--vf-node-color' | ||
@@ -51,8 +51,8 @@ | '--vf-box-shadow' | ||
| '--vf-handle' | ||
export type ThemeVars = { | ||
export declare type ThemeVars = { | ||
[key in CSSVars]?: CSSProperties['color'] | ||
} | ||
export type Styles = CSSProperties & ThemeVars & CustomThemeVars | ||
export type ClassFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => string | void | ||
export type StyleFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => Styles | void | ||
export declare type Styles = CSSProperties & ThemeVars & CustomThemeVars | ||
export declare type ClassFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => string | void | ||
export declare type StyleFunc<ElementType extends FlowElement = FlowElement> = (element: ElementType) => Styles | void | ||
/** Handle Positions */ | ||
@@ -69,3 +69,3 @@ export declare enum Position { | ||
} | ||
export type XYZPosition = XYPosition & { | ||
export declare type XYZPosition = XYPosition & { | ||
z: number | ||
@@ -82,3 +82,3 @@ } | ||
export interface Rect extends Dimensions, XYPosition {} | ||
export type SnapGrid = [number, number] | ||
export declare type SnapGrid = [number, number] | ||
export interface SelectionRect extends Rect { | ||
@@ -167,2 +167,2 @@ startX: number | ||
} | ||
export type FlowOptions = FlowProps | ||
export declare type FlowOptions = FlowProps |
@@ -5,3 +5,3 @@ import type { Dimensions, Position, XYPosition } from './flow' | ||
import type { GraphNode } from './node' | ||
export type HandleType = 'source' | 'target' | ||
export declare type HandleType = 'source' | 'target' | ||
export interface HandleElement extends XYPosition, Dimensions { | ||
@@ -17,3 +17,3 @@ id?: string | null | ||
/** A valid connection function can determine if an attempted connection is valid or not, i.e. abort creating a new edge */ | ||
export type ValidConnectionFunc = ( | ||
export declare type ValidConnectionFunc = ( | ||
connection: Connection, | ||
@@ -26,3 +26,3 @@ elements: { | ||
) => boolean | ||
export type HandleConnectableFunc = (node: GraphNode, connectedEdges: GraphEdge[]) => boolean | ||
export declare type HandleConnectableFunc = (node: GraphNode, connectedEdges: GraphEdge[]) => boolean | ||
/** | ||
@@ -35,3 +35,3 @@ * set to true to allow unlimited connections, | ||
*/ | ||
export type HandleConnectable = boolean | 'single' | HandleConnectableFunc | ||
export declare type HandleConnectable = boolean | 'single' | HandleConnectableFunc | ||
export interface HandleProps { | ||
@@ -38,0 +38,0 @@ /** Unique id of handle element */ |
@@ -10,3 +10,3 @@ import type { EventHook, EventHookOn, EventHookTrigger } from '@vueuse/core' | ||
import type { FlowElements } from './flow' | ||
export type MouseTouchEvent = MouseEvent | TouchEvent | PointerEvent | ||
export declare type MouseTouchEvent = MouseEvent | TouchEvent | PointerEvent | ||
export interface NodeMouseEvent { | ||
@@ -180,9 +180,9 @@ event: MouseTouchEvent | ||
} | ||
export type FlowHooks = Readonly<{ | ||
export declare type FlowHooks = Readonly<{ | ||
[key in keyof FlowEvents]: EventHook<FlowEvents[key]> | ||
}> | ||
export type FlowHooksOn = Readonly<{ | ||
export declare type FlowHooksOn = Readonly<{ | ||
[key in keyof FlowEvents as `on${Capitalize<key>}`]: EventHookOn<FlowEvents[key]> | ||
}> | ||
export type FlowHooksEmit = Readonly<{ | ||
export declare type FlowHooksEmit = Readonly<{ | ||
[key in keyof FlowEvents]: EventHookTrigger<FlowEvents[key]> | ||
@@ -194,7 +194,7 @@ }> | ||
*/ | ||
export type CustomEvent<Args extends any[] = any[], Return = any> = (...args: Args) => Return | ||
type CustomEventHandlers<CustomEvents = {}> = { | ||
export declare type CustomEvent<Args extends any[] = any[], Return = any> = (...args: Args) => Return | ||
declare type CustomEventHandlers<CustomEvents = {}> = { | ||
[key in keyof CustomEvents]: CustomEvents[key] | ||
} | ||
export type NodeEventsHandler<CustomEvents = {}> = { | ||
export declare type NodeEventsHandler<CustomEvents = {}> = { | ||
doubleClick: (event: NodeMouseEvent) => void | { | ||
@@ -228,9 +228,9 @@ off: () => void | ||
} & CustomEventHandlers<CustomEvents> | ||
export type NodeEventsOn<CustomEvents = {}> = { | ||
export declare type NodeEventsOn<CustomEvents = {}> = { | ||
[key in keyof NodeEventsHandler]: EventHookOn<NodeEventsHandler[key] extends (event: infer Event) => any ? Event : never> | ||
} & CustomEventHandlers<CustomEvents> | ||
export type NodeEventsEmit<CustomEvents = {}> = { | ||
export declare type NodeEventsEmit<CustomEvents = {}> = { | ||
[key in keyof NodeEventsHandler]: EventHookTrigger<NodeEventsHandler[key] extends (event: infer Event) => any ? Event : never> | ||
} & CustomEventHandlers<CustomEvents> | ||
export type EdgeEventsHandler<CustomEvents = {}> = { | ||
export declare type EdgeEventsHandler<CustomEvents = {}> = { | ||
doubleClick: (event: EdgeMouseEvent) => void | { | ||
@@ -264,8 +264,8 @@ off: () => void | ||
} & CustomEventHandlers<CustomEvents> | ||
export type EdgeEventsOn<CustomEvents = {}> = { | ||
export declare type EdgeEventsOn<CustomEvents = {}> = { | ||
[key in keyof EdgeEventsHandler]: EventHookOn<EdgeEventsHandler[key] extends (event: infer Event) => any ? Event : never> | ||
} & CustomEventHandlers<CustomEvents> | ||
export type EdgeEventsEmit<CustomEvents = {}> = { | ||
export declare type EdgeEventsEmit<CustomEvents = {}> = { | ||
[key in keyof EdgeEventsHandler]: EventHookTrigger<EdgeEventsHandler[key] extends (event: infer Event) => any ? Event : never> | ||
} & CustomEventHandlers<CustomEvents> | ||
export {} |
@@ -12,3 +12,3 @@ import type { Component, VNode } from 'vue' | ||
/** Defined as [[x-from, y-from], [x-to, y-to]] **/ | ||
export type CoordinateExtent = [[number, number], [number, number]] | ||
export declare type CoordinateExtent = [[number, number], [number, number]] | ||
export interface NodeHandleBounds { | ||
@@ -18,4 +18,4 @@ source?: HandleElement[] | ||
} | ||
export type WidthFunc = (node: GraphNode) => number | string | void | ||
export type HeightFunc = (node: GraphNode) => number | string | void | ||
export declare type WidthFunc = (node: GraphNode) => number | string | void | ||
export declare type HeightFunc = (node: GraphNode) => number | string | void | ||
export interface Node<Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any> { | ||
@@ -22,0 +22,0 @@ /** Unique node id */ |
@@ -112,14 +112,16 @@ import type { CSSProperties, ComputedRef, ToRefs } from 'vue' | ||
} | ||
export type SetElements = (elements: Elements | ((elements: FlowElements) => Elements), extent?: CoordinateExtent) => void | ||
export type SetNodes = (nodes: Node[] | ((nodes: GraphNode[]) => Node[]), extent?: CoordinateExtent) => void | ||
export type SetEdges = (edges: Edge[] | ((edges: GraphEdge[]) => Edge[])) => void | ||
export type AddNodes = (nodes: Node[] | ((nodes: GraphNode[]) => Node[]), extent?: CoordinateExtent) => void | ||
export type RemoveNodes = ( | ||
export declare type SetElements = (elements: Elements | ((elements: FlowElements) => Elements), extent?: CoordinateExtent) => void | ||
export declare type SetNodes = (nodes: Node[] | ((nodes: GraphNode[]) => Node[]), extent?: CoordinateExtent) => void | ||
export declare type SetEdges = (edges: Edge[] | ((edges: GraphEdge[]) => Edge[])) => void | ||
export declare type AddNodes = (nodes: Node[] | ((nodes: GraphNode[]) => Node[]), extent?: CoordinateExtent) => void | ||
export declare type RemoveNodes = ( | ||
nodes: (Node[] | string[]) | ((nodes: GraphNode[]) => Node[] | string[]), | ||
removeConnectedEdges?: boolean, | ||
) => void | ||
export type RemoveEdges = (edges: (Edge[] | string[]) | ((edges: GraphEdge[]) => Edge[] | string[])) => void | ||
export type AddEdges = (edgesOrConnections: (Edge | Connection)[] | ((edges: GraphEdge[]) => (Edge | Connection)[])) => void | ||
export type UpdateEdge = (oldEdge: GraphEdge, newConnection: Connection) => GraphEdge | false | ||
export type SetState = ( | ||
export declare type RemoveEdges = (edges: (Edge[] | string[]) | ((edges: GraphEdge[]) => Edge[] | string[])) => void | ||
export declare type AddEdges = ( | ||
edgesOrConnections: (Edge | Connection)[] | ((edges: GraphEdge[]) => (Edge | Connection)[]), | ||
) => void | ||
export declare type UpdateEdge = (oldEdge: GraphEdge, newConnection: Connection) => GraphEdge | false | ||
export declare type SetState = ( | ||
state: | ||
@@ -129,12 +131,12 @@ | Partial<FlowOptions & Omit<State, 'nodes' | 'edges' | 'modelValue'>> | ||
) => void | ||
export type UpdateNodePosition = (dragItems: NodeDragItem[], changed: boolean, dragging: boolean) => void | ||
export type UpdateNodeDimensions = (updates: UpdateNodeDimensionsParams[]) => void | ||
export type UpdateNodeInternals = (nodeIds: string[]) => void | ||
export type FindNode = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>( | ||
export declare type UpdateNodePosition = (dragItems: NodeDragItem[], changed: boolean, dragging: boolean) => void | ||
export declare type UpdateNodeDimensions = (updates: UpdateNodeDimensionsParams[]) => void | ||
export declare type UpdateNodeInternals = (nodeIds: string[]) => void | ||
export declare type FindNode = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>( | ||
id: string, | ||
) => GraphNode<Data, CustomEvents> | undefined | ||
export type FindEdge = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>( | ||
export declare type FindEdge = <Data = ElementData, CustomEvents extends Record<string, CustomEvent> = any>( | ||
id: string, | ||
) => GraphEdge<Data, CustomEvents> | undefined | ||
export type GetIntersectingNodes = ( | ||
export declare type GetIntersectingNodes = ( | ||
node: | ||
@@ -148,3 +150,3 @@ | (Partial<Node> & { | ||
) => GraphNode[] | ||
export type IsNodeIntersecting = ( | ||
export declare type IsNodeIntersecting = ( | ||
node: | ||
@@ -254,6 +256,6 @@ | (Partial<Node> & { | ||
} | ||
export type ComputedGetters = { | ||
export declare type ComputedGetters = { | ||
[key in keyof Getters]: ComputedRef<Getters[key]> | ||
} | ||
export type VueFlowStore = { | ||
export declare type VueFlowStore = { | ||
readonly id: string | ||
@@ -260,0 +262,0 @@ readonly emits: FlowHooksEmit |
import type { Selection, ZoomBehavior } from 'd3' | ||
import type { Rect, XYPosition } from './flow' | ||
export type D3Zoom = ZoomBehavior<HTMLDivElement, unknown> | ||
export type D3Selection = Selection<HTMLDivElement, unknown, any, any> | ||
export type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void | ||
export declare type D3Zoom = ZoomBehavior<HTMLDivElement, unknown> | ||
export declare type D3Selection = Selection<HTMLDivElement, unknown, any, any> | ||
export declare type D3ZoomHandler = (this: HTMLDivElement, event: any, d: unknown) => void | ||
export declare enum PanOnScrollMode { | ||
@@ -14,3 +14,3 @@ Free = 'free', | ||
} | ||
export type FitViewParams = { | ||
export declare type FitViewParams = { | ||
padding?: number | ||
@@ -31,24 +31,24 @@ includeHiddenNodes?: boolean | ||
} | ||
export type SetCenterOptions = TransitionOptions & { | ||
export declare type SetCenterOptions = TransitionOptions & { | ||
zoom?: number | ||
} | ||
export type FitBoundsOptions = TransitionOptions & { | ||
export declare type FitBoundsOptions = TransitionOptions & { | ||
padding?: number | ||
} | ||
/** Fit the viewport around visible nodes */ | ||
export type FitView = (fitViewOptions?: FitViewParams) => void | ||
export declare type FitView = (fitViewOptions?: FitViewParams) => void | ||
/** project a position onto the viewport, i.e. a mouse event clientX/clientY onto graph coordinates */ | ||
export type Project = (position: XYPosition) => XYPosition | ||
export declare type Project = (position: XYPosition) => XYPosition | ||
/** set center of viewport */ | ||
export type SetCenter = (x: number, y: number, options?: SetCenterOptions) => void | ||
export declare type SetCenter = (x: number, y: number, options?: SetCenterOptions) => void | ||
/** fit the viewport around bounds */ | ||
export type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => void | ||
export declare type FitBounds = (bounds: Rect, options?: FitBoundsOptions) => void | ||
/** zoom in/out */ | ||
export type ZoomInOut = (options?: TransitionOptions) => void | ||
export declare type ZoomInOut = (options?: TransitionOptions) => void | ||
/** zoom to a specific level */ | ||
export type ZoomTo = (zoomLevel: number, options?: TransitionOptions) => void | ||
export declare type ZoomTo = (zoomLevel: number, options?: TransitionOptions) => void | ||
/** get current viewport transform */ | ||
export type GetTransform = () => ViewportTransform | ||
export declare type GetTransform = () => ViewportTransform | ||
/** set current viewport transform */ | ||
export type SetTransform = (transform: ViewportTransform, options?: TransitionOptions) => void | ||
export declare type SetTransform = (transform: ViewportTransform, options?: TransitionOptions) => void | ||
export interface ViewportFunctions { | ||
@@ -55,0 +55,0 @@ zoomIn: ZoomInOut |
@@ -1,2 +0,2 @@ | ||
import type { XYPosition } from '~/types' | ||
import type { XYPosition } from '../types' | ||
export declare const ARIA_NODE_DESC_KEY = 'vue-flow__node-desc' | ||
@@ -3,0 +3,0 @@ export declare const ARIA_EDGE_DESC_KEY = 'vue-flow__edge-desc' |
@@ -17,3 +17,3 @@ import type { | ||
NodeSelectionChange, | ||
} from '~/types' | ||
} from '../types' | ||
export declare const applyChanges: < | ||
@@ -20,0 +20,0 @@ T extends Node<any, any> | Edge<any, any> | FlowElement<any, any, any, any> = Node<any, any>, |
import type { Ref } from 'vue' | ||
import type { ComputedGetters, CoordinateExtent, Getters, GraphNode, NodeDragItem, XYPosition } from '~/types' | ||
import type { ComputedGetters, CoordinateExtent, Getters, GraphNode, NodeDragItem, XYPosition } from '../types' | ||
export declare function hasSelector(target: Element, selector: string, node: Ref<Element>): boolean | ||
@@ -30,3 +30,7 @@ export declare function getDragItems( | ||
) => { | ||
position: XYPosition | ||
position: { | ||
x: number | ||
y: number | ||
} | ||
computedPosition: XYPosition | ||
} |
@@ -1,3 +0,3 @@ | ||
import type { EdgePositions, Getters, GraphEdge, GraphNode, HandleElement, Rect, ViewportTransform, XYPosition } from '~/types' | ||
import type { Position } from '~/types' | ||
import type { EdgePositions, Getters, GraphEdge, GraphNode, HandleElement, Rect, ViewportTransform, XYPosition } from '../types' | ||
import type { Position } from '../types' | ||
export declare const getHandlePosition: (position: Position, rect: Rect, handle?: HandleElement) => XYPosition | ||
@@ -4,0 +4,0 @@ export declare const getHandle: (bounds?: HandleElement[], handleId?: string | null) => HandleElement | undefined |
@@ -19,3 +19,3 @@ import type { | ||
XYZPosition, | ||
} from '~/types' | ||
} from '../types' | ||
export declare const nodeToRect: (node: GraphNode) => Rect | ||
@@ -27,3 +27,3 @@ export declare const getOverlappingArea: (rectA: Rect, rectB: Rect) => number | ||
export declare const getHostForElement: (element: HTMLElement) => Document | ||
type MaybeElement = Node | Edge | Connection | FlowElement | ||
declare type MaybeElement = Node | Edge | Connection | FlowElement | ||
export declare const isEdge: <Data = any>(element: MaybeElement) => element is Edge<Data, any> | ||
@@ -39,7 +39,7 @@ export declare const isGraphEdge: <Data = any>(element: MaybeElement) => element is GraphEdge<Data, any> | ||
elements: Elements<any, any, any, any>, | ||
) => import('~/types').Element<any, any, any, any>[] | ||
) => import('../types').Element<any, any, any, any>[] | ||
export declare const getIncomers: ( | ||
node: GraphNode, | ||
elements: Elements<any, any, any, any>, | ||
) => import('~/types').Element<any, any, any, any>[] | ||
) => import('../types').Element<any, any, any, any>[] | ||
export declare const getEdgeId: ({ source, sourceHandle, target, targetHandle }: Connection) => string | ||
@@ -46,0 +46,0 @@ export declare const connectionExists: (edge: Edge | Connection, elements: Elements<any, any, any, any>) => boolean |
import type { Ref } from 'vue' | ||
import type { Actions, GraphNode, HandleElement } from '~/types' | ||
import type { Actions, GraphNode, HandleElement } from '../types' | ||
export declare const getHandleBounds: (selector: string, nodeElement: HTMLDivElement, zoom: number) => HandleElement[] | undefined | ||
@@ -4,0 +4,0 @@ export declare const handleNodeClick: ( |
@@ -1,2 +0,2 @@ | ||
import type { Connection, CoordinateExtent, Edge, Getters, GraphEdge, GraphNode, Node } from '~/types' | ||
import type { Connection, CoordinateExtent, Edge, Getters, GraphEdge, GraphNode, Node } from '../types' | ||
export declare const isDef: <T>(val: T) => val is NonNullable<T> | ||
@@ -8,3 +8,3 @@ export declare const addEdgeToStore: ( | ||
| false | ||
| (import('~/types').DefaultEdge<any, any> & { | ||
| (import('../types').DefaultEdge<any, any> & { | ||
selected?: boolean | undefined | ||
@@ -15,4 +15,4 @@ z?: number | undefined | ||
data: any | ||
events: Partial<import('~/types').EdgeEventsHandler<any>> | ||
} & import('~/types').EdgePositions) | ||
events: Partial<import('../types').EdgeEventsHandler<any>> | ||
} & import('../types').EdgePositions) | ||
export declare const updateEdgeAction: ( | ||
@@ -40,3 +40,3 @@ edge: GraphEdge, | ||
| import('vue').Component< | ||
import('~/types').EdgeTextProps, | ||
import('../types').EdgeTextProps, | ||
any, | ||
@@ -50,14 +50,14 @@ any, | ||
animated?: boolean | undefined | ||
markerStart?: import('~/types').EdgeMarkerType | undefined | ||
markerEnd?: import('~/types').EdgeMarkerType | undefined | ||
updatable?: import('~/types').EdgeUpdatable | undefined | ||
markerStart?: import('../types').EdgeMarkerType | undefined | ||
markerEnd?: import('../types').EdgeMarkerType | undefined | ||
updatable?: import('../types').EdgeUpdatable | undefined | ||
selectable?: boolean | undefined | ||
focusable?: boolean | undefined | ||
class?: string | import('~/types').ClassFunc<GraphEdge<any, any>> | undefined | ||
style?: import('~/types').Styles | import('~/types').StyleFunc<GraphEdge<any, any>> | undefined | ||
class?: string | import('../types').ClassFunc<GraphEdge<any, any>> | undefined | ||
style?: import('../types').Styles | import('../types').StyleFunc<GraphEdge<any, any>> | undefined | ||
hidden?: boolean | undefined | ||
interactionWidth?: number | undefined | ||
template?: import('~/types').EdgeComponent | undefined | ||
template?: import('../types').EdgeComponent | undefined | ||
data: any | ||
events: Partial<import('~/types').EdgeEventsHandler<any>> | ||
events: Partial<import('../types').EdgeEventsHandler<any>> | ||
ariaLabel?: string | null | undefined | ||
@@ -64,0 +64,0 @@ labelStyle?: import('vue').CSSProperties | undefined |
import type { ToRefs } from 'vue' | ||
import type { FlowProps, VueFlowStore } from '~/types' | ||
import type { FlowProps, VueFlowStore } from '../types' | ||
export declare const useWatch: ( | ||
@@ -4,0 +4,0 @@ models: ToRefs<Pick<FlowProps, 'nodes' | 'edges' | 'modelValue'>>, |
{ | ||
"name": "@vue-flow/core", | ||
"version": "1.10.1", | ||
"version": "1.10.2", | ||
"private": false, | ||
@@ -61,3 +61,3 @@ "license": "MIT", | ||
"build": "vite build", | ||
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && tsc -p tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist && pnpm run patch", | ||
"types": "pnpm prepare && vue-tsc --declaration --emitDeclarationOnly && tsc -p ./tsconfig.build.json && shx rm -rf tmp && pnpm lint:dist && pnpm run patch", | ||
"patch": "node patch/slots.js", | ||
@@ -64,0 +64,0 @@ "theme": "postcss src/style.css -o dist/style.css && postcss src/theme-default.css -o dist/theme-default.css", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
739030
13065