0.1.0 (#1)
All checks were successful
continuous-integration/drone/push Build is passing

Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: https://git.jvalver.de/Thilawyn/traitify-ts/pulls/1
This commit was merged in pull request #1.
This commit is contained in:
Julien Valverdé
2024-02-06 03:15:39 +01:00
parent eaaabeec49
commit 65092c27cb
19 changed files with 582 additions and 423 deletions

25
src/util/misc.ts Normal file
View File

@@ -0,0 +1,25 @@
import { Fn } from "hotscript"
import { AbstractClass, Simplify } from "type-fest"
/**
* Represents the common keys between two types.
* @template A - The first type.
* @template B - The second type.
*/
export type CommonKeys<A, B> = Extract<keyof A, keyof B>
export interface SimplifyFn extends Fn {
return: Simplify<this["arg0"]>
}
/**
* Represents the static members of a class.
* @template Class - A class extending AbstractClass.
*/
export type StaticMembers<Class extends AbstractClass<any>> = (
Omit<Class, "prototype">
)
export interface StaticMembersFn extends Fn {
return: StaticMembers<this["arg0"]>
}