-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.d.ts
More file actions
25 lines (23 loc) · 853 Bytes
/
index.d.ts
File metadata and controls
25 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* 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;