Skip to content

Commit 1331522

Browse files
committed
Avoid using types defined in @types/trusted-types
1 parent d823366 commit 1331522

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

build/monaco/monaco.d.ts.recipe

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,25 @@ declare namespace monaco {
3434
*/
3535
getWorkerUrl?(workerId: string, label: string): string;
3636
/**
37-
* Create a trust types policy (same API as window.trustedTypes.createPolicy)
37+
* Create a trusted types policy (same API as window.trustedTypes.createPolicy)
3838
*/
39-
createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions>(
39+
createTrustedTypesPolicy(
4040
policyName: string,
41-
policyOptions?: Options,
42-
): undefined | Pick<TrustedTypePolicy<Options>, 'name' | Extract<keyof Options, keyof TrustedTypePolicyOptions>>;
41+
policyOptions?: ITrustedTypePolicyOptions,
42+
): undefined | ITrustedTypePolicy;
43+
}
44+
45+
export interface ITrustedTypePolicyOptions {
46+
createHTML?: (input: string, ...arguments: any[]) => string;
47+
createScript?: (input: string, ...arguments: any[]) => string;
48+
createScriptURL?: (input: string, ...arguments: any[]) => string;
49+
}
50+
51+
export interface ITrustedTypePolicy {
52+
readonly name: string;
53+
createHTML?(input: string): any;
54+
createScript?(input: string): any;
55+
createScriptURL?(input: string): any;
4356
}
4457

4558
export interface IDisposable {

src/vs/monaco.d.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,25 @@ declare namespace monaco {
3434
*/
3535
getWorkerUrl?(workerId: string, label: string): string;
3636
/**
37-
* Create a trust types policy (same API as window.trustedTypes.createPolicy)
37+
* Create a trusted types policy (same API as window.trustedTypes.createPolicy)
3838
*/
39-
createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions>(
39+
createTrustedTypesPolicy(
4040
policyName: string,
41-
policyOptions?: Options,
42-
): undefined | Pick<TrustedTypePolicy<Options>, 'name' | Extract<keyof Options, keyof TrustedTypePolicyOptions>>;
41+
policyOptions?: ITrustedTypePolicyOptions,
42+
): undefined | ITrustedTypePolicy;
43+
}
44+
45+
export interface ITrustedTypePolicyOptions {
46+
createHTML?: (input: string, ...arguments: any[]) => string;
47+
createScript?: (input: string, ...arguments: any[]) => string;
48+
createScriptURL?: (input: string, ...arguments: any[]) => string;
49+
}
50+
51+
export interface ITrustedTypePolicy {
52+
readonly name: string;
53+
createHTML?(input: string): any;
54+
createScript?(input: string): any;
55+
createScriptURL?(input: string): any;
4356
}
4457

4558
export interface IDisposable {

0 commit comments

Comments
 (0)