More work on export

This commit is contained in:
N-Pex 2025-07-02 15:40:43 +02:00
parent 94bf35875a
commit 2b2c736311
5 changed files with 327 additions and 299 deletions

View file

@ -9,9 +9,7 @@ export type KeanuEventExtension = {
}
export type EventAttachmentUrlType = "src" | "thumbnail";
export type EventAttachmentLoadSrcOptions = {
asBlob?: boolean;
}
export type EventAttachmentUrlData = {data: string, type: EventAttachmentUrlType};
export type EventAttachment = {
event: MatrixEvent & KeanuEventExtension;
@ -19,13 +17,14 @@ export type EventAttachment = {
src?: string;
srcSize: number;
srcProgress: number;
srcPromise?: Promise<{data: string | Blob, type: EventAttachmentUrlType}>;
srcPromise?: Promise<EventAttachmentUrlData>;
thumbnail?: string;
thumbnailProgress: number;
thumbnailPromise?: Promise<{data: string | Blob, type: EventAttachmentUrlType}>;
thumbnailPromise?: Promise<EventAttachmentUrlData>;
autoDownloadable: boolean;
loadSrc: (options?: EventAttachmentLoadSrcOptions) => Promise<{data: string | Blob, type: EventAttachmentUrlType}>;
loadThumbnail: () => Promise<{data: string | Blob, type: EventAttachmentUrlType}>;
loadSrc: () => Promise<EventAttachmentUrlData>;
loadThumbnail: () => Promise<EventAttachmentUrlData>;
loadBlob: () => Promise<{data: Blob}>;
release: (src: boolean, thumbnail: boolean) => void;
};