import { Extension } from '../extension' ; import { Method } from './method' ; import { isString } from './string' ; type FunctionReturn < TR > = ( ) => TR ; export function method < TFunctionReturn , TMock > ( target ) ; export function method < TFunctionReturn , TMock > ( cb ) ; export function method < TFunctionReturn , TMock > ( cbOrTarget ) { if ( isString ( cbOrTarget ) ) { return ( mock ) : Method < TFunctionReturn > => mock [ cbOrTarget ] as Method < TFunctionReturn > ; } else { return cbOrTarget as unknown as ( mock : TMock ) => Method < TFunctionReturn > ; } }