UNPKG

1.66 kBTypeScriptView Raw
1import { AnimationClip } from "../animation/AnimationClip.js";
2import { BufferGeometry } from "../core/BufferGeometry.js";
3import { InstancedBufferGeometry } from "../core/InstancedBufferGeometry.js";
4import { Object3D } from "../core/Object3D.js";
5import { Material } from "../materials/Material.js";
6import { Source } from "../textures/Source.js";
7import { Texture } from "../textures/Texture.js";
8import { Loader } from "./Loader.js";
9import { LoadingManager } from "./LoadingManager.js";
10
11export class ObjectLoader extends Loader<Object3D> {
12 constructor(manager?: LoadingManager);
13
14 load(
15 url: string,
16 onLoad?: (data: Object3D) => void,
17 onProgress?: (event: ProgressEvent) => void,
18 onError?: (err: unknown) => void,
19 ): void;
20
21 parse(json: unknown, onLoad?: (object: Object3D) => void): Object3D;
22 parseAsync(json: unknown): Promise<Object3D>;
23 parseGeometries(json: unknown): { [key: string]: InstancedBufferGeometry | BufferGeometry };
24 parseMaterials(json: unknown, textures: { [key: string]: Texture }): { [key: string]: Material };
25 parseAnimations(json: unknown): { [key: string]: AnimationClip };
26 parseImages(json: unknown, onLoad?: () => void): { [key: string]: Source };
27 parseImagesAsync(json: unknown): Promise<{ [key: string]: Source }>;
28 parseTextures(json: unknown, images: { [key: string]: Source }): { [key: string]: Texture };
29 parseObject(
30 data: unknown,
31 geometries: { [key: string]: InstancedBufferGeometry | BufferGeometry },
32 materials: { [key: string]: Material },
33 animations: { [key: string]: AnimationClip },
34 ): Object3D;
35}