Skip to content

Commit

Permalink
Create autocomplete.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
chwoerz authored Nov 29, 2024
1 parent ab3b800 commit a2550bd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autocomplete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type AutoComplete<T extends string> = T | (string & {});

type Lang = AutoComplete<"TypeScript"| "JavaScript">;

const valid: Lang = "Anything";
const alsoValid: Lang = "TypeScript";
// ^ Autocomplete suggestions from ts-server works

0 comments on commit a2550bd

Please sign in to comment.