From 4b0ad7cdfa3d535851260c4a056ff248fe3bbd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=84sperus?= Date: Wed, 12 Aug 2026 20:00:12 +0800 Subject: [PATCH 1/2] fest(UI & observability): improve module panel and support custom log export --- manifest.json | 2 +- packages/i18n/src/ru/translations.ts | 8 +- packages/i18n/src/zh-TW/translations.ts | 7 +- packages/i18n/src/zh/translations.ts | 7 +- packages/plugin/CHANGELOG.md | 6 + packages/plugin/dist/dev.spec.d.ts | 2 +- ...5wq.spec.d.ts => index-2mGPGNnI.spec.d.ts} | 4 +- packages/plugin/dist/index-Ddt5UAXp.spec.d.ts | 1331 +++++++++++++++++ packages/plugin/dist/index.spec.d.ts | 2 +- packages/plugin/package.json | 2 +- .../src/components/module-management/Card.tsx | 19 +- .../src/components/module-management/index.ts | 4 +- packages/plugin/src/en.ts | 8 +- packages/plugin/src/global.css | 21 + packages/plugin/src/index.ts | 11 +- packages/plugin/src/modules/Extensibility.ts | 3 +- packages/plugin/src/modules/ModulesModal.ts | 10 +- packages/plugin/src/modules/Observability.ts | 21 +- packages/plugin/src/settings/development.ts | 20 +- versions.json | 3 +- 20 files changed, 1429 insertions(+), 62 deletions(-) rename packages/plugin/dist/{index-zKP375wq.spec.d.ts => index-2mGPGNnI.spec.d.ts} (99%) create mode 100644 packages/plugin/dist/index-Ddt5UAXp.spec.d.ts diff --git a/manifest.json b/manifest.json index 73d5cca..559e46c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "sync-engine", "name": "Sync Engine", - "version": "3.0.4", + "version": "3.0.5", "minAppVersion": "1.12.3", "authorUrl": "https://hesprs.github.io", "description": "The next-generation syncing plugin: Fast · Free · Extend with Modules. Supports WebDAV and S3.", diff --git a/packages/i18n/src/ru/translations.ts b/packages/i18n/src/ru/translations.ts index 4eeedfe..b431ceb 100644 --- a/packages/i18n/src/ru/translations.ts +++ b/packages/i18n/src/ru/translations.ts @@ -104,7 +104,6 @@ const ru: Translations = { development: 'Разработка', diffMatchPatch: 'Объединить', disableModule: 'Отключить модуль', - disabled: 'Отключено', done: 'Готово', download: 'Скачать', downloadModule: 'Скачать модуль', @@ -114,13 +113,14 @@ const ru: Translations = { editSources: 'Редактировать источники', enable: 'Включить', enableModule: 'Включить модуль', - enabled: 'Включено', exclusionRules: 'Правила исключения', exclusionRulesDescription: 'Файлы и папки, соответствующие этим glob-шаблонам, не будут синхронизироваться. Не забудьте указать расширения файлов (например, .md), если хотите исключить файлы.', executing: 'Выполняется', export: 'Экспорт', - exportLogsDescription: 'Экспортировать логи плагина в файл внутри хранилища.', + exportLogsDescription: + 'Экспортировать логи плагина в файл внутри хранилища. Укажите папку для экспорта логов в поле ниже.', + exportLogsDirectoryPlaceholder: 'Укажите папку для экспорта логов', exportLogsFailed: 'Не удалось экспортировать логи', exportLogsToFile: 'Экспортировать логи в файл', failed: 'Ошибка', @@ -204,10 +204,10 @@ const ru: Translations = { noMatchingModulesFound: 'Подходящие модули не найдены.', noModulesAvailable: 'Нет доступных модулей.', none: 'Нет', - notInstalled: 'Не установлено', noticeStatusOnMobile: 'Уведомления о статусе на мобильных устройствах', noticeStatusOnMobileDescription: 'Отображать всплывающее уведомление на мобильных устройствах во время синхронизации. Заменяет строку состояния, используемую на ПК.', + official: 'Официальный', omittedInvalidEntry: 'Пропущено недействительных записей: {{count}}.', openPanel: 'Открыть панель', realtimeSync: 'Синхронизация в реальном времени', diff --git a/packages/i18n/src/zh-TW/translations.ts b/packages/i18n/src/zh-TW/translations.ts index 1d1f48e..6f8df23 100644 --- a/packages/i18n/src/zh-TW/translations.ts +++ b/packages/i18n/src/zh-TW/translations.ts @@ -102,7 +102,6 @@ const zhTW: Translations = { development: '開發者選項', diffMatchPatch: '文字合併', disableModule: '停用模組', - disabled: '已停用', done: '完成', download: '下載', downloadModule: '下載模組', @@ -112,13 +111,13 @@ const zhTW: Translations = { editSources: '編輯來源', enable: '啟用', enableModule: '啟用模組', - enabled: '已啟用', exclusionRules: '排除規則', exclusionRulesDescription: '符合這些 Glob 萬用字元模式的檔案或資料夾將不會進行同步。若要排除特定檔案,請記得加上副檔名(例如 .md)。', executing: '執行中', export: '匯出', - exportLogsDescription: '將外掛程式紀錄匯出至儲存庫中的檔案。', + exportLogsDescription: '將外掛程式紀錄匯出至儲存庫中的檔案。請在欄位中設定紀錄匯出目錄。', + exportLogsDirectoryPlaceholder: '設定紀錄匯出的目標目錄', exportLogsFailed: '匯出紀錄失敗', exportLogsToFile: '匯出紀錄至檔案', failed: '失敗', @@ -198,9 +197,9 @@ const zhTW: Translations = { noMatchingModulesFound: '未找到符合條件的模組。', noModulesAvailable: '無可用模組。', none: '無', - notInstalled: '未安裝', noticeStatusOnMobile: '行動裝置同步狀態通知', noticeStatusOnMobileDescription: '同步進行時於行動裝置上顯示通知訊息(取代桌面版的狀態列)。', + official: '官方', omittedInvalidEntry: '已忽略 {{count}} 項無效條目。', openPanel: '開啟面板', realtimeSync: '即時同步', diff --git a/packages/i18n/src/zh/translations.ts b/packages/i18n/src/zh/translations.ts index 332e332..9d410ea 100644 --- a/packages/i18n/src/zh/translations.ts +++ b/packages/i18n/src/zh/translations.ts @@ -90,7 +90,6 @@ const zh: Translations = { development: '开发', diffMatchPatch: '合并', disableModule: '禁用模块', - disabled: '已禁用', done: '完成', download: '下载', downloadModule: '下载模块', @@ -100,13 +99,13 @@ const zh: Translations = { editSources: '编辑源', enable: '启用', enableModule: '启用模块', - enabled: '已启用', exclusionRules: '排除规则', exclusionRulesDescription: '匹配这些 Glob 模式的文件 / 文件夹将不会被同步。如果您想排除文件,请记得添加文件扩展名(例如 .md)。', executing: '正在执行', export: '导出', - exportLogsDescription: '将插件日志导出到库中的文件中。', + exportLogsDescription: '将插件日志导出到仓库中的文件。请在输入框中设置日志导出目录。', + exportLogsDirectoryPlaceholder: '设置日志导出的目录', exportLogsFailed: '导出日志失败', exportLogsToFile: '导出日志到文件', failed: '失败', @@ -185,10 +184,10 @@ const zh: Translations = { noMatchingModulesFound: '未找到匹配的模块。', noModulesAvailable: '没有可用模块。', none: '无', - notInstalled: '未安装', noticeStatusOnMobile: '移动端同步状态提示', noticeStatusOnMobileDescription: '同步进行时在移动设备上显示通知提示。在桌面端则会替换状态栏显示。', + official: '官方', omittedInvalidEntry: '已忽略 {{count}} 条无效条目。', openPanel: '打开面板', realtimeSync: '实时同步', diff --git a/packages/plugin/CHANGELOG.md b/packages/plugin/CHANGELOG.md index 858dff0..a92544d 100644 --- a/packages/plugin/CHANGELOG.md +++ b/packages/plugin/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## Sync Engine v3.0.5 - 2026-08-12 + +- Fixed the bug that non-root hidden files and folders cannot be discovered in syncing by @pedrovillalobos. +- Improved module card display and adjusted panel size on mobile by @hesprs. +- Made log export directory configurable by @hesprs. + ## Sync Engine v3.0.4 - 2026-08-10 - Fixed the bug that "Rename and keep both" conflict resolution strategy duplicates content locally instead of propagate over remote. diff --git a/packages/plugin/dist/dev.spec.d.ts b/packages/plugin/dist/dev.spec.d.ts index 5784217..36a2be7 100644 --- a/packages/plugin/dist/dev.spec.d.ts +++ b/packages/plugin/dist/dev.spec.d.ts @@ -1,4 +1,4 @@ -import { Ct as FolderStat, St as FileStat, f as Request, p as RequestParam, ut as Fs, vt as RootFs, xt as Binary, yt as WrappedFs } from "./index-zKP375wq.spec.js"; +import { Ct as FolderStat, St as FileStat, f as Request, p as RequestParam, ut as Fs, vt as RootFs, xt as Binary, yt as WrappedFs } from "./index-Ddt5UAXp.spec.js"; //#region src/sdk/debug-wrapper.d.ts declare function debugWrapper(original: Fs, log: (content: string) => void): WrappedFs; //#endregion diff --git a/packages/plugin/dist/index-zKP375wq.spec.d.ts b/packages/plugin/dist/index-2mGPGNnI.spec.d.ts similarity index 99% rename from packages/plugin/dist/index-zKP375wq.spec.d.ts rename to packages/plugin/dist/index-2mGPGNnI.spec.d.ts index b1fd665..50ab23d 100644 --- a/packages/plugin/dist/index-zKP375wq.spec.d.ts +++ b/packages/plugin/dist/index-2mGPGNnI.spec.d.ts @@ -948,20 +948,18 @@ declare class Bootstrap { //#region src/components/module-management/index.d.ts type ModuleManagementTranslations = { disableModule: string; - disabled: string; downloadModule: string; enableModule: string; - enabled: string; installed: string; loadingModules: string; noInstalledModulesFound: string; noMatchingModulesFound: string; noModulesAvailable: string; - notInstalled: string; updateAvailable: string; updateModule: string; deleteModule: string; editModuleInformation: string; + official: string; }; //#endregion //#region src/components/SourceEditorModal.d.ts diff --git a/packages/plugin/dist/index-Ddt5UAXp.spec.d.ts b/packages/plugin/dist/index-Ddt5UAXp.spec.d.ts new file mode 100644 index 0000000..5d1fbe0 --- /dev/null +++ b/packages/plugin/dist/index-Ddt5UAXp.spec.d.ts @@ -0,0 +1,1331 @@ +import { App, Command, EventRef, IconName, ListedFiles, Modal, Plugin, RequestUrlParam, Stat, ToggleComponent } from "obsidian"; +//#region test/e2e-utils.d.ts +type General$1 = any; +//#endregion +//#region src/types.d.ts +type MaybePromise = Promise | T; +type TogglableValue = { + enabled: boolean; + value: T; +}; +type FileStat = { + isDir: false; + key: string; + mtime: number; + size: number; + uid: string; +}; +type FolderStat = { + isDir: true; + key: string; +}; +type Stat$1 = FileStat | FolderStat; +type RecordStat = { + isDir: false; + local: string; + remote: string; +} | { + isDir: true; +}; +type StatsMap = Map; +type RecordStatsMap = Map; +type GlobMatchRule = { + expr: string; + caseSensitive: boolean; +}; +type Progress = { + total: number; + completed: number; + current?: T; +}; +type Binary = Uint8Array; +//#endregion +//#region src/fs/interface.d.ts +/** + * All keys use unified format: + * - root: `/` + * - file: `note.md`, `folder/note.md` + * - folder: `folder/`, `folder/nested/` + */ +type RootFs = { + getUid(): string; + read(key: string, stat: FileStat): MaybePromise; + readStream(key: string, stat: FileStat): MaybePromise>; + write(key: string, value: Binary, stat: FileStat): MaybePromise; + writeStream(key: string, value: ReadableStream, stat: FileStat): MaybePromise; + delete(key: string): MaybePromise; + move(oldKey: string, newKey: string): MaybePromise; + mkdir(key: string, recursive?: boolean): MaybePromise; + stat(key: string): MaybePromise; + exists(key: string): MaybePromise; + list(key: string, reporter: ListReporter): MaybePromise>; +}; +type ListReporter = (progress: Required) => MaybePromise<'include' | 'exclude' | 'advance'>; +type WrappedFs = RootFs & { + original: Fs; +}; +type Fs = WrappedFs | RootFs; +type WriteAtom = { + type: 'write'; + key: string; + execute: () => MaybePromise; + resolve: (uid: string) => void; + reject: (err: Error) => void; +}; +type DeleteAtom = { + type: 'delete'; + key: string; + execute: () => MaybePromise; + resolve: () => void; + reject: (err: Error) => void; +}; +type MoveAtom = { + type: 'move'; + oldKey: string; + newKey: string; + execute: () => MaybePromise; + resolve: () => void; + reject: (err: Error) => void; +}; +type MkdirAtom = { + type: 'mkdir'; + key: string; + execute: () => MaybePromise; + resolve: () => void; + reject: (err: Error) => void; +}; +type InputAtom = WriteAtom | DeleteAtom | MoveAtom | MkdirAtom; +type CustomAtom = { + type: 'custom'; + execute: () => MaybePromise; +}; +type OutputAtom = InputAtom | CustomAtom; +type OptimizerInput = { + atoms: Array; + fs: Fs; + executeAtom: (atom: OutputAtom) => Promise; +}; +type OptimizerOutput = Array; +type BatchOptimizer = (input: OptimizerInput) => OptimizerOutput; +//#endregion +//#region ../../node_modules/.bun/uni-kv@..+..+uni-kv.tgz/node_modules/uni-kv/dist/interface.d.ts +//#region src/interface.d.ts +type Database, M extends Record, F extends boolean> = { + getStore(name: K): Store; + getStoreNames(): IsPromise, F>; + deleteStore(name: string): IsPromise; + clearStores(): IsPromise; + getMeta(key: T): IsPromise; + setMeta(key: T, value: M[T]): IsPromise; + dispose(): IsPromise; +}; +type Store = { + get(key: string): IsPromise; + set(key: string, value: T): IsPromise; + delete(key: string): IsPromise; + clear(): IsPromise; + keys(): IsPromise, F>; + values(): IsPromise, F>; + entries(): IsPromise, F>; + batch(operations: Array>): IsPromise>, F>; +}; +type StoreSync = Store; +type StoreAsync = Store; +type DatabaseSync = Record, M extends Record = {}> = Database; +type DatabaseAsync = Record, M extends Record = {}> = Database; +type GetOperation = { + type: 'get'; + key: string; +}; +type GetResult = { + key: string; + value: T | undefined; +}; +type SetOperation = { + type: 'set'; + key: string; + value: T; +}; +type DeleteOperation = { + type: 'delete'; + key: string; +}; +type StoreOperations = GetOperation | SetOperation | DeleteOperation; +type IsPromise = F extends true ? Promise : T; +//#endregion +//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/context.d.ts +//#region src/context.d.ts +type General = any; +type GeneralConstructor = new (...args: Array) => General; +type ModuleConstructor = new (context: C) => General; +type GeneralModuleInput = ReadonlyArray | ReadonlyArray; +type IsPlainObject = T extends object ? T extends Function | Date | RegExp | Array | Map | Set ? false : true : false; +type ShallowMerge = IsPlainObject extends true ? (IsPlainObject extends true ? Omit & B : B) : B; +type Keys = T extends General ? keyof T : never; +type InstanceEach = T extends ReadonlyArray ? { [K in keyof T]: InstanceType; } : T; +type PickEach, K extends PropertyKey> = { [I in keyof T]: Pick>; }; +type RootValue = RootKey extends keyof T ? Extract : {}; +type MergeRootEach> = { [I in keyof T]: ShallowMerge, RootValue>; }; +type ExtractKeyEach, K extends Keys> = { [I in keyof T]: K extends keyof T[I] ? T[I][K] : never; }; +type MergeObjects, O extends ReadonlyArray = MergeRootEach> = { [P in Keys]: MergeValues>; }; +type MergeSingleKey[number]>> = MergeValues, K>>; +type MergePair = [A] extends [never] ? B : [B] extends [never] ? A : ShallowMerge; +type MergeValues> = T extends readonly [infer First, ...infer Rest] ? [First] extends [never] ? MergeValues : Rest extends ReadonlyArray ? Rest['length'] extends 0 ? First : MergePair> : never : never; +type MergeResult[number]>, Pr extends object, Po extends object> = MergeObjects<[Pr, ...PickEach, K>, Po]>; +type Context$1[number]>, Pr extends object = {}, Po extends object = {}> = MergeResult & { + __modules__: WeakMap[number]>; + __getModule__: InstanceEach[number]>(ctor: C) => InstanceType; + __addModule__: >>(newModule: N) => Context$1<[...M, N], K, Pr, Po>; + __assign__: (obj: Partial>) => Context$1; +}; +declare const ROOT_KEY = "root"; +type RootKey = typeof ROOT_KEY; +//#endregion +//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/reactive.d.ts +//#region src/reactive.d.ts +type RefMatchingFunc = (newValue: T, oldValue: T) => unknown; +type Ref = { + (): T; + (newValue: T): void; + subscribe(func: RefMatchingFunc, options?: { + immediate?: boolean; + }): () => void; + unsubscribe(func: RefMatchingFunc): void; + clear(): void; +}; +//#endregion +//#region src/modules/EventBus.d.ts +type Dispatch = (...[key, payload]: undefined extends O[K] ? [K] : [K, O[K]]) => void; +type On = (key: K, callback: (payload: O[K]) => void) => () => void; +declare class EventBus { + readonly events: { + logSync: string; + logGeneral: string; + errorSync: string; + errorGeneral: string; + }; + private readonly cleanupCallbacks; + private readonly isIdle; + private readonly syncLogs; + private readonly generalLogs; + constructor(); + private readonly getThisSync; + private readonly putSyncLog; + private readonly putGeneralLog; + private readonly subscribers; + private readonly on; + private readonly dispatch; + private readonly getLogs; + readonly dispose: () => void; + readonly root: { + dispatch: Dispatch; + getLogs: () => string; + isIdle: Ref; + on: On; + }; +} +//#endregion +//#region src/modules/I18n.d.ts +type ObsidianLanguageCode = 'en' | 'af' | 'am' | 'ar' | 'az' | 'be' | 'bg' | 'bn' | 'ca' | 'cs' | 'da' | 'de' | 'dv' | 'el' | 'en-GB' | 'eo' | 'es' | 'eu' | 'fa' | 'fi' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ka' | 'kh' | 'kn' | 'ko' | 'ky' | 'la' | 'lt' | 'lv' | 'ml' | 'ms' | 'nan-TW' | 'ne' | 'nl' | 'nn' | 'no' | 'oc' | 'or' | 'pl' | 'pt' | 'pt-BR' | 'ro' | 'ru' | 'sa' | 'si' | 'sk' | 'sl' | 'sq' | 'sr' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'vi' | 'zh' | 'zh-TW'; +type Primitive = string | number | boolean | null | undefined; +type Fragment = (frag: DocumentFragment, args: A) => void; +type TranslationResource = Record>; +type InterpolationValues = Record; +type TranslateParams | string> = R extends Fragment ? ([undefined] extends [A] ? [] : [A]) : [] | [InterpolationValues]; +type Translate = (key: K, ...args: TranslateParams) => O[K] extends string ? string : DocumentFragment; +declare class I18n { + private readonly targetLangs; + readonly i18n: {}; + private readonly registerI18n; + private readonly translate; + root: { + registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void; + translate: Translate; + }; +} +//#endregion +//#region src/modules/Storage.d.ts +type RecordStore = StoreAsync; +declare class Storage { + private readonly ctx; + private readonly memoryDB; + private readonly indexedDB; + constructor(ctx: { + getNamespace: () => string; + }); + private readonly getRecordStore; + private readonly deleteRecordStore; + private readonly clearRecordStores; + private readonly recordStoreExists; + readonly root: { + clearRecordStores: () => Promise; + deleteRecordStore: (namespace?: string) => MaybePromise; + getRecordStore: (namespace?: string) => { + get(key: string): Promise; + set(key: string, value: RecordStat): Promise; + delete(key: string): Promise; + clear(): Promise; + keys(): Promise; + values(): Promise; + entries(): Promise<[string, RecordStat][]>; + batch(operations: StoreOperations[]): Promise[]>; + }; + indexedDB: DatabaseAsync; + memoryDB: { + getStore(name: K): { + get(key: string): any; + set(key: string, value: any): void; + delete(key: string): void; + clear(): void; + keys(): string[]; + values(): any[]; + entries(): [string, any][]; + batch(operations: StoreOperations[]): GetResult[]; + }; + getStoreNames(): string[]; + deleteStore(name: string): void; + clearStores(): void; + getMeta(key: T): any; + setMeta(key: T, value: any): void; + dispose(): void; + }; + recordStoreExists: (namespace?: string) => MaybePromise; + }; + readonly dispose: () => void; +} +//#endregion +//#region src/sync/tasks/interface.d.ts +type BaseTaskOptions = { + localFs: Fs; + remoteFs: Fs; + record: RecordStore; +}; +type TaskNames = 'addRecord' | 'removeRecord' | 'createLocalDir' | 'createRemoteDir' | 'download' | 'resolveConflict' | 'removeLocal' | 'removeRemote' | 'upload' | 'moveLocal' | 'moveRemote'; +type ConflictResolverPayload = { + local: FileStat; + remote: FileStat; + key: string; + localFs: Fs; + remoteFs: Fs; + record: RecordStore; +}; +type ConflictResolver = (payload: ConflictResolverPayload) => MaybePromise; +declare abstract class BaseTask { + readonly options: BaseTaskOptions & T; + constructor(options: BaseTaskOptions & T); + protected readonly remoteFs: Fs; + protected readonly localFs: Fs; + protected readonly record: RecordStore; + name: TaskNames; + prettyName: string; + readonly key: string; + readonly local: (BaseTaskOptions & T)['local']; + readonly remote: (BaseTaskOptions & T)['remote']; + abstract exec(): MaybePromise; +} +//#endregion +//#region src/sync/tasks/AddRecord.d.ts +declare class AddRecord extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/CreateRemoteDir.d.ts +declare class CreateRemoteDir extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/Download.d.ts +declare class Download extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/MoveLocal.d.ts +declare class MoveLocal extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/MoveRemote.d.ts +declare class MoveRemote extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/RemoveLocal.d.ts +declare class RemoveLocal extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/RemoveRecord.d.ts +declare class RemoveRecord extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/RemoveRemote.d.ts +declare class RemoveRemote extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/tasks/ResolveConflict.d.ts +declare class ResolveConflict extends BaseTask { + exec: () => MaybePromise; +} +//#endregion +//#region src/sync/tasks/Upload.d.ts +declare class Upload extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/sync/decision/interface.d.ts +type TaskOptions = { + key: string; + remote?: Stat$1; + local?: Stat$1; +}; +type OptionsWithRemoteFileStat = { + remote: FileStat; +} & TaskOptions; +type OptionsWithLocalFileStat = { + local: FileStat; +} & TaskOptions; +type OptionsWithRemoteFolderStat = { + remote: FolderStat; +} & TaskOptions; +type OptionsWithLocalFolderStat = { + local: FolderStat; +} & TaskOptions; +type OptionsWithLocalStat = { + local: Stat$1; +} & TaskOptions; +type OptionsWithRemoteStat = { + remote: Stat$1; +} & TaskOptions; +type OptionsWithBothStats = { + local: Stat$1; + remote: Stat$1; +} & TaskOptions; +type OptionsWithBothFileStats = { + local: FileStat; + remote: FileStat; +} & TaskOptions; +type OptionsWithLocalStatAndOldKey = { + local: Stat$1; + oldKey: string; +} & TaskOptions; +type OptionsWithRemoteStatAndOldKey = { + remote: Stat$1; + oldKey: string; +} & TaskOptions; +type TaskOptionsMap = { + download: OptionsWithRemoteFileStat; + upload: OptionsWithLocalFileStat; + resolveConflict: OptionsWithBothFileStats; + removeLocal: OptionsWithLocalStat; + removeRemote: OptionsWithRemoteStat; + createLocalDir: OptionsWithRemoteFolderStat; + createRemoteDir: OptionsWithLocalFolderStat; + removeRecord: TaskOptions; + addRecord: OptionsWithBothStats; + moveLocal: OptionsWithRemoteStatAndOldKey; + moveRemote: OptionsWithLocalStatAndOldKey; +}; +declare const taskMap: { + readonly addRecord: typeof AddRecord; + readonly createLocalDir: typeof CreateLocalDir; + readonly createRemoteDir: typeof CreateRemoteDir; + readonly download: typeof Download; + readonly moveLocal: typeof MoveLocal; + readonly moveRemote: typeof MoveRemote; + readonly removeLocal: typeof RemoveLocal; + readonly removeRecord: typeof RemoveRecord; + readonly removeRemote: typeof RemoveRemote; + readonly resolveConflict: typeof ResolveConflict; + readonly upload: typeof Upload; +}; +type TaskFactory = (name: N, options: TaskOptionsMap[N]) => InstanceType<(typeof taskMap)[N]>; +type Decider = (input: DeciderInput) => Array; +type DeciderInput = { + localStats: StatsMap; + remoteStats: StatsMap; + records: RecordStatsMap; + taskFactory: TaskFactory; + logger: (log: string) => void; +}; +//#endregion +//#region src/sync/tasks/CreateLocalDir.d.ts +declare class CreateLocalDir extends BaseTask { + exec(): Promise; +} +//#endregion +//#region src/modules/Sync.d.ts +type SyncTerminateReason = { + result: 'cancelled'; +} | { + result: 'completed'; +} | { + result: 'failed'; + error: string; +} | { + result: 'noop'; +}; +type TaskInfo = { + name: TaskNames; + key: string; + prettyName: string; + isDir: boolean; +}; +type FailedTaskInfo = TaskInfo & { + error: string; +}; +declare class Sync { + private readonly ctx; + dispatch: Dispatch; + on: On; + constructor(ctx: { + dispatch: Dispatch; + initializeSync: () => Infras; + getDecider: () => Decider; + on: On; + translate: Translate; + listRemote: RemoteLister; + getConflictResolver: () => ConflictResolver; + }); + readonly events: { + syncStarted: { + isCancelled: Ref; + trigger: string; + }; + remoteWalkProgress: Progress; + syncTerminated: SyncTerminateReason; + requestConfirmDelete: Array; + requestConfirmTasks: Array; + syncCanceled: undefined; + taskCompleted: TaskInfo; + taskFailed: FailedTaskInfo; + executionStarted: Array; + }; + readonly settings: { + maxFileSize: TogglableValue; + exclusionRules: Array; + inclusionRules: Array; + confirmDeleteInAutoSync: boolean; + confirmTasksInSync: boolean; + }; + private readonly postProcess; + private readonly confirmTasks; + private readonly confirmDeletion; + private readonly executeSync; + private readonly convertDeleteToUpload; + root: { + executeSync: (trigger: string) => Promise<{ + result: 'cancelled'; + } | { + result: 'completed'; + } | { + result: 'failed'; + error: string; + } | { + result: 'noop'; + }>; + }; +} +//#endregion +//#region src/modules/Observability.d.ts +type SyncStage = 'none' | 'walkingRemote' | 'awaitingConfirmation' | 'executing' | 'completed' | 'completedNoop' | 'cancelled' | 'failed'; +type AddRibbonIcon = (icon: IconName, title: string, callback: (evt: MouseEvent) => void) => HTMLElement; +declare class Observability { + private readonly ctx; + private lastSyncTime; + private readonly sinceLastSyncText; + private readonly syncStage; + private readonly walkProgress; + private readonly executionProgress; + private readonly cleanupCallbacks; + private readonly t; + private readonly progressText; + readonly settings: { + noticeStatusOnMobile: boolean; + exportLogsDirectory: string; + }; + readonly i18n: { + startSync: string; + startNonInteractiveSync: string; + stopSync: string; + showProgress: string; + exportLogsToFile: string; + exportLogsFailed: string; + idle: string; + }; + constructor(ctx: { + addStatusBarItem: () => HTMLElement; + on: On; + translate: Translate; + isIdle: Ref; + dispatch: Dispatch; + requestSync: (trigger: string) => Promise; + showProgress: () => void; + addCommand: (command: Command) => Command; + addRibbonIcon: AddRibbonIcon; + getLogs: () => string; + app: App; + }); + readonly start: () => void; + private readonly setupStatus; + private readonly setupCommands; + private readonly exportLogs; + readonly dispose: () => void; + root: { + executionProgress: Ref>; + exportLogs: () => Promise; + syncStage: Ref; + walkProgress: Ref; + }; +} +//#endregion +//#region src/components/file-tree/index.d.ts +type FileTreeTranslations = { + selectAll: string; +}; +//#endregion +//#region src/components/HeadersEditorModal.d.ts +type HeadersEditorTranslations = { + add: string; + cancel: string; + addSecretHeader: string; + remove: string; + save: string; + customHeadersDescription: string; + editHeaders: string; + headerKeyPlaceholder: string; + headerValuePlaceholder: string; + omittedInvalidEntry: string; +}; +//#endregion +//#region src/components/MigrationModal.d.ts +type MigrationModalTranslations = { + cancel: string; + remoteMigration: string; + migrationProcess: string; + startMigration: string; + migrationDescription: string; + migrationPhase1Description: string; + migrationPhase2Description: string; + migrationPhase3Description: string; + toggleWithoutMigration: string; + migrationFailed: string; + completed: string; + hide: string; + done: string; +}; +type MigrationEvents = { + migrationProgress: Progress; + migrationFailed: string; +}; +type MigrationContext = { + app: App; + on: On; + dispatch: Dispatch; + translate: Translate; + requestSync: (trigger: string) => Promise; + initializeSync: () => Infras; + memoryDB: ExistingMemoryDB; +}; +declare function setNeedMigration(ctx: MigrationContext, { toggle, needMigration, content, apply }: { + toggle: ToggleComponent; + needMigration?: (value: boolean) => MaybePromise; + content: (value: boolean) => string | DocumentFragment; + apply: (value: boolean) => MaybePromise; +}): void; +//#endregion +//#region src/sdk/prefix.d.ts +declare function prefixWrapper(original: Fs, prefix: string): WrappedFs; +//#endregion +//#region src/utils/pipe.d.ts +declare function pipe({ from, to, stat, key }: { + from: Fs; + to: Fs; + key: string; + stat: FileStat; +}): Promise; +declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise | undefined>; +declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream, stat: FileStat): MaybePromise; +//#endregion +//#region src/sdk/index.d.ts +declare function digOriginal(wrapped: Fs): RootFs; +type SelectFromContext = Context extends O ? O : never; +//#endregion +//#region src/modules/Extensibility.d.ts +type ModuleInstance = { + moduleSettings: object; + dispose?: () => void; + start?: () => void; +}; +type ModuleCtor = new (ctx: object) => ModuleInstance; +type ModuleMeta = { + id: string; + name: string; + version: string; + description: string; + main: string; + icon?: string; + minPluginVersion?: string; + integrity: string; +}; +type AugmentedModuleMeta = ModuleMeta & { + enabled: boolean; + source: string; + icon: string; +}; +declare class Extensibility { + private readonly ctx; + private readonly moduleDir; + private readonly sourceCache; + private readonly discoveredModules; + private readonly loadedModules; + private readonly moduleStore; + private autoUpdateTimeout?; + readonly settings: { + moduleSources: Array; + moduleAutoUpdate: boolean; + modules: Record; + }; + readonly i18n: { + failedToLoadModule: string; + failedToDownloadModule: string; + failedToFetchSource: string; + }; + readonly events: { + moduleLoaded: string; + moduleUnloaded: string; + }; + constructor(ctx: { + app: App; + __addModule__: Context['__addModule__']; + __getModule__: Context['__getModule__']; + dispatch: Dispatch; + translate: Translate; + allModules: Set; + isIdle: Ref; + saveSettings: () => Promise; + indexedDB: DatabaseAsync>; + }); + readonly start: () => void; + private readonly createOperationFactory; + private readonly loadAllModules; + private readonly loadModule; + private readonly unloadModule; + private readonly downloadModule; + private readonly deleteModule; + private readonly fetchSources; + private readonly updateModules; + private readonly updateModuleMeta; + private readonly enableModule; + private readonly disableModule; + private readonly getModulePath; + private readonly parseModulePath; + readonly dispose: () => void; + readonly root: { + deleteModule: (id: string) => Promise; + disableModule: (id: string) => void; + discoveredModules: Map; + downloadModule: (meta: AugmentedModuleMeta, waitIdle?: boolean) => Promise; + enableModule: (id: string) => Promise; + fetchSources: (manual?: boolean) => Promise; + loadAllModules: () => Promise; + loadModule: (meta: AugmentedModuleMeta, start?: boolean, module?: string) => Promise; + loadedModules: Map; + unloadModule: (id: string) => void; + updateModuleMeta: (meta: AugmentedModuleMeta) => Promise; + updateModules: () => Promise; + }; +} +//#endregion +//#region src/components/ModuleEditorModal.d.ts +type ModuleEditorTranslations = { + editModuleInformation: string; + enable: string; + name: string; + namePlaceholder: string; + description: string; + descriptionPlaceholder: string; + icon: string; + iconDescription: Fragment; + iconPlaceholder: string; + updateSource: string; + updateSourceDescription: string; + updateSourcePlaceholder: string; + invalidValue: string; + integrityVerification: string; + integrityVerificationDescription: Fragment; + save: string; + cancel: string; +}; +//#endregion +//#region src/components/UnknownModuleModal.d.ts +type FileInfo = { + path: string; + size: string; + mtime: string; + ctime: string; + fileName: string; +}; +type UnknownModuleTranslations = { + unknownModule: string; + unknownModuleDescription: Fragment; + delete: string; + configure: string; +}; +//#endregion +//#region src/settings/controls.d.ts +type ControlsSettingTranslations = { + controls: string; + maxFileSize: string; + maxFileSizeDescription: string; + maxFileSizePlaceholder: string; + maxRequestConcurrency: string; + minRequestInterval: string; + minRequestIntervalDescription: string; + minRequestIntervalPlaceholder: string; + maxRequestConcurrencyPlaceholder: string; + maxRequestConcurrencyDescription: string; + maxMemoryConsumption: string; + maxMemoryConsumptionDescription: string; + maxMemoryConsumptionPlaceholder: string; + invalidValue: string; +}; +//#endregion +//#region src/settings/development.d.ts +type DevelopmentSettingTranslations = { + development: string; + clearRecords: string; + recordsCleared: string; + clear: string; + clearRecordsDescription: string; + export: string; + exportLogsDescription: string; + exportLogsDirectoryPlaceholder: string; + exportLogsToFile: string; +}; +//#endregion +//#region src/settings/features.d.ts +type FeaturesSettingTranslations = { + features: string; + realtimeSyncFastMode: string; + realtimeSyncFastModeDescription: string; + realtimeSync: string; + realtimeSyncDescription: string; + realtimeSyncPlaceholder: string; + startupSync: string; + startupSyncDescription: string; + startupSyncPlaceholder: string; + scheduledSync: string; + scheduledSyncDescription: string; + scheduledSyncPlaceholder: string; + asymmetricStorage: string; + asymmetricStorageDescription: Fragment; + asymmetricStorageMigration: Fragment<'enable' | 'disable'>; + invalidValue: string; +} & MigrationModalTranslations; +//#endregion +//#region src/components/FilterEditorModal.d.ts +type FilterEditorTranslations = { + cancel: string; + remove: string; + save: string; + add: string; + inclusionRules: string; + exclusionRules: string; + inclusionRulesDescription: string; + exclusionRulesDescription: string; + filterPlaceholder: string; +}; +//#endregion +//#region src/settings/filter.d.ts +type FilterSettingTranslations = { + filterRules: string; + edit: string; +} & FilterEditorTranslations; +//#endregion +//#region src/settings/head.d.ts +type HeadSettingTranslations = { + moduleAutoUpdate: string; + moduleAutoUpdateDescription: string; + moduleManagement: string; + moduleManagementDescription: string; + openPanel: string; + backend: string; + backendDescription: string; + syncStrategy: string; + syncStrategyDescription: string; + checkConnectionFailed: string; + checkConnectionSuccess: string; + checkConnection: string; + conflictResolveStrategy: string; + conflictResolveStrategyDescription: string; +}; +//#endregion +//#region src/settings/miscellaneous.d.ts +type MiscellaneousSettingTranslations = { + miscellaneous: string; + diffMatchPatch: string; + keepLocal: string; + keepRemote: string; + skip: string; + noticeStatusOnMobile: string; + noticeStatusOnMobileDescription: string; + confirmTasksInSync: string; + confirmTasksInSyncDescription: string; + confirmDeleteInAutoSync: string; + confirmDeleteInAutoSyncDescription: string; + customHeaders: string; + customHeadersDescription: string; + edit: string; +}; +//#endregion +//#region src/modules/Bootstrap.d.ts +type CustomHeaders = Array<{ + type: 'plaintext' | 'secret'; + value: string; + key: string; +}>; +type ExistingMemoryDB = DatabaseSync<{ + localContext20000: Stat$1; + remoteContext10000: Stat$1; + remoteContext20000: Stat$1; +}, { + localContext20000Marker: string; + remoteContext10000Marker: string; + remoteContext20000Marker: string; +}>; +declare class Bootstrap { + private readonly ctx; + private readonly cleanupCallbacks; + private readonly memoryStates; + private isCancelled?; + private readonly localPool; + private readonly remotePool; + private localFs?; + private remoteFs?; + readonly i18n: { + bidirectional: string; + latestSurvive: string; + keepLocal: string; + keepRemote: string; + renameAndKeepBoth: string; + skip: string; + } & ControlsSettingTranslations & DevelopmentSettingTranslations & FeaturesSettingTranslations & FilterSettingTranslations & HeadSettingTranslations & MiscellaneousSettingTranslations & HeadersEditorTranslations & UnknownModuleTranslations & ModuleEditorTranslations & FileTreeTranslations; + readonly settings: { + maxMemoryConsumption: TogglableValue; + maxRequestConcurrency: TogglableValue; + minRequestInterval: TogglableValue; + realtimeSyncFastMode: boolean; + asymmetricStorage: boolean; + customHeaders: CustomHeaders; + }; + constructor(ctx: { + app: App; + registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void; + on: On; + dispatch: Dispatch; + memoryDB: ExistingMemoryDB; + registerDecider: (id: string, entry: DeciderEntry) => void; + registerLocalFsWrapper: (entry: FsWrapperEntry) => void; + registerRemoteFs: (id: string, entry: RemoteFsEntry) => void; + registerRemoteFsWrapper: (entry: FsWrapperEntry) => void; + translate: Translate; + optimizeLocal: BatchOptimizer; + optimizeRemote: BatchOptimizer; + registerLocalOptimizer: (optimizer: OptimizerEntry) => void; + registerRemoteOptimizer: (optimizer: OptimizerEntry) => void; + registerRemoteLister: (entry: RemoteListerEntry) => () => boolean; + registerSetting: (entry: SettingEntry) => () => boolean; + registerConflictResolver: (id: string, entry: ConflictResolverEntry) => void; + registerRemoteRequestMiddleware: (entry: RemoteRequestMiddlewareEntry) => void; + registerLocalRequestMiddleware: (entry: LocalRequestMiddlewareEntry) => void; + }); + readonly start: () => void; + readonly dispose: () => void; +} +//#endregion +//#region src/components/module-management/index.d.ts +type ModuleManagementTranslations = { + disableModule: string; + downloadModule: string; + enableModule: string; + installed: string; + loadingModules: string; + noInstalledModulesFound: string; + noMatchingModulesFound: string; + noModulesAvailable: string; + updateAvailable: string; + updateModule: string; + deleteModule: string; + editModuleInformation: string; + official: string; +}; +//#endregion +//#region src/components/SourceEditorModal.d.ts +type SourceEditorTranslations = { + add: string; + cancel: string; + editSources: string; + omittedInvalidEntry: string; + moduleSourcePlaceholder: string; + remove: string; + save: string; + sourcesDescription: string; + httpInsecureWarning: string; +}; +//#endregion +//#region src/modules/ModulesModal.d.ts +type ModulesModalTranslations = ModuleManagementTranslations & SourceEditorTranslations & { + searchModules: string; + editSources: string; + moduleManagement: string; + showInstalledOnly: string; + configurations: string; +}; +declare class ModulesModal extends Modal { + private readonly ctx; + private readonly t; + private readonly modalCleanup; + private sourceEditorModal?; + private showInstalledOnly; + constructor(ctx: { + app: App; + translate: Translate; + saveSettings: () => Promise; + fetchSources: (manual?: boolean) => Promise>; + discoveredModules: Map; + loadedModules: Map; + downloadModule: (meta: AugmentedModuleMeta) => Promise; + deleteModule: (id: string) => Promise; + loadModule: (meta: AugmentedModuleMeta, start?: boolean) => Promise; + unloadModule: (id: string) => void; + enableModule: (id: string) => Promise; + disableModule: (id: string) => void; + updateModuleMeta: (meta: AugmentedModuleMeta) => Promise; + }); + readonly i18n: ModulesModalTranslations; + readonly settings: { + moduleSources: Array; + }; + root: { + closeModuleManagement: () => void; + openModuleManagement: () => void; + }; + onOpen(): void; + onClose(): void; + private readonly openSourceEditorModal; + dispose(): void; +} +//#endregion +//#region src/modules/ProgressModal.d.ts +type DeleteConfirmReturn = { + delete: Array; + reupload: Array; +}; +declare class ProgressModal extends Modal { + private readonly ctx; + private readonly moduleCleanupCallbacks; + private readonly t; + private opening; + private readonly modalCleanupCallbacks; + private readonly dispatch; + private description?; + private detailContainer?; + private controls?; + constructor(ctx: { + app: App; + translate: Translate; + on: On; + dispatch: Dispatch; + syncStage: Ref; + walkProgress: Ref; + executionProgress: Ref>; + }); + readonly events: { + tasksConfirmed: Array; + deleteConfirmed: DeleteConfirmReturn; + }; + readonly i18n: { + syncProgress: string; + completed: string; + failedTasksDescription: string; + confirmDeleteDescription: string; + confirmTasksDescription: Fragment; + hide: string; + confirm: string; + cancel: string; + done: string; + stopSync: string; + } & Record; + private readonly renderHideStop; + private readonly renderConfirmCancel; + private readonly renderDone; + private readonly showDetails; + private readonly hideDetails; + onOpen(): void; + root: { + hideProgress: () => void; + showProgress: () => void; + }; + onClose(): void; + dispose(): void; +} +//#endregion +//#region src/modules/Scheduler.d.ts +declare class Scheduler { + private readonly ctx; + private readonly pendingRequests; + private isScheduling; + private realtimeSyncTimer?; + private scheduledSyncTimer?; + private startupSyncTimer?; + constructor(ctx: { + syncStage: Ref; + executeSync: (trigger: string) => Promise; + registerEvent: (ref: EventRef) => void; + app: App; + isIdle: Ref; + }); + settings: { + startupSync: TogglableValue; + scheduledSync: TogglableValue; + realtimeSync: TogglableValue; + exclusionRules: Array; + inclusionRules: Array; + }; + private readonly requestSync; + start: () => void; + dispose: () => void; + private readonly startScheduledSync; + private readonly stopScheduledSync; + private readonly onChange; + private readonly scheduleFlush; + private readonly flush; + root: { + requestSync: (trigger: string) => Promise; + startScheduledSync: () => void; + stopScheduledSync: () => void; + }; +} +//#endregion +//#region src/index.d.ts +declare const internalModules: readonly [typeof EventBus, typeof I18n, typeof Storage, typeof Extensibility, typeof Registrar, typeof Sync, typeof Observability, typeof Scheduler, typeof ProgressModal, typeof ModulesModal, typeof Bootstrap]; +type InternalModules = typeof internalModules; +type MergeKeys = 'settings' | 'root' | 'events' | 'i18n'; +type Context = Context$1 Command; + registerEvent: (ref: EventRef) => void; + addRibbonIcon: AddRibbonIcon; + addStatusBarItem: () => HTMLElement; + saveSettings: () => Promise; +}>; +type Events = MergeSingleKey; +type Settings = MergeSingleKey; +type Translations = MergeSingleKey; +//#endregion +//#region src/modules/Registrar.d.ts +type RejectableWrapper = (value: T) => T | undefined; +type OrderedWrapperEntry = { + priority: number; + apply: RejectableWrapper; +}; +type RemoteRequestMiddlewareEntry = OrderedWrapperEntry; +type LocalRequestMiddlewareEntry = OrderedWrapperEntry; +type FsWrapperEntry = OrderedWrapperEntry; +type CheckConnectionResult = { + success: true; +} | { + success: false; + reason: string; +}; +type RemoteFsEntry = { + instantiate: (request: Request) => RootFs; + prettyName: () => string; + checkConnection: (request: Request) => MaybePromise; +}; +type DeciderEntry = { + decider: Decider; + prettyName: () => string; +}; +type ConflictResolverEntry = { + prettyName: () => string; + resolver: ConflictResolver; +}; +type GeneralFn = (...args: ReadonlyArray) => unknown; +type RejectableApply = (...input: Parameters) => ReturnType | undefined; +type OrderedApplyEntry = { + apply: RejectableApply; + priority: number; +}; +type RemoteLister = (info: Infras & { + trigger: string; + reporter: ListReporter; +}) => MaybePromise>; +type RemoteListerEntry = OrderedApplyEntry; +type OptimizerEntry = OrderedApplyEntry; +type SettingEntry = { + priority: number; + apply: (el: HTMLElement) => void; +}; +type RequestParam = Omit & { + body?: string | Binary; +}; +type RequestResponse = { + text: () => string; + bytes: () => Binary; + json: () => General$1; + headers: Record; + status: number; +}; +type Request = (params: RequestParam | string) => Promise; +type Infras = { + localFs: Fs; + remoteFs: Fs; + record: RecordStore; +}; +declare class Registrar { + private readonly ctx; + private settingTab?; + private readonly cleanupCallbacks; + private readonly localFsWrapperRegistry; + private readonly remoteFsWrapperRegistry; + private readonly localOptimizerRegistry; + private readonly remoteOptimizerRegistry; + private readonly remoteListerRegistry; + private readonly settingRegistry; + private readonly remoteRequestMiddlewareRegistry; + private readonly localRequestMiddlewareRegistry; + private readonly remoteFsRegistry; + private readonly deciderRegistry; + private readonly conflictResolverRegistry; + readonly settings: { + remoteFs: string; + decider: string; + conflictResolver: string; + }; + constructor(ctx: { + app: App; + on: On; + getRecordStore: (namespace?: string) => StoreAsync; + }); + private readonly getVaultRequest; + private readonly createLocalFs; + private readonly createRemoteFs; + private readonly getRequest; + private readonly getCheckConnection; + private readonly getDecider; + private readonly optimizeLocal; + private readonly optimizeRemote; + private readonly listRemote; + private readonly getConflictResolver; + private readonly getNamespace; + private readonly initializeSync; + private readonly addSettingTab; + private readonly rerenderSettingTab; + root: { + addSettingTab: (plugin: Plugin) => void; + conflictResolverRegistry: Map; + createLocalFs: () => Fs; + createRemoteFs: (remoteFs?: string) => RootFs; + deciderRegistry: Map; + getCheckConnection: (remoteFs?: string) => () => MaybePromise; + getConflictResolver: () => ConflictResolver; + getDecider: () => Decider; + getNamespace: (localFs?: Fs, remoteFs?: Fs) => string; + getRequest: () => Request; + getVaultRequest: () => VaultRequest; + initializeSync: () => Infras; + listRemote: RemoteLister; + optimizeLocal: BatchOptimizer; + optimizeRemote: BatchOptimizer; + registerConflictResolver: (key: string, entry: ConflictResolverEntry) => () => boolean; + registerCss: (css: string) => () => void; + registerDecider: (key: string, entry: DeciderEntry) => () => boolean; + registerLocalFsWrapper: (entry: FsWrapperEntry) => () => boolean; + registerLocalOptimizer: (entry: OptimizerEntry) => () => boolean; + registerLocalRequestMiddleware: (entry: LocalRequestMiddlewareEntry) => () => boolean; + registerRemoteFs: (key: string, entry: RemoteFsEntry) => () => boolean; + registerRemoteFsWrapper: (entry: FsWrapperEntry) => () => boolean; + registerRemoteLister: (entry: RemoteListerEntry) => () => boolean; + registerRemoteOptimizer: (entry: OptimizerEntry) => () => boolean; + registerRemoteRequestMiddleware: (entry: RemoteRequestMiddlewareEntry) => () => boolean; + registerSetting: (entry: SettingEntry) => () => boolean; + remoteFsRegistry: Map; + rerenderSettingTab: () => void | undefined; + }; + readonly dispose: () => void; +} +//#endregion +//#region src/fs/vault/request.d.ts +type VaultRequestParam = { + method: 'GET'; + key: string; +} | { + method: 'GET_STREAM'; + key: string; +} | { + method: 'PUT'; + key: string; + value: Binary; + headers?: { + mtime?: number; + ctime?: number; + }; +} | { + method: 'APPEND'; + key: string; + value: Binary; + headers?: { + mtime?: number; + ctime?: number; + }; +} | { + method: 'DELETE'; + key: string; + headers?: { + permanent?: boolean; + }; +} | { + method: 'MOVE'; + key: string; + headers: { + destination: string; + }; +} | { + method: 'MKDIR'; + key: string; +} | { + method: 'EXISTS'; + key: string; +} | { + method: 'STAT'; + key: string; + headers?: { + cached?: boolean; + }; +} | { + method: 'LIST'; + key: string; + headers?: { + cached?: boolean; + }; +}; +type VaultRequestResponseMap = { + GET: Binary; + GET_STREAM: ReadableStream; + PUT: void; + APPEND: void; + DELETE: void; + MOVE: void; + MKDIR: void; + EXISTS: boolean; + STAT: Stat; + LIST: ListedFiles; +}; +type VaultRequest = (params: T) => Promise; +//#endregion +export { TranslationResource as $, SyncTerminateReason as A, MoveRemote as B, SelectFromContext as C, FolderStat as Ct, writeWithValue as D, RecordStatsMap as Dt, readWithSize as E, RecordStat as Et, Upload as F, BaseTask as G, Download as H, ResolveConflict as I, TaskNames as J, ConflictResolver as K, RemoveRemote as L, Decider as M, DeciderInput as N, prefixWrapper as O, Stat$1 as Ot, TaskFactory as P, Translate as Q, RemoveRecord as R, ModuleMeta as S, FileStat as St, pipe as T, Progress as Tt, CreateRemoteDir as U, MoveLocal as V, AddRecord as W, Fragment as X, RecordStore as Y, ObsidianLanguageCode as Z, Events as _, OutputAtom as _t, FsWrapperEntry as a, StoreOperations as at, ExistingMemoryDB as b, WriteAtom as bt, RemoteFsEntry as c, CustomAtom as ct, RemoteRequestMiddlewareEntry as d, InputAtom as dt, Dispatch as et, Request as f, ListReporter as ft, Context as g, OptimizerOutput as gt, SettingEntry as h, OptimizerInput as ht, DeciderEntry as i, StoreAsync as it, CreateLocalDir as j, setNeedMigration as k, StatsMap as kt, RemoteLister as l, DeleteAtom as lt, RequestResponse as m, MoveAtom as mt, CheckConnectionResult as n, DatabaseAsync as nt, LocalRequestMiddlewareEntry as o, StoreSync as ot, RequestParam as p, MkdirAtom as pt, ConflictResolverPayload as q, ConflictResolverEntry as r, DatabaseSync as rt, OptimizerEntry as s, BatchOptimizer as st, VaultRequest as t, On as tt, RemoteListerEntry as u, Fs as ut, Settings as v, RootFs as vt, digOriginal as w, MaybePromise as wt, AugmentedModuleMeta as x, Binary as xt, Translations as y, WrappedFs as yt, RemoveLocal as z }; \ No newline at end of file diff --git a/packages/plugin/dist/index.spec.d.ts b/packages/plugin/dist/index.spec.d.ts index 71d6174..0a43aeb 100644 --- a/packages/plugin/dist/index.spec.d.ts +++ b/packages/plugin/dist/index.spec.d.ts @@ -1,2 +1,2 @@ -import { $ as TranslationResource, A as SyncTerminateReason, B as MoveRemote, C as SelectFromContext, Ct as FolderStat, D as writeWithValue, Dt as RecordStatsMap, E as readWithSize, Et as RecordStat, F as Upload, G as BaseTask, H as Download, I as ResolveConflict, J as TaskNames, K as ConflictResolver, L as RemoveRemote, M as Decider, N as DeciderInput, O as prefixWrapper, Ot as Stat, P as TaskFactory, Q as Translate, R as RemoveRecord, S as ModuleMeta, St as FileStat, T as pipe, Tt as Progress, U as CreateRemoteDir, V as MoveLocal, W as AddRecord, X as Fragment, Y as RecordStore, Z as ObsidianLanguageCode, _ as Events, _t as OutputAtom, a as FsWrapperEntry, at as StoreOperations, b as ExistingMemoryDB, bt as WriteAtom, c as RemoteFsEntry, ct as CustomAtom, d as RemoteRequestMiddlewareEntry, dt as InputAtom, et as Dispatch, f as Request, ft as ListReporter, g as Context, gt as OptimizerOutput, h as SettingEntry, ht as OptimizerInput, i as DeciderEntry, it as StoreAsync, j as CreateLocalDir, k as setNeedMigration, kt as StatsMap, l as RemoteLister, lt as DeleteAtom, m as RequestResponse, mt as MoveAtom, n as CheckConnectionResult, nt as DatabaseAsync, o as LocalRequestMiddlewareEntry, ot as StoreSync, p as RequestParam, pt as MkdirAtom, q as ConflictResolverPayload, r as ConflictResolverEntry, rt as DatabaseSync, s as OptimizerEntry, st as BatchOptimizer, t as VaultRequest, tt as On, u as RemoteListerEntry, ut as Fs, v as Settings, vt as RootFs, w as digOriginal, wt as MaybePromise, x as AugmentedModuleMeta, xt as Binary, y as Translations, yt as WrappedFs, z as RemoveLocal } from "./index-zKP375wq.spec.js"; +import { $ as TranslationResource, A as SyncTerminateReason, B as MoveRemote, C as SelectFromContext, Ct as FolderStat, D as writeWithValue, Dt as RecordStatsMap, E as readWithSize, Et as RecordStat, F as Upload, G as BaseTask, H as Download, I as ResolveConflict, J as TaskNames, K as ConflictResolver, L as RemoveRemote, M as Decider, N as DeciderInput, O as prefixWrapper, Ot as Stat, P as TaskFactory, Q as Translate, R as RemoveRecord, S as ModuleMeta, St as FileStat, T as pipe, Tt as Progress, U as CreateRemoteDir, V as MoveLocal, W as AddRecord, X as Fragment, Y as RecordStore, Z as ObsidianLanguageCode, _ as Events, _t as OutputAtom, a as FsWrapperEntry, at as StoreOperations, b as ExistingMemoryDB, bt as WriteAtom, c as RemoteFsEntry, ct as CustomAtom, d as RemoteRequestMiddlewareEntry, dt as InputAtom, et as Dispatch, f as Request, ft as ListReporter, g as Context, gt as OptimizerOutput, h as SettingEntry, ht as OptimizerInput, i as DeciderEntry, it as StoreAsync, j as CreateLocalDir, k as setNeedMigration, kt as StatsMap, l as RemoteLister, lt as DeleteAtom, m as RequestResponse, mt as MoveAtom, n as CheckConnectionResult, nt as DatabaseAsync, o as LocalRequestMiddlewareEntry, ot as StoreSync, p as RequestParam, pt as MkdirAtom, q as ConflictResolverPayload, r as ConflictResolverEntry, rt as DatabaseSync, s as OptimizerEntry, st as BatchOptimizer, t as VaultRequest, tt as On, u as RemoteListerEntry, ut as Fs, v as Settings, vt as RootFs, w as digOriginal, wt as MaybePromise, x as AugmentedModuleMeta, xt as Binary, y as Translations, yt as WrappedFs, z as RemoveLocal } from "./index-Ddt5UAXp.spec.js"; export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CheckConnectionResult, type ConflictResolver, type ConflictResolverEntry, type ConflictResolverPayload, type Context, type CreateLocalDir, type CreateRemoteDir, type CustomAtom, type DatabaseAsync, type DatabaseSync, type Decider, type DeciderEntry, type DeciderInput, type DeleteAtom, type Dispatch, type Download, type Events, type ExistingMemoryDB, type FileStat, type FolderStat, type Fragment, type Fs, type FsWrapperEntry, type InputAtom, type ListReporter, type LocalRequestMiddlewareEntry, type MaybePromise, type MkdirAtom, type ModuleMeta, type MoveAtom, type MoveLocal, type MoveRemote, type ObsidianLanguageCode, type On, type OptimizerEntry, type OptimizerInput, type OptimizerOutput, type OutputAtom, type Progress, type RecordStat, type RecordStatsMap, type RecordStore, type RemoteFsEntry, type RemoteLister, type RemoteListerEntry, type RemoteRequestMiddlewareEntry, type RemoveLocal, type RemoveRecord, type RemoveRemote, type Request, type RequestParam, type RequestResponse, type ResolveConflict, type RootFs, SelectFromContext, type SettingEntry, type Settings, type Stat, type StatsMap, type StoreAsync, type StoreOperations, type StoreSync, type SyncTerminateReason, type TaskFactory, type TaskNames, type Translate, type TranslationResource, type Translations, type Upload, type VaultRequest, type WrappedFs, type WriteAtom, digOriginal, pipe, prefixWrapper, readWithSize, setNeedMigration, writeWithValue }; \ No newline at end of file diff --git a/packages/plugin/package.json b/packages/plugin/package.json index aaeea9f..62ea660 100644 --- a/packages/plugin/package.json +++ b/packages/plugin/package.json @@ -1,6 +1,6 @@ { "name": "@hesprs/sync-engine-sdk", - "version": "3.0.4", + "version": "3.0.5", "description": "Official SDK for developing modules targeting Sync Engine, the extensible Obsidian syncing plugin.", "keywords": [ "obsidian-plugin", diff --git a/packages/plugin/src/components/module-management/Card.tsx b/packages/plugin/src/components/module-management/Card.tsx index 6316fff..0e01fad 100644 --- a/packages/plugin/src/components/module-management/Card.tsx +++ b/packages/plugin/src/components/module-management/Card.tsx @@ -3,6 +3,7 @@ import { Show, createEffect } from 'solid-js'; import { compare } from 'verkit'; import type { AugmentedModuleMeta } from '@/modules/Extensibility'; import type { MaybePromise } from '@/types'; +import { OFFICIAL_SOURCE } from '@/modules/Extensibility'; import type { ModuleManagementContext, PendingAction } from './index'; import ModuleEditorModal from '../ModuleEditorModal'; @@ -36,7 +37,7 @@ export default function Card(props: { }; return ( -
+
- - {isInstalled() - ? props.ctx.translate('installed') - : props.ctx.translate('notInstalled')} - + + {props.ctx.translate('official')} + - - {props.isLoaded - ? props.ctx.translate('enabled') - : props.ctx.translate('disabled')} - + {props.ctx.translate('installed')} - {props.ctx.translate('updateAvailable')} + {props.ctx.translate('updateAvailable')}
diff --git a/packages/plugin/src/components/module-management/index.ts b/packages/plugin/src/components/module-management/index.ts index 5662192..49d8684 100644 --- a/packages/plugin/src/components/module-management/index.ts +++ b/packages/plugin/src/components/module-management/index.ts @@ -9,20 +9,18 @@ export type PendingAction = 'delete' | 'disable' | 'download' | 'enable' | 'edit export type ModuleManagementTranslations = { disableModule: string; - disabled: string; downloadModule: string; enableModule: string; - enabled: string; installed: string; loadingModules: string; noInstalledModulesFound: string; noMatchingModulesFound: string; noModulesAvailable: string; - notInstalled: string; updateAvailable: string; updateModule: string; deleteModule: string; editModuleInformation: string; + official: string; }; export type ModuleManagementHooks = { diff --git a/packages/plugin/src/en.ts b/packages/plugin/src/en.ts index 86d3f45..0ac9979 100644 --- a/packages/plugin/src/en.ts +++ b/packages/plugin/src/en.ts @@ -104,7 +104,6 @@ const en: Translations = { development: 'Development', diffMatchPatch: 'Merge', disableModule: 'Disable module', - disabled: 'Disabled', done: 'Done', download: 'Download', downloadModule: 'Download module', @@ -114,13 +113,14 @@ const en: Translations = { editSources: 'Edit sources', enable: 'Enable', enableModule: 'Enable module', - enabled: 'Enabled', exclusionRules: 'Exclusion rules', exclusionRulesDescription: 'Files / folders matching these glob patterns will not be synced. Please remember to add file extensions (for example, .md) if you want to exclude files.', executing: 'Executing', export: 'Export', - exportLogsDescription: 'Export plugin logs to a file in the vault.', + exportLogsDescription: + 'Export plugin logs to a file in the vault. Set the log export directory in the field.', + exportLogsDirectoryPlaceholder: 'Set the directory to export logs to', exportLogsFailed: 'Failed to export logs', exportLogsToFile: 'Export logs to file', failed: 'Failed', @@ -204,10 +204,10 @@ const en: Translations = { noMatchingModulesFound: 'No matching modules found.', noModulesAvailable: 'No modules available.', none: 'None', - notInstalled: 'Not installed', noticeStatusOnMobile: 'Notice sync status on mobile', noticeStatusOnMobileDescription: 'Display a notice on mobile devices when synchronization is in progress. Replaces the status bar on desktop.', + official: 'Official', omittedInvalidEntry: 'Omitted {{count}} invalid entry(s).', openPanel: 'Open panel', realtimeSync: 'Realtime sync', diff --git a/packages/plugin/src/global.css b/packages/plugin/src/global.css index 47820cb..9efa385 100644 --- a/packages/plugin/src/global.css +++ b/packages/plugin/src/global.css @@ -56,3 +56,24 @@ input[type='checkbox']:indeterminate { flex-direction: column; } } + +.sync-engine-large-modal { + width: var(--modal-width); + height: var(--modal-height); + max-width: var(--modal-max-width); + max-height: var(--modal-max-height); +} + +.is-phone .sync-engine-large-modal { + height: 100%; + margin-top: auto; +} + +.sync-engine-card .flair { + margin: 0; +} + +.sync-engine-card .flair.prominent { + --flair-background: var(--color-accent); + --flair-color: var(--text-on-accent); +} diff --git a/packages/plugin/src/index.ts b/packages/plugin/src/index.ts index d92ccf0..f5dba5f 100644 --- a/packages/plugin/src/index.ts +++ b/packages/plugin/src/index.ts @@ -7,7 +7,7 @@ import type { AddRibbonIcon } from './modules/Observability'; import type { GlobMatchRule } from './types'; import Bootstrap from './modules/Bootstrap'; import EventBus from './modules/EventBus'; -import Extensibility from './modules/Extensibility'; +import Extensibility, { OFFICIAL_SOURCE } from './modules/Extensibility'; import I18n from './modules/I18n'; import ModulesModal from './modules/ModulesModal'; import Observability from './modules/Observability'; @@ -17,10 +17,6 @@ import Scheduler from './modules/Scheduler'; import Storage from './modules/Storage'; import Sync from './modules/Sync'; -function createGlobMatchOptions(expr: string) { - return { caseSensitive: false, expr }; -} - const internalModules = [ EventBus, I18n, @@ -84,14 +80,15 @@ export default class SyncEngine extends Plugin { '**/~$*.xlsx', '.trash', this.app.vault.configDir, - ].map(createGlobMatchOptions), + ].map((expr) => ({ caseSensitive: false, expr })), + exportLogsDirectory: 'Sync Engine Logs/', inclusionRules: [], maxFileSize: { enabled: false, value: 31_457_280 }, maxMemoryConsumption: { enabled: true, value: 100 * 1024 ** 2 }, maxRequestConcurrency: { enabled: true, value: 50 }, minRequestInterval: { enabled: false, value: 0 }, moduleAutoUpdate: true, - moduleSources: ['https://sync.consensia.cc/modules.json'], + moduleSources: [OFFICIAL_SOURCE], modules: {}, noticeStatusOnMobile: true, realtimeSync: { enabled: false, value: 5000 }, diff --git a/packages/plugin/src/modules/Extensibility.ts b/packages/plugin/src/modules/Extensibility.ts index 31c0632..df3a8ff 100644 --- a/packages/plugin/src/modules/Extensibility.ts +++ b/packages/plugin/src/modules/Extensibility.ts @@ -44,6 +44,7 @@ export type AugmentedModuleMeta = ModuleMeta & { const MODULE_EXTENSION = '.js'; const AUTO_UPDATE_DELAY = 200; +export const OFFICIAL_SOURCE = 'https://sync.consensia.cc/modules.json'; export default class Extensibility { private readonly moduleDir: string; @@ -397,7 +398,7 @@ function isValidMeta(meta: unknown): meta is ModuleMeta { ); } -// TODO: remove after August 12 +// TODO: remove after August 16 async function migrateModules({ moduleStore, fileList, diff --git a/packages/plugin/src/modules/ModulesModal.ts b/packages/plugin/src/modules/ModulesModal.ts index b2d44a2..dfb62da 100644 --- a/packages/plugin/src/modules/ModulesModal.ts +++ b/packages/plugin/src/modules/ModulesModal.ts @@ -42,6 +42,8 @@ export default class ModulesModal extends Modal { ) { super(ctx.app); this.t = ctx.translate; + this.containerEl.getElementsByClassName('modal-bg')[0].addClass('opacity-0!'); + this.modalEl.addClasses(['sync-engine-large-modal', 'shadow-none!']); } declare readonly i18n: ModulesModalTranslations; @@ -53,15 +55,7 @@ export default class ModulesModal extends Modal { }; onOpen() { - this.containerEl.getElementsByClassName('modal-bg')[0].addClass('opacity-0!'); this.setTitle(this.t('moduleManagement')); - this.modalEl.addClasses([ - 'w-[--modal-width]', - 'h-[--modal-height]', - 'max-w-[--modal-max-width]', - 'max-h-[--modal-max-height]', - 'shadow-none!', - ]); const controlsEl = this.contentEl.createDiv('flex items-center gap-2 pb-4'); const searchEl = controlsEl.createDiv('min-w-0 flex-1'); const listEl = this.contentEl.createDiv('min-h-0 overflow-y-auto'); diff --git a/packages/plugin/src/modules/Observability.ts b/packages/plugin/src/modules/Observability.ts index 7c1aff3..cbf957b 100644 --- a/packages/plugin/src/modules/Observability.ts +++ b/packages/plugin/src/modules/Observability.ts @@ -1,5 +1,5 @@ import type { Events, Translations } from '@'; -import type { App, Command, IconName } from 'obsidian'; +import type { App, Command, DataAdapter, IconName } from 'obsidian'; import type { Ref } from 'synthkernel'; import { Notice, Platform, setIcon } from 'obsidian'; import { computed, ref } from 'synthkernel'; @@ -65,7 +65,7 @@ export default class Observability { }, ); - declare readonly settings: { noticeStatusOnMobile: boolean }; + declare readonly settings: { noticeStatusOnMobile: boolean; exportLogsDirectory: string }; declare readonly i18n: { startSync: string; startNonInteractiveSync: string; @@ -290,11 +290,10 @@ export default class Observability { const log = getLogs(); const timestamp = new Date().toISOString().replaceAll(/[:.]/gv, '-'); const fileName = `${timestamp}.md`; - const dirPath = 'Sync Engine Logs'; - const filePath = `${dirPath}/${fileName}`; + const { exportLogsDirectory } = this.settings; + const filePath = `${exportLogsDirectory === '/' ? '' : exportLogsDirectory}${fileName}`; try { - const folderExists = app.vault.getFolderByPath(dirPath); - if (!folderExists) await app.vault.createFolder(dirPath); + await mkdirRecursive(app.vault.adapter, exportLogsDirectory); const file = await app.vault.create(filePath, log); await app.workspace.getLeaf().openFile(file); } catch (error) { @@ -316,3 +315,13 @@ export default class Observability { walkProgress: this.walkProgress, }; } + +async function mkdirRecursive(adapter: DataAdapter, path: string): Promise { + const parts = path.split('/'); + let currentPath = ''; + for (const part of parts) { + if (!part) return; + currentPath = currentPath ? `${currentPath}/${part}` : part; + if (!(await adapter.exists(currentPath))) await adapter.mkdir(currentPath); + } +} diff --git a/packages/plugin/src/settings/development.ts b/packages/plugin/src/settings/development.ts index b66f362..f201bc6 100644 --- a/packages/plugin/src/settings/development.ts +++ b/packages/plugin/src/settings/development.ts @@ -1,3 +1,5 @@ +import type { Settings } from '@'; +import { normalizeBaseDir } from '@repo/shared/path'; import { Notice, Setting } from 'obsidian'; import type { Translate } from '@/modules/I18n'; import type { MaybePromise } from '@/sdk'; @@ -10,6 +12,7 @@ export type DevelopmentSettingTranslations = { clearRecordsDescription: string; export: string; exportLogsDescription: string; + exportLogsDirectoryPlaceholder: string; exportLogsToFile: string; }; @@ -19,9 +22,11 @@ export default function developmentSettings( translate: Translate; deleteRecordStore: (namespace?: string) => MaybePromise; exportLogs: () => Promise; + settings: Settings; + saveSettings: () => Promise; }, ) { - const { translate, exportLogs, deleteRecordStore } = ctx; + const { translate, exportLogs, deleteRecordStore, settings, saveSettings } = ctx; new Setting(el).setName(translate('development')).setHeading(); new Setting(el) @@ -40,6 +45,19 @@ export default function developmentSettings( new Setting(el) .setName(translate('exportLogsToFile')) .setDesc(translate('exportLogsDescription')) + .addText((text) => + text + .setValue(settings.exportLogsDirectory) + .setPlaceholder(translate('exportLogsDirectoryPlaceholder')) + .inputEl.addEventListener('blur', () => { + const normalized = normalizeBaseDir(text.getValue().trim()); + if (settings.exportLogsDirectory !== normalized) { + settings.exportLogsDirectory = normalized; + void saveSettings(); + } + text.setValue(normalized); + }), + ) .addButton((button) => { button.setButtonText(translate('export')).onClick(exportLogs); }); diff --git a/versions.json b/versions.json index 3ea89c3..43b16b3 100644 --- a/versions.json +++ b/versions.json @@ -3,5 +3,6 @@ "3.0.1": "1.12.3", "3.0.2": "1.12.3", "3.0.3": "1.12.3", - "3.0.4": "1.12.3" + "3.0.4": "1.12.3", + "3.0.5": "1.12.3" } From 377ec531ec2e7cba2c4d7f0b0b271bf92cfaceba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?He=CC=84sperus?= Date: Wed, 12 Aug 2026 20:06:00 +0800 Subject: [PATCH 2/2] chore(modules): bump modules --- modules.json | 12 +- packages/plugin/dist/index-2mGPGNnI.spec.d.ts | 1329 ----------------- 2 files changed, 6 insertions(+), 1335 deletions(-) delete mode 100644 packages/plugin/dist/index-2mGPGNnI.spec.d.ts diff --git a/modules.json b/modules.json index 7c476e0..2843b18 100644 --- a/modules.json +++ b/modules.json @@ -29,29 +29,29 @@ { "id": "i18n-zh", "name": "I18n 简体中文", - "version": "0.0.10", + "version": "0.0.11", "description": "Simplified Chinese UI language pack. / 简体中文介面语言包。", "icon": "languages", "main": "https://sync.consensia.cc/modules/i18n-zh.js", - "minPluginVersion": "3.0.3" + "minPluginVersion": "3.0.5" }, { "id": "i18n-zh-TW", "name": "I18n 繁體中文", - "version": "0.0.2", + "version": "0.0.3", "description": "Traditional Chinese UI language pack. / 繁體中文介面語言包。", "icon": "languages", "main": "https://sync.consensia.cc/modules/i18n-zh-TW.js", - "minPluginVersion": "3.0.3" + "minPluginVersion": "3.0.5" }, { "id": "i18n-ru", "name": "I18n Русский", - "version": "0.0.2", + "version": "0.0.3", "description": "Russian UI language pack. / Пакет русского интерфейса.", "icon": "languages", "main": "https://sync.consensia.cc/modules/i18n-ru.js", - "minPluginVersion": "3.0.3" + "minPluginVersion": "3.0.5" }, { "id": "smart-merge", diff --git a/packages/plugin/dist/index-2mGPGNnI.spec.d.ts b/packages/plugin/dist/index-2mGPGNnI.spec.d.ts deleted file mode 100644 index 50ab23d..0000000 --- a/packages/plugin/dist/index-2mGPGNnI.spec.d.ts +++ /dev/null @@ -1,1329 +0,0 @@ -import { App, Command, EventRef, IconName, ListedFiles, Modal, Plugin, RequestUrlParam, Stat, ToggleComponent } from "obsidian"; -//#region test/e2e-utils.d.ts -type General$1 = any; -//#endregion -//#region src/types.d.ts -type MaybePromise = Promise | T; -type TogglableValue = { - enabled: boolean; - value: T; -}; -type FileStat = { - isDir: false; - key: string; - mtime: number; - size: number; - uid: string; -}; -type FolderStat = { - isDir: true; - key: string; -}; -type Stat$1 = FileStat | FolderStat; -type RecordStat = { - isDir: false; - local: string; - remote: string; -} | { - isDir: true; -}; -type StatsMap = Map; -type RecordStatsMap = Map; -type GlobMatchRule = { - expr: string; - caseSensitive: boolean; -}; -type Progress = { - total: number; - completed: number; - current?: T; -}; -type Binary = Uint8Array; -//#endregion -//#region src/fs/interface.d.ts -/** - * All keys use unified format: - * - root: `/` - * - file: `note.md`, `folder/note.md` - * - folder: `folder/`, `folder/nested/` - */ -type RootFs = { - getUid(): string; - read(key: string, stat: FileStat): MaybePromise; - readStream(key: string, stat: FileStat): MaybePromise>; - write(key: string, value: Binary, stat: FileStat): MaybePromise; - writeStream(key: string, value: ReadableStream, stat: FileStat): MaybePromise; - delete(key: string): MaybePromise; - move(oldKey: string, newKey: string): MaybePromise; - mkdir(key: string, recursive?: boolean): MaybePromise; - stat(key: string): MaybePromise; - exists(key: string): MaybePromise; - list(key: string, reporter: ListReporter): MaybePromise>; -}; -type ListReporter = (progress: Required) => MaybePromise<'include' | 'exclude' | 'advance'>; -type WrappedFs = RootFs & { - original: Fs; -}; -type Fs = WrappedFs | RootFs; -type WriteAtom = { - type: 'write'; - key: string; - execute: () => MaybePromise; - resolve: (uid: string) => void; - reject: (err: Error) => void; -}; -type DeleteAtom = { - type: 'delete'; - key: string; - execute: () => MaybePromise; - resolve: () => void; - reject: (err: Error) => void; -}; -type MoveAtom = { - type: 'move'; - oldKey: string; - newKey: string; - execute: () => MaybePromise; - resolve: () => void; - reject: (err: Error) => void; -}; -type MkdirAtom = { - type: 'mkdir'; - key: string; - execute: () => MaybePromise; - resolve: () => void; - reject: (err: Error) => void; -}; -type InputAtom = WriteAtom | DeleteAtom | MoveAtom | MkdirAtom; -type CustomAtom = { - type: 'custom'; - execute: () => MaybePromise; -}; -type OutputAtom = InputAtom | CustomAtom; -type OptimizerInput = { - atoms: Array; - fs: Fs; - executeAtom: (atom: OutputAtom) => Promise; -}; -type OptimizerOutput = Array; -type BatchOptimizer = (input: OptimizerInput) => OptimizerOutput; -//#endregion -//#region ../../node_modules/.bun/uni-kv@..+..+uni-kv.tgz/node_modules/uni-kv/dist/interface.d.ts -//#region src/interface.d.ts -type Database, M extends Record, F extends boolean> = { - getStore(name: K): Store; - getStoreNames(): IsPromise, F>; - deleteStore(name: string): IsPromise; - clearStores(): IsPromise; - getMeta(key: T): IsPromise; - setMeta(key: T, value: M[T]): IsPromise; - dispose(): IsPromise; -}; -type Store = { - get(key: string): IsPromise; - set(key: string, value: T): IsPromise; - delete(key: string): IsPromise; - clear(): IsPromise; - keys(): IsPromise, F>; - values(): IsPromise, F>; - entries(): IsPromise, F>; - batch(operations: Array>): IsPromise>, F>; -}; -type StoreSync = Store; -type StoreAsync = Store; -type DatabaseSync = Record, M extends Record = {}> = Database; -type DatabaseAsync = Record, M extends Record = {}> = Database; -type GetOperation = { - type: 'get'; - key: string; -}; -type GetResult = { - key: string; - value: T | undefined; -}; -type SetOperation = { - type: 'set'; - key: string; - value: T; -}; -type DeleteOperation = { - type: 'delete'; - key: string; -}; -type StoreOperations = GetOperation | SetOperation | DeleteOperation; -type IsPromise = F extends true ? Promise : T; -//#endregion -//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/context.d.ts -//#region src/context.d.ts -type General = any; -type GeneralConstructor = new (...args: Array) => General; -type ModuleConstructor = new (context: C) => General; -type GeneralModuleInput = ReadonlyArray | ReadonlyArray; -type IsPlainObject = T extends object ? T extends Function | Date | RegExp | Array | Map | Set ? false : true : false; -type ShallowMerge = IsPlainObject extends true ? (IsPlainObject extends true ? Omit & B : B) : B; -type Keys = T extends General ? keyof T : never; -type InstanceEach = T extends ReadonlyArray ? { [K in keyof T]: InstanceType; } : T; -type PickEach, K extends PropertyKey> = { [I in keyof T]: Pick>; }; -type RootValue = RootKey extends keyof T ? Extract : {}; -type MergeRootEach> = { [I in keyof T]: ShallowMerge, RootValue>; }; -type ExtractKeyEach, K extends Keys> = { [I in keyof T]: K extends keyof T[I] ? T[I][K] : never; }; -type MergeObjects, O extends ReadonlyArray = MergeRootEach> = { [P in Keys]: MergeValues>; }; -type MergeSingleKey[number]>> = MergeValues, K>>; -type MergePair = [A] extends [never] ? B : [B] extends [never] ? A : ShallowMerge; -type MergeValues> = T extends readonly [infer First, ...infer Rest] ? [First] extends [never] ? MergeValues : Rest extends ReadonlyArray ? Rest['length'] extends 0 ? First : MergePair> : never : never; -type MergeResult[number]>, Pr extends object, Po extends object> = MergeObjects<[Pr, ...PickEach, K>, Po]>; -type Context$1[number]>, Pr extends object = {}, Po extends object = {}> = MergeResult & { - __modules__: WeakMap[number]>; - __getModule__: InstanceEach[number]>(ctor: C) => InstanceType; - __addModule__: >>(newModule: N) => Context$1<[...M, N], K, Pr, Po>; - __assign__: (obj: Partial>) => Context$1; -}; -declare const ROOT_KEY = "root"; -type RootKey = typeof ROOT_KEY; -//#endregion -//#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/reactive.d.ts -//#region src/reactive.d.ts -type RefMatchingFunc = (newValue: T, oldValue: T) => unknown; -type Ref = { - (): T; - (newValue: T): void; - subscribe(func: RefMatchingFunc, options?: { - immediate?: boolean; - }): () => void; - unsubscribe(func: RefMatchingFunc): void; - clear(): void; -}; -//#endregion -//#region src/modules/EventBus.d.ts -type Dispatch = (...[key, payload]: undefined extends O[K] ? [K] : [K, O[K]]) => void; -type On = (key: K, callback: (payload: O[K]) => void) => () => void; -declare class EventBus { - readonly events: { - logSync: string; - logGeneral: string; - errorSync: string; - errorGeneral: string; - }; - private readonly cleanupCallbacks; - private readonly isIdle; - private readonly syncLogs; - private readonly generalLogs; - constructor(); - private readonly getThisSync; - private readonly putSyncLog; - private readonly putGeneralLog; - private readonly subscribers; - private readonly on; - private readonly dispatch; - private readonly getLogs; - readonly dispose: () => void; - readonly root: { - dispatch: Dispatch; - getLogs: () => string; - isIdle: Ref; - on: On; - }; -} -//#endregion -//#region src/modules/I18n.d.ts -type ObsidianLanguageCode = 'en' | 'af' | 'am' | 'ar' | 'az' | 'be' | 'bg' | 'bn' | 'ca' | 'cs' | 'da' | 'de' | 'dv' | 'el' | 'en-GB' | 'eo' | 'es' | 'eu' | 'fa' | 'fi' | 'fr' | 'ga' | 'gl' | 'he' | 'hi' | 'hr' | 'hu' | 'id' | 'it' | 'ja' | 'ka' | 'kh' | 'kn' | 'ko' | 'ky' | 'la' | 'lt' | 'lv' | 'ml' | 'ms' | 'nan-TW' | 'ne' | 'nl' | 'nn' | 'no' | 'oc' | 'or' | 'pl' | 'pt' | 'pt-BR' | 'ro' | 'ru' | 'sa' | 'si' | 'sk' | 'sl' | 'sq' | 'sr' | 'sv' | 'sw' | 'ta' | 'te' | 'th' | 'tl' | 'tr' | 'tt' | 'uk' | 'ur' | 'uz' | 'vi' | 'zh' | 'zh-TW'; -type Primitive = string | number | boolean | null | undefined; -type Fragment = (frag: DocumentFragment, args: A) => void; -type TranslationResource = Record>; -type InterpolationValues = Record; -type TranslateParams | string> = R extends Fragment ? ([undefined] extends [A] ? [] : [A]) : [] | [InterpolationValues]; -type Translate = (key: K, ...args: TranslateParams) => O[K] extends string ? string : DocumentFragment; -declare class I18n { - private readonly targetLangs; - readonly i18n: {}; - private readonly registerI18n; - private readonly translate; - root: { - registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void; - translate: Translate; - }; -} -//#endregion -//#region src/modules/Storage.d.ts -type RecordStore = StoreAsync; -declare class Storage { - private readonly ctx; - private readonly memoryDB; - private readonly indexedDB; - constructor(ctx: { - getNamespace: () => string; - }); - private readonly getRecordStore; - private readonly deleteRecordStore; - private readonly clearRecordStores; - private readonly recordStoreExists; - readonly root: { - clearRecordStores: () => Promise; - deleteRecordStore: (namespace?: string) => MaybePromise; - getRecordStore: (namespace?: string) => { - get(key: string): Promise; - set(key: string, value: RecordStat): Promise; - delete(key: string): Promise; - clear(): Promise; - keys(): Promise; - values(): Promise; - entries(): Promise<[string, RecordStat][]>; - batch(operations: StoreOperations[]): Promise[]>; - }; - indexedDB: DatabaseAsync; - memoryDB: { - getStore(name: K): { - get(key: string): any; - set(key: string, value: any): void; - delete(key: string): void; - clear(): void; - keys(): string[]; - values(): any[]; - entries(): [string, any][]; - batch(operations: StoreOperations[]): GetResult[]; - }; - getStoreNames(): string[]; - deleteStore(name: string): void; - clearStores(): void; - getMeta(key: T): any; - setMeta(key: T, value: any): void; - dispose(): void; - }; - recordStoreExists: (namespace?: string) => MaybePromise; - }; - readonly dispose: () => void; -} -//#endregion -//#region src/sync/tasks/interface.d.ts -type BaseTaskOptions = { - localFs: Fs; - remoteFs: Fs; - record: RecordStore; -}; -type TaskNames = 'addRecord' | 'removeRecord' | 'createLocalDir' | 'createRemoteDir' | 'download' | 'resolveConflict' | 'removeLocal' | 'removeRemote' | 'upload' | 'moveLocal' | 'moveRemote'; -type ConflictResolverPayload = { - local: FileStat; - remote: FileStat; - key: string; - localFs: Fs; - remoteFs: Fs; - record: RecordStore; -}; -type ConflictResolver = (payload: ConflictResolverPayload) => MaybePromise; -declare abstract class BaseTask { - readonly options: BaseTaskOptions & T; - constructor(options: BaseTaskOptions & T); - protected readonly remoteFs: Fs; - protected readonly localFs: Fs; - protected readonly record: RecordStore; - name: TaskNames; - prettyName: string; - readonly key: string; - readonly local: (BaseTaskOptions & T)['local']; - readonly remote: (BaseTaskOptions & T)['remote']; - abstract exec(): MaybePromise; -} -//#endregion -//#region src/sync/tasks/AddRecord.d.ts -declare class AddRecord extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/CreateRemoteDir.d.ts -declare class CreateRemoteDir extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/Download.d.ts -declare class Download extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/MoveLocal.d.ts -declare class MoveLocal extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/MoveRemote.d.ts -declare class MoveRemote extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/RemoveLocal.d.ts -declare class RemoveLocal extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/RemoveRecord.d.ts -declare class RemoveRecord extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/RemoveRemote.d.ts -declare class RemoveRemote extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/tasks/ResolveConflict.d.ts -declare class ResolveConflict extends BaseTask { - exec: () => MaybePromise; -} -//#endregion -//#region src/sync/tasks/Upload.d.ts -declare class Upload extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/sync/decision/interface.d.ts -type TaskOptions = { - key: string; - remote?: Stat$1; - local?: Stat$1; -}; -type OptionsWithRemoteFileStat = { - remote: FileStat; -} & TaskOptions; -type OptionsWithLocalFileStat = { - local: FileStat; -} & TaskOptions; -type OptionsWithRemoteFolderStat = { - remote: FolderStat; -} & TaskOptions; -type OptionsWithLocalFolderStat = { - local: FolderStat; -} & TaskOptions; -type OptionsWithLocalStat = { - local: Stat$1; -} & TaskOptions; -type OptionsWithRemoteStat = { - remote: Stat$1; -} & TaskOptions; -type OptionsWithBothStats = { - local: Stat$1; - remote: Stat$1; -} & TaskOptions; -type OptionsWithBothFileStats = { - local: FileStat; - remote: FileStat; -} & TaskOptions; -type OptionsWithLocalStatAndOldKey = { - local: Stat$1; - oldKey: string; -} & TaskOptions; -type OptionsWithRemoteStatAndOldKey = { - remote: Stat$1; - oldKey: string; -} & TaskOptions; -type TaskOptionsMap = { - download: OptionsWithRemoteFileStat; - upload: OptionsWithLocalFileStat; - resolveConflict: OptionsWithBothFileStats; - removeLocal: OptionsWithLocalStat; - removeRemote: OptionsWithRemoteStat; - createLocalDir: OptionsWithRemoteFolderStat; - createRemoteDir: OptionsWithLocalFolderStat; - removeRecord: TaskOptions; - addRecord: OptionsWithBothStats; - moveLocal: OptionsWithRemoteStatAndOldKey; - moveRemote: OptionsWithLocalStatAndOldKey; -}; -declare const taskMap: { - readonly addRecord: typeof AddRecord; - readonly createLocalDir: typeof CreateLocalDir; - readonly createRemoteDir: typeof CreateRemoteDir; - readonly download: typeof Download; - readonly moveLocal: typeof MoveLocal; - readonly moveRemote: typeof MoveRemote; - readonly removeLocal: typeof RemoveLocal; - readonly removeRecord: typeof RemoveRecord; - readonly removeRemote: typeof RemoveRemote; - readonly resolveConflict: typeof ResolveConflict; - readonly upload: typeof Upload; -}; -type TaskFactory = (name: N, options: TaskOptionsMap[N]) => InstanceType<(typeof taskMap)[N]>; -type Decider = (input: DeciderInput) => Array; -type DeciderInput = { - localStats: StatsMap; - remoteStats: StatsMap; - records: RecordStatsMap; - taskFactory: TaskFactory; - logger: (log: string) => void; -}; -//#endregion -//#region src/sync/tasks/CreateLocalDir.d.ts -declare class CreateLocalDir extends BaseTask { - exec(): Promise; -} -//#endregion -//#region src/modules/Sync.d.ts -type SyncTerminateReason = { - result: 'cancelled'; -} | { - result: 'completed'; -} | { - result: 'failed'; - error: string; -} | { - result: 'noop'; -}; -type TaskInfo = { - name: TaskNames; - key: string; - prettyName: string; - isDir: boolean; -}; -type FailedTaskInfo = TaskInfo & { - error: string; -}; -declare class Sync { - private readonly ctx; - dispatch: Dispatch; - on: On; - constructor(ctx: { - dispatch: Dispatch; - initializeSync: () => Infras; - getDecider: () => Decider; - on: On; - translate: Translate; - listRemote: RemoteLister; - getConflictResolver: () => ConflictResolver; - }); - readonly events: { - syncStarted: { - isCancelled: Ref; - trigger: string; - }; - remoteWalkProgress: Progress; - syncTerminated: SyncTerminateReason; - requestConfirmDelete: Array; - requestConfirmTasks: Array; - syncCanceled: undefined; - taskCompleted: TaskInfo; - taskFailed: FailedTaskInfo; - executionStarted: Array; - }; - readonly settings: { - maxFileSize: TogglableValue; - exclusionRules: Array; - inclusionRules: Array; - confirmDeleteInAutoSync: boolean; - confirmTasksInSync: boolean; - }; - private readonly postProcess; - private readonly confirmTasks; - private readonly confirmDeletion; - private readonly executeSync; - private readonly convertDeleteToUpload; - root: { - executeSync: (trigger: string) => Promise<{ - result: 'cancelled'; - } | { - result: 'completed'; - } | { - result: 'failed'; - error: string; - } | { - result: 'noop'; - }>; - }; -} -//#endregion -//#region src/modules/Observability.d.ts -type SyncStage = 'none' | 'walkingRemote' | 'awaitingConfirmation' | 'executing' | 'completed' | 'completedNoop' | 'cancelled' | 'failed'; -type AddRibbonIcon = (icon: IconName, title: string, callback: (evt: MouseEvent) => void) => HTMLElement; -declare class Observability { - private readonly ctx; - private lastSyncTime; - private readonly sinceLastSyncText; - private readonly syncStage; - private readonly walkProgress; - private readonly executionProgress; - private readonly cleanupCallbacks; - private readonly t; - private readonly progressText; - readonly settings: { - noticeStatusOnMobile: boolean; - }; - readonly i18n: { - startSync: string; - startNonInteractiveSync: string; - stopSync: string; - showProgress: string; - exportLogsToFile: string; - exportLogsFailed: string; - idle: string; - }; - constructor(ctx: { - addStatusBarItem: () => HTMLElement; - on: On; - translate: Translate; - isIdle: Ref; - dispatch: Dispatch; - requestSync: (trigger: string) => Promise; - showProgress: () => void; - addCommand: (command: Command) => Command; - addRibbonIcon: AddRibbonIcon; - getLogs: () => string; - app: App; - }); - readonly start: () => void; - private readonly setupStatus; - private readonly setupCommands; - private readonly exportLogs; - readonly dispose: () => void; - root: { - executionProgress: Ref>; - exportLogs: () => Promise; - syncStage: Ref; - walkProgress: Ref; - }; -} -//#endregion -//#region src/components/file-tree/index.d.ts -type FileTreeTranslations = { - selectAll: string; -}; -//#endregion -//#region src/components/HeadersEditorModal.d.ts -type HeadersEditorTranslations = { - add: string; - cancel: string; - addSecretHeader: string; - remove: string; - save: string; - customHeadersDescription: string; - editHeaders: string; - headerKeyPlaceholder: string; - headerValuePlaceholder: string; - omittedInvalidEntry: string; -}; -//#endregion -//#region src/components/MigrationModal.d.ts -type MigrationModalTranslations = { - cancel: string; - remoteMigration: string; - migrationProcess: string; - startMigration: string; - migrationDescription: string; - migrationPhase1Description: string; - migrationPhase2Description: string; - migrationPhase3Description: string; - toggleWithoutMigration: string; - migrationFailed: string; - completed: string; - hide: string; - done: string; -}; -type MigrationEvents = { - migrationProgress: Progress; - migrationFailed: string; -}; -type MigrationContext = { - app: App; - on: On; - dispatch: Dispatch; - translate: Translate; - requestSync: (trigger: string) => Promise; - initializeSync: () => Infras; - memoryDB: ExistingMemoryDB; -}; -declare function setNeedMigration(ctx: MigrationContext, { toggle, needMigration, content, apply }: { - toggle: ToggleComponent; - needMigration?: (value: boolean) => MaybePromise; - content: (value: boolean) => string | DocumentFragment; - apply: (value: boolean) => MaybePromise; -}): void; -//#endregion -//#region src/sdk/prefix.d.ts -declare function prefixWrapper(original: Fs, prefix: string): WrappedFs; -//#endregion -//#region src/utils/pipe.d.ts -declare function pipe({ from, to, stat, key }: { - from: Fs; - to: Fs; - key: string; - stat: FileStat; -}): Promise; -declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise | undefined>; -declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream, stat: FileStat): MaybePromise; -//#endregion -//#region src/sdk/index.d.ts -declare function digOriginal(wrapped: Fs): RootFs; -type SelectFromContext = Context extends O ? O : never; -//#endregion -//#region src/modules/Extensibility.d.ts -type ModuleInstance = { - moduleSettings: object; - dispose?: () => void; - start?: () => void; -}; -type ModuleCtor = new (ctx: object) => ModuleInstance; -type ModuleMeta = { - id: string; - name: string; - version: string; - description: string; - main: string; - icon?: string; - minPluginVersion?: string; - integrity: string; -}; -type AugmentedModuleMeta = ModuleMeta & { - enabled: boolean; - source: string; - icon: string; -}; -declare class Extensibility { - private readonly ctx; - private readonly moduleDir; - private readonly sourceCache; - private readonly discoveredModules; - private readonly loadedModules; - private readonly moduleStore; - private autoUpdateTimeout?; - readonly settings: { - moduleSources: Array; - moduleAutoUpdate: boolean; - modules: Record; - }; - readonly i18n: { - failedToLoadModule: string; - failedToDownloadModule: string; - failedToFetchSource: string; - }; - readonly events: { - moduleLoaded: string; - moduleUnloaded: string; - }; - constructor(ctx: { - app: App; - __addModule__: Context['__addModule__']; - __getModule__: Context['__getModule__']; - dispatch: Dispatch; - translate: Translate; - allModules: Set; - isIdle: Ref; - saveSettings: () => Promise; - indexedDB: DatabaseAsync>; - }); - readonly start: () => void; - private readonly createOperationFactory; - private readonly loadAllModules; - private readonly loadModule; - private readonly unloadModule; - private readonly downloadModule; - private readonly deleteModule; - private readonly fetchSources; - private readonly updateModules; - private readonly updateModuleMeta; - private readonly enableModule; - private readonly disableModule; - private readonly getModulePath; - private readonly parseModulePath; - readonly dispose: () => void; - readonly root: { - deleteModule: (id: string) => Promise; - disableModule: (id: string) => void; - discoveredModules: Map; - downloadModule: (meta: AugmentedModuleMeta, waitIdle?: boolean) => Promise; - enableModule: (id: string) => Promise; - fetchSources: (manual?: boolean) => Promise; - loadAllModules: () => Promise; - loadModule: (meta: AugmentedModuleMeta, start?: boolean, module?: string) => Promise; - loadedModules: Map; - unloadModule: (id: string) => void; - updateModuleMeta: (meta: AugmentedModuleMeta) => Promise; - updateModules: () => Promise; - }; -} -//#endregion -//#region src/components/ModuleEditorModal.d.ts -type ModuleEditorTranslations = { - editModuleInformation: string; - enable: string; - name: string; - namePlaceholder: string; - description: string; - descriptionPlaceholder: string; - icon: string; - iconDescription: Fragment; - iconPlaceholder: string; - updateSource: string; - updateSourceDescription: string; - updateSourcePlaceholder: string; - invalidValue: string; - integrityVerification: string; - integrityVerificationDescription: Fragment; - save: string; - cancel: string; -}; -//#endregion -//#region src/components/UnknownModuleModal.d.ts -type FileInfo = { - path: string; - size: string; - mtime: string; - ctime: string; - fileName: string; -}; -type UnknownModuleTranslations = { - unknownModule: string; - unknownModuleDescription: Fragment; - delete: string; - configure: string; -}; -//#endregion -//#region src/settings/controls.d.ts -type ControlsSettingTranslations = { - controls: string; - maxFileSize: string; - maxFileSizeDescription: string; - maxFileSizePlaceholder: string; - maxRequestConcurrency: string; - minRequestInterval: string; - minRequestIntervalDescription: string; - minRequestIntervalPlaceholder: string; - maxRequestConcurrencyPlaceholder: string; - maxRequestConcurrencyDescription: string; - maxMemoryConsumption: string; - maxMemoryConsumptionDescription: string; - maxMemoryConsumptionPlaceholder: string; - invalidValue: string; -}; -//#endregion -//#region src/settings/development.d.ts -type DevelopmentSettingTranslations = { - development: string; - clearRecords: string; - recordsCleared: string; - clear: string; - clearRecordsDescription: string; - export: string; - exportLogsDescription: string; - exportLogsToFile: string; -}; -//#endregion -//#region src/settings/features.d.ts -type FeaturesSettingTranslations = { - features: string; - realtimeSyncFastMode: string; - realtimeSyncFastModeDescription: string; - realtimeSync: string; - realtimeSyncDescription: string; - realtimeSyncPlaceholder: string; - startupSync: string; - startupSyncDescription: string; - startupSyncPlaceholder: string; - scheduledSync: string; - scheduledSyncDescription: string; - scheduledSyncPlaceholder: string; - asymmetricStorage: string; - asymmetricStorageDescription: Fragment; - asymmetricStorageMigration: Fragment<'enable' | 'disable'>; - invalidValue: string; -} & MigrationModalTranslations; -//#endregion -//#region src/components/FilterEditorModal.d.ts -type FilterEditorTranslations = { - cancel: string; - remove: string; - save: string; - add: string; - inclusionRules: string; - exclusionRules: string; - inclusionRulesDescription: string; - exclusionRulesDescription: string; - filterPlaceholder: string; -}; -//#endregion -//#region src/settings/filter.d.ts -type FilterSettingTranslations = { - filterRules: string; - edit: string; -} & FilterEditorTranslations; -//#endregion -//#region src/settings/head.d.ts -type HeadSettingTranslations = { - moduleAutoUpdate: string; - moduleAutoUpdateDescription: string; - moduleManagement: string; - moduleManagementDescription: string; - openPanel: string; - backend: string; - backendDescription: string; - syncStrategy: string; - syncStrategyDescription: string; - checkConnectionFailed: string; - checkConnectionSuccess: string; - checkConnection: string; - conflictResolveStrategy: string; - conflictResolveStrategyDescription: string; -}; -//#endregion -//#region src/settings/miscellaneous.d.ts -type MiscellaneousSettingTranslations = { - miscellaneous: string; - diffMatchPatch: string; - keepLocal: string; - keepRemote: string; - skip: string; - noticeStatusOnMobile: string; - noticeStatusOnMobileDescription: string; - confirmTasksInSync: string; - confirmTasksInSyncDescription: string; - confirmDeleteInAutoSync: string; - confirmDeleteInAutoSyncDescription: string; - customHeaders: string; - customHeadersDescription: string; - edit: string; -}; -//#endregion -//#region src/modules/Bootstrap.d.ts -type CustomHeaders = Array<{ - type: 'plaintext' | 'secret'; - value: string; - key: string; -}>; -type ExistingMemoryDB = DatabaseSync<{ - localContext20000: Stat$1; - remoteContext10000: Stat$1; - remoteContext20000: Stat$1; -}, { - localContext20000Marker: string; - remoteContext10000Marker: string; - remoteContext20000Marker: string; -}>; -declare class Bootstrap { - private readonly ctx; - private readonly cleanupCallbacks; - private readonly memoryStates; - private isCancelled?; - private readonly localPool; - private readonly remotePool; - private localFs?; - private remoteFs?; - readonly i18n: { - bidirectional: string; - latestSurvive: string; - keepLocal: string; - keepRemote: string; - renameAndKeepBoth: string; - skip: string; - } & ControlsSettingTranslations & DevelopmentSettingTranslations & FeaturesSettingTranslations & FilterSettingTranslations & HeadSettingTranslations & MiscellaneousSettingTranslations & HeadersEditorTranslations & UnknownModuleTranslations & ModuleEditorTranslations & FileTreeTranslations; - readonly settings: { - maxMemoryConsumption: TogglableValue; - maxRequestConcurrency: TogglableValue; - minRequestInterval: TogglableValue; - realtimeSyncFastMode: boolean; - asymmetricStorage: boolean; - customHeaders: CustomHeaders; - }; - constructor(ctx: { - app: App; - registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void; - on: On; - dispatch: Dispatch; - memoryDB: ExistingMemoryDB; - registerDecider: (id: string, entry: DeciderEntry) => void; - registerLocalFsWrapper: (entry: FsWrapperEntry) => void; - registerRemoteFs: (id: string, entry: RemoteFsEntry) => void; - registerRemoteFsWrapper: (entry: FsWrapperEntry) => void; - translate: Translate; - optimizeLocal: BatchOptimizer; - optimizeRemote: BatchOptimizer; - registerLocalOptimizer: (optimizer: OptimizerEntry) => void; - registerRemoteOptimizer: (optimizer: OptimizerEntry) => void; - registerRemoteLister: (entry: RemoteListerEntry) => () => boolean; - registerSetting: (entry: SettingEntry) => () => boolean; - registerConflictResolver: (id: string, entry: ConflictResolverEntry) => void; - registerRemoteRequestMiddleware: (entry: RemoteRequestMiddlewareEntry) => void; - registerLocalRequestMiddleware: (entry: LocalRequestMiddlewareEntry) => void; - }); - readonly start: () => void; - readonly dispose: () => void; -} -//#endregion -//#region src/components/module-management/index.d.ts -type ModuleManagementTranslations = { - disableModule: string; - downloadModule: string; - enableModule: string; - installed: string; - loadingModules: string; - noInstalledModulesFound: string; - noMatchingModulesFound: string; - noModulesAvailable: string; - updateAvailable: string; - updateModule: string; - deleteModule: string; - editModuleInformation: string; - official: string; -}; -//#endregion -//#region src/components/SourceEditorModal.d.ts -type SourceEditorTranslations = { - add: string; - cancel: string; - editSources: string; - omittedInvalidEntry: string; - moduleSourcePlaceholder: string; - remove: string; - save: string; - sourcesDescription: string; - httpInsecureWarning: string; -}; -//#endregion -//#region src/modules/ModulesModal.d.ts -type ModulesModalTranslations = ModuleManagementTranslations & SourceEditorTranslations & { - searchModules: string; - editSources: string; - moduleManagement: string; - showInstalledOnly: string; - configurations: string; -}; -declare class ModulesModal extends Modal { - private readonly ctx; - private readonly t; - private readonly modalCleanup; - private sourceEditorModal?; - private showInstalledOnly; - constructor(ctx: { - app: App; - translate: Translate; - saveSettings: () => Promise; - fetchSources: (manual?: boolean) => Promise>; - discoveredModules: Map; - loadedModules: Map; - downloadModule: (meta: AugmentedModuleMeta) => Promise; - deleteModule: (id: string) => Promise; - loadModule: (meta: AugmentedModuleMeta, start?: boolean) => Promise; - unloadModule: (id: string) => void; - enableModule: (id: string) => Promise; - disableModule: (id: string) => void; - updateModuleMeta: (meta: AugmentedModuleMeta) => Promise; - }); - readonly i18n: ModulesModalTranslations; - readonly settings: { - moduleSources: Array; - }; - root: { - closeModuleManagement: () => void; - openModuleManagement: () => void; - }; - onOpen(): void; - onClose(): void; - private readonly openSourceEditorModal; - dispose(): void; -} -//#endregion -//#region src/modules/ProgressModal.d.ts -type DeleteConfirmReturn = { - delete: Array; - reupload: Array; -}; -declare class ProgressModal extends Modal { - private readonly ctx; - private readonly moduleCleanupCallbacks; - private readonly t; - private opening; - private readonly modalCleanupCallbacks; - private readonly dispatch; - private description?; - private detailContainer?; - private controls?; - constructor(ctx: { - app: App; - translate: Translate; - on: On; - dispatch: Dispatch; - syncStage: Ref; - walkProgress: Ref; - executionProgress: Ref>; - }); - readonly events: { - tasksConfirmed: Array; - deleteConfirmed: DeleteConfirmReturn; - }; - readonly i18n: { - syncProgress: string; - completed: string; - failedTasksDescription: string; - confirmDeleteDescription: string; - confirmTasksDescription: Fragment; - hide: string; - confirm: string; - cancel: string; - done: string; - stopSync: string; - } & Record; - private readonly renderHideStop; - private readonly renderConfirmCancel; - private readonly renderDone; - private readonly showDetails; - private readonly hideDetails; - onOpen(): void; - root: { - hideProgress: () => void; - showProgress: () => void; - }; - onClose(): void; - dispose(): void; -} -//#endregion -//#region src/modules/Scheduler.d.ts -declare class Scheduler { - private readonly ctx; - private readonly pendingRequests; - private isScheduling; - private realtimeSyncTimer?; - private scheduledSyncTimer?; - private startupSyncTimer?; - constructor(ctx: { - syncStage: Ref; - executeSync: (trigger: string) => Promise; - registerEvent: (ref: EventRef) => void; - app: App; - isIdle: Ref; - }); - settings: { - startupSync: TogglableValue; - scheduledSync: TogglableValue; - realtimeSync: TogglableValue; - exclusionRules: Array; - inclusionRules: Array; - }; - private readonly requestSync; - start: () => void; - dispose: () => void; - private readonly startScheduledSync; - private readonly stopScheduledSync; - private readonly onChange; - private readonly scheduleFlush; - private readonly flush; - root: { - requestSync: (trigger: string) => Promise; - startScheduledSync: () => void; - stopScheduledSync: () => void; - }; -} -//#endregion -//#region src/index.d.ts -declare const internalModules: readonly [typeof EventBus, typeof I18n, typeof Storage, typeof Extensibility, typeof Registrar, typeof Sync, typeof Observability, typeof Scheduler, typeof ProgressModal, typeof ModulesModal, typeof Bootstrap]; -type InternalModules = typeof internalModules; -type MergeKeys = 'settings' | 'root' | 'events' | 'i18n'; -type Context = Context$1 Command; - registerEvent: (ref: EventRef) => void; - addRibbonIcon: AddRibbonIcon; - addStatusBarItem: () => HTMLElement; - saveSettings: () => Promise; -}>; -type Events = MergeSingleKey; -type Settings = MergeSingleKey; -type Translations = MergeSingleKey; -//#endregion -//#region src/modules/Registrar.d.ts -type RejectableWrapper = (value: T) => T | undefined; -type OrderedWrapperEntry = { - priority: number; - apply: RejectableWrapper; -}; -type RemoteRequestMiddlewareEntry = OrderedWrapperEntry; -type LocalRequestMiddlewareEntry = OrderedWrapperEntry; -type FsWrapperEntry = OrderedWrapperEntry; -type CheckConnectionResult = { - success: true; -} | { - success: false; - reason: string; -}; -type RemoteFsEntry = { - instantiate: (request: Request) => RootFs; - prettyName: () => string; - checkConnection: (request: Request) => MaybePromise; -}; -type DeciderEntry = { - decider: Decider; - prettyName: () => string; -}; -type ConflictResolverEntry = { - prettyName: () => string; - resolver: ConflictResolver; -}; -type GeneralFn = (...args: ReadonlyArray) => unknown; -type RejectableApply = (...input: Parameters) => ReturnType | undefined; -type OrderedApplyEntry = { - apply: RejectableApply; - priority: number; -}; -type RemoteLister = (info: Infras & { - trigger: string; - reporter: ListReporter; -}) => MaybePromise>; -type RemoteListerEntry = OrderedApplyEntry; -type OptimizerEntry = OrderedApplyEntry; -type SettingEntry = { - priority: number; - apply: (el: HTMLElement) => void; -}; -type RequestParam = Omit & { - body?: string | Binary; -}; -type RequestResponse = { - text: () => string; - bytes: () => Binary; - json: () => General$1; - headers: Record; - status: number; -}; -type Request = (params: RequestParam | string) => Promise; -type Infras = { - localFs: Fs; - remoteFs: Fs; - record: RecordStore; -}; -declare class Registrar { - private readonly ctx; - private settingTab?; - private readonly cleanupCallbacks; - private readonly localFsWrapperRegistry; - private readonly remoteFsWrapperRegistry; - private readonly localOptimizerRegistry; - private readonly remoteOptimizerRegistry; - private readonly remoteListerRegistry; - private readonly settingRegistry; - private readonly remoteRequestMiddlewareRegistry; - private readonly localRequestMiddlewareRegistry; - private readonly remoteFsRegistry; - private readonly deciderRegistry; - private readonly conflictResolverRegistry; - readonly settings: { - remoteFs: string; - decider: string; - conflictResolver: string; - }; - constructor(ctx: { - app: App; - on: On; - getRecordStore: (namespace?: string) => StoreAsync; - }); - private readonly getVaultRequest; - private readonly createLocalFs; - private readonly createRemoteFs; - private readonly getRequest; - private readonly getCheckConnection; - private readonly getDecider; - private readonly optimizeLocal; - private readonly optimizeRemote; - private readonly listRemote; - private readonly getConflictResolver; - private readonly getNamespace; - private readonly initializeSync; - private readonly addSettingTab; - private readonly rerenderSettingTab; - root: { - addSettingTab: (plugin: Plugin) => void; - conflictResolverRegistry: Map; - createLocalFs: () => Fs; - createRemoteFs: (remoteFs?: string) => RootFs; - deciderRegistry: Map; - getCheckConnection: (remoteFs?: string) => () => MaybePromise; - getConflictResolver: () => ConflictResolver; - getDecider: () => Decider; - getNamespace: (localFs?: Fs, remoteFs?: Fs) => string; - getRequest: () => Request; - getVaultRequest: () => VaultRequest; - initializeSync: () => Infras; - listRemote: RemoteLister; - optimizeLocal: BatchOptimizer; - optimizeRemote: BatchOptimizer; - registerConflictResolver: (key: string, entry: ConflictResolverEntry) => () => boolean; - registerCss: (css: string) => () => void; - registerDecider: (key: string, entry: DeciderEntry) => () => boolean; - registerLocalFsWrapper: (entry: FsWrapperEntry) => () => boolean; - registerLocalOptimizer: (entry: OptimizerEntry) => () => boolean; - registerLocalRequestMiddleware: (entry: LocalRequestMiddlewareEntry) => () => boolean; - registerRemoteFs: (key: string, entry: RemoteFsEntry) => () => boolean; - registerRemoteFsWrapper: (entry: FsWrapperEntry) => () => boolean; - registerRemoteLister: (entry: RemoteListerEntry) => () => boolean; - registerRemoteOptimizer: (entry: OptimizerEntry) => () => boolean; - registerRemoteRequestMiddleware: (entry: RemoteRequestMiddlewareEntry) => () => boolean; - registerSetting: (entry: SettingEntry) => () => boolean; - remoteFsRegistry: Map; - rerenderSettingTab: () => void | undefined; - }; - readonly dispose: () => void; -} -//#endregion -//#region src/fs/vault/request.d.ts -type VaultRequestParam = { - method: 'GET'; - key: string; -} | { - method: 'GET_STREAM'; - key: string; -} | { - method: 'PUT'; - key: string; - value: Binary; - headers?: { - mtime?: number; - ctime?: number; - }; -} | { - method: 'APPEND'; - key: string; - value: Binary; - headers?: { - mtime?: number; - ctime?: number; - }; -} | { - method: 'DELETE'; - key: string; - headers?: { - permanent?: boolean; - }; -} | { - method: 'MOVE'; - key: string; - headers: { - destination: string; - }; -} | { - method: 'MKDIR'; - key: string; -} | { - method: 'EXISTS'; - key: string; -} | { - method: 'STAT'; - key: string; - headers?: { - cached?: boolean; - }; -} | { - method: 'LIST'; - key: string; - headers?: { - cached?: boolean; - }; -}; -type VaultRequestResponseMap = { - GET: Binary; - GET_STREAM: ReadableStream; - PUT: void; - APPEND: void; - DELETE: void; - MOVE: void; - MKDIR: void; - EXISTS: boolean; - STAT: Stat; - LIST: ListedFiles; -}; -type VaultRequest = (params: T) => Promise; -//#endregion -export { TranslationResource as $, SyncTerminateReason as A, MoveRemote as B, SelectFromContext as C, FolderStat as Ct, writeWithValue as D, RecordStatsMap as Dt, readWithSize as E, RecordStat as Et, Upload as F, BaseTask as G, Download as H, ResolveConflict as I, TaskNames as J, ConflictResolver as K, RemoveRemote as L, Decider as M, DeciderInput as N, prefixWrapper as O, Stat$1 as Ot, TaskFactory as P, Translate as Q, RemoveRecord as R, ModuleMeta as S, FileStat as St, pipe as T, Progress as Tt, CreateRemoteDir as U, MoveLocal as V, AddRecord as W, Fragment as X, RecordStore as Y, ObsidianLanguageCode as Z, Events as _, OutputAtom as _t, FsWrapperEntry as a, StoreOperations as at, ExistingMemoryDB as b, WriteAtom as bt, RemoteFsEntry as c, CustomAtom as ct, RemoteRequestMiddlewareEntry as d, InputAtom as dt, Dispatch as et, Request as f, ListReporter as ft, Context as g, OptimizerOutput as gt, SettingEntry as h, OptimizerInput as ht, DeciderEntry as i, StoreAsync as it, CreateLocalDir as j, setNeedMigration as k, StatsMap as kt, RemoteLister as l, DeleteAtom as lt, RequestResponse as m, MoveAtom as mt, CheckConnectionResult as n, DatabaseAsync as nt, LocalRequestMiddlewareEntry as o, StoreSync as ot, RequestParam as p, MkdirAtom as pt, ConflictResolverPayload as q, ConflictResolverEntry as r, DatabaseSync as rt, OptimizerEntry as s, BatchOptimizer as st, VaultRequest as t, On as tt, RemoteListerEntry as u, Fs as ut, Settings as v, RootFs as vt, digOriginal as w, MaybePromise as wt, AugmentedModuleMeta as x, Binary as xt, Translations as y, WrappedFs as yt, RemoveLocal as z }; \ No newline at end of file