Typehinting the io interface