const request = require("request-promise")
interface User
id: number
username: string
class RegUser
constructor(public user: User)
async reg(): Promise<boolean>
try
let user = JSON.stringify(this.user);
await request('http://host.com/api/reg').post(user)
return true
catch(e)
console.error(e)
return false
let user: User =
id: 1
username: 'root'
new RegUser(user).reg()
wut?!
The TypeScript Design Goals would totally prohibit this from even being considered.
If you want a language that is not a superset of JavaScript, then TypeScript is not for you.
What about parens for invokation? They are not needed as well (see F#). #noParents
If you want a language that is not a superset of JavaScript, then TypeScript is not for you.
Indeed. Many options listed at https://github.com/jashkenas/coffeescript/wiki/list-of-languages-that-compile-to-js
Most helpful comment
wut?!