36 lines
No EOL
1.2 KiB
TypeScript
36 lines
No EOL
1.2 KiB
TypeScript
import { MatrixEvent, Room } from "matrix-js-sdk";
|
|
|
|
export type KeanuEventExtension = {
|
|
isMxThread?: boolean;
|
|
isChannelMessage?: boolean;
|
|
isPinned?: boolean;
|
|
parentThread?: MatrixEvent & KeanuEventExtension;
|
|
replyEvent?: MatrixEvent & KeanuEventExtension;
|
|
}
|
|
|
|
export type KeanuEvent = MatrixEvent & KeanuEventExtension;
|
|
|
|
export type EventAttachmentUrlType = "src" | "thumbnail";
|
|
export type EventAttachmentUrlData = {data: string, type: EventAttachmentUrlType};
|
|
|
|
export type EventAttachment = {
|
|
event: KeanuEvent;
|
|
name: string;
|
|
src?: string;
|
|
srcSize: number;
|
|
srcProgress: number;
|
|
srcPromise?: Promise<EventAttachmentUrlData>;
|
|
thumbnail?: string;
|
|
thumbnailProgress: number;
|
|
thumbnailPromise?: Promise<EventAttachmentUrlData>;
|
|
autoDownloadable: boolean;
|
|
loadSrc: () => Promise<EventAttachmentUrlData>;
|
|
loadThumbnail: () => Promise<EventAttachmentUrlData>;
|
|
loadBlob: () => Promise<{data: Blob}>;
|
|
release: (src: boolean, thumbnail: boolean) => void;
|
|
};
|
|
|
|
|
|
export type KeanuRoom = Room & {
|
|
displayType: "im.keanu.room_type_default" | "im.keanu.room_type_voice" | "im.keanu.room_type_file" | "im.keanu.room_type_channel" | undefined;
|
|
} |