UNPKG

@vctrl/hooks

Version:

vctrl/hooks is a React hooks package designed to simplify 3D model loading and management within React applications. It's part of the vectreal-core ecosystem and is primarily used in the vctrl/viewer React component and the official website application.

17 lines (16 loc) 801 B
import { ModelLoader } from '../../../core/src/model-loader/index.ts'; import { default as React } from 'react'; import { Action, ModelFile, OptimizerIntegrationReturn } from './types'; import { useOptimizeModel } from '../use-optimize-model'; /** * Integrates the optimizer into the model loading process. * * Provides the `applyOptimization` method that: * 1. Runs an optional optimization function * 2. Exports the optimized model as GLB * 3. Reloads it into Three.js * 4. Updates the model state * * Returns `null` when no optimizer instance is provided. */ export declare function useOptimizerIntegration(instance: ReturnType<typeof useOptimizeModel> | undefined, dispatch: React.Dispatch<Action>, file: ModelFile | null, modelLoader: ModelLoader): OptimizerIntegrationReturn<boolean>;