Skip to content

Commit 55df8ec

Browse files
committed
Create trusted-types.ts
1 parent 48b7d78 commit 55df8ec

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

unittests/files/trusted-types.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
declare const assertNotAssignable: <T>() => <T1>(
2+
_x: T1,
3+
) => T1 extends T
4+
? { error: "Right side should not be assignable to left side" }
5+
: () => void;
6+
7+
const policy = trustedTypes.createPolicy("policy");
8+
9+
document.body.innerHTML = "foo";
10+
document.body.innerHTML = policy.createHTML("foo");
11+
12+
declare const position: GeolocationPosition;
13+
assertNotAssignable<typeof document.head.innerHTML>()(position)();
14+
15+
const html: string = document.body.innerHTML;

0 commit comments

Comments
 (0)