This commit is contained in:
@@ -6,7 +6,7 @@ import pkg from "./package.json" assert { type: "json" }
|
|||||||
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
input: "src/index.ts",
|
input: "src/lib.ts",
|
||||||
|
|
||||||
output: [
|
output: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,14 @@
|
|||||||
import { Call, Fn, Pipe, Tuples } from "hotscript"
|
import { Call, Fn, Pipe, Tuples } from "hotscript"
|
||||||
import { AbstractClass, Class, Opaque, Simplify } from "type-fest"
|
import { AbstractClass, Class, Opaque } from "type-fest"
|
||||||
import { AbstractTag, RemoveAbstractFromImplClass, Trait, TraitApplierSuperTag } from "."
|
import { AbstractTag, RemoveAbstractFromImplClass, Trait, TraitApplierSuperTag } from "."
|
||||||
import { CommonKeys, ExtendFn, KeysOnlyInLeft, SimplifyFn, StaticMembersFn } from "./util"
|
import { ExtendFn, SimplifyFn, StaticMembersFn } from "./util"
|
||||||
|
|
||||||
|
|
||||||
|
type RemoveSupertraitsAbstractFromAbstract<Left, Right> = {
|
||||||
|
[Key in Extract<keyof Left, keyof Right>]: Left[Key]
|
||||||
|
} & {
|
||||||
|
[Key in Exclude<keyof Left, keyof Right>]: Left[Key]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export class TraitExpression<
|
export class TraitExpression<
|
||||||
@@ -54,10 +61,7 @@ export class TraitExpression<
|
|||||||
) {
|
) {
|
||||||
return new Trait(
|
return new Trait(
|
||||||
this,
|
this,
|
||||||
{} as Simplify<
|
{} as RemoveSupertraitsAbstractFromAbstract<SubtraitAbstract, Implements<typeof this>>,
|
||||||
CommonKeys<SubtraitAbstract, Implements<typeof this>> &
|
|
||||||
KeysOnlyInLeft<SubtraitAbstract, Implements<typeof this>>
|
|
||||||
>,
|
|
||||||
apply as any as (Super: AbstractClass<{}>) => RemoveAbstractFromImplClass<SubtraitImplClassWithAbstract, SubtraitAbstract>,
|
apply as any as (Super: AbstractClass<{}>) => RemoveAbstractFromImplClass<SubtraitImplClassWithAbstract, SubtraitAbstract>,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
5
src/lib.ts
Normal file
5
src/lib.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
export {
|
||||||
|
abstract, expression, trait,
|
||||||
|
type Trait,
|
||||||
|
type TraitExpression
|
||||||
|
} from "."
|
||||||
Reference in New Issue
Block a user