reactflow-velocity
Version:
React Flow - A highly customizable React library for building node-based editors and interactive flow charts.
22 lines • 985 B
TypeScript
import type { StoreApi } from 'zustand';
import type { ReactFlowState } from '../types';
type ExtractState = StoreApi<ReactFlowState> extends {
getState: () => infer T;
} ? T : never;
/**
* Hook for accessing the internal store. Should only be used in rare cases.
*
* @public
* @param selector
* @param equalityFn
* @returns The selected state slice
*/
declare function useStore<StateSlice = ExtractState>(selector: (state: ReactFlowState) => StateSlice, equalityFn?: (a: StateSlice, b: StateSlice) => boolean): StateSlice;
declare const useStoreApi: () => {
getState: () => ReactFlowState;
setState: (partial: ReactFlowState | Partial<ReactFlowState> | ((state: ReactFlowState) => ReactFlowState | Partial<ReactFlowState>), replace?: boolean | undefined) => void;
subscribe: (listener: (state: ReactFlowState, prevState: ReactFlowState) => void) => () => void;
destroy: () => void;
};
export { useStore, useStoreApi };
//# sourceMappingURL=useStore.d.ts.map