This commit is contained in:
10
src/trait.ts
10
src/trait.ts
@@ -5,8 +5,8 @@ import { StaticMembers } from "./util"
|
||||
|
||||
|
||||
type AddAbstractToImpl<
|
||||
Impl extends Class<object, []>,
|
||||
Abstract extends object,
|
||||
Impl extends Class<{}, []>,
|
||||
Abstract extends {},
|
||||
> = (
|
||||
Class<
|
||||
InstanceType<Impl> & Abstract,
|
||||
@@ -17,7 +17,7 @@ type AddAbstractToImpl<
|
||||
|
||||
type RemoveAbstractFromImpl<
|
||||
ImplWithAbstract extends Class<Abstract, []>,
|
||||
Abstract extends object,
|
||||
Abstract extends {},
|
||||
> = (
|
||||
Class<
|
||||
Omit<InstanceType<ImplWithAbstract>, keyof Abstract>,
|
||||
@@ -30,8 +30,8 @@ type RemoveAbstractFromImpl<
|
||||
export type TraitTag = "@thilawyn/traitify-ts/Trait"
|
||||
|
||||
export type Trait<
|
||||
Abstract extends object,
|
||||
Impl extends Class<object, []>,
|
||||
Abstract extends {},
|
||||
Impl extends Class<{}, []>,
|
||||
> = (
|
||||
Opaque<{
|
||||
readonly apply: TraitApplier<
|
||||
|
||||
Reference in New Issue
Block a user