import type { ChatEvent } from '../../../shared-kernel'; import type { ChatAttachmentAnnouncement } from '../../../shared-kernel'; export type FileAnnounceEvent = ChatEvent & { type: 'file-announce'; messageId: string; file: ChatAttachmentAnnouncement; }; export type FileChunkEvent = ChatEvent & { type: 'file-chunk'; messageId: string; fileId: string; index: number; total: number; data: string; fromPeerId?: string; }; export type FileRequestEvent = ChatEvent & { type: 'file-request'; messageId: string; fileId: string; fromPeerId?: string; }; export type FileCancelEvent = ChatEvent & { type: 'file-cancel'; messageId: string; fileId: string; fromPeerId?: string; }; export type FileNotFoundEvent = ChatEvent & { type: 'file-not-found'; messageId: string; fileId: string; }; export type FileAnnouncePayload = Pick; export interface FileChunkPayload { messageId?: string; fileId?: string; fromPeerId?: string; index?: number; total?: number; data?: ChatEvent['data']; } export type FileRequestPayload = Pick; export type FileCancelPayload = Pick; export type FileNotFoundPayload = Pick; export type LocalFileWithPath = File & { path?: string; };