use trusted types definitions from definitely typed, https://github.com/microsoft/vscode/issues/106396

This commit is contained in:
Johannes Rieken 2020-10-05 12:28:15 +02:00
parent 625365b723
commit e584897dd8
3 changed files with 6 additions and 36 deletions

View file

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

View file

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

View file

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