web-platform-dx / baseline-status

Apache License 2.0
13 stars 4 forks source link

Add typescript support and openapi integration with backend #5

Open devnook opened 4 months ago

devnook commented 4 months ago

From @jcscottiii :

Typing:

To help with the responses and preventing yourself from having to manually check the possible values, you could generate the types based on the openapi document for the backend. Then use type hinting annotations to help. This will help with the maps between data and css classes as well as reduce any other potential bugs (like the values for browser implementation). You can use something like this to generate the typing based on the openapi.yaml: https://www.npmjs.com/package/openapi-typescript

jcscottiii commented 4 months ago

In the meantime, I suggested some JS type definitions to help out https://github.com/GoogleChrome/baseline-status/pull/4#pullrequestreview-2091046762