From fd9851fab89df71eabb38fc4920d013f03eb8598 Mon Sep 17 00:00:00 2001 From: moklick Date: Mon, 23 Jun 2025 09:30:32 +0200 Subject: [PATCH] chore(libs): add tsdoc annotations --- packages/react/src/types/general.ts | 16 ++++++++++++++++ packages/svelte/src/lib/types/general.ts | 12 ++++++++++++ packages/system/src/types/general.ts | 12 ++++++++++++ 3 files changed, 40 insertions(+) diff --git a/packages/react/src/types/general.ts b/packages/react/src/types/general.ts index 80acc45c..d13d11be 100644 --- a/packages/react/src/types/general.ts +++ b/packages/react/src/types/general.ts @@ -99,6 +99,9 @@ export type OnSelectionChangeFunc ) => void; +/** + * @inline + */ export type FitViewParams = FitViewParamsBase; /** @@ -107,9 +110,18 @@ export type FitViewParams = FitViewParamsBase = FitViewOptionsBase; + +/** + * @inline + */ export type FitView = (fitViewOptions?: FitViewOptions) => Promise; + +/** + * @inline + */ export type OnInit = ( reactFlowInstance: ReactFlowInstance ) => void; @@ -209,4 +221,8 @@ export type OnBeforeDelete; +/** + * This type can be used to type the `isValidConnection` function. + * If the function returns `true`, the connection is valid and can be created. + */ export type IsValidConnection = (edge: EdgeType | Connection) => boolean; diff --git a/packages/svelte/src/lib/types/general.ts b/packages/svelte/src/lib/types/general.ts index 34474408..701496e9 100644 --- a/packages/svelte/src/lib/types/general.ts +++ b/packages/svelte/src/lib/types/general.ts @@ -21,8 +21,16 @@ export type ConnectionData = { connectionStatus: string | null; }; +/** + * @inline + */ export type FitViewOptions = FitViewOptionsBase; +/** + * This type can be used to type the `onDelete` function with a custom node and edge type. + * + * @public + */ export type OnDelete = (params: { nodes: NodeType[]; edges: EdgeType[]; @@ -40,6 +48,10 @@ export type OnBeforeDelete< EdgeType extends Edge = Edge > = OnBeforeDeleteBase; +/** + * This type can be used to type the `isValidConnection` function. + * If the function returns `true`, the connection is valid and can be created. + */ export type IsValidConnection = ( edge: EdgeType | Connection ) => boolean; diff --git a/packages/system/src/types/general.ts b/packages/system/src/types/general.ts index 367ca1d8..2e68a74d 100644 --- a/packages/system/src/types/general.ts +++ b/packages/system/src/types/general.ts @@ -17,9 +17,21 @@ export type OnMove = (event: MouseEvent | TouchEvent | null, viewport: Viewport) export type OnMoveStart = OnMove; export type OnMoveEnd = OnMove; +/** + * @inline + */ export type ZoomInOut = (options?: ViewportHelperFunctionOptions) => Promise; +/** + * @inline + */ export type ZoomTo = (zoomLevel: number, options?: ViewportHelperFunctionOptions) => Promise; +/** + * @inline + */ export type GetZoom = () => number; +/** + * @inline + */ export type GetViewport = () => Viewport; /**