Implement Role class with various methods #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Not sure how you were envisioning this API to look, but this was an initial pass to create a Role class that has various methods on it:
name()
supportedAriaProps()
supportsAriaProp(prop: string)
If this isn't the direction you were hoping to go, let me know we can totally discuss! I know you were envisioning an API with queries over the whole role dataset (i.e. give me all roles that support aria-foo or give me all native DOM elements that support aria-bar). This can be exposed and used under the hood for this.
Also this is my first go with flow, so let me know if I'm missing anything. There are errors outputting w.r.t. computed class properties. They don't seem to be supported, but I think this was a good way to encapsulate the data.