0.1.4 #4

Merged
Thilawyn merged 68 commits from next into master 2024-02-20 01:39:38 +01:00
2 changed files with 7 additions and 5 deletions
Showing only changes of commit 3cf5733869 - Show all commits

View File

@@ -14,7 +14,9 @@ export type AddAbstractToImplClass<
StaticAbstract extends {},
> = (
Class<
Abstract & InstanceType<ImplClass>,
Abstract &
InstanceType<ImplClass>,
ConstructorParameters<ImplClass>
> &
StaticAbstract &
@@ -22,7 +24,7 @@ export type AddAbstractToImplClass<
)
export type RemoveAbstractFromImplClass<
ImplClassWithAbstract extends Class<Abstract, []> & { _tag: TraitApplierSuperTag },
ImplClassWithAbstract extends Class<Abstract, []> & StaticAbstract & { _tag: TraitApplierSuperTag },
Abstract extends {},
StaticAbstract extends {},
> = (
@@ -153,11 +155,11 @@ export namespace Trait {
export function trait<
Abstract extends {},
StaticAbstract extends {},
ImplClassWithAbstract extends Class<Abstract, []> & { _tag: TraitApplierSuperTag },
ImplClassWithAbstract extends Class<Abstract, []> & StaticAbstract & { _tag: TraitApplierSuperTag },
>(
abstract: Opaque<Abstract, AbstractTag>,
staticAbstract: Opaque<StaticAbstract, AbstractTag>,
apply: (Super: AbstractClass<Abstract> & { _tag: TraitApplierSuperTag }) => ImplClassWithAbstract,
apply: (Super: AbstractClass<Abstract> & StaticAbstract & { _tag: TraitApplierSuperTag }) => ImplClassWithAbstract,
) {
return new Trait(
emptyTraitExpression,

View File

@@ -55,7 +55,7 @@ export class TraitExpression<
This extends TraitExpression<typeof TraitExpression.NullSuperclass, any, any>,
SubtraitAbstract extends Implements<This>,
SubtraitStaticAbstract extends ImplementsStatic<This>,
SubtraitImplClassWithAbstract extends Class<SubtraitAbstract, []> & { _tag: TraitApplierSuperTag },
SubtraitImplClassWithAbstract extends Class<SubtraitAbstract, []> & SubtraitStaticAbstract & { _tag: TraitApplierSuperTag },
>(
this: This,
abstract: (expression: This) => Opaque<SubtraitAbstract, AbstractTag>,