export interface UrlParamsRes { [targetKey: string]: string; } /** * 把字符串转换成 base64 * * @export * @param {string} [str=''] 传入的字符串 * @returns {string} 转成 base64 后的字符串 */ export declare function toBase64Str(str?: string): string; /** * 把 base64 字符串转成普通字符串 * * @export * @param {string} str base64 字符串 * @returns {string} 普通字符串 */ export declare function fromBase64Str(str: string): any; /** * 解析并获取浏览器路由的参数 * * @param {string | undefined} targetKey 需要获取的值的 key, 例如 id=123, 此时为 id * @param {string} href 需要获取的字符串,默认为 window.location.href * @param {boolean} fromBase64 是否 base64 的字符串 * @returns {string | object} 返回获取的结果 */ export declare function getUrlParams(targetKey?: string, href?: string, fromBase64?: boolean): string | object; /** * 解析浏览器的参数 * * @export * @param {string} searchStr 需要解析的路由字符串 * @returns {string} 结果 */ export declare function searchUrlParams(searchStr: string): string; /** * 解析并构造 url * @example * resolveUrl('https://example.com', 'route1', 'route2') -> 'https://example.com/route1/route2' * * @export * @param {string} baseUrl 基准 url * @param {string} paths 路由们 * @returns {string} 解析构造后的 url 结果 */ export declare function resolveUrl(baseUrl: string, ...paths: string[]): string; /** * 解码 base64 后的参数 * * @export * @param {string} sVar 需要解析的 url * @param {boolean} [isParse=false] 是否转换 * @returns {string} */ export declare function decodeHashUrl(sVar: string, isParse?: boolean): any; export interface ParamEntity { [param: string]: any; } export interface WrapUrlParamsOptions { url?: string; params?: ParamEntity; toBase64?: boolean; } /** * 把 params 包装成 query url 的结构 * * @example * urlParamsToQuery({ * url: 'https://a.com', * params: { * ID: "123" * } * }) -> 'https://a.com?ID=123' * * @param {WrapUrlParamsOptions} options 包装配置 * @returns {string} 包装的 url 结果 */ export declare function urlParamsToQuery(options: WrapUrlParamsOptions): string; export declare function wrapReqHashUrl(): any; /** * 打开新的窗口 * * @param {WrapUrlParamsOptions} options * @param {string} windowParamStr 标准浏览器的配置 * @returns {Window} */ export declare function openWindowUseHashUrl(options: WrapUrlParamsOptions, windowParamStr: string): Window;