Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate typescript declaration for XState #17

Open
4 tasks done
DrSensor opened this issue Jun 8, 2019 · 1 comment
Open
4 tasks done

Generate typescript declaration for XState #17

DrSensor opened this issue Jun 8, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@DrSensor
Copy link
Owner

DrSensor commented Jun 8, 2019

json_typegen results
{
  "states": {
    "set": {
      "on": {
        "TOGGLE": "reset",
        "RESET": "reset",
        "OFF": "set"
      }
    },
    "reset": {
      "on": {
        "TOGGLE": "set",
        "SET": "set",
        "DATA": "set"
      }
    }
  }
}

json_typegen above.json -O typescript --name MachineConfig > below.ts

interface MachineConfig {
    states: States;
}
interface States {
    set: Set;
    reset: Reset;
}
interface Set {
    on: On;
}
interface On {
    TOGGLE: string;
    RESET: string;
    OFF: string;
}
interface Reset {
    on: On2;
}
interface On2 {
    TOGGLE: string;
    SET: string;
    DATA: string;
}

Things to keep track

@DrSensor DrSensor added the enhancement New feature or request label Jun 8, 2019
@DrSensor DrSensor added this to the v1.0 milestone Jun 8, 2019
@DrSensor DrSensor added the good first issue Good for newcomers label Jun 8, 2019
@DrSensor DrSensor self-assigned this Jul 13, 2019
@DrSensor
Copy link
Owner Author

DrSensor commented Jul 14, 2019

This is just a temporary hack, in the future find a way to use and contribute to swc_ecma_codegen typescript implementation. (hint: fork then include that as a git-submodule)

beware: this might need more RAM since Rust langserver doesn't have a mode to conserve memory. So delay this until I can buy better laptop 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant