File tree Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Expand file tree Collapse file tree 2 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,25 @@ declare namespace monaco {
34
34
*/
35
35
getWorkerUrl?(workerId: string, label: string): string;
36
36
/**
37
- * Create a trust types policy (same API as window.trustedTypes.createPolicy)
37
+ * Create a trusted types policy (same API as window.trustedTypes.createPolicy)
38
38
*/
39
- createTrustedTypesPolicy<Options extends TrustedTypePolicyOptions> (
39
+ createTrustedTypesPolicy(
40
40
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;
43
56
}
44
57
45
58
export interface IDisposable {
Original file line number Diff line number Diff line change @@ -34,12 +34,25 @@ declare namespace monaco {
34
34
*/
35
35
getWorkerUrl ?( workerId : string , label : string ) : string ;
36
36
/**
37
- * Create a trust types policy (same API as window.trustedTypes.createPolicy)
37
+ * Create a trusted types policy (same API as window.trustedTypes.createPolicy)
38
38
*/
39
- createTrustedTypesPolicy < Options extends TrustedTypePolicyOptions > (
39
+ createTrustedTypesPolicy (
40
40
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 ;
43
56
}
44
57
45
58
export interface IDisposable {
You can’t perform that action at this time.
0 commit comments