diff --git a/package.json b/package.json index 8af485bec87116194b9fdab2f69c63ffadec779e..2a72973c515b9b8d523d1243f4525a397e44c7a3 100644 --- a/package.json +++ b/package.json @@ -91,6 +91,7 @@ "@types/mocha": "2.2.39", "@types/node": "^12.11.7", "@types/sinon": "^1.16.36", + "@types/trusted-types": "^1.0.6", "@types/vscode-windows-registry": "^1.0.0", "@types/webpack": "^4.4.10", "@types/windows-foreground-love": "^0.3.0", diff --git a/src/typings/trustedTypes.d.ts b/src/typings/trustedTypes.d.ts deleted file mode 100644 index feb4af291844ebaf60a8371cfc6169fa088c2c2d..0000000000000000000000000000000000000000 --- a/src/typings/trustedTypes.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// see https://w3c.github.io/webappsec-trusted-types/dist/spec/ -// this isn't complete nor 100% correct - -type TrustedHTML = string & object; -type TrustedScript = string; -type TrustedScriptURL = string; - -interface TrustedTypePolicyOptions { - createHTML?: (value: string) => string - createScript?: (value: string) => string - createScriptURL?: (value: string) => string -} - -interface TrustedTypePolicy { - readonly name: string; - createHTML(input: string, ...more: any[]): TrustedHTML - createScript(input: string, ...more: any[]): TrustedScript - createScriptURL(input: string, ...more: any[]): TrustedScriptURL -} - -interface TrustedTypePolicyFactory { - createPolicy(policyName: string, object: TrustedTypePolicyOptions): TrustedTypePolicy; -} - -interface Window { - trustedTypes: TrustedTypePolicyFactory | undefined; -} - -interface WorkerGlobalScope { - trustedTypes: TrustedTypePolicyFactory | undefined; -} diff --git a/yarn.lock b/yarn.lock index a38db6751b5bbe5949afeb4c29921e1cb88913ac..e742c87caeb01b6c81c9bf91d98e926670794c33 100644 --- a/yarn.lock +++ b/yarn.lock @@ -295,6 +295,11 @@ resolved "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.4.tgz#b4ffc7dc97b498c969b360a41eee247f82616370" integrity sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ== +"@types/trusted-types@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-1.0.6.tgz#569b8a08121d3203398290d602d84d73c8dcf5da" + integrity sha512-230RC8sFeHoT6sSUlRO6a8cAnclO06eeiq1QDfiv2FGCLWFvvERWgwIQD4FWqD9A69BN7Lzee4OXwoMVnnsWDw== + "@types/uglify-js@*": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.3.tgz#801a5ca1dc642861f47c46d14b700ed2d610840b"