class MyScene extends Phaser.Scene {
//..
preload(){
// intelliSence will work here
}
}
first of all, in general, and specially if you are using webpack, you probably want to have a jsconfig file. You probably may want to use a tsconfig file instead if you want to use Typescript in your project.
Think for two seconds about why intellisense isn’t working: all you have is a function, preload and you haven’t told anyone anything about it.
If I just open up a file and add a function preload, there is no way to infer anything about it.
Now, if you are writing typescript, you can always add type information. If you are writing javascript only, you can always use JSDoc annotations.
So ideally you just want to extend Phaser.Scene, like I did above. Things will be smooth enough to infer what you meant if you go that route. If you don’t want to do that, you probably (not 100% sure) can simply add a JSDoc comment with a @this tag.
Thank you very much for your answer.
The annotation @this works fine. I experimented a bit with annotations but I think it will make it quite complicated.
So I think I will give TypeScript a chance.