We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 48b7d78 commit 55df8ecCopy full SHA for 55df8ec
unittests/files/trusted-types.ts
@@ -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