TypeScript: fixed selectSwitch/flatMapLatest definition

fixes #304