diff --git a/src/public/app/server_types.ts b/src/public/app/server_types.ts new file mode 100644 index 000000000..cdbb1c9ec --- /dev/null +++ b/src/public/app/server_types.ts @@ -0,0 +1,18 @@ +// TODO: Deduplicate with src/services/entity_changes_interface.ts +export interface EntityChange { + id?: number | null; + noteId?: string; + entityName: string; + entityId: string; + entity?: any; + positions?: Record; + hash: string; + utcDateChanged?: string; + utcDateModified?: string; + utcDateCreated?: string; + isSynced: boolean | 1 | 0; + isErased: boolean | 1 | 0; + componentId?: string | null; + changeId?: string | null; + instanceId?: string | null; +} \ No newline at end of file diff --git a/src/public/app/services/froca_updater.ts b/src/public/app/services/froca_updater.ts index 2c850881d..d936a5495 100644 --- a/src/public/app/services/froca_updater.ts +++ b/src/public/app/services/froca_updater.ts @@ -7,7 +7,7 @@ import FBranch, { FBranchRow } from "../entities/fbranch.js"; import FAttribute, { FAttributeRow } from "../entities/fattribute.js"; import FAttachment, { FAttachmentRow } from "../entities/fattachment.js"; import FNote, { FNoteRow } from "../entities/fnote.js"; -import { EntityChange } from "../../../services/entity_changes_interface.js"; +import type { EntityChange } from "../server_types.js" async function processEntityChanges(entityChanges: EntityChange[]) { const loadResults = new LoadResults(entityChanges); diff --git a/src/public/app/services/load_results.ts b/src/public/app/services/load_results.ts index 7945a943e..7627fc2c8 100644 --- a/src/public/app/services/load_results.ts +++ b/src/public/app/services/load_results.ts @@ -1,4 +1,4 @@ -import { EntityChange } from "../../../services/entity_changes_interface.js"; +import { EntityChange } from "../server_types.js"; interface BranchRow { branchId: string; diff --git a/src/public/app/services/ws.ts b/src/public/app/services/ws.ts index 86f047dae..061673470 100644 --- a/src/public/app/services/ws.ts +++ b/src/public/app/services/ws.ts @@ -4,8 +4,8 @@ import server from "./server.js"; import options from "./options.js"; import frocaUpdater from "./froca_updater.js"; import appContext from "../components/app_context.js"; -import { EntityChange } from '../../../services/entity_changes_interface.js'; import { t } from './i18n.js'; +import { EntityChange } from '../server_types.js'; type MessageHandler = (message: any) => void; const messageHandlers: MessageHandler[] = [];