@types/trusted-types
Advanced tools
@@ -14,12 +14,2 @@ // Type definitions for trusted-types 1.0 | ||
| interface FullTypedPolicy<Options extends TrustedTypePolicyOptions> { | ||
| name: string; | ||
| createHTML(...args: Args<Options, 'createHTML'>): TrustedHTML; | ||
| createScript(...args: Args<Options, 'createScript'>): TrustedScript; | ||
| createScriptURL(...args: Args<Options, 'createScriptURL'>): TrustedScriptURL; | ||
| } | ||
| type TypedPolicy<Options extends TrustedTypePolicyOptions> = | ||
| Pick<FullTypedPolicy<Options>, 'name' | Extract<keyof Options, FnNames>>; | ||
| declare global { | ||
@@ -45,3 +35,3 @@ class TrustedHTML { | ||
| policyOptions?: Options, | ||
| ): TypedPolicy<Options>; | ||
| ): Pick<TrustedTypePolicy<Options>, 'name'|Extract<keyof Options, FnNames>>; | ||
| isHTML(value: unknown): value is TrustedHTML; | ||
@@ -57,7 +47,7 @@ isScript(value: unknown): value is TrustedScript; | ||
| interface TrustedTypePolicy { | ||
| interface TrustedTypePolicy<Options extends TrustedTypePolicyOptions = TrustedTypePolicyOptions> { | ||
| readonly name: string; | ||
| createHTML(input: string, ...arguments: any[]): TrustedHTML; | ||
| createScript(input: string, ...arguments: any[]): TrustedScript; | ||
| createScriptURL(input: string, ...arguments: any[]): TrustedScriptURL; | ||
| createHTML(...args: Args<Options, 'createHTML'>): TrustedHTML; | ||
| createScript(...args: Args<Options, 'createScript'>): TrustedScript; | ||
| createScriptURL(...args: Args<Options, 'createScriptURL'>): TrustedScriptURL; | ||
| } | ||
@@ -72,6 +62,5 @@ | ||
| interface Window { | ||
| // NOTE: This is needed while the implementation in Chrome still relies | ||
| // on the old uppercase name, either of the values below could be | ||
| // undefined. | ||
| // See https://github.com/w3c/webappsec-trusted-types/issues/177 | ||
| // `trustedTypes` is left intentionally optional to make sure that | ||
| // people handle the case when their code is running in a browser not | ||
| // supporting trustedTypes. | ||
| trustedTypes?: TrustedTypePolicyFactory; | ||
@@ -78,0 +67,0 @@ TrustedHTML: TrustedHTML; |
| { | ||
| "name": "@types/trusted-types", | ||
| "version": "1.0.5", | ||
| "version": "1.0.6", | ||
| "description": "TypeScript definitions for trusted-types", | ||
@@ -37,4 +37,4 @@ "license": "MIT", | ||
| "dependencies": {}, | ||
| "typesPublisherContentHash": "e8cc1850e59ef7ac39aed0ac39d6e7834aed7d3e3b080d8793b7919f3dbdd25c", | ||
| "typesPublisherContentHash": "070feae57de6a10c796a05d7d23292a4f7a35ea39b8eedf959f7bab06d65f50e", | ||
| "typeScriptVersion": "3.1" | ||
| } |
@@ -11,3 +11,3 @@ # Installation | ||
| ### Additional Details | ||
| * Last updated: Tue, 28 Jul 2020 21:15:44 GMT | ||
| * Last updated: Fri, 31 Jul 2020 11:47:49 GMT | ||
| * Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
6196
-5.76%65
-12.16%