Closed valadaptive closed 1 year ago
Upon revisiting this, I went with a simpler solution--expand AvroSchema
to include Type
instances and arrays of Type
instances. This makes Schema
an alias of AvroSchema
, but I think that's fine. I'd like to revisit the typings more heavily in the future anyway.
Sounds reasonable.
I'd like to revisit the typings more heavily in the future anyway.
In case it's useful, you can take a look at the typings for @avro/types
here. Some of the methods have been renamed but the API is very similar. (The @avro/*
packages were an attempt to decompose avsc
into focused components but I never found the time to complete the migration. With the introduction of exports
it also isn't as important anymore.)
In a type schema, union members can be type schemas or predefined
avro.Type
instances:This adds support for that in the TypeScript definitions.