threepipe
Version:
A 3D viewer framework built on top of three.js in TypeScript with a focus on quality rendering, modularity and extensibility.
35 lines • 1.68 kB
TypeScript
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';
import { BufferGeometry, LoadingManager, Mesh } from 'three';
import { AnyOptions } from 'ts-browser-helpers';
import { ILoader } from '../IImporter';
export declare class DRACOLoader2 extends DRACOLoader implements ILoader<BufferGeometry, Mesh | undefined> {
encoderPending: Promise<any> | null;
encoderConfig: any;
static DRACO_LIBRARY_PATH: string;
constructor(manager?: LoadingManager);
transform(res: BufferGeometry, _: AnyOptions): Mesh | undefined;
preload(decoder?: boolean, encoder?: boolean): DRACOLoader;
initEncoder(): Promise<any>;
initDecoder(): Promise<any>;
/**
* This is a hack to allow bundling the draco decoder js file with your app source
* See {@link DRACOLoader2.SetDecoderJsString} for example
*/
static LibraryValueMap: Record<string, any>;
_loadLibrary(url: string, responseType: string): Promise<any>;
/**
* Set the decoder js string
* Sample for how to set LibraryValueMap
* This is useful for bundling the draco decoder js file with your app source
* @example
* First put the draco_decoder.js file in your src folder, then import it in js/ts as a string
* ```js
* import draco_decoder from './libs/draco_decoder.1.5.6.js?raw' // vite will load this as a string
* // console.log(draco_decoder) // this should be a string with js content
* DRACOLoader2.SetDecoderJsString(draco_decoder)
* ```
* @param jsString - the contents of draco_decoder.js file
*/
static SetDecoderJsString(jsString: string): void;
}
//# sourceMappingURL=DRACOLoader2.d.ts.map