Improve TSDoc comments for type UseOnViewportChangeOptions and useOnViewportChange hook
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@xyflow/react': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Improve TSDoc comments for `type UseOnViewportChangeOptions` and `useOnViewportChange` hook
|
||||||
@@ -4,8 +4,11 @@ import type { OnViewportChange } from '@xyflow/system';
|
|||||||
import { useStoreApi } from './useStore';
|
import { useStoreApi } from './useStore';
|
||||||
|
|
||||||
export type UseOnViewportChangeOptions = {
|
export type UseOnViewportChangeOptions = {
|
||||||
|
/** Gets called when the viewport starts changing. */
|
||||||
onStart?: OnViewportChange;
|
onStart?: OnViewportChange;
|
||||||
|
/** Gets called when the viewport changes. */
|
||||||
onChange?: OnViewportChange;
|
onChange?: OnViewportChange;
|
||||||
|
/** Gets called when the viewport stops changing. */
|
||||||
onEnd?: OnViewportChange;
|
onEnd?: OnViewportChange;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -15,10 +18,6 @@ export type UseOnViewportChangeOptions = {
|
|||||||
* change: `onStart`, `onChange`, and `onEnd`.
|
* change: `onStart`, `onChange`, and `onEnd`.
|
||||||
*
|
*
|
||||||
* @public
|
* @public
|
||||||
* @param params.onStart - gets called when the viewport starts changing
|
|
||||||
* @param params.onChange - gets called when the viewport changes
|
|
||||||
* @param params.onEnd - gets called when the viewport stops changing
|
|
||||||
*
|
|
||||||
* @example
|
* @example
|
||||||
* ```jsx
|
* ```jsx
|
||||||
*import { useCallback } from 'react';
|
*import { useCallback } from 'react';
|
||||||
|
|||||||
Reference in New Issue
Block a user