Skip to content

Commit

Permalink
feat: add gltf loader types (#143)
Browse files Browse the repository at this point in the history
* Add gltf loader types

* Update `createNodeMesh` return types

* Add entry to contributors
  • Loading branch information
robertlong authored Nov 7, 2021
1 parent fdbd9bd commit 39dc2e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@
"contributions": [
"code"
]
},
{
"login": "robertlong",
"name": "Robert Long",
"avatar_url": "https://avatars.githubusercontent.com/u/1753624?v=4",
"profile": "https://github.com/robertlong",
"contributions": [
"code"
]
}
],
"skipCi": true,
Expand Down
17 changes: 17 additions & 0 deletions types/three/examples/jsm/loaders/GLTFLoader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import {
Material,
SkinnedMesh,
Texture,
TextureLoader,
FileLoader,
ImageBitmapLoader,
} from '../../../src/Three';

import { DRACOLoader } from './DRACOLoader';
Expand Down Expand Up @@ -75,6 +78,19 @@ export interface GLTFReference {
export class GLTFParser {
json: any;

options: {
path: string;
manager: LoadingManager;
ktx2Loader: KTX2Loader;
meshoptDecoder: /* MeshoptDecoder */ any;
crossOrigin: string;
requestHeader: { [header: string]: string };
};

fileLoader: FileLoader;
textureLoader: TextureLoader | ImageBitmapLoader;
plugins: GLTFLoaderPlugin;
extensions: { [name: string]: any };
associations: Map<Object3D | Material | Texture, GLTFReference>;

getDependency: (type: string, index: number) => Promise<any>;
Expand Down Expand Up @@ -135,5 +151,6 @@ export interface GLTFLoaderPlugin {
extendMaterialParams?:
| ((materialIndex: number, materialParams: { [key: string]: any }) => Promise<any> | null)
| undefined;
createNodeMesh?: ((nodeIndex: number) => Promise<Group | Mesh | SkinnedMesh> | null) | undefined;
createNodeAttachment?: ((nodeIndex: number) => Promise<Object3D> | null) | undefined;
}

0 comments on commit 39dc2e2

Please sign in to comment.