videx-3d
Version:
React 3D component library designed for sub surface visualizations in the browser
44 lines (43 loc) • 1.12 kB
TypeScript
import { Line, Mesh, Object3D } from 'three';
type ObjectRef = {
object: Mesh | Line;
instanceIndex?: number;
};
type HighlightState = {
highlighted: ObjectRef[];
set: (partial: ((state: HighlightState) => Partial<HighlightState>) | Partial<HighlightState>) => void;
};
export declare const useHighlightState: import('zustand').UseBoundStore<import('zustand').StoreApi<HighlightState>>;
/**
* Allows a component to interact with the `Highlighter` handler component.
*
* @example
* const highlighter = useHighlighter()
*
* return (
* <Wellbore
* id={wellbore.id}
* ...
* onPointerEnter={async (event) => {
* if (!isSelected) {
* highlighter.highlight(event.target)
* }
* }}
* onPointerLeave={async () => {
* highlighter.removeAll()
* }}
* ...
* />
* )
*
* @see {@link EventEmitter}
* @see {@link Highlighter}
*
* @group Hooks
*/
export declare const useHighlighter: () => {
highlight: (obj: Object3D, index?: number) => void;
removeHighlight: (obj: Object3D, index?: number) => void;
removeAll: () => void;
};
export {};