-
-
Save johnlokerse/1618ce4322d06d17c19b02dc9c849cec to your computer and use it in GitHub Desktop.
Learn how to enhance objects with User-Defined Types in Azure Bicep blog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Enforce string to be either 'This', 'Is' or 'Awesome' | |
type stringType = 'This' | 'Is' | 'Awesome' | |
// Enforce number to be either 1, 2, 3, 4 or 5 | |
type intType = 1 | 2 | 3 | 4 | 5 | |
// Enforce boolean to be true | |
type boolType = true | |
// Enforce to be an array of type string (look at the way of writing!) | |
type arrayType = string[] | |
// Enforce to be an array of allowed values: 'This', 'Is' or 'Awesome' | |
type arrayType2 = ('This' | 'Is' | 'Awesome')[] | |
// Enforcing to be an array of either 'This is awesome', 5, true or {} | |
type arrayMixedType = ('This is awesome' | 5 | true | {})[] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment