|
|
|
|
|
by antics
2405 days ago
|
|
Ah—unions of strings (e.g., `"foo" | "bar"`) effectively are enums in TypeScript and JavaScript. They are autocompleted and type-checked at compile time, so you should get exactly the same behavior. Even exhaustiveness checking. See docs[1] for details. And, to the specific point: you absolutely should not have to look up the docs. These values definitely will autocomplete. Anyway, aside from all that, unions of strings is "the idiomatic way" to do this sort of thing in TypeScript and JavaScript. [1]: https://www.typescriptlang.org/docs/handbook/advanced-types.... |
|
This is what one of the property types actually look like:
In AWS CDK it was an easy task to select Postgres - in Pulumi case I had to read the comment.