There is still some inconsistency between what a *Def stores, and what a *Type represents. To avoid this, it's probably better to use UnderlyingType from ref-napi rather than generating it ourselves. E.g:
type MyStructType = UnderlyingType<typeof MyStructDef>;
instead of
type MyStructType = StructObject<MyStruct>;
since the TS typing and the coerced ref-napiNamedType may not align exactly.
There is still some inconsistency between what a
*Def
stores, and what a*Type
represents. To avoid this, it's probably better to useUnderlyingType
fromref-napi
rather than generating it ourselves. E.g:instead of
since the TS typing and the coerced
ref-napi
NamedType
may not align exactly.