import { TypePlainObject } from '../types'; /** * 将参数设置到 location.search 上 * @method setQuery * @param {String} url URL字符串 * @param {Object} query 参数对象 * @return {String} 拼接好参数的URL字符串 * @example * import { setQuery } from '@spore-ui/tskit'; * setQuery('localhost'); // 'localhost' * setQuery('localhost', {a: 1}); // 'localhost?a=1' * setQuery('', {a: 1}); // '?a=1' * setQuery('localhost?a=1', {a: 2}); // 'localhost?a=2' * setQuery('localhost?a=1', {a: ''}); // 'localhost?a=' * setQuery('localhost?a=1', {a: null}); // 'localhost' * setQuery('localhost?a=1', {b: 2}); // 'localhost?a=1&b=2' * setQuery('localhost?a=1&b=1', {a: 2, b: 3}); // 'localhost?a=2&b=3' * setQuery('localhost#a=1', {a: 2, b: 3}); // 'localhost?a=2&b=3#a=1' * setQuery('#a=1', {a: 2, b: 3}); // '?a=2&b=3#a=1' */ export declare function setQuery(href: string, query?: TypePlainObject): string; export default setQuery;