🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@types/trusted-types

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/trusted-types - npm Package Compare versions

Comparing version
1.0.5
to
1.0.6
+8
-19
trusted-types/index.d.ts

@@ -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