加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.d.ts 853 Bytes
一键复制 编辑 原始数据 按行查看 历史
/**
* Replaces text in a string, using a regular expression or search string.
* @param string The input string.
* @param searchValue A string to search for.
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
*/
declare function replaceAsync(
string: string,
searchValue: string | RegExp,
replaceValue: string
): Promise<string>;
/**
* Replaces text in a string, using a regular expression or search string.
* @param string The input string.
* @param searchValue A string to search for.
* @param replacer An async function that returns the replacement text.
*/
declare function replaceAsync(
string: string,
searchValue: string | RegExp,
replacer: (substring: string, ...args: any[]) => Promise<string> | string
): Promise<string>;
export default replaceAsync;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化