提交 e584897d 编写于 作者: J Johannes Rieken

use trusted types definitions from definitely typed,...

use trusted types definitions from definitely typed, https://github.com/microsoft/vscode/issues/106396
上级 625365b7
/*---------------------------------------------------------------------------------------------
* 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;
}
......@@ -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"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册