RPG Maker MZ Typescript edition


What does this mean for the project?
not that much the 'deprecated' method is quite nice tho. but mostly it'S just improvement.
Very Interesting, I have always been thinking to develop plugins in TypeScript, although I am still learning the basics of TS. It seems like to me that we must write declaration files for the RMMZ's code first? Now we sees the source code, it seems like a lot of work, but is there any significant challenges for that?
most of the time No @RaiderSoap code is enough clear to understand the type directly from the sources code.
what gets complicated is when there's cross references between class that are not yet being defined in TS (like I didn't did the definitions files for it) so it get complicated.

Also as I love TS it can be challenging to work dynamically for plugin development (when you don't know module augmentation and such)
Although as explained above if we follow the cyclone engine way of doing alias or extending class it will be way easier. even if I think some input will be lost but ill figure it out when it come to it.
If I want to contribute documentation to classes/methods as I continue experimenting with RMMZ, should I write them in JSDoc format or TSDoc format?

Also is it worth copy/pasting the comments from the base javascript files into the corresponding places in the d.ts files, or will those be linked in automatically somehow?
If I want to contribute documentation to classes/methods as I continue experimenting with RMMZ, should I write them in JSDoc format or TSDoc format?

Also is it worth copy/pasting the comments from the base javascript files into the corresponding places in the d.ts files, or will those be linked in automatically somehow?
The typescript and MZ code base are kinda separated I do plan to speak with degica to introduce the code definitions into MZ doc. but take it with a grain of salt. As for the doc depending what they use as parser we might need to anotate but per functionality Typescript already anotate the type so just having comment works per say.
JsDoc comments work perfectly fine for TS. If you wanted to contribute it'd have to be to the repository itself.

There's a significant rewrite process for MZ for Typescript definitions so it will take time.
I was already planning to write my scripts in typescript since it's what my work uses and I could use the extra practice. So I have a strong interest in this project.

I've been a bit hesitant to help with the re-writing of the code because I can't find any indication on the project page of who may already be working on what. I would hate to rewrite something only to find out someone else was already doing it. How are you coordinating things?
I was already planning to write my scripts in typescript since it's what my work uses and I could use the extra practice. So I have a strong interest in this project.

I've been a bit hesitant to help with the re-writing of the code because I can't find any indication on the project page of who may already be working on what. I would hate to rewrite something only to find out someone else was already doing it. How are you coordinating things?
So far I am the only one working on it.

how I coordinate things I generally work on one rmm_***.js file at a time as a separated file. an extra hand wouldn't be wrong.
I am very peculiar with the organization (you can refers to how I approach the declarations files)

but as I said it's not actual code it's definitions files. so there's no 'body' content.
just 'declarations'

SO FAR I am doing the Game_Object file. so the other files are still in dev.

I also changed the way you bundle the files (they are now will all be bundle in one single file so doing )

Code:
import {Scene_Base} from "../rpg_scene/Scene_Base";
in files is perfectly fine.
I took a look at the windows.js file and tried writing out the type definitions for Window_Base. It took longer than I expected :dizzy: but I have a pull request on GitHub that you can review when you have time. I'll probably try to do at least one class a day during the week.
I am interested in helping this project, as Ghost314 suggest we can somehow coordinate this.

I have wrote my own plugin TypeScript + rollup environment and all I need is to wait for the '@types/rmmz'
(or something like that, hopefully it can be published to npm
(Can't wait for this already,
I mean I can try to publish to NPM although I am not super strong when it come to that (I don't use it since I work with Unity most of the time so npm isn't used widely)

and you free to help!
and most of the typing will be compiled to rmmz_api.d.ts
@Ghost314 ill review it.
I actually created one yesterday but I need some testers.
I actually created one yesterday but I need some testers.

Wow this looks very complete, thanks a lot for the efforts!
I posted this issue related to the RPG namespace
which solve a lots for the

also for any moderator will it be possible to finally repine the project? it was unpinned as reason it was supposed to be moved to a 'proper' place and pinned back but it didn't happened yet.
I got tired of manually creating files and copy-pasting class and method names so I created a java utility to do most of the work. It takes 2 arguments when run, first is the path to a javascript file, and the second is an output directory folder.

It parses the javascript file with regular expressions to find lines that look like class/method/constructor definitions and generates a corresponding typescript declaration file in the output directory folder for each class that it finds.

It obviously can't figure out any of the type information, and it also doesn't parse Object.defineProperty statements, so the output still has to manually verified and completed. It saves a bit of time with copy and pasting though, since it generates files like this to use as a starting point:
starting class.jpg


I made it leave the return type of each method blank so it's easy to tell which classes still need to be worked on.

I don't think the tool is smart enough to be worth distributing as a separate project, so I just attached the full source code to this post in a .zip file in case anyone else wants to use it.
oh jesus it is awesome xD
Nice job
You can use tsc to generate .d.ts files from .js files. Although not all types are correct, but it saves you all the copy & paste steps. Most importantly, it never miss any functions.
You can use tsc to generate .d.ts files from .js files. Although not all types are correct, but it saves you all the copy & paste steps. Most importantly, it never miss any functions.
wait you can D: ? I didn't know that lol
I actually knew about tsc, you can use compiler options to tell it to compile .js files and you can tell it to emit .d.ts files both at the same time. I ran into trouble though trying to actually compile those .js files (I am relatively new to typescript). So I ended up doing it myself.

If someone can figure out how to properly set up the tsc for this then let me know, it would be a good way to error check our work.

Original thread: https://forums.rpgmakerweb.com/threads/rpg-maker-mz-typescript-edition.124983/