Type annotation for function does not recognize imported type