-
Notifications
You must be signed in to change notification settings - Fork 0
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
better exporting of types #43
Conversation
I basically now generate a export { ProtobufSchema } from './proto'
export { JSONSchema } from './schema' both refer to a mixed type that can the be imported like: /**
* @property {import('./types').JSONSchema} obj
*/ However one cannot access individual schemas from there like so: /**
THIS WON'T WORK
* @property {import('./types').JSONSchema.Observation} observation
*/ Since i.e Observation is not actually a field inside JSONSchema. /**
THIS WILL WORK
* @property {import('./types/schema').Observation} observation
*/ this works since each |
An alternative to referring to individual types would be exporting every JSONSchema and Proto types from export { Observation_5 as ObservationProto } from './proto/observation/v5'
export { Observation_4 as ObservationProto_4 } from './proto/observation/v4' this, I think, would allow to do smth like /**
* @param {import ('./types').ObservationProto} observation
*/ instead of /**
* @param {import ('./types/proto').Observation} observation
*/ I don't have any preferences, so open to suggestions... |
Cool, that works for me. I'll do some quick experiments using/integrating this. |
This PR addresses #39 and #38