Skip to content

Commit ca63564

Browse files
committed
add types for escape and unescape methods microsoft#18813
although the issue is marked working as expected, it is important to mention that most major browsers maintain support for escape and unescape, and some javascript codebases moving to typescript may have escape and unescape in them. They are valid JavaScript, and thus they should be included in the global definition.
1 parent e821c2b commit ca63564

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib/es5.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ declare function encodeURI(uri: string): string;
6262
*/
6363
declare function encodeURIComponent(uriComponent: string): string;
6464

65+
/**
66+
* Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
67+
* @param string A string value
68+
*/
69+
declare function escape(string: string): string;
70+
71+
/**
72+
* Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.
73+
* @param string A string value
74+
*/
75+
declare function unescape(string: string): string;
76+
6577
interface PropertyDescriptor {
6678
configurable?: boolean;
6779
enumerable?: boolean;

0 commit comments

Comments
 (0)