-
Notifications
You must be signed in to change notification settings - Fork 747
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
Add option to create user defined types from static data #14715
Labels
Milestone
Comments
I like this suggestion! The implementation would likely be a utility type (the type obj = {
foo: string
bar: string
}
@sealed()
type sealedObj = {
foo: string
bar: string
}
type objKey = keyof<obj> // == 'foo' | 'bar' | string
type sealedObjKey = keyof<sealedObj> // == 'foo' | 'bar' I think we might need a // do scale
var roles = loadJsonContent('roles.json')
@export()
type SuggestedRoleName = keyof<typeof<roles>>
@export()
func suggestedRoleId(name SuggestedRoleName) string => roles[name] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
Would be nice to have the option to add types from static data in bicep.
Main benefit is that you get intelisence on calling suggestedRoleId() that is dynamically updated.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: