Former New York Mayor Rudy Giuliani is in hospital in a critical but stable condition, according to a statement posted on social media.