Git Product home page Git Product logo

Comments (3)

Linnest2020 avatar Linnest2020 commented on May 16, 2024

Yep, Typescript is neccessary for developing, change the repo into Typescript was listed in TODO list, however, it is limitied by two problem

  1. I haven't learn how to use Typescript yet
  2. Using Typescript may bring some barrier for adding new features, thoght the editor started to get stable

from vic3-mapdata-editor.

Jaykingamez avatar Jaykingamez commented on May 16, 2024

Perhaps you would like to organize it around a framework like React or Angular?

Anyway, the current JS code can be pasted in typescript, the only things to change would be declaring types.

from vic3-mapdata-editor.

Linnest2020 avatar Linnest2020 commented on May 16, 2024

type state_detail_private_type = {
state_type:"corporated"|"incorporated"|"treaty_port"|("corporated"|"incorporated"|"treaty_port")[]
country:string
owned_provinces:string[]
}
type state_detail_type = {
create_state:(state_detail_private_type|state_detail_private_type[])
add_claim?:string|string[]
add_homeland?:string|string[]
}
type history_dict_type = {
STATES:{[key:string]:state_detail_type}
}

You can see I post a ROUGH TypeScript Version on it, and the code above is the interface of 00_states.txt, however, when it comes with actual usage:

full_map_data.histroy_state_dict["STATES"][old_state]["create_state"]["owned_provinces"] = full_map_data.histroy_state_dict["STATES"][old_state]["create_state"]["owned_provinces"].filter((item:string) => item!=prov)

It would raise error

And then, when I complite with tsc, it don't works(warning at Uncaught ReferenceError: exports is not defined at index.js:2:1)

from vic3-mapdata-editor.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.