threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
42 lines • 2.07 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;
readonly isDRACOLoader2 = true;
/**
* Path to the draco decoder/encoder libraries, default uses jsdelivr CDN
* You may want to set this to your own path or use {@link DRACOLoader2.SetDecoderJsString}
* to bundle the draco decoder js file with your app source
* @default 'https://cdn.jsdelivr.net/gh/google/draco@1.5.6/javascript/'
*/
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=../../src/assetmanager/import/DRACOLoader2.d.ts.map