Utility type that adds a fn parameter to each method in the input type T, transforming the original method's parameter types and return type into a function type.
fn
T
// Input:interface MyInterface { method1(a: string, b: number): boolean; method2(x: Foo, y: Bar): void;}// Output:interface MyInterfaceWithFn { method1(fn: (a: string, b: number) => boolean): void; method2(fn: (x: Foo, y: Bar) => void): void;}
Generated using TypeDoc
Utility type that adds a
fn
parameter to each method in the input typeT
, transforming the original method's parameter types and return type into a function type.Example