UNPKG

t-comm

Version:

专业、稳定、纯粹的工具库

27 lines (26 loc) 786 B
/** * 判断是否为腾讯文档链接 * @param url 待判断的链接 * * @example * ```ts * isTencentDocLink('https://docs.qq.com/doc/xxx'); // true * isTencentDocLink('https://example.com'); // false * ``` */ export declare function isTencentDocLink(url?: string): boolean; /** * 打开腾讯文档链接 * * - H5 环境下:直接 `window.location.href` 跳转 * - 小程序环境下:跳转到腾讯文档小程序详情页 * * @param jumpUrl 腾讯文档链接(必须以 `https://docs.qq.com/doc` 开头) * @returns 是否为腾讯文档链接(仅当链接合法时执行跳转并返回 true) * * @example * ```ts * openTencentDocLink('https://docs.qq.com/doc/xxx'); * ``` */ export declare function openTencentDocLink(jumpUrl?: string): boolean;