Extracts a union of all keys of T whose values are functions. This is useful for constraining a parameter or property to only name a method that actually exists on a given type.
T
The object type to inspect.
0.9.8
interface MyApi { fetch(url: string): Promise<Response>; retry(url: string): Promise<Response>; baseUrl: string;}type ApiMethods = TypeFuncNames<MyApi>;// => "fetch" | "retry" ("baseUrl" is excluded because it is not a function) Copy
interface MyApi { fetch(url: string): Promise<Response>; retry(url: string): Promise<Response>; baseUrl: string;}type ApiMethods = TypeFuncNames<MyApi>;// => "fetch" | "retry" ("baseUrl" is excluded because it is not a function)
Extracts a union of all keys of
Twhose values are functions. This is useful for constraining a parameter or property to only name a method that actually exists on a given type.