forked from irinazheltisheva/vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrustedTypes.d.ts
More file actions
36 lines (29 loc) · 1.22 KB
/
Copy pathtrustedTypes.d.ts
File metadata and controls
36 lines (29 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*---------------------------------------------------------------------------------------------
* 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;
}