Created
February 7, 2025 14:42
-
-
Save Kcko/7c768cacc1735dc51e20457e6d9df5bb to your computer and use it in GitHub Desktop.
This file contains 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 characters
/* | |
Required je utility typ v TypeScriptu, který změní všechny vlastnosti daného typu na povinné (required). | |
*/ | |
interface User1 { | |
id: number; | |
name?: string; | |
email?: string; | |
} | |
type RequiredUser = Required<User1>; | |
const user1: RequiredUser = { | |
id: 1, | |
name: 'Alice', | |
email: '[email protected]', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment