0.1.2 #9

Merged
Thilawyn merged 8 commits from next into master 2024-01-27 23:40:19 +01:00
Showing only changes of commit 47907c67b7 - Show all commits

View File

@@ -18,9 +18,11 @@ export type Trait<
C extends AbstractClass<any>
> = Opaque<
TraitApplier<C>,
"thilatrait/Trait"
"@thilawyn/thilatrait/Trait"
>
export type TraitApplierTag = "@thilawyn/thilatrait/Trait"
/**
* Represents the function signature for applying a trait to a parent class.
* @template C - The abstract class type.
@@ -28,7 +30,7 @@ export type Trait<
export type TraitApplier<
C extends AbstractClass<any>
> =
(Parent: AbstractConstructor<object>) => C
(Parent: Opaque<AbstractConstructor<object>, TraitApplierTag>) => Opaque<C, TraitApplierTag>
/**
* Returns the class type of a trait.
@@ -154,7 +156,7 @@ export function extendsAndExpresses<
) {
return traits.reduce(
(previous, trait) => trait(previous),
extend,
extend as Opaque<C, TraitApplierTag>,
) as (
AbstractClass<
InstanceType<C> &