Typehint and check $ids parameter.