Guest User

Untitled

a guest
Apr 25th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. interface LoginInterface {
  2. username: string;
  3. password: string;
  4. }
  5.  
  6. const MyObject = {
  7. credentials: null as LoginInterface,
  8. otherInfo: "I'm something not relevant to this question"
  9. }
  10.  
  11. const MyObject: {
  12. credentials: LoginInterface,
  13. otherInfo: string
  14. } = {
  15. credentials: null,
  16. otherInfo: "I'm something not relevant to this question"
  17. };
  18.  
  19. const MyObject: { credentials: ?LoginInterface } = {
  20. credentials: null,
  21. otherInfo: "I'm something not relevant to this question"
  22. }
  23.  
  24. type MyType = { credentials: ?LoginInterface, otherInfo?: string }
Add Comment
Please, Sign In to add comment