Closed dustinlacewell closed 5 days ago
In ComponentType I believe there is a missing readonly keyword when attempting to conditionally infer ListType:
ComponentType
readonly
ListType
export type ComponentType<T extends ISchema> = { [key in keyof T]: T[key] extends Type ? ArrayByType[T[key]] : T[key] extends [infer RT, number] ? RT extends Type ? Array<ArrayByType[RT]> : unknown : T[key] extends ISchema ? ComponentType<T[key]> : unknown; };
Should read:
export type ComponentType<T extends ISchema> = { [key in keyof T]: T[key] extends Type ? ArrayByType[T[key]] : T[key] extends readonly [infer RT, number] ? RT extends Type ? Array<ArrayByType[RT]> : unknown : T[key] extends ISchema ? ComponentType<T[key]> : unknown; };
full typescript rewrite:
https://github.com/NateTheGreatt/bitECS/tree/rc-0-4-0
In
ComponentType
I believe there is a missingreadonly
keyword when attempting to conditionally inferListType
:Should read: