@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) • 962 B
TypeScript
import { Document } from '@gltf-transform/core';
import { ModelFile } from '../use-load-model';
/**
* A React hook for exporting a 3D model using the core ModelExporter.
*
* @param {Function} [onSaved] Called when the export is complete.
* @param {Function} [onError] Called when an error occurs during exporting.
* @returns An object with export functions.
*/
declare const useExportModel: (onSaved?: () => void, onError?: (error: Error) => void) => {
handleThreeGltfExport: (file: ModelFile | null, binary: boolean) => Promise<void>;
handleDocumentGltfExport: (jsonDocument: Document, file: ModelFile | null, binary?: boolean, download?: boolean) => Promise<import('../../../core/src/model-exporter/index.ts').GLTFExportResult | undefined>;
handleThreeUsdzExport: (file: ModelFile | null) => Promise<void>;
handleDocumentGlbDracoExport: (jsonDocument: Document, file: ModelFile | null) => Promise<void>;
};
export default useExportModel;