Skip to content

dkaraush/TypeScript

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36,749 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Operator Overloading TypeScript Fork

Installation

npm install -D typescript@npm:@operated/typescript

And for VS Code:

  • Ctrl/⌘+Shift+P
  • Open Settings
  • Type in Search "tsdk"
  • Put path {your_project}/node_modules/typescript/lib/
  • Restart VS Code

Usage

When operators are run on objects, TypeScript checks whether there is a method to call, instead of an operator. In final JS, it would look like an object method was called. (a + b => a.plus(b))

Along with a compiler, "Go To Definition" feature was supported for IDE: click on an operator between the objects to jump to method, that will be invoked.

Operator Method Name
+, += plus
-, -= minus
*, *= times
/, /= div, invDiv*
%, %= rem
^. ^= pow
==, != equals
===, !== exactEquals
a() run

* — invDiv is inverted division, needed when divided type is not an object. For example, 2 / vec2(1, 0) will result in vec2(1, 0).invDiv(2)

About

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.9%
  • Other 0.1%