We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a2550bd + a13f3b1 commit 7cdeda0Copy full SHA for 7cdeda0
literal_union.ts
@@ -0,0 +1,13 @@
1
+type LiteralUnion<Suggestions extends string> = Suggestions | (string & {});
2
+
3
+type ImageMimiTypes =
4
+ "image/bmp" |
5
+ "image/gif" |
6
+ "image/png" |
7
+ "image/svg+xml" |
8
+ "image/tiff" |
9
+ "image/vnd.microsoft.icon" |
10
+ "image/webp";
11
12
+let validValueWithMimeType: LiteralUnion<ImageMimiTypes> = 'image/bmp'; // this is valid and was suggested automatically
13
+let validValueWithoutMimeType: LiteralUnion<ImageMimiTypes> = ''; // this is still valid
0 commit comments