chore: make SignatureKey generic instead of using unknown

This commit is contained in:
Jos de Jong 2023-01-04 14:32:44 +01:00
parent e468ec72dd
commit bd05dc9267

View File

@ -66,10 +66,10 @@ export interface Signatures<T> {
re: (a: T) => RealType<T>
}
type SignatureKey = keyof Signatures<unknown>
type SignatureKey<T> = keyof Signatures<T>
export type Signature<Name extends SignatureKey, T> = Signatures<T>[Name]
export type Returns<Name extends SignatureKey, T> = ReturnType<Signatures<T>[Name]>
export type Dependencies<Name extends SignatureKey, T> = {[K in Name]: Signature<K, T>}
export type Signature<Name extends SignatureKey<T>, T> = Signatures<T>[Name]
export type Returns<Name extends SignatureKey<T>, T> = ReturnType<Signatures<T>[Name]>
export type Dependencies<Name extends SignatureKey<T>, T> = {[K in Name]: Signature<K, T>}
export type AliasOf<Name extends string, T> = T & {aliasOf?: Name}