trusted-types: Prevent structural typing

This commit is contained in:
Jakub Vrana
2019-01-09 14:57:05 +01:00
parent 18af3f8a10
commit 71cbfeded4
+15 -4
View File
@@ -3,10 +3,21 @@
// Definitions by: Jakub Vrana <https://github.com/vrana>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare class TrustedHTML {}
declare class TrustedScript {}
declare class TrustedScriptURL {}
declare class TrustedURL {}
declare class TrustedHTML {
private readonly _TrustedHTMLBrand: true; // To prevent structural typing.
}
declare class TrustedScript {
private readonly _TrustedScriptBrand: true; // To prevent structural typing.
}
declare class TrustedScriptURL {
private readonly _TrustedScriptURLBrand: true; // To prevent structural typing.
}
declare class TrustedURL {
private readonly _TrustedURL: trueBrand; // To prevent structural typing.
}
declare class TrustedTypePolicy {
createHTML(s: string): TrustedHTML;