summaryrefslogtreecommitdiffhomepage
path: root/src/image-attachments.ts
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-03-29 17:51:22 +0900
committerAdam Malczewski <[email protected]>2026-03-29 17:51:22 +0900
commit73c25761f6b879d78ebd8ecddac35881848831db (patch)
tree10c3e7e585e44dbd38aeef07295c39d93c9d1fec /src/image-attachments.ts
parente8d107e454b3804e089a33ce5fe7c931040d4647 (diff)
downloadai-pulse-obsidian-plugin-73c25761f6b879d78ebd8ecddac35881848831db.tar.gz
ai-pulse-obsidian-plugin-73c25761f6b879d78ebd8ecddac35881848831db.zip
enable image attachments to the chatHEADmain
Diffstat (limited to 'src/image-attachments.ts')
-rw-r--r--src/image-attachments.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/image-attachments.ts b/src/image-attachments.ts
new file mode 100644
index 0000000..add2afd
--- /dev/null
+++ b/src/image-attachments.ts
@@ -0,0 +1,24 @@
+export interface ImageAttachment {
+ base64: string;
+ mimeType: string;
+ originalName: string;
+ arrayBuffer: ArrayBuffer;
+}
+
+let currentAttachments: ImageAttachment[] = [];
+
+export function setCurrentAttachments(attachments: ImageAttachment[]): void {
+ currentAttachments = attachments;
+}
+
+export function getCurrentAttachments(): ImageAttachment[] {
+ return currentAttachments;
+}
+
+export function clearCurrentAttachments(): void {
+ currentAttachments = [];
+}
+
+export function hasCurrentAttachments(): boolean {
+ return currentAttachments.length > 0;
+}