https://github.com/codingbeard/sciter-tiscript-intellisense
set your ide to detect tiscript as typescript and stick the stubs file somewhere in your repo
https://github.com/codingbeard/sciter-tiscript-intellisense
Last synced: 3 months ago
JSON representation
set your ide to detect tiscript as typescript and stick the stubs file somewhere in your repo
- Host: GitHub
- URL: https://github.com/codingbeard/sciter-tiscript-intellisense
- Owner: CodingBeard
- License: gpl-3.0
- Created: 2018-11-13T16:09:58.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T16:30:02.000Z (over 7 years ago)
- Last Synced: 2025-03-03T11:43:29.547Z (over 1 year ago)
- Size: 83 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sciter-tiscript-intellisense
Set your ide to detect tiscript as typescript and stick the stubs file somewhere in your repo.
Note that methods/properties which return multiple values are not 100% accurate as typescript doesn't support that. In those places I have it typehinted to return: MultipleReturnValue
If you're using Intellij Idea Ultimate (which supports typescript) it's helpful to empty the lib.es6.d.ts definition file in C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.6\plugins\JavaScriptLanguage\jsLanguageServicesImpl\external\lib.es6.d.ts
This way you won't have any es6/typescript intellisense confusing you.
You can also get defined as typescript in intellij by following: https://intellij-support.jetbrains.com/hc/en-us/community/posts/207004385-How-do-I-highlight-my-inline-script-with-type-text-javascript-lazy-as-if-it-were-javascript-
Notes:
use the variable name evt for Event object typehinting in handler functions
I haven't added stubs for the following (feel free to add a PR):
- Behavior
- Graphics
- Image
- Sciter
- DataSocket
- WebSocket
- Tokenizer
tiscript class inheritance and function declaration breaks typescript syntax, so you won't get intellisense on any custom classes you create
Try to use typescript compatible functions E.G.
```
self.select() instead of self.$()
self.ready = function() {} instead of function self.ready() {}
dip(100) instead of 100dip
function hashType(type) {return eval(type);} hashType("#view") instead of #view
etc
```