UNPKG

321 BTypeScriptView Raw
1import type { PropertyKey } from "../index";
2
3declare function GetMethod<O, P extends PropertyKey>(
4 O: O,
5 P: P,
6): P extends keyof O // eslint-disable-next-line @typescript-eslint/ban-types
7 ? NonNullable<O[P]> extends Function ? O[P]
8 : never
9 : ((...args: any) => any) | undefined;
10export = GetMethod;