arktype
arktype copied to clipboard
Find a better strategy for external/internal implementation type compat
Currently in arktype
and @arktype/schema
, there are lots of RawX
and InternalX
style types that represent inner objects. There is also a .internal
prop on the external object that allows access to those.
However, the internal and external versions are not compatible in either direction in terms of types despite that they represent the same value at runtime. Beyond some cases where I can use .internal
, it just results in tons of casting.
I'd like to find a more cohesive strategy to deal with this.