Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TypeScript] Add loadAsync typing #21001

Merged
merged 1 commit into from
Jan 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/jsm/loaders/3DMLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export class Rhino3dmLoader extends Loader {
setWorkerLimit( workerLimit: number ): Rhino3dmLoader;
dispose(): Rhino3dmLoader;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Object3D>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/3MFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export class ThreeMFLoader extends Loader {
parse( data: ArrayBuffer ): Group;
addExtension( extension: object ):void

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/AMFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class AMFLoader extends Loader {
load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer ): Group;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/AssimpLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export class AssimpLoader extends Loader {
load( url: string, onLoad: ( result: Assimp ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( buffer: ArrayBuffer, path: string ) : Assimp;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Assimp>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/BVHLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export class BVHLoader extends Loader {
load( url: string, onLoad: ( bvh: BVH ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( text: string ) : BVH;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BVH>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/BasisTextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export class BasisTextureLoader extends Loader {
detectSupport( renderer: WebGLRenderer ): this;
dispose(): void;
load( url: string, onLoad: ( texture: CompressedTexture ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<CompressedTexture>;

setTranscoderPath( path: string ): this;
setWorkerLimit( workerLimit: number ): this;

Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/loaders/ColladaLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export class ColladaLoader extends Loader {
load( url: string, onLoad: ( collada: Collada ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( text: string, path: string ) : Collada;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Collada>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/DRACOLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ export class DRACOLoader extends Loader {
preload(): DRACOLoader;
dispose(): DRACOLoader;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/FBXLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class FBXLoader extends Loader {
load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( FBXBuffer: ArrayBuffer | string, path: string ) : Group;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/GCodeLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export class GCodeLoader extends Loader {
load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: string ) : Group;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/GLTFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export class GLTFLoader extends Loader {

parse( data: ArrayBuffer | string, path: string, onLoad: ( gltf: GLTF ) => void, onError?: ( event: ErrorEvent ) => void ) : void;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<GLTF>;

}

export interface GLTFReference {
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/loaders/HDRCubeTextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export class HDRCubeTextureLoader extends Loader {
load( urls: string[], onLoad: ( texture: CubeTexture ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
setDataType( type: TextureDataType ): this;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<CubeTexture>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/KMZLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export class KMZLoader extends Loader {
load( url: string, onLoad: ( kmz: Collada ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer ): Collada;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Collada>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/LDrawLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ export class LDrawLoader extends Loader {
addMaterial( material: Material ): void;
getMaterial( colourCode: string ): Material | null;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/LUT3dlLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ export class LUT3dlLoader extends Loader {
);
parse( data: string ): LUT3dlResult;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<LUT3dlResult>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/LUTCubeLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ export class LUTCubeLoader extends Loader {
);
parse( data: string ): LUTCubeResult;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<LUTCubeResult>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/LWOLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ export class LWOLoader extends Loader {
load( url: string, onLoad: ( lwo: LWO ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer, path: string, modelName: string ): LWO;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<LWO>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/LottieLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export class LottieLoader extends Loader {

setQuality( value: Number ) : void;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<CanvasTexture>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/MD2Loader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class MD2Loader extends Loader {
load( url: string, onLoad: ( geometry: BufferGeometry ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer ): BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/MDDLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export class MDDLoader extends Loader {
load( url: string, onLoad: ( result: MDD ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer ) : MDD;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<MDD>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/MMDLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ export class MMDLoader extends Loader {
loadWithAnimation( url: string, vmdUrl: string | string[], onLoad: ( object: MMDLoaderAnimationObject ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
setAnimationPath( animationPath: string ): this;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<SkinnedMesh>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/MTLLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export class MTLLoader extends Loader {
parse( text: string, path: string ) : MTLLoader.MaterialCreator;
setMaterialOptions( value: MaterialCreatorOptions ) : void;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<MTLLoader.MaterialCreator>;

}

export interface MaterialInfo {
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/loaders/OBJLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export class OBJLoader extends Loader {
parse( data: string ) : Group;
setMaterials( materials: MTLLoader.MaterialCreator ) : this;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/OBJLoader2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ export class OBJLoader2 extends Loader {
load( url: string, onLoad: ( object3d: Object3D ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void, onMeshAlter?: ( meshData: object ) => void ): void;
parse( content: ArrayBuffer | string ): Object3D;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Object3D>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/PCDLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export class PCDLoader extends Loader {
load( url: string, onLoad: ( points: Points ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer | string, url: string ) : Points;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Points>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/PDBLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export class PDBLoader extends Loader {
load( url: string, onLoad: ( pdb: PDB ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( text: string ) : PDB;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<PDB>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/PLYLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export class PLYLoader extends Loader {
setPropertyNameMapping( mapping: object ) : void;
parse( data: ArrayBuffer | string ) : BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/PRWMLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export class PRWMLoader extends Loader {
load( url: string, onLoad: ( geometry: BufferGeometry ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer ) : BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

static isBigEndianPlatform(): boolean;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/STLLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export class STLLoader extends Loader {
load( url: string, onLoad: ( geometry: BufferGeometry ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer | string ) : BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/SVGLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export class SVGLoader extends Loader {
load( url: string, onLoad: ( data: SVGResult ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( text: string ) : SVGResult;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<SVGResult>;

static getStrokeStyle( width?: number, color?: string, lineJoin?: string, lineCap?: string, miterLimit?: number ): StrokeStyle;
static pointsToStroke( points: Vector3[], style: StrokeStyle, arcDivisions?: number, minDistance?: number ): BufferGeometry;
static pointsToStrokeWithBuffers( points: Vector3[], style: StrokeStyle, arcDivisions?: number, minDistance?: number, vertices?: number[], normals?: number[], uvs?: number[], vertexOffset?: number ): number;
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/loaders/TDSLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export class TDSLoader extends Loader {
load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( arraybuffer: ArrayBuffer, path: string ): Group;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

debugMessage( message: object ): void;
endChunk( chunk: object ): void;
nextChunk( data: DataView, chunk: object ): void;
Expand Down
2 changes: 2 additions & 0 deletions examples/jsm/loaders/TGALoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class TGALoader extends Loader {
load( url: string, onLoad: ( texture: Texture ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: ArrayBuffer ) : Texture;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Texture>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/TTFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class TTFLoader extends Loader {
load( url: string, onLoad: ( json: object ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( arraybuffer: ArrayBuffer ): object;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<object>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/TiltLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class TiltLoader extends Loader {
load( url: string, onLoad: ( object: Group ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer ): Group;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Group>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/VOXLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export class VOXLoader extends Loader {
load( url: string, onLoad: ( chunks: Array<object> ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer ): Array<object>;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Array<object>>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/VRMLLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class VRMLLoader extends Loader {
load( url: string, onLoad: ( scene: Scene ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ) : void;
parse( data: string, path: string ) : Scene;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Scene>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/VRMLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ export class VRMLoader extends Loader {
parse( gltf: GLTF, onLoad: ( scene: GLTF ) => void ): void;
setDRACOLoader( dracoLoader: DRACOLoader ): this;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<GLTF>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/VTKLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class VTKLoader extends Loader {
load( url: string, onLoad: ( geometry: BufferGeometry ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer | string, path: string ): BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/XLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export class XLoader extends Loader {
load( url: string, onLoad: ( object: XResult ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: ArrayBuffer | string, onLoad: ( object: object ) => void ): object;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<XResult>;

}
2 changes: 2 additions & 0 deletions examples/jsm/loaders/XYZLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ export class XYZLoader extends Loader {
load( url: string, onLoad: ( geometry: BufferGeometry ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
parse( data: string, onLoad: ( geometry: BufferGeometry ) => void ): object;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<BufferGeometry>;

}
2 changes: 2 additions & 0 deletions src/loaders/AnimationLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export class AnimationLoader extends Loader {
): void;
parse( json: any ): AnimationClip[];

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<AnimationClip[]>;

}
2 changes: 2 additions & 0 deletions src/loaders/AudioLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export class AudioLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): void;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<AudioBuffer>;

}
2 changes: 2 additions & 0 deletions src/loaders/BufferGeometryLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ export class BufferGeometryLoader extends Loader {
): void;
parse( json: any ): InstancedBufferGeometry | BufferGeometry;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<InstancedBufferGeometry | BufferGeometry>;

}
2 changes: 2 additions & 0 deletions src/loaders/CompressedTextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export class CompressedTextureLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): CompressedTexture;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<CompressedTexture>;

}
2 changes: 2 additions & 0 deletions src/loaders/CubeTextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export class CubeTextureLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): CubeTexture;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<CubeTexture>;

}
2 changes: 2 additions & 0 deletions src/loaders/DataTextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ export class DataTextureLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): void;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<DataTexture>;

}
2 changes: 2 additions & 0 deletions src/loaders/FileLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export class FileLoader extends Loader {
setMimeType( mimeType: MimeType ): FileLoader;
setResponseType( responseType: string ): FileLoader;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<string | ArrayBuffer>;

}
2 changes: 2 additions & 0 deletions src/loaders/FontLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ export class FontLoader extends Loader {
): void;
parse( json: any ): Font;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Font>;

}
2 changes: 2 additions & 0 deletions src/loaders/ImageBitmapLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ export class ImageBitmapLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): any;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<ImageBitmap>;

}
2 changes: 2 additions & 0 deletions src/loaders/ImageLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ export class ImageLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): HTMLImageElement;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<HTMLImageElement>;

}
2 changes: 2 additions & 0 deletions src/loaders/MaterialLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ export class MaterialLoader extends Loader {
setTextures( textures: { [key: string]: Texture } ): this;
parse( json: any ): Material;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Material>;

}
2 changes: 2 additions & 0 deletions src/loaders/ObjectLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ export class ObjectLoader extends Loader {
animations: AnimationClip[]
): T;

loadAsync<ObjectType extends Object3D>( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<ObjectType>;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be like this?

loadAsync<T extends Object3D>( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<T>;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea to be honest. I don't know much about types...
We can merged it as it is and let other people fix it if it's wrong.


}
2 changes: 2 additions & 0 deletions src/loaders/TextureLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export class TextureLoader extends Loader {
onError?: ( event: ErrorEvent ) => void
): Texture;

loadAsync( url: string, onProgress?: ( event: ProgressEvent ) => void ): Promise<Texture>;

}