Skip to content

Commit 153ee6e

Browse files
committed
types: Again make toplevel-declared types exact, where no errors.
Similar to 7037393 a few months ago: done for the same reasons, and in the exact same way. The remaining cases that cause errors are mostly examples of #3451, so we can convert them to exact object types as we fix that. And then there are a handful of types that are genuinely meant to be inexact object types. When we upgrade soon to Flow v0.84 (as part of #3399), we can make those explicit; tracking that as #3452.
1 parent e863fe8 commit 153ee6e

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

src/api/registerForEvents.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { Auth } from './transportTypes';
33
import type { Narrow } from './apiTypes';
44
import { apiPost, objectToParams } from './apiFetch';
55

6-
type RegisterForEventsParams = {
6+
type RegisterForEventsParams = {|
77
apply_markdown?: boolean,
88
client_gravatar?: boolean,
99
all_public_streams?: boolean,
@@ -12,7 +12,7 @@ type RegisterForEventsParams = {
1212
include_subscribers?: boolean,
1313
narrow?: Narrow,
1414
queue_lifespan_secs?: number,
15-
};
15+
|};
1616

1717
/** See https://zulipchat.com/api/register-queue */
1818
export default (auth: Auth, params: RegisterForEventsParams) =>

src/api/users/updateUserStatus.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import type { ApiResponseSuccess, Auth } from '../transportTypes';
33
import { apiPost, objectToParams } from '../apiFetch';
44

5-
type UserStatusParams = {
5+
type UserStatusParams = {|
66
away?: boolean,
77
status_text?: string,
8-
};
8+
|};
99

1010
export default (auth: Auth, params: UserStatusParams): Promise<ApiResponseSuccess> =>
1111
apiPost(auth, 'users/me/status', objectToParams(params));

src/common/GroupAvatar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const styles = StyleSheet.create({
1717
},
1818
});
1919

20-
type Props = {
20+
type Props = {|
2121
names: string,
2222
size: number,
2323
shape: 'rounded' | 'square',
2424
children?: React$Node,
2525
onPress?: () => void,
26-
};
26+
|};
2727

2828
/**
2929
* Renders a text avatar based on a single or multiple user's

src/common/UserAvatar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import { ImageBackground, View } from 'react-native';
55
import type { Node as React$Node } from 'react';
66
import Touchable from './Touchable';
77

8-
type Props = {
8+
type Props = {|
99
avatarUrl: string,
1010
size: number,
1111
shape: 'rounded' | 'square',
1212
children?: React$Node,
1313
onPress?: () => void,
14-
};
14+
|};
1515

1616
/**
1717
* Renders an image of the user's avatar.

src/title-buttons/titleButtonFromNarrow.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import ExtraNavButtonTopic from './ExtraNavButtonTopic';
1919

2020
type Props = {| color: string, narrow: Narrow |};
2121
type NarrowNavButton = ComponentType<Props>;
22-
type NarrowNavButtonCandidate = {
22+
type NarrowNavButtonCandidate = {|
2323
isFunc: Narrow => boolean,
2424
ButtonComponent: NarrowNavButton | null,
25-
};
25+
|};
2626

2727
const infoButtonHandlers: NarrowNavButtonCandidate[] = [
2828
{ isFunc: isHomeNarrow, ButtonComponent: null },

src/user-status/UserStatusScreen.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const styles = StyleSheet.create({
2424
},
2525
});
2626

27-
type Props = {
27+
type Props = {|
2828
dispatch: Dispatch,
2929
userStatusText: string,
30-
};
30+
|};
3131

32-
type State = {
32+
type State = {|
3333
statusText: string,
34-
};
34+
|};
3535

3636
class UserStatusScreen extends PureComponent<Props, State> {
3737
state = {

0 commit comments

Comments
 (0)