0.1.0 #1
@@ -1,7 +1,7 @@
|
||||
import { Fn } from "hotscript"
|
||||
import { AbstractClass, Class, Opaque } from "type-fest"
|
||||
import { StaticMembers } from "./util"
|
||||
import { AbstractTag } from "."
|
||||
import { StaticMembers } from "./util"
|
||||
|
||||
|
||||
type AddAbstractToImpl<
|
||||
@@ -97,7 +97,7 @@ export interface TraitInstanceFn extends Fn {
|
||||
export type TraitApplierSuperTag = "@thilawyn/traitify-ts/TraitApplierSuper"
|
||||
|
||||
export type TraitApplier<
|
||||
Abstract extends object,
|
||||
Abstract extends {},
|
||||
ImplWithAbstract extends Class<Abstract, []>,
|
||||
> = (
|
||||
(Super: Opaque<AbstractClass<Abstract>, TraitApplierSuperTag>) => (
|
||||
@@ -110,9 +110,7 @@ export function trait<
|
||||
ImplWithAbstract extends Class<Abstract, []>,
|
||||
>(
|
||||
abstract: Opaque<Abstract, AbstractTag>,
|
||||
apply: (Super: Opaque<AbstractClass<Abstract>, TraitApplierSuperTag>) => (
|
||||
Opaque<ImplWithAbstract, TraitApplierSuperTag>
|
||||
),
|
||||
apply: TraitApplier<Abstract, ImplWithAbstract>,
|
||||
): Trait<
|
||||
Abstract,
|
||||
RemoveAbstractFromImpl<ImplWithAbstract, Abstract>
|
||||
|
||||
Reference in New Issue
Block a user