UNPKG

@threlte/extras

Version:

Utilities, abstractions and plugins for your Threlte apps

23 lines (22 loc) 1.03 kB
import { type AsyncWritable } from '@threlte/core'; import type { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js'; import type { MeshoptDecoder } from 'three/examples/jsm/libs/meshopt_decoder.module.js'; import type { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader.js'; import { type SceneGraph } from '../lib/buildSceneGraph.js'; import type { ThrelteGltf } from '../types/types.js'; type UseGltfOptions = { dracoLoader?: DRACOLoader | undefined; meshoptDecoder?: typeof MeshoptDecoder | undefined; ktx2Loader?: KTX2Loader | undefined; }; export declare function useGltf(options?: UseGltfOptions): { load: <Graph extends SceneGraph = { nodes: Record<string, any>; materials: Record<string, any>; }>(url: string) => AsyncWritable<ThrelteGltf<Graph>>; }; export declare function useGltf<Graph extends SceneGraph = { nodes: Record<string, any>; materials: Record<string, any>; }>(url: string, options?: UseGltfOptions): AsyncWritable<ThrelteGltf<Graph>>; export {};