Changeset View
Changeset View
Standalone View
Standalone View
web/input/input-state.js
Show All 28 Lines | export type PendingMultimediaUpload = { | ||||
progressPercent: number, | progressPercent: number, | ||||
// This is set once the network request begins and used if the upload is | // This is set once the network request begins and used if the upload is | ||||
// cancelled | // cancelled | ||||
abort: ?() => void, | abort: ?() => void, | ||||
steps: MediaMissionStep[], | steps: MediaMissionStep[], | ||||
selectTime: number, | selectTime: number, | ||||
}; | }; | ||||
export type TypeaheadState = { | |||||
+canBeVisible: boolean, | |||||
+moveChoiceUp: ?() => void, | |||||
+moveChoiceDown: ?() => void, | |||||
+close: ?() => void, | |||||
+accept: ?() => void, | |||||
}; | |||||
// This type represents the input state for a particular thread | // This type represents the input state for a particular thread | ||||
export type InputState = { | export type InputState = { | ||||
+pendingUploads: $ReadOnlyArray<PendingMultimediaUpload>, | +pendingUploads: $ReadOnlyArray<PendingMultimediaUpload>, | ||||
+assignedUploads: { | +assignedUploads: { | ||||
[messageID: string]: $ReadOnlyArray<PendingMultimediaUpload>, | [messageID: string]: $ReadOnlyArray<PendingMultimediaUpload>, | ||||
}, | }, | ||||
+draft: string, | +draft: string, | ||||
+textCursorPosition: number, | +textCursorPosition: number, | ||||
+typeaheadState: TypeaheadState, | |||||
+appendFiles: (files: $ReadOnlyArray<File>) => Promise<boolean>, | +appendFiles: (files: $ReadOnlyArray<File>) => Promise<boolean>, | ||||
+cancelPendingUpload: (localUploadID: string) => void, | +cancelPendingUpload: (localUploadID: string) => void, | ||||
+sendTextMessage: ( | +sendTextMessage: ( | ||||
messageInfo: RawTextMessageInfo, | messageInfo: RawTextMessageInfo, | ||||
threadInfo: ThreadInfo, | threadInfo: ThreadInfo, | ||||
) => Promise<void>, | ) => Promise<void>, | ||||
+createMultimediaMessage: (localID: number, threadInfo: ThreadInfo) => void, | +createMultimediaMessage: (localID: number, threadInfo: ThreadInfo) => void, | ||||
+setDraft: (draft: string) => void, | +setDraft: (draft: string) => void, | ||||
+setTextCursorPosition: (newPosition: number) => void, | +setTextCursorPosition: (newPosition: number) => void, | ||||
+setTypeaheadState: ($Shape<TypeaheadState>) => void, | |||||
+messageHasUploadFailure: (localMessageID: string) => boolean, | +messageHasUploadFailure: (localMessageID: string) => boolean, | ||||
+retryMultimediaMessage: ( | +retryMultimediaMessage: ( | ||||
localMessageID: string, | localMessageID: string, | ||||
threadInfo: ThreadInfo, | threadInfo: ThreadInfo, | ||||
) => void, | ) => void, | ||||
+addReply: (text: string) => void, | +addReply: (text: string) => void, | ||||
+addReplyListener: ((message: string) => void) => void, | +addReplyListener: ((message: string) => void) => void, | ||||
+removeReplyListener: ((message: string) => void) => void, | +removeReplyListener: ((message: string) => void) => void, | ||||
Show All 9 Lines |