Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export interface Screen {
- screen: string;
- }
- export interface ResetScreen<T> extends Screen {
- passProps?: T;
- }
- export interface PushedScreen<T> extends ResetScreen<T> {
- }
- interface BioProps {
- username: string;
- }
- function push<T>(params: PushedScreen<T>) {
- return params.passProps;
- }
- push<BioProps>({ screen: 'hi', passProps: { username: 'hi' } });
Add Comment
Please, Sign In to add comment