Last active
February 7, 2023 15:23
-
-
Save pffigueiredo/33e920d30e602a4aa94e4c9f5063e766 to your computer and use it in GitHub Desktop.
Revisions
-
pffigueiredo revised this gist
Feb 7, 2023 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,4 +3,7 @@ type Prettify<T> = {[K in keyof T]: T[K]} & {}; // autocomplete that also accepts string // so you still have intellisense but it's open to any string type AutoComplete<T extends string> = T | (string & {}); // the value of objects type ValueOf<T extends object> = T[keyof T]; -
pffigueiredo revised this gist
Feb 7, 2023 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,5 @@ type Prettify<T> = {[K in keyof T]: T[K]} & {}; // autocomplete that also accepts string // so you still have intellisense but it's open to any string type AutoComplete<T extends string> = T | (string & {}); -
pffigueiredo created this gist
Feb 7, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ // prettify intersection on types, like `a & b & c` type Prettify<T> = {[K in keyof T]: T[K]} & {}; // autocomplete that also accepts string type AutoComplete<T extends string> = T | (string & {});