devtypes - v1.1.0
    Preparing search index...

    Type Alias MethodNames<T>

    MethodNames: {
        [K in keyof T]-?: T[K] extends (...args: any[]) => any ? K : never
    }[keyof T]

    Extract method names from a class.

    Type Parameters

    • T

      A class or object type

    Returns a union of all callable method names of the class. Does not include readonly or non-function properties.

    class Service { getData() {} setData() {} value = 123; }
    type Methods = MethodNames< Service >; // "getData" | "setData"