Conversation
tordans
left a comment
There was a problem hiding this comment.
This looks great. I really like to see more TS in our projects. It will make working with them a lot easier.
tyrasd
left a comment
There was a problem hiding this comment.
It would be preferable if we could keep the no-await-in-loop linter rule. If the specific use here makes the file more easily readable, it's better to only disable the rule on that particular occurrence.
PS: for the types definitions to be imported as
import type { Field } from '@openstreetmap/id-tagging-schema';we'd need to include "types": "./dist/index.d.ts" in package.json, right?
|
done, also added |
|
@tyrasd yes that's correct, that snippet will need to be added to |
|
Aaah, yes, that makes sense. Sorry, I was once again confused by there being two different repositories for the tagging schema 🙈 |
Besides from iD, there are several typescript projects which use this library. Currently, each project has to write their own type-definitions (see examples from overpass-turbo and osmapp). This is inconvenient and the definitions could easily become out-of-date.
This PR uses json-schema-to-typescript to generate TS definition files for the main JSON files in
dist/*. This means that the next release of @openstreetmap/id-tagging-schema will include.d.json.tsfiles - example hereExamples: