Changeset View
Changeset View
Standalone View
Standalone View
lib/types/user-types.js
// @flow | // @flow | ||||
import type { DefaultNotificationPayload } from './account-types.js'; | import type { DefaultNotificationPayload } from './account-types.js'; | ||||
import type { ClientAvatar } from './avatar-types.js'; | |||||
import type { UserRelationshipStatus } from './relationship-types.js'; | import type { UserRelationshipStatus } from './relationship-types.js'; | ||||
import type { UserInconsistencyReportCreationRequest } from './report-types.js'; | import type { UserInconsistencyReportCreationRequest } from './report-types.js'; | ||||
export type GlobalUserInfo = { | export type GlobalUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: ?string, | +username: ?string, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type GlobalAccountUserInfo = { | export type GlobalAccountUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: string, | +username: string, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type UserInfo = { | export type UserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: ?string, | +username: ?string, | ||||
+relationshipStatus?: UserRelationshipStatus, | +relationshipStatus?: UserRelationshipStatus, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type UserInfos = { +[id: string]: UserInfo }; | export type UserInfos = { +[id: string]: UserInfo }; | ||||
export type AccountUserInfo = { | export type AccountUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: string, | +username: string, | ||||
+relationshipStatus?: UserRelationshipStatus, | +relationshipStatus?: UserRelationshipStatus, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type UserStore = { | export type UserStore = { | ||||
+userInfos: UserInfos, | +userInfos: UserInfos, | ||||
+inconsistencyReports: $ReadOnlyArray<UserInconsistencyReportCreationRequest>, | +inconsistencyReports: $ReadOnlyArray<UserInconsistencyReportCreationRequest>, | ||||
}; | }; | ||||
export type RelativeUserInfo = { | export type RelativeUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: ?string, | +username: ?string, | ||||
+isViewer: boolean, | +isViewer: boolean, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type OldLoggedInUserInfo = { | export type OldLoggedInUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: string, | +username: string, | ||||
+email: string, | +email: string, | ||||
+emailVerified: boolean, | +emailVerified: boolean, | ||||
}; | }; | ||||
export type LoggedInUserInfo = { | export type LoggedInUserInfo = { | ||||
+id: string, | +id: string, | ||||
+username: string, | +username: string, | ||||
+settings?: DefaultNotificationPayload, | +settings?: DefaultNotificationPayload, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; | ||||
export type LoggedOutUserInfo = { | export type LoggedOutUserInfo = { | ||||
+id: string, | +id: string, | ||||
+anonymous: true, | +anonymous: true, | ||||
}; | }; | ||||
export type OldCurrentUserInfo = OldLoggedInUserInfo | LoggedOutUserInfo; | export type OldCurrentUserInfo = OldLoggedInUserInfo | LoggedOutUserInfo; | ||||
export type CurrentUserInfo = LoggedInUserInfo | LoggedOutUserInfo; | export type CurrentUserInfo = LoggedInUserInfo | LoggedOutUserInfo; | ||||
export type PasswordUpdate = { | export type PasswordUpdate = { | ||||
+updatedFields: { | +updatedFields: { | ||||
+password?: ?string, | +password?: ?string, | ||||
}, | }, | ||||
+currentPassword: string, | +currentPassword: string, | ||||
}; | }; | ||||
export type UserListItem = { | export type UserListItem = { | ||||
+id: string, | +id: string, | ||||
+username: string, | +username: string, | ||||
+disabled?: boolean, | +disabled?: boolean, | ||||
+notice?: string, | +notice?: string, | ||||
+alertText?: string, | +alertText?: string, | ||||
+alertTitle?: string, | +alertTitle?: string, | ||||
+avatar?: ?ClientAvatar, | |||||
}; | }; |