import Scene from '../Scene'; import Material from '../Material'; import Mesh from '../Mesh'; import ClayNode from '../Node'; import Texture2D from '../Texture2D'; import Skeleton from '../Skeleton'; import Joint from '../Joint'; import TrackAnimator from '../animation/TrackAnimator'; import Shader from '../Shader'; import Camera from '../Camera'; type GLTFFormat = any; interface ParsedLib { json: GLTFFormat; buffers: ArrayBuffer[]; bufferViews: ArrayBuffer[]; rootNode?: ClayNode; cameras: Camera[]; nodes: ClayNode[]; textures: Texture2D[]; materials: Material[]; meshes: Mesh[][]; joints: Joint[]; skeletons: Skeleton[]; animators: TrackAnimator[]; instancedMeshes: Mesh[]; } export type GLTFLoadResult = Pick & { scene?: Scene; meshes: Mesh[]; }; interface GLTFLoadOpts { rootNode?: ClayNode; /** * Root path for uri parsing. */ rootPath?: string; /** * Root path for texture uri parsing. Defaultly use the rootPath * @type {string} */ textureRootPath?: string; /** * Root path for buffer uri parsing. Defaultly use the rootPath */ bufferRootPath?: string; /** * Shader used when creating the materials. */ shader?: Shader; /** * If use {@link clay.StandardMaterial} */ useStandardMaterial?: boolean; /** * If loading the cameras. */ includeCamera?: boolean; /** * If loading the animations. * @type {boolean} */ includeAnimation?: boolean; /** * If loading the meshes */ includeMesh?: boolean; /** * If loading the textures. */ includeTexture?: boolean; /** * @type {string} */ crossOrigin: string; /** * @see https://github.com/KhronosGroup/glTF/issues/674 */ textureFlipY: boolean; onload?: (res: GLTFLoadResult) => void; onerror?: (err: any) => void; onprogress?: (percent: number, loaded: number, total: number) => void; } export declare function load(url: string, opts?: Partial>): Promise; /** * Parse glTF binary * @param {ArrayBuffer} buffer * @return {clay.loader.GLTF.Result} */ export declare function parseBinary(buffer: ArrayBuffer, opts: Partial): GLTFLoadResult | undefined; /** * @param {Object} json * @param {ArrayBuffer[]} [buffer] * @return {clay.loader.GLTF.Result} */ export declare function parse(json: GLTFFormat, buffers: ArrayBuffer[] | undefined, opts: Partial): GLTFLoadResult; export {};