Files
traitify-ts/src/util/misc.ts
Julien Valverdé 65092c27cb
All checks were successful
continuous-integration/drone/push Build is passing
0.1.0 (#1)
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com>
Reviewed-on: https://git.jvalver.de/Thilawyn/traitify-ts/pulls/1
2024-02-06 03:15:39 +01:00

26 lines
636 B
TypeScript

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"]>
}