- Fixed: The Fetch that was broken at 0.17.33 has been fixed.

- Refactored again: Internal file sync, plug-in sync and Set up URI have been moved into each file.
This commit is contained in:
vorotamoroz
2023-03-23 16:48:30 +09:00
parent 4998e2ef0b
commit 6f33d23088
7 changed files with 1384 additions and 1245 deletions

27
src/LiveSyncCommands.ts Normal file
View File

@@ -0,0 +1,27 @@
import { EntryDoc } from "./lib/src/types";
import { PouchDB } from "./lib/src/pouchdb-browser.js";
import type ObsidianLiveSyncPlugin from "./main";
export abstract class LiveSyncCommands {
plugin: ObsidianLiveSyncPlugin;
get app() {
return this.plugin.app;
}
get settings() {
return this.plugin.settings;
}
get localDatabase() {
return this.plugin.localDatabase;
}
constructor(plugin: ObsidianLiveSyncPlugin) {
this.plugin = plugin;
}
abstract onunload(): void;
abstract onload(): void | Promise<void>;
abstract onInitializeDatabase(showNotice: boolean): void | Promise<void>;
abstract beforeReplicate(showNotice: boolean): void | Promise<void>;
abstract onResume(): void | Promise<void>;
abstract parseReplicationResultItem(docs: PouchDB.Core.ExistingDocument<EntryDoc>): Promise<boolean> | boolean;
abstract realizeSettingSyncMode(): Promise<void>;
}