1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. GTA Network forum is now in archive mode.

TypeScript definition files

Discussion in 'Scripts' started by Eraknelo, Jan 1, 2017.

  1. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    I've been working on TypeScript definition files for the JavaScript library.

    It's far from sort of done, should work alright.
    It might have some faulty class names or something. Let me know if you run into something.

    I'm sorry, but I will not be helping with "how do I TypeScript". This is for people who already know how to, or can Google to figure it out ;-)

    Available as a NuGet package. Install with
    Code:
    Install-Package types-gtanetwork
    Or as a download from GitHub.

    Please feel free to contribute. Greatly appreciated.

    Just include the index.d.ts as a reference in your .ts file, something like this:
    Code:
    /// <reference path="../typescriptdefinitions/types-gtanetwork/index.d.ts" />
     
    Last edited: Jan 11, 2017
    Adam, Voxel, andreasb and 1 other person like this.
  2. Voxel

    Voxel Member

    Messages:
    5
    Likes Received:
    0
    Joined:
    Dec 6, 2016
    Awesome, I can tell you put a lot of work into this due to the amount of time it took. Great work!
     
  3. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    I appreciate your appreciation. You can tell by the way I'm appreciating you :=)
     
    Voxel likes this.
  4. Tirus

    Tirus Member

    Messages:
    5
    Likes Received:
    2
    Joined:
    Jan 5, 2017
    Great Job! Looking forward to implement some UI with TypeScript + Angular 2.

    EDIT: The icing on the top of this would be a npm package :=D
     
  5. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    I'll look into it. Haven't built an NPM package yet. To be fair, my first NuGet package too.
     
    Tirus likes this.
  6. Armyw0w

    Armyw0w Member

    Messages:
    39
    Likes Received:
    2
    Joined:
    Apr 30, 2017
    Hi Eraknelo, i found in your github a project were you compile the Typescript in one javascript.
    I wanna ask you, I know I need a module, system or amd and seems like the system don't catch the JS.
    How I should catch the compiled JS on client ?
     
  7. Eraknelo

    Eraknelo Active Member

    Messages:
    64
    Likes Received:
    61
    Joined:
    Dec 26, 2016
    Not sure what you mean with "catch the JS", but I don't think a module system will work. Best I've come up with is that example where you compile everything to a single JS file, and then use the classes as modules, basically.

    TS also supports namespaces, if that helps.
     
  8. Armyw0w

    Armyw0w Member

    Messages:
    39
    Likes Received:
    2
    Joined:
    Apr 30, 2017
    I wanted to use system instead commonjs.
    Well, I wanted some typeof conditions, i made manually already.

    thanks
     

Share This Page