Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh export annotations; add some more to race with other PRs #4975

Merged
merged 5 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/Centerer.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ type Props = $ReadOnly<{|
* @prop [padding] - Specifies if the components should be padded.
*/
export default class Centerer extends PureComponent<Props> {
static defaultProps = {
static defaultProps: {| padding: boolean |} = {
padding: false,
};

render() {
render(): Node {
const { children, padding, style } = this.props;

return (
Expand Down
2 changes: 1 addition & 1 deletion src/common/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const IconRight: SpecificIconType = makeIcon(Feather, 'chevron-right');
export const IconPlusCircle: SpecificIconType = makeIcon(Feather, 'plus-circle');
export const IconLeft: SpecificIconType = makeIcon(Feather, 'chevron-left');
export const IconPeople: SpecificIconType = makeIcon(Feather, 'users');
export const IconPerson = makeIcon(Feather, 'user');
export const IconPerson: SpecificIconType = makeIcon(Feather, 'user');
export const IconImage: SpecificIconType = makeIcon(Feather, 'image');
export const IconCamera: SpecificIconType = makeIcon(Feather, 'camera');
export const IconTerminal: SpecificIconType = makeIcon(Feather, 'terminal');
Expand Down
11 changes: 6 additions & 5 deletions src/nav/navSelectors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* @flow strict-local */
import type { NavigationState, Route } from '@react-navigation/native';
import type { NavigationState, Route, ScreenParams } from '@react-navigation/native';

import * as NavigationService from './NavigationService';

Expand All @@ -11,13 +11,14 @@ const getNavigationIndex = () => getNavState().index;

const getCurrentRoute = (): void | Route<string> => getNavigationRoutes()[getNavigationIndex()];

export const getCurrentRouteName = () => getCurrentRoute()?.name;
export const getCurrentRouteName = (): void | string => getCurrentRoute()?.name;

export const getCurrentRouteParams = () => getCurrentRoute()?.params;
export const getCurrentRouteParams = (): void | ScreenParams => getCurrentRoute()?.params;

export const getChatScreenParams = () => getCurrentRouteParams() ?? { narrow: undefined };
export const getChatScreenParams = (): ScreenParams | {| narrow: void |} =>
getCurrentRouteParams() ?? { narrow: undefined };

export const getSameRoutesCount = () => {
export const getSameRoutesCount = (): number => {
const routes = getNavigationRoutes();
let i = routes.length - 1;
while (i >= 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/reactUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function useDebugAssertConstant<T>(value: T) {
* The caller must use a constant `duration` through the lifetime of a given
* component instance.
*/
export const useHasStayedTrueForMs = (value: boolean, duration: number) => {
export const useHasStayedTrueForMs = (value: boolean, duration: number): boolean => {
useDebugAssertConstant(duration);

const [result, setResult] = useState<boolean>(false);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ const messageSound = new Sound('zulip.mp3', Sound.MAIN_BUNDLE, (error: Error) =>
}
});

export const playMessageSound = () => messageSound.play();
export const playMessageSound = (): $FlowFixMe => messageSound.play();