/** * Resolves a function that accepts both the object argument fields of F1 and F2. * The function returns an intersection of what F1 and F2 return. * * @public */ export type MergeFunctions = F1 extends (arg: infer A1) => infer R1 ? F2 extends (arg: infer A2) => infer R2 ? R1 extends Promise ? (arg?: A1 & A2) => Promise & Awaited> : (arg?: A1 & A2) => R1 & R2 : never : never;