Is it possible to model Typescript `type`s not just interface and Classes
See original GitHub issueI am using types instead of interfaces and classes eg.
type Something = {
name: string
value: number
user: User
}```
with many types containing other types (eg. a hierarchy similar to the demo) but when running tsuml I get the following (as though it can't parse it, but it is valid Typescript):
render to svg Error: Parse error on line 3:
^ Expecting ‘IDENT’, ‘[’, got ‘EOF’ Error: Parse error on line 3:
^ Expecting ‘IDENT’, ‘[’, got ‘EOF’ at Parser.parseError (/Users/…/node_modules/nomnoml/dist/nomnoml.js:806:25) at Parser.parse (/Users/…/node_modules/nomnoml/dist/nomnoml.js:867:26) at intermediateParse (/Users/…/node_modules/nomnoml/dist/nomnoml.js:1392:34) at parse (/Users/…/node_modules/nomnoml/dist/nomnoml.js:1312:25) at parseAndRender (/Users/…/node_modules/nomnoml/dist/nomnoml.js:2159:29) at Object.renderSvg (/Users/…/node_modules/nomnoml/dist/nomnoml.js:2175:34) at renderNomnomlSVG (/Users/…/node_modules/tsuml2/dist/core/io.js:30:20) at createNomnomlSVG (/Users/…/node_modules/tsuml2/dist/core/index.js:93:41) at /Users/…/node_modules/tsuml2/dist/bin/index.js:18:41 at Object.<anonymous> (/Users/…/node_modules/tsuml2/dist/bin/index.js:24:3) { hash: { text: ‘’, token: ‘EOF’, line: 2, loc: { first_line: 1, last_line: 3, first_column: 0, last_column: 0 }, expected: [ “‘IDENT’”, “‘[’” ] } }```
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
@rpocklin member associations can be rendered now in v0.6.1 If the member is an array “0…*” is added in addition to the assocation line. Would be nice if you can try it out use the
-m
command line parameterAnd thanks for the constructive comments
That’s what I call a minimal reproduction 👍 In this case the problem was that not a single entity could be emitted and therefore nomnoml complained about that.
Now an error message will be shown in such a case.
By the way
will not produce an entity now (open for suggestions). For now only types like
will produce output.
Can you give
0.5.1
a try