UNPKG

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.

50 lines 2.49 kB
import { GLTF, GLTFLoaderPlugin, GLTFParser, GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; import { LoadingManager, Object3D } from 'three'; import { AnyOptions } from 'ts-browser-helpers'; import { ThreeViewer } from '../../viewer'; import { ILoader } from '../IImporter'; import { ImportAddOptions } from '../AssetManager'; export declare class GLTFLoader2 extends GLTFLoader implements ILoader<GLTF, Object3D | undefined> { isGLTFLoader2: boolean; importOptions?: ImportAddOptions; constructor(manager: LoadingManager); static ImportExtensions: ((parser: GLTFParser) => GLTFLoaderPlugin)[]; /** * Use {@link MeshLine}(an extension of three.js `Line2`) instead of default `Line` for lines. This allows changing line width and other properties. * * This is the default value for the flag, it can also be controlled by using the `useMeshLines` in the import options. * * Note - Lines may not export correctly when loaded with this. */ static UseMeshLines: boolean; /** * If true, the loader will create unique names for objects in the gltf file when multiple objects with the same name are found. * This is useful when importing gltf files with multiple objects with the same name, and creating animations for them. */ static CreateUniqueNames: boolean; /** * Preparsers are run on the arraybuffer/string before parsing to read the glb/gltf data */ preparsers: GLTFPreparser[]; preparse(data: ArrayBuffer | string, path: string): Promise<ArrayBuffer | string>; parse(data: ArrayBuffer | string, path: string, onLoad: (gltf: GLTF) => void, onError?: (event: ErrorEvent) => void, url?: string): void; /** * This is run post parse to extract the result scene from the GLTF object * @param res * @param _ */ transform(res: GLTF, _: AnyOptions): Object3D | undefined; register(callback: (parser: GLTFParser) => GLTFLoaderPlugin): this; setup(viewer: ThreeViewer, extraExtensions: ((parser: GLTFParser) => GLTFLoaderPlugin)[]): this; gltfViewerParser: (viewer: ThreeViewer) => (p: GLTFParser) => GLTFLoaderPlugin; } export interface GLTFPreparser { process(data: string | ArrayBuffer, path: string): Promise<string | ArrayBuffer>; [key: string]: any; } declare module 'three/examples/jsm/loaders/GLTFLoader.js' { interface GLTFParser { importOptions?: ImportAddOptions; } } //# sourceMappingURL=GLTFLoader2.d.ts.map