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