Closed adiherzog closed 7 years ago
I tested it and it works (see examples). Not understanding your problem.
could it be a version problem ?? What typescript version are you using?
Our enums already use string values (see index.d.ts) and this should work with newest typescript. At least it did in our examples.
@adiherzog please check my answers above and let me know whether it was a version problem and we can close this?
@bruderol Enums in TypeScript can't have string values, just numbers, see here: https://www.typescriptlang.org/docs/handbook/enums.html
´´´ Enums allow us to define a set of named numeric constants. An enum can be defined using the enum keyword. ´´´
Or is this a different kind of enum from the ones used in the type definition file?
I'm using "typescript": "^1.8.10",
in package.json which currently results in version 1.8.10
to be installed. I see that your examples are using version "typescript": "~2.0.3"
. So this could really make the difference.
sorry, but somebody told me that it is allready working with strings. and it works in 2.x.
I fixed the problem and made this PR: https://github.com/scenarioo/scenarioo-js/pull/48
@adiherzog Sorry, i don't get it. In my oppinion there is nothing to fix. Just use TypeScript 2.x Maybe we need discuss this. Your PR is a breaking change.
ok, now I understand after our discussion today and agree to change it according our discussion and changes by @Dogen91 . see commits on https://github.com/scenarioo/scenarioo-js/pull/48
done, will be released with 3.0.1 thanks @Dogen91 and @adiherzog
Currently using the TypeScript typings does not work. I get the following error:
The problem seems to be that TypeScript enums (ScreenAnnotationClickAction and ScreenAnnotationStyle) don't support strings but only numbers. Instead we could probably use string literal types in
index.d.ts
, see also here: http://stackoverflow.com/a/15491832@bruderol Did you not run into this issue yet? How shall we solve it?