Skip to content
This repository has been archived by the owner on Jan 14, 2022. It is now read-only.

Commit

Permalink
Added declare module example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
cecilemuller committed Jun 22, 2018
1 parent 70613c5 commit 7060d7d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,18 @@ const scene = new Scene();
const renderer = new WebGLRenderer();
const controls = new OrbitControls();
````


## Typescript

Until definitions are integrated directly in `@types/three`, add a file `globals.d.ts`
at the root of your project to specify the types of the imports, e.g.:

````ts
declare module 'three/examples/js/controls/OrbitControls' {
export const OrbitControls: typeof THREE.OrbitControls;
}
````

Note that this is *not* required for compiling to JS, it improves Intellisense in your code editor.

0 comments on commit 7060d7d

Please sign in to comment.