diff --git a/literal_union.ts b/literal_union.ts new file mode 100644 index 0000000..0850df4 --- /dev/null +++ b/literal_union.ts @@ -0,0 +1,13 @@ +type LiteralUnion = Suggestions | (string & {}); + +type ImageMimiTypes = + "image/bmp" | + "image/gif" | + "image/png" | + "image/svg+xml" | + "image/tiff" | + "image/vnd.microsoft.icon" | + "image/webp"; + +let validValueWithMimeType: LiteralUnion = 'image/bmp'; // this is valid and was suggested automatically +let validValueWithoutMimeType: LiteralUnion = ''; // this is still valid