From 476ce0545af66dd424206a5eb0530dd556efccdb Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 21 Dec 2024 17:50:18 +0200 Subject: [PATCH] chore(client/ts): port services/import --- src/public/app/services/{import.js => import.ts} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/public/app/services/{import.js => import.ts} (92%) diff --git a/src/public/app/services/import.js b/src/public/app/services/import.ts similarity index 92% rename from src/public/app/services/import.js rename to src/public/app/services/import.ts index 6cc3aebe7..b63fde8de 100644 --- a/src/public/app/services/import.js +++ b/src/public/app/services/import.ts @@ -1,11 +1,11 @@ -import toastService from "./toast.js"; +import toastService, { ToastOptions } from "./toast.js"; import server from "./server.js"; import ws from "./ws.js"; import utils from "./utils.js"; import appContext from "../components/app_context.js"; import { t } from "./i18n.js"; -export async function uploadFiles(entityType, parentNoteId, files, options) { +export async function uploadFiles(entityType: string, parentNoteId: string, files: string[], options: Record) { if (!['notes', 'attachments'].includes(entityType)) { throw new Error(`Unrecognized import entity type '${entityType}'.`); } @@ -45,7 +45,7 @@ export async function uploadFiles(entityType, parentNoteId, files, options) { } } -function makeToast(id, message) { +function makeToast(id: string, message: string): ToastOptions { return { id: id, title: t("import.import-status"),