26 lines
636 B
TypeScript
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"]>
|
|
}
|