export interface AppendOptions { sep?: string; eq?: string; decodeURIComponent?: (str: string) => string; encodeURIComponent?: (str: string) => string; filter?: (key: string, val: any) => any; } /** * 在 URL 地址后追加 query 参数 * * @example * ```js * append('http://demo.com', 'a=1&b=1&c=1'); * // 'http://demo.com?a=1&b=1&c=1' * * append('http://demo.com?test=1#hash', 'a=1&b=1&c=1'); * // 'http://demo.com?test=1&a=1&b=1&c=1#hash' * * append('http://demo.com', { a: 1, b: 1, c: 1 }); * // 'http://demo.com?a=1&b=1&c=1' * * append('http://demo.com?test=1#hash', { a: 1, b: 1, c: 1 }); * // 'http://demo.com?test=1&a=1&b=1&c=1#hash' * * append('http://demo.com', 'a=1&b=1&c=1&hideTopbar=1&hideSidebar=1', { * filter(key) { * return key !== 'hideTopbar' && key !== 'hideSidebar'; * }, * }) * // 'http://demo.com?a=1&b=1&c=1' * * append('http://demo.com', { a: 1, b: 1, c: 1, hideTopbar: 1, hideSidebar: 1 }, { * filter(key) { * return key !== 'hideTopbar' && key !== 'hideSidebar'; * }, * }) * // 'http://demo.com?a=1&b=1&c=1' * ``` * * @param url URL 地址 * @param query 以字符串或者对象形式的 query 参数 * @param opts 可选参数 * @returns 追加 query 参数后的 URL 地址 */ export declare function append(url: string, query: string | object, opts?: AppendOptions): string;