0.1.1 #8

Merged
Thilawyn merged 6 commits from next into master 2024-01-07 22:49:30 +01:00
Showing only changes of commit ead4844145 - Show all commits

View File

@@ -31,7 +31,7 @@ export type TraitApplier<
(Parent: AbstractConstructor<any>) => C (Parent: AbstractConstructor<any>) => C
/** /**
* Unwraps the type of the class from a given trait. * Returns the class type of a trait.
* @template T - The trait type. * @template T - The trait type.
*/ */
export type TraitClass<T> = export type TraitClass<T> =
@@ -39,6 +39,10 @@ export type TraitClass<T> =
? C ? C
: never : never
/**
* Returns the instance type of a trait.
* @template T - The trait type.
*/
export type TraitInstance<T> = export type TraitInstance<T> =
T extends Trait<infer C> T extends Trait<infer C>
? InstanceType<C> ? InstanceType<C>