diff --git a/types/angular/angular-tests.ts b/types/angular/angular-tests.ts index 28d01dfc3e..80f97d485d 100644 --- a/types/angular/angular-tests.ts +++ b/types/angular/angular-tests.ts @@ -1481,6 +1481,10 @@ function testIHttpParamSerializerJQLikeProvider() { }); } +function testJqLiteRestoreBehavior() { + angular.UNSAFE_restoreLegacyJqLiteXHTMLReplacement(); // $ExpectType void +} + function anyOf2(v1: T1, v2: T2) { return Math.random() < 0.5 ? v1 : v2; } diff --git a/types/angular/index.d.ts b/types/angular/index.d.ts index e54b8664f6..c43b8ded3f 100644 --- a/types/angular/index.d.ts +++ b/types/angular/index.d.ts @@ -188,6 +188,17 @@ declare namespace angular { * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with. */ resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService; + + /** + * Restores the pre-1.8 behavior of jqLite that turns XHTML-like strings like + * `
` to `
` instead of `
`. + * The new behavior is a security fix so if you use this method, please try to adjust + * to the change & remove the call as soon as possible. + * Note that this only patches jqLite. If you use jQuery 3.5.0 or newer, please read + * [jQuery 3.5 upgrade guide](https://jquery.com/upgrade-guide/3.5/) for more details + * about the workarounds. + */ + UNSAFE_restoreLegacyJqLiteXHTMLReplacement(): void; } ///////////////////////////////////////////////////////////////////////////