import type { Attachment, LocalAttachment, SharedLocationResponse } from 'stream-chat'; export type AttachmentUploadState = { /** * `true` once every byte has been sent but the server has not answered yet. Browser upload * progress counts bytes written to the connection, so it reaches 100% before the server * confirms; the indicator is indeterminate in that window. */ uploadConfirmationPending: boolean; /** `true` only while `client.uploadManager` holds a live record for one of the attachments. */ isUploading: boolean; /** * 0-100 while uploading and the transfer length is known, `undefined` otherwise. For several * attachments, their mean. */ progress?: number; }; /** * Reports whether a request for any of the attachments is in flight right now, and how far along * it is. * * The source of truth is `client.uploadManager`, which holds a record only while the request runs. * Attachments returned by the API have no `localMetadata`, so they never match and the upload UI * stays off for sent messages. A pending `localMetadata.uploadState` only selects candidates: a * message that outlives its request (aborted upload, `disconnectUser`, a stale state from an * offline store) shows no progress because it has no live record. `localMetadata.uploadProgress` * is only a fallback for the progress number. * * @param attachments - Attachments to track. Ones that are not pending uploads are ignored. * @returns The combined upload state of the attachments. */ export declare const useAttachmentsUploadState: (attachments: (Attachment | LocalAttachment | SharedLocationResponse | undefined)[]) => AttachmentUploadState; /** Single-attachment convenience wrapper around {@link useAttachmentsUploadState}. */ export declare const useAttachmentUploadState: (attachment?: Attachment | LocalAttachment | SharedLocationResponse) => AttachmentUploadState; //# sourceMappingURL=useAttachmentUploadState.d.ts.map