mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-12 01:10:15 +00:00
add type defs for community automatic review
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export declare const enableI18nFeature: import("@lib/interfaces/ServiceModule").ServiceFeatureFunction<keyof import("../../lib/src/services/ServiceHub").ServiceHub<import("../../lib/src/services/base/ServiceBase").ServiceContext>, keyof import("@lib/interfaces/ServiceModule").ServiceModules, Promise<boolean>>;
|
||||
Vendored
+37
@@ -0,0 +1,37 @@
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
import { type LogFunction } from "@lib/services/lib/logUtils";
|
||||
/**
|
||||
* Flag file handler interface, similar to target filter pattern.
|
||||
*/
|
||||
interface FlagFileHandler {
|
||||
priority: number;
|
||||
check: () => Promise<boolean>;
|
||||
handle: () => Promise<boolean>;
|
||||
}
|
||||
/**
|
||||
* Factory function to create a fetch all flag handler.
|
||||
* All logic related to fetch all flag is encapsulated here.
|
||||
*/
|
||||
export declare function createFetchAllFlagHandler(host: NecessaryServices<"vault" | "fileProcessing" | "tweakValue" | "UI" | "setting" | "appLifecycle" | "path" | "keyValueDB" | "database", "storageAccess" | "rebuilder" | "fileHandler">, log: LogFunction): FlagFileHandler;
|
||||
/**
|
||||
* Adjust setting to remote configuration.
|
||||
* @param config current configuration to retrieve remote preferred config
|
||||
* @returns updated configuration if applied, otherwise null.
|
||||
*/
|
||||
/**
|
||||
* Factory function to create a rebuild flag handler.
|
||||
* All logic related to rebuild flag is encapsulated here.
|
||||
*/
|
||||
export declare function createRebuildFlagHandler(host: NecessaryServices<"setting" | "appLifecycle" | "UI" | "tweakValue", "storageAccess" | "rebuilder">, log: LogFunction): {
|
||||
priority: number;
|
||||
check: () => Promise<boolean>;
|
||||
handle: () => Promise<boolean>;
|
||||
};
|
||||
/**
|
||||
* Factory function to create a suspend all flag handler.
|
||||
* All logic related to suspend flag is encapsulated here.
|
||||
*/
|
||||
export declare function createSuspendFlagHandler(host: NecessaryServices<"setting", "storageAccess">, log: LogFunction): FlagFileHandler;
|
||||
export declare function flagHandlerToEventHandler(flagHandler: FlagFileHandler): () => Promise<boolean>;
|
||||
export declare function useRedFlagFeatures(host: NecessaryServices<"API" | "appLifecycle" | "UI" | "setting" | "tweakValue" | "fileProcessing" | "vault" | "path" | "keyValueDB" | "database", "storageAccess" | "rebuilder" | "fileHandler">): void;
|
||||
export {};
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
import { type LogFunction } from "@lib/services/lib/logUtils";
|
||||
import { type FullScanOptions } from "@lib/serviceFeatures/offlineScanner";
|
||||
export declare const SIMPLE_FETCH_STAGE1_REMOTE_WINS = "Overwrite all with remote files";
|
||||
export declare const SIMPLE_FETCH_STAGE1_NEWER_WINS = "Compare time and take newer";
|
||||
export declare const SIMPLE_FETCH_STAGE1_LEGACY = "Use the detailed flow";
|
||||
export declare const SIMPLE_FETCH_STAGE1_CANCEL = "Cancel";
|
||||
export declare const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE = "Keep local files even if not on remote";
|
||||
export declare const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL = "Delete local files if not on remote";
|
||||
export declare const SIMPLE_FETCH_STAGE2_NEWER_CLEANUP = "Delete local files if deleted on remote";
|
||||
export declare const SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL = "Keep local files even if deleted on remote";
|
||||
export declare const STAGE2_ABORT = "Cancel all and reboot";
|
||||
export declare function askSimpleFetchMode(host: NecessaryServices<"UI" | "vault", "storageAccess">): Promise<{
|
||||
mode: string;
|
||||
options: Partial<FullScanOptions>;
|
||||
} | "cancelled" | "aborted">;
|
||||
export declare function askAndPerformFastSetupOnScheduledFetchAll(host: NecessaryServices<"vault" | "fileProcessing" | "tweakValue" | "UI" | "setting" | "appLifecycle" | "path" | "keyValueDB" | "database", "storageAccess" | "rebuilder" | "fileHandler">, log: LogFunction, cleanupFlag: () => Promise<void>): Promise<boolean | undefined>;
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
import { type LogFunction } from "@lib/services/lib/logUtils";
|
||||
import type { ObsidianLiveSyncSettings } from "@lib/common/models/setting.type";
|
||||
export declare function isFlagFileExist(host: NecessaryServices<never, "storageAccess">, path: string): Promise<boolean>;
|
||||
export declare function deleteFlagFile(host: NecessaryServices<never, "storageAccess">, log: LogFunction, path: string): Promise<void>;
|
||||
/**
|
||||
* Adjust setting to remote configuration.
|
||||
* @param config current configuration to retrieve remote preferred config
|
||||
* @returns updated configuration if applied, otherwise null.
|
||||
*/
|
||||
export declare function adjustSettingToRemote(host: NecessaryServices<"tweakValue" | "UI" | "setting", never>, log: LogFunction, config: ObsidianLiveSyncSettings): Promise<ObsidianLiveSyncSettings | undefined>;
|
||||
/**
|
||||
* Adjust setting to remote if needed.
|
||||
* @param extra result of dialogues that may contain preventFetchingConfig flag (e.g, from FetchEverything or RebuildEverything)
|
||||
* @param config current configuration to retrieve remote preferred config
|
||||
*/
|
||||
export declare function adjustSettingToRemoteIfNeeded(host: NecessaryServices<"tweakValue" | "UI" | "setting", never>, log: LogFunction, extra: {
|
||||
preventFetchingConfig: boolean;
|
||||
}, config: ObsidianLiveSyncSettings): Promise<void>;
|
||||
/**
|
||||
* Process vault initialisation with suspending file watching and sync.
|
||||
* @param proc process to be executed during initialisation, should return true if can be continued, false if app is unable to continue the process.
|
||||
* @param keepSuspending whether to keep suspending file watching after the process.
|
||||
* @returns result of the process, or false if error occurs.
|
||||
*/
|
||||
export declare function processVaultInitialisation(host: NecessaryServices<"setting", never>, log: LogFunction, proc: () => Promise<boolean>, keepSuspending?: boolean): Promise<boolean>;
|
||||
export declare function verifyAndUnlockSuspension(host: NecessaryServices<"setting" | "appLifecycle" | "UI", never>, log: LogFunction): Promise<boolean>;
|
||||
@@ -0,0 +1,6 @@
|
||||
import { type SetupManager } from "@/modules/features/SetupManager";
|
||||
import type { SetupFeatureHost } from "@lib/serviceFeatures/setupObsidian/types";
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
export declare function openSetupURI(setupManager: SetupManager): Promise<void>;
|
||||
export declare function openP2PSettings(host: SetupFeatureHost, setupManager: SetupManager): Promise<boolean>;
|
||||
export declare function useSetupManagerHandlersFeature(host: NecessaryServices<"API" | "UI" | "setting" | "appLifecycle", never>, setupManager: SetupManager): void;
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { LogFunction } from "@lib/services/lib/logUtils";
|
||||
import type { SetupFeatureHost } from "@lib/serviceFeatures/setupObsidian/types";
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
import { type SetupManager } from "@/modules/features/SetupManager";
|
||||
export declare function registerSetupProtocolHandler(host: SetupFeatureHost, log: LogFunction, setupManager: SetupManager): void;
|
||||
export declare function useSetupProtocolFeature(host: NecessaryServices<"API" | "UI" | "setting" | "appLifecycle", never>, setupManager: SetupManager): void;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import type { NecessaryServices } from "@lib/interfaces/ServiceModule";
|
||||
import { type UseP2PReplicatorResult } from "@lib/replication/trystero/UseP2PReplicatorResult";
|
||||
import { P2PLogCollector } from "@lib/replication/trystero/P2PLogCollector";
|
||||
import type { LiveSyncCore } from "@/main";
|
||||
/**
|
||||
* ServiceFeature: P2P Replicator lifecycle management.
|
||||
* Binds a LiveSyncTrysteroReplicator to the host's lifecycle events,
|
||||
* following the same middleware style as useOfflineScanner.
|
||||
*
|
||||
* @param viewTypeAndFactory Optional [viewType, factory] pair for registering the P2P pane view.
|
||||
* When provided, also registers commands and ribbon icon via services.API.
|
||||
*/
|
||||
export declare function useP2PReplicatorUI(host: NecessaryServices<"API" | "appLifecycle" | "setting" | "vault" | "database" | "databaseEvents" | "keyValueDB" | "replication" | "config" | "UI" | "replicator", never>, core: LiveSyncCore, replicator: UseP2PReplicatorResult): {
|
||||
replicator: import("../lib/src/replication/trystero/LiveSyncTrysteroReplicator").LiveSyncTrysteroReplicator;
|
||||
p2pLogCollector: P2PLogCollector;
|
||||
storeP2PStatusLine: import("octagonal-wheels/dataobject/reactive_v2").ReactiveSource<string>;
|
||||
};
|
||||
Reference in New Issue
Block a user