Rpc.Stub<null> instead of raw null. And this does not play nice with anything the caller would want to do afterwards. For example, if (error) does not work to check if we're in the error case, since Rpc.Stub<null> != null; and the same null-check doesn't work for the data object.Rpc.Stub<> for null and undefined. For all other types (number, boolean, custom types, etc) , the generated TS uses the actual type.