Guest User

Untitled

a guest
Feb 24th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. export interface Screen {
  2. screen: string;
  3. }
  4.  
  5. export interface ResetScreen<T> extends Screen {
  6. passProps?: T;
  7. }
  8.  
  9. export interface PushedScreen<T> extends ResetScreen<T> {
  10. }
  11.  
  12. interface BioProps {
  13. username: string;
  14. }
  15.  
  16. function push<T>(params: PushedScreen<T>) {
  17. return params.passProps;
  18. }
  19.  
  20. push<BioProps>({ screen: 'hi', passProps: { username: 'hi' } });
Add Comment
Please, Sign In to add comment