@nevware21/ts-utils
    Preparing search index...

    Type Alias TypeFuncNames<T>

    TypeFuncNames: { [key in keyof T]: T[key] extends Function ? key : never }[keyof T]

    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.

    Type Parameters

    • 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)