mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-10 20:21:41 +08:00
chore(client/ts): port services/import
This commit is contained in:
parent
f15bebd330
commit
476ce0545a
@ -1,11 +1,11 @@
|
|||||||
import toastService from "./toast.js";
|
import toastService, { ToastOptions } from "./toast.js";
|
||||||
import server from "./server.js";
|
import server from "./server.js";
|
||||||
import ws from "./ws.js";
|
import ws from "./ws.js";
|
||||||
import utils from "./utils.js";
|
import utils from "./utils.js";
|
||||||
import appContext from "../components/app_context.js";
|
import appContext from "../components/app_context.js";
|
||||||
import { t } from "./i18n.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<string, string | Blob>) {
|
||||||
if (!['notes', 'attachments'].includes(entityType)) {
|
if (!['notes', 'attachments'].includes(entityType)) {
|
||||||
throw new Error(`Unrecognized import entity type '${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 {
|
return {
|
||||||
id: id,
|
id: id,
|
||||||
title: t("import.import-status"),
|
title: t("import.import-status"),
|
||||||
Loading…
x
Reference in New Issue
Block a user