@hesprs/sync-engine-sdk 3.1.5 → 3.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/dev.js +1 -1
  2. package/dist/dev.spec.d.ts +1 -1
  3. package/dist/index-lLeUlsPq.spec.d.ts +1404 -0
  4. package/dist/index.js +1 -1
  5. package/dist/index.spec.d.ts +2 -834
  6. package/dist/node_modules/.bun/synthkernel@._synthkernel.tgz/node_modules/synthkernel/dist/reactive.js +1 -0
  7. package/dist/packages/plugin/src/components/MigrationModal.js +1 -0
  8. package/dist/prefix.js +1 -1
  9. package/package.json +1 -1
  10. package/dist/index-g3mTMY1u.spec.d.ts +0 -560
  11. package/dist/plugin/src/components/MigrationModal.js +0 -1
  12. /package/dist/{plugin → packages/plugin}/src/components/render-progress.js +0 -0
  13. /package/dist/{plugin → packages/plugin}/src/fs/wrappers/memory-control.js +0 -0
  14. /package/dist/{plugin → packages/plugin}/src/settings/utils.js +0 -0
  15. /package/dist/{plugin → packages/plugin}/src/sync/decision/interface.js +0 -0
  16. /package/dist/{plugin → packages/plugin}/src/sync/tasks/AddRecord.js +0 -0
  17. /package/dist/{plugin → packages/plugin}/src/sync/tasks/CreateLocalDir.js +0 -0
  18. /package/dist/{plugin → packages/plugin}/src/sync/tasks/CreateRemoteDir.js +0 -0
  19. /package/dist/{plugin → packages/plugin}/src/sync/tasks/Download.js +0 -0
  20. /package/dist/{plugin → packages/plugin}/src/sync/tasks/MoveLocal.js +0 -0
  21. /package/dist/{plugin → packages/plugin}/src/sync/tasks/MoveRemote.js +0 -0
  22. /package/dist/{plugin → packages/plugin}/src/sync/tasks/RemoveLocal.js +0 -0
  23. /package/dist/{plugin → packages/plugin}/src/sync/tasks/RemoveRecord.js +0 -0
  24. /package/dist/{plugin → packages/plugin}/src/sync/tasks/RemoveRemote.js +0 -0
  25. /package/dist/{plugin → packages/plugin}/src/sync/tasks/ResolveConflict.js +0 -0
  26. /package/dist/{plugin → packages/plugin}/src/sync/tasks/Upload.js +0 -0
  27. /package/dist/{plugin → packages/plugin}/src/sync/tasks/interface.js +0 -0
  28. /package/dist/{plugin → packages/plugin}/src/utils/move-value.js +0 -0
  29. /package/dist/{plugin → packages/plugin}/src/utils/pipe.js +0 -0
  30. /package/dist/{plugin → packages/plugin}/src/utils/round-percent.js +0 -0
  31. /package/dist/{plugin → packages/plugin}/src/utils/sha-256.js +0 -0
  32. /package/dist/{plugin → packages/plugin}/src/utils/to-error-message.js +0 -0
  33. /package/dist/{plugin → packages/plugin}/test/test-kit.js +0 -0
  34. /package/dist/{shared → packages/shared}/src/get-status.js +0 -0
  35. /package/dist/{shared → packages/shared}/src/path.js +0 -0
@@ -1,834 +1,2 @@
1
- import { $ as RootFs, A as AddRecord, B as StoreOperations, C as RemoveRemote, D as MoveLocal, E as MoveRemote, F as RecordStore, G as Fs, H as BatchOptimizer, I as Storage, J as MkdirAtom, K as InputAtom, L as DatabaseAsync, M as ConflictResolver, N as ConflictResolverPayload, O as Download, P as TaskNames, Q as OutputAtom, R as DatabaseSync, S as ResolveConflict, T as RemoveLocal, U as CustomAtom, V as StoreSync, W as DeleteAtom, X as OptimizerInput, Y as MoveAtom, Z as OptimizerOutput, _ as CreateLocalDir, a as FsWrapperEntry, at as MaybePromise, b as TaskFactory, c as OptimizerEntry, ct as RecordStatsMap, d as RemoteLister, dt as TogglableValue, et as WrappedFs, f as RemoteListerEntry, ft as Binary, g as RequestResponse, h as RequestParam, i as DeciderEntry, it as GlobMatchRule, j as BaseTask, k as CreateRemoteDir, l as Registrar, lt as Stat, m as Request, n as CheckConnectionResult, nt as FileStat, o as Infras, ot as Progress, p as RemoteRequestMiddlewareEntry, pt as General$1, q as ListReporter, r as ConflictResolverEntry, rt as FolderStat, s as LocalRequestMiddlewareEntry, st as RecordStat, t as VaultRequest, tt as WriteAtom, u as RemoteFsEntry, ut as StatsMap, v as Decider, w as RemoveRecord, x as Upload, y as DeciderInput, z as StoreAsync } from "./index-g3mTMY1u.spec.js";
2
- import { App, Command, EventRef, ExtraButtonComponent, IconName, Modal, Plugin, Setting, SettingDefinition, SettingDefinitionGroup, SettingDefinitionItem, SettingDefinitionList, SettingDefinitionPage, TextComponent, ToggleComponent } from "obsidian";
3
- //#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/context.d.ts
4
- //#region src/context.d.ts
5
- type General = any;
6
- type GeneralConstructor = new (...args: Array<General>) => General;
7
- type ModuleConstructor<C extends object> = new (context: C) => General;
8
- type GeneralModuleInput = ReadonlyArray<GeneralConstructor> | ReadonlyArray<object>;
9
- type IsPlainObject<T> = T extends object ? T extends Function | Date | RegExp | Array<any> | Map<any, any> | Set<any> ? false : true : false;
10
- type ShallowMerge<A, B> = IsPlainObject<A> extends true ? (IsPlainObject<B> extends true ? Omit<A, keyof B> & B : B) : B;
11
- type Keys<T> = T extends General ? keyof T : never;
12
- type InstanceEach<T extends GeneralModuleInput> = T extends ReadonlyArray<GeneralConstructor> ? { [K in keyof T]: InstanceType<T[K]>; } : T;
13
- type PickEach<T extends ReadonlyArray<object>, K extends PropertyKey> = { [I in keyof T]: Pick<T[I], Extract<K, keyof T[I]>>; };
14
- type RootValue<T extends object> = RootKey extends keyof T ? Extract<T[RootKey], object> : {};
15
- type MergeRootEach<T extends ReadonlyArray<object>> = { [I in keyof T]: ShallowMerge<Omit<T[I], RootKey>, RootValue<T[I]>>; };
16
- type ExtractKeyEach<T extends ReadonlyArray<object>, K extends Keys<T>> = { [I in keyof T]: K extends keyof T[I] ? T[I][K] : never; };
17
- type MergeObjects<T extends ReadonlyArray<object>, O extends ReadonlyArray<object> = MergeRootEach<T>> = { [P in Keys<O[number]>]: MergeValues<ExtractKeyEach<O, P>>; };
18
- type MergeSingleKey<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>> = MergeValues<ExtractKeyEach<InstanceEach<M>, K>>;
19
- type MergePair<A, B> = [A] extends [never] ? B : [B] extends [never] ? A : ShallowMerge<A, B>;
20
- type MergeValues<T extends ReadonlyArray<unknown>> = T extends readonly [infer First, ...infer Rest] ? [First] extends [never] ? MergeValues<Rest> : Rest extends ReadonlyArray<unknown> ? Rest['length'] extends 0 ? First : MergePair<First, MergeValues<Rest>> : never : never;
21
- type MergeResult<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>, Pr extends object, Po extends object> = MergeObjects<[Pr, ...PickEach<InstanceEach<M>, K>, Po]>;
22
- type Context$1<M extends GeneralModuleInput, K extends Keys<InstanceEach<M>[number]>, Pr extends object = {}, Po extends object = {}> = MergeResult<M, K, Pr, Po> & {
23
- __modules__: WeakMap<M[number], InstanceEach<M>[number]>;
24
- __getModule__: <C extends new (ctx: General) => InstanceEach<M>[number]>(ctor: C) => InstanceType<C>;
25
- __addModule__: <N extends ModuleConstructor<Context$1<[...M, N], K, Pr, Po>>>(newModule: N) => Context$1<[...M, N], K, Pr, Po>;
26
- __assign__: (obj: Partial<MergeResult<M, K, Pr, Po>>) => Context$1<M, K, Pr, Po>;
27
- };
28
- declare const ROOT_KEY = "root";
29
- type RootKey = typeof ROOT_KEY;
30
- //#endregion
31
- //#region ../../node_modules/.bun/synthkernel@.+synthkernel.tgz/node_modules/synthkernel/dist/reactive.d.ts
32
- //#region src/reactive.d.ts
33
- type RefMatchingFunc<T> = (newValue: T, oldValue: T) => unknown;
34
- type Ref<T> = {
35
- (): T;
36
- (newValue: T): void;
37
- subscribe(func: RefMatchingFunc<T>, options?: {
38
- immediate?: boolean;
39
- }): () => void;
40
- unsubscribe(func: RefMatchingFunc<T>): void;
41
- clear(): void;
42
- };
43
- //#endregion
44
- //#region src/modules/EventBus.d.ts
45
- type Dispatch<O extends object> = <K extends keyof O>(...[key, payload]: undefined extends O[K] ? [K] : [K, O[K]]) => void;
46
- type On<O extends object> = <K extends keyof O>(key: K, callback: (payload: O[K]) => void) => () => void;
47
- declare class EventBus {
48
- readonly events: {
49
- logSync: string;
50
- logGeneral: string;
51
- errorSync: string;
52
- errorGeneral: string;
53
- };
54
- private readonly cleanupCallbacks;
55
- private readonly isIdle;
56
- private readonly syncLogs;
57
- private readonly generalLogs;
58
- constructor();
59
- private readonly getThisSync;
60
- private readonly putSyncLog;
61
- private readonly putGeneralLog;
62
- private readonly subscribers;
63
- private readonly on;
64
- private readonly dispatch;
65
- private readonly getLogs;
66
- readonly dispose: () => void;
67
- readonly root: {
68
- dispatch: Dispatch<General$1>;
69
- getLogs: () => string;
70
- isIdle: Ref<boolean>;
71
- on: On<General$1>;
72
- };
73
- }
74
- //#endregion
75
- //#region src/modules/I18n.d.ts
76
- 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';
77
- type Factory<A = undefined> = (args: A) => DocumentFragment | string;
78
- type Fragment<A = undefined> = (args: A) => DocumentFragment;
79
- type Snippet<A = undefined> = (args: A) => string;
80
- type TranslationTypes = string | Factory<General$1>;
81
- type TranslationResource = Record<string, TranslationTypes>;
82
- type TranslateParams<R extends TranslationTypes> = R extends Factory<infer A> ? ([A] extends [undefined] ? [] : [A]) : [];
83
- type Translate<O extends TranslationResource> = <K extends keyof O>(key: K, ...arg: TranslateParams<O[K]>) => O[K] extends string | Snippet<General$1> ? string : DocumentFragment;
84
- declare class I18n {
85
- private readonly targetLangs;
86
- readonly i18n: {};
87
- private readonly registerI18n;
88
- private readonly translate;
89
- root: {
90
- registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void;
91
- translate: Translate<TranslationResource>;
92
- };
93
- }
94
- //#endregion
95
- //#region src/modules/Sync.d.ts
96
- type SyncTerminateReason = {
97
- result: 'cancelled';
98
- } | {
99
- result: 'completed';
100
- } | {
101
- result: 'failed';
102
- error: string;
103
- } | {
104
- result: 'noop';
105
- };
106
- type TaskInfo = {
107
- name: TaskNames;
108
- key: string;
109
- prettyName: string;
110
- isDir: boolean;
111
- };
112
- type FailedTaskInfo = TaskInfo & {
113
- error: string;
114
- };
115
- declare class Sync {
116
- private readonly ctx;
117
- constructor(ctx: {
118
- dispatch: Dispatch<Events>;
119
- initializeSync: () => Infras;
120
- getDecider: () => Decider;
121
- on: On<Events>;
122
- translate: Translate<Translations>;
123
- listRemote: RemoteLister;
124
- getConflictResolver: () => ConflictResolver;
125
- });
126
- readonly events: {
127
- syncStarted: {
128
- isCancelled: Ref<boolean>;
129
- trigger: string;
130
- };
131
- remoteWalkProgress: Progress;
132
- syncTerminated: SyncTerminateReason;
133
- requestConfirmDelete: Array<RemoveLocal>;
134
- requestConfirmTasks: Array<BaseTask>;
135
- syncCanceled: undefined;
136
- taskCompleted: TaskInfo;
137
- taskFailed: FailedTaskInfo;
138
- executionStarted: Array<BaseTask>;
139
- };
140
- readonly settings: {
141
- maxFileSize: TogglableValue;
142
- exclusionRules: Array<GlobMatchRule>;
143
- inclusionRules: Array<GlobMatchRule>;
144
- confirmDeleteInAutoSync: boolean;
145
- confirmTasksInSync: boolean;
146
- };
147
- private readonly postProcess;
148
- private readonly confirmTasks;
149
- private readonly confirmDeletion;
150
- private readonly executeSync;
151
- private readonly convertDeleteToUpload;
152
- root: {
153
- executeSync: (trigger: string) => Promise<SyncTerminateReason>;
154
- };
155
- }
156
- //#endregion
157
- //#region src/modules/Observability.d.ts
158
- type SyncStage = 'none' | 'walkingRemote' | 'awaitingConfirmation' | 'executing' | 'completed' | 'completedNoop' | 'cancelled' | 'failed';
159
- type AddRibbonIcon = (icon: IconName, title: string, callback: (evt: MouseEvent) => void) => HTMLElement;
160
- declare class Observability {
161
- private readonly ctx;
162
- private lastSyncTime;
163
- private lastFailure?;
164
- private readonly sinceLastSyncText;
165
- private readonly syncStage;
166
- private readonly walkProgress;
167
- private readonly executionProgress;
168
- private readonly cleanupCallbacks;
169
- private readonly t;
170
- private readonly progressText;
171
- readonly settings: {
172
- noticeStatusOnMobile: boolean;
173
- exportLogsDirectory: string;
174
- };
175
- readonly i18n: {
176
- startSync: string;
177
- startNonInteractiveSync: string;
178
- stopSync: string;
179
- showProgress: string;
180
- exportLogsToFile: string;
181
- exportLogsFailed: string;
182
- idle: string;
183
- };
184
- constructor(ctx: {
185
- addStatusBarItem: () => HTMLElement;
186
- on: On<Events>;
187
- translate: Translate<Translations>;
188
- isIdle: Ref<boolean>;
189
- dispatch: Dispatch<Events>;
190
- requestSync: (trigger: string) => Promise<SyncTerminateReason>;
191
- showProgress: () => void;
192
- addCommand: (command: Command) => Command;
193
- addRibbonIcon: AddRibbonIcon;
194
- getLogs: () => string;
195
- app: App;
196
- });
197
- readonly start: () => void;
198
- private readonly setupStatus;
199
- private readonly setupCommands;
200
- private readonly exportLogs;
201
- readonly dispose: () => void;
202
- root: {
203
- executionProgress: Ref<Progress<TaskInfo>>;
204
- exportLogs: () => Promise<void>;
205
- syncStage: Ref<SyncStage>;
206
- walkProgress: Ref<Progress>;
207
- };
208
- }
209
- //#endregion
210
- //#region src/components/file-tree/index.d.ts
211
- type FileTreeTranslations = {
212
- selectAll: string;
213
- xSelected: Snippet<number>;
214
- };
215
- //#endregion
216
- //#region src/modules/Extensibility.d.ts
217
- type ModuleInstance = {
218
- moduleSettings: object;
219
- dispose?: () => void;
220
- start?: () => void;
221
- };
222
- type ModuleCtor = new (ctx: object) => ModuleInstance;
223
- type ModuleMeta = {
224
- id: string;
225
- name: string;
226
- version: string;
227
- description: string;
228
- main: string;
229
- icon?: string;
230
- minPluginVersion?: string;
231
- readme?: string;
232
- integrity: string;
233
- };
234
- type AugmentedModuleMeta = ModuleMeta & {
235
- enabled: boolean;
236
- source: string;
237
- icon: string;
238
- };
239
- declare class Extensibility {
240
- private readonly ctx;
241
- private readonly moduleDir;
242
- private readonly sourceCache;
243
- private readonly discoveredModules;
244
- private readonly loadedModules;
245
- private readonly moduleStore;
246
- private autoUpdateTimeout?;
247
- readonly settings: {
248
- moduleSources: Array<string>;
249
- moduleAutoUpdate: boolean;
250
- modules: Record<string, object>;
251
- };
252
- readonly i18n: {
253
- failedToLoadModule: Snippet<string>;
254
- failedToDownloadModule: Snippet<string>;
255
- failedToFetchSource: Snippet<string>;
256
- };
257
- readonly events: {
258
- moduleLoaded: string;
259
- moduleUnloaded: string;
260
- };
261
- constructor(ctx: {
262
- app: App;
263
- __addModule__: Context['__addModule__'];
264
- __getModule__: Context['__getModule__'];
265
- dispatch: Dispatch<Events>;
266
- translate: Translate<Translations>;
267
- allModules: Set<General$1>;
268
- isIdle: Ref<boolean>;
269
- saveSettings: () => Promise<void>;
270
- indexedDB: DatabaseAsync<Record<string, AugmentedModuleMeta>>;
271
- });
272
- readonly start: () => void;
273
- private readonly createOperationFactory;
274
- private readonly loadAllModules;
275
- private readonly loadModule;
276
- private readonly unloadModule;
277
- private readonly installModule;
278
- private readonly downloadModule;
279
- private readonly deleteModule;
280
- private readonly fetchSources;
281
- private readonly updateModules;
282
- private readonly updateModuleMeta;
283
- private readonly enableModule;
284
- private readonly disableModule;
285
- private readonly getModulePath;
286
- private readonly parseModulePath;
287
- readonly dispose: () => void;
288
- readonly root: {
289
- deleteModule: (id: string) => Promise<void>;
290
- disableModule: (id: string) => void;
291
- discoveredModules: Map<string, AugmentedModuleMeta>;
292
- downloadModule: (meta: AugmentedModuleMeta, waitIdle?: boolean) => Promise<void>;
293
- enableModule: (id: string) => Promise<void>;
294
- fetchSources: (manual?: boolean) => Promise<AugmentedModuleMeta[]>;
295
- installModule: (meta: AugmentedModuleMeta, module: string) => Promise<void>;
296
- loadAllModules: () => Promise<void>;
297
- loadModule: (meta: AugmentedModuleMeta, start?: boolean, module?: string) => Promise<void>;
298
- loadedModules: Map<string, ModuleCtor>;
299
- pluginOutdated: boolean;
300
- unloadModule: (id: string) => void;
301
- updateModuleMeta: (meta: AugmentedModuleMeta) => Promise<void>;
302
- updateModules: () => Promise<void>;
303
- };
304
- }
305
- //#endregion
306
- //#region src/components/UnknownModuleModal.d.ts
307
- type FileInfo = {
308
- path: string;
309
- size: string;
310
- mtime: string;
311
- ctime: string;
312
- fileName: string;
313
- };
314
- type UnknownModuleTranslations = {
315
- unknownModule: string;
316
- unknownModuleDescription: Fragment<FileInfo>;
317
- delete: string;
318
- configure: string;
319
- };
320
- //#endregion
321
- //#region src/modules/Setting.d.ts
322
- type SettingTree = {
323
- (self: SettingTree): SettingDefinitionItem;
324
- [key: number]: SettingTree;
325
- };
326
- type NestedCallableTree = {
327
- (self: SettingTree): SettingDefinitionItem;
328
- [key: number]: CallableOrObjectTree;
329
- };
330
- type CallableOrObjectTree = NestedCallableTree | {
331
- [key: number]: CallableOrObjectTree;
332
- };
333
- type SettingEntry = {
334
- priority: number;
335
- apply: CallableOrObjectTree;
336
- };
337
- declare class Setting$1 {
338
- private readonly ctx;
339
- private readonly cleanupCallbacks;
340
- private settingTab?;
341
- private readonly settingRegistry;
342
- readonly i18n: {
343
- match: string;
344
- matchLabelDescription: string;
345
- speed: string;
346
- speedLabelDescription: string;
347
- };
348
- constructor(ctx: {
349
- on: On<Events>;
350
- translate: Translate<Translations>;
351
- registerSetting: (entry: SettingEntry) => () => boolean;
352
- });
353
- readonly start: () => void;
354
- private readonly matchLabel;
355
- private readonly speedLabel;
356
- private readonly addSettingTab;
357
- private readonly rerenderSettingTab;
358
- private readonly refreshSettingTab;
359
- root: {
360
- addSettingTab: (plugin: Plugin) => void;
361
- matchLabel: () => {
362
- text: string;
363
- tooltip: string;
364
- };
365
- refreshSettingTab: () => void | undefined;
366
- registerSetting: (entry: SettingEntry) => () => boolean;
367
- rerenderSettingTab: () => void | undefined;
368
- speedLabel: () => {
369
- color: string;
370
- text: string;
371
- textColor: string;
372
- tooltip: string;
373
- };
374
- };
375
- readonly dispose: () => void;
376
- }
377
- //#endregion
378
- //#region src/settings/utils.d.ts
379
- type EphemeralEditableItem<T> = {
380
- valid: boolean;
381
- new: boolean;
382
- value: T;
383
- };
384
- type EphemeralEditableListSchema = {
385
- ephemeralEditableLists: Array<EphemeralEditableItem<General$1>>;
386
- };
387
- type AugmentedSettingDefinitionItem<K extends string = string> = SettingDefinitionGroup<K> | SettingDefinitionList<K> | (SettingDefinitionPage<K> & {
388
- labels?: Array<LabelDefinition>;
389
- }) | (SettingDefinition<K> & {
390
- labels?: Array<LabelDefinition>;
391
- });
392
- type LabelDefinition = {
393
- text: string;
394
- tooltip: string;
395
- color?: string;
396
- textColor?: string;
397
- };
398
- export declare function s(parent: (self: SettingTree) => AugmentedSettingDefinitionItem, children?: CallableOrObjectTree): CallableOrObjectTree;
399
- export declare function reactivelyValidate<T>({ text, parse, onSave, format, immediate }: {
400
- text: TextComponent;
401
- parse: (value: string) => T | undefined;
402
- format?: (value: T) => string;
403
- onSave: (value: T) => void;
404
- immediate?: boolean;
405
- }): void;
406
- export declare function generateEditableList<T>({ memoryDB, items, identifier, saveSettings, rerenderSettingTab, defaultValue, render, translations: { add, empty, heading }, extraButtons }: {
407
- memoryDB: DatabaseSync<EphemeralEditableListSchema>;
408
- items: Array<T>;
409
- identifier: string;
410
- saveSettings: () => Promise<void>;
411
- rerenderSettingTab: () => void;
412
- defaultValue: T;
413
- render: (setting: Setting, item: EphemeralEditableItem<T>, save: () => void) => void | (() => void);
414
- translations: {
415
- add: string;
416
- empty: string;
417
- heading?: string;
418
- };
419
- extraButtons?: Array<(button: ExtraButtonComponent, list: Array<EphemeralEditableItem<T>>, save: () => void) => void>;
420
- }): SettingDefinitionList;
421
- //#endregion
422
- //#region src/settings/controls.d.ts
423
- type ControlsSettingTranslations = {
424
- controls: string;
425
- maxFileSize: string;
426
- maxFileSizeDescription: string;
427
- maxFileSizePlaceholder: string;
428
- maxRequestConcurrency: string;
429
- minRequestInterval: string;
430
- minRequestIntervalDescription: string;
431
- minRequestIntervalPlaceholder: string;
432
- maxRequestConcurrencyPlaceholder: string;
433
- maxRequestConcurrencyDescription: string;
434
- maxMemoryConsumption: string;
435
- maxMemoryConsumptionDescription: string;
436
- maxMemoryConsumptionPlaceholder: string;
437
- };
438
- //#endregion
439
- //#region src/settings/development.d.ts
440
- type DevelopmentSettingTranslations = {
441
- development: string;
442
- clearRecords: string;
443
- recordsCleared: string;
444
- clear: string;
445
- clearRecordsDescription: string;
446
- export: string;
447
- exportLogsDescription: string;
448
- exportLogsDirectoryPlaceholder: string;
449
- exportLogsToFile: string;
450
- moduleSources: string;
451
- moduleSourcesDescription: string;
452
- edit: string;
453
- xConfigured: Snippet<number>;
454
- addSource: string;
455
- noSourceConfigured: string;
456
- moduleSourcePlaceholder: string;
457
- };
458
- //#endregion
459
- //#region src/components/MigrationModal.d.ts
460
- type MigrationModalTranslations = {
461
- cancel: string;
462
- remoteMigration: string;
463
- migrationProcess: string;
464
- startMigration: string;
465
- migrationDescription: string;
466
- migrationPhase1Description: string;
467
- migrationPhase2Description: string;
468
- migrationPhase3Description: string;
469
- toggleWithoutMigration: string;
470
- migrationFailed: string;
471
- completed: string;
472
- hide: string;
473
- done: string;
474
- };
475
- type MigrationEvents = {
476
- migrationProgress: Progress;
477
- migrationFailed: string;
478
- };
479
- type MigrationContext = {
480
- app: App;
481
- on: On<MigrationEvents>;
482
- dispatch: Dispatch<MigrationEvents & Events>;
483
- translate: Translate<MigrationModalTranslations>;
484
- requestSync: (trigger: string) => Promise<SyncTerminateReason>;
485
- initializeSync: () => Infras;
486
- memoryDB: ExistingMemoryDB;
487
- };
488
- declare function setNeedMigration(ctx: MigrationContext, { toggle, needMigration, content, apply }: {
489
- toggle: ToggleComponent;
490
- needMigration?: (value: boolean) => MaybePromise<boolean>;
491
- content: (value: boolean) => string | DocumentFragment;
492
- apply: (value: boolean) => MaybePromise<void>;
493
- }): void;
494
- //#endregion
495
- //#region src/settings/features.d.ts
496
- type FeaturesSettingTranslations = {
497
- features: string;
498
- realtimeSyncFastMode: string;
499
- realtimeSyncFastModeDescription: string;
500
- realtimeSync: string;
501
- realtimeSyncDescription: string;
502
- realtimeSyncPlaceholder: string;
503
- startupSync: string;
504
- startupSyncDescription: string;
505
- startupSyncPlaceholder: string;
506
- scheduledSync: string;
507
- scheduledSyncDescription: string;
508
- scheduledSyncPlaceholder: string;
509
- asymmetricStorage: string;
510
- asymmetricStorageDescription: Fragment;
511
- asymmetricStorageMigration: Fragment<boolean>;
512
- } & MigrationModalTranslations;
513
- //#endregion
514
- //#region src/settings/filter.d.ts
515
- type FilterSettingTranslations = {
516
- filterRules: string;
517
- inclusionRules: string;
518
- inclusionRulesDescription: Fragment;
519
- exclusionRules: string;
520
- exclusionRulesDescription: Fragment;
521
- xConfigured: Snippet<number>;
522
- addInclusionRule: string;
523
- addExclusionRule: string;
524
- noRuleConfigured: string;
525
- filterPlaceholder: string;
526
- caseSensitive: string;
527
- };
528
- //#endregion
529
- //#region src/settings/head.d.ts
530
- type HeadSettingTranslations = {
531
- moduleAutoUpdate: string;
532
- moduleAutoUpdateDescription: string;
533
- moduleManagement: string;
534
- moduleManagementDescription: string;
535
- backend: string;
536
- backendDescription: string;
537
- syncStrategy: string;
538
- syncStrategyDescription: string;
539
- checkConnectionFailed: string;
540
- checkConnectionSuccess: string;
541
- checkConnection: string;
542
- conflictResolveStrategy: string;
543
- conflictResolveStrategyDescription: string;
544
- xEnabled: Snippet<number>;
545
- settingTips: Fragment<{
546
- labels: Array<LabelDefinition>;
547
- addLabel: typeof addLabel;
548
- }>;
549
- };
550
- declare function addLabel(element: Element, { text, tooltip, color, textColor }: LabelDefinition): HTMLSpanElement;
551
- //#endregion
552
- //#region src/settings/miscellaneous.d.ts
553
- type MiscellaneousSettingTranslations = {
554
- miscellaneous: string;
555
- diffMatchPatch: string;
556
- keepLocal: string;
557
- keepRemote: string;
558
- skip: string;
559
- noticeStatusOnMobile: string;
560
- noticeStatusOnMobileDescription: string;
561
- confirmTasksInSync: string;
562
- confirmTasksInSyncDescription: string;
563
- confirmDeleteInAutoSync: string;
564
- confirmDeleteInAutoSyncDescription: string;
565
- customHeaders: string;
566
- customHeadersDescription: string;
567
- edit: string;
568
- xConfigured: Snippet<number>;
569
- addHeader: string;
570
- noHeaderConfigured: string;
571
- headerKeyPlaceholder: string;
572
- headerValuePlaceholder: string;
573
- addSecretHeader: string;
574
- avoidAutoSyncWhenOffline: string;
575
- avoidAutoSyncWhenOfflineDescription: string;
576
- };
577
- //#endregion
578
- //#region src/components/module-management/index.d.ts
579
- type ModuleManagementTranslations = {
580
- disableModule: string;
581
- downloadModule: string;
582
- enableModule: string;
583
- installed: string;
584
- loadingModules: string;
585
- noInstalledModulesFound: string;
586
- noMatchingModulesFound: string;
587
- noModulesAvailable: string;
588
- updateAvailable: string;
589
- updateModule: string;
590
- deleteModule: string;
591
- editModuleInformation: string;
592
- official: string;
593
- someModulesHidden: string;
594
- openReadme: string;
595
- };
596
- //#endregion
597
- //#region src/components/ModuleEditorModal.d.ts
598
- type ModuleEditorTranslations = {
599
- editModuleInformation: string;
600
- enable: string;
601
- enableDescription: string;
602
- name: string;
603
- namePlaceholder: string;
604
- nameDescription: string;
605
- description: string;
606
- descriptionDescription: string;
607
- descriptionPlaceholder: string;
608
- icon: string;
609
- iconDescription: Fragment;
610
- iconPlaceholder: string;
611
- update: string;
612
- updateDescription: string;
613
- updatePlaceholder: string;
614
- integrityVerification: string;
615
- integrityVerificationDescription: Fragment;
616
- save: string;
617
- cancel: string;
618
- readmePage: string;
619
- readmePageDescription: string;
620
- readmePagePlaceholder: string;
621
- };
622
- //#endregion
623
- //#region src/settings/module-management.d.ts
624
- type ModulesTranslations = ModuleEditorTranslations & ModuleManagementTranslations & {
625
- searchModules: string;
626
- moduleManagement: string;
627
- showInstalledOnly: string;
628
- installModuleFromFile: string;
629
- moduleExtensionWarning: Fragment;
630
- };
631
- //#endregion
632
- //#region src/modules/Bootstrap.d.ts
633
- type CustomHeaders = Array<{
634
- type: 'plaintext' | 'secret';
635
- value: string;
636
- key: string;
637
- }>;
638
- type ExistingMemoryDB = DatabaseSync<{
639
- localContext20000: Stat;
640
- remoteContext10000: Stat;
641
- remoteContext20000: Stat;
642
- }, {
643
- localContext20000Marker: string;
644
- remoteContext10000Marker: string;
645
- remoteContext20000Marker: string;
646
- }>;
647
- declare class Bootstrap {
648
- private readonly ctx;
649
- private readonly cleanupCallbacks;
650
- private readonly memoryStates;
651
- private isCancelled?;
652
- private readonly localPool;
653
- private readonly remotePool;
654
- private localFs?;
655
- private remoteFs?;
656
- readonly i18n: {
657
- bidirectional: string;
658
- mirrorLocal: string;
659
- mirrorRemote: string;
660
- latestSurvive: string;
661
- keepLocal: string;
662
- keepRemote: string;
663
- renameAndKeepBoth: string;
664
- skip: string;
665
- } & ControlsSettingTranslations & DevelopmentSettingTranslations & FeaturesSettingTranslations & FilterSettingTranslations & HeadSettingTranslations & MiscellaneousSettingTranslations & UnknownModuleTranslations & FileTreeTranslations & ModulesTranslations;
666
- readonly settings: {
667
- maxMemoryConsumption: TogglableValue;
668
- maxRequestConcurrency: TogglableValue;
669
- minRequestInterval: TogglableValue;
670
- realtimeSyncFastMode: boolean;
671
- asymmetricStorage: boolean;
672
- customHeaders: CustomHeaders;
673
- };
674
- constructor(ctx: {
675
- app: App;
676
- registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void;
677
- on: On<Events>;
678
- dispatch: Dispatch<Events>;
679
- memoryDB: ExistingMemoryDB;
680
- registerDecider: (id: string, entry: DeciderEntry) => void;
681
- registerLocalFsWrapper: (entry: FsWrapperEntry) => void;
682
- registerRemoteFs: (id: string, entry: RemoteFsEntry) => void;
683
- registerRemoteFsWrapper: (entry: FsWrapperEntry) => void;
684
- translate: Translate<Translations>;
685
- optimizeLocal: BatchOptimizer;
686
- optimizeRemote: BatchOptimizer;
687
- registerLocalOptimizer: (optimizer: OptimizerEntry) => void;
688
- registerRemoteOptimizer: (optimizer: OptimizerEntry) => void;
689
- registerRemoteLister: (entry: RemoteListerEntry) => () => boolean;
690
- registerConflictResolver: (id: string, entry: ConflictResolverEntry) => void;
691
- registerRemoteRequestMiddleware: (entry: RemoteRequestMiddlewareEntry) => void;
692
- registerLocalRequestMiddleware: (entry: LocalRequestMiddlewareEntry) => void;
693
- });
694
- readonly start: () => void;
695
- readonly dispose: () => void;
696
- }
697
- //#endregion
698
- //#region src/modules/ProgressModal.d.ts
699
- type DeleteConfirmReturn = {
700
- delete: Array<RemoveLocal>;
701
- reupload: Array<RemoveLocal>;
702
- };
703
- type TaskCounts = {
704
- total: number;
705
- deleteLocal: number;
706
- deleteRemote: number;
707
- conflict: number;
708
- };
709
- declare class ProgressModal extends Modal {
710
- private readonly ctx;
711
- private readonly moduleCleanupCallbacks;
712
- private readonly t;
713
- private opening;
714
- private readonly modalCleanupCallbacks;
715
- private readonly dispatch;
716
- private description?;
717
- private detailContainer?;
718
- private controls?;
719
- constructor(ctx: {
720
- app: App;
721
- translate: Translate<Translations>;
722
- on: On<Events>;
723
- dispatch: Dispatch<Events>;
724
- syncStage: Ref<SyncStage>;
725
- walkProgress: Ref<Progress>;
726
- executionProgress: Ref<Progress<TaskInfo>>;
727
- });
728
- readonly events: {
729
- tasksConfirmed: Array<BaseTask>;
730
- deleteConfirmed: DeleteConfirmReturn;
731
- };
732
- readonly i18n: {
733
- syncProgress: string;
734
- completed: string;
735
- failedTasksDescription: Snippet<number>;
736
- confirmDeleteDescription: Snippet<number>;
737
- confirmTasksDescription: Snippet<TaskCounts>;
738
- hide: string;
739
- confirm: string;
740
- cancel: string;
741
- done: string;
742
- stopSync: string;
743
- } & Record<TaskNames | SyncStage, string>;
744
- private readonly renderHideStop;
745
- private readonly renderConfirmCancel;
746
- private readonly renderDone;
747
- private readonly showDetails;
748
- private readonly hideDetails;
749
- onOpen(): void;
750
- root: {
751
- hideProgress: {
752
- (): void;
753
- (): void;
754
- };
755
- showProgress: () => void;
756
- };
757
- onClose(): void;
758
- dispose(): void;
759
- }
760
- //#endregion
761
- //#region src/modules/Scheduler.d.ts
762
- declare class Scheduler {
763
- private readonly ctx;
764
- private readonly pendingRequests;
765
- private isScheduling;
766
- private realtimeSyncTimer?;
767
- private scheduledSyncTimer?;
768
- private startupSyncTimer?;
769
- constructor(ctx: {
770
- syncStage: Ref<SyncStage>;
771
- executeSync: (trigger: string) => Promise<SyncTerminateReason>;
772
- registerEvent: (ref: EventRef) => void;
773
- app: App;
774
- isIdle: Ref<boolean>;
775
- dispatch: Dispatch<Events>;
776
- });
777
- settings: {
778
- startupSync: TogglableValue;
779
- scheduledSync: TogglableValue;
780
- realtimeSync: TogglableValue;
781
- exclusionRules: Array<GlobMatchRule>;
782
- inclusionRules: Array<GlobMatchRule>;
783
- avoidAutoSyncWhenOffline: boolean;
784
- };
785
- private readonly requestSync;
786
- start: () => void;
787
- dispose: () => void;
788
- private readonly startScheduledSync;
789
- private readonly stopScheduledSync;
790
- private readonly onChange;
791
- private readonly scheduleFlush;
792
- private readonly flush;
793
- root: {
794
- requestSync: (trigger: string) => Promise<SyncTerminateReason>;
795
- startScheduledSync: () => void;
796
- stopScheduledSync: () => void;
797
- };
798
- }
799
- //#endregion
800
- //#region src/index.d.ts
801
- declare const internalModules: readonly [typeof EventBus, typeof I18n, typeof Storage, typeof Extensibility, typeof Setting$1, typeof Registrar, typeof Sync, typeof Observability, typeof Scheduler, typeof ProgressModal, typeof Bootstrap];
802
- type InternalModules = typeof internalModules;
803
- type MergeKeys = 'settings' | 'root' | 'events' | 'i18n';
804
- type Context = Context$1<InternalModules, MergeKeys, {
805
- app: App;
806
- addCommand: (command: Command) => Command;
807
- registerEvent: (ref: EventRef) => void;
808
- addRibbonIcon: AddRibbonIcon;
809
- addStatusBarItem: () => HTMLElement;
810
- saveSettings: () => Promise<void>;
811
- }>;
812
- type Events = MergeSingleKey<InternalModules, 'events'>;
813
- type Settings = MergeSingleKey<InternalModules, 'settings'>;
814
- type Translations = MergeSingleKey<InternalModules, 'i18n'>;
815
- //#endregion
816
- //#region src/sdk/prefix.d.ts
817
- declare function prefixWrapper(original: Fs, prefix: string): WrappedFs;
818
- //#endregion
819
- //#region src/utils/pipe.d.ts
820
- declare const chunkSize: number, concurrency: number;
821
- export declare function pipe({ from, to, stat, key }: {
822
- from: Fs;
823
- to: Fs;
824
- key: string;
825
- stat: FileStat;
826
- }): Promise<string | undefined>;
827
- export declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise<Binary | ReadableStream<Binary> | undefined>;
828
- export declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
829
- //#endregion
830
- //#region src/sdk/index.d.ts
831
- export declare function digOriginal(wrapped: Fs): RootFs;
832
- export type SelectFromContext<O extends object> = Context extends O ? O : never;
833
- //#endregion
834
- export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CallableOrObjectTree, 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 LabelDefinition, 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, type SettingEntry, type Settings, type Snippet, 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, chunkSize, concurrency, prefixWrapper, setNeedMigration };
1
+ import { $ as RemoveRecord, A as setNeedMigration, At as FileStat, B as ObsidianLanguageCode, C as digOriginal, Ct as MoveAtom, D as readWithSize, Dt as RootFs, E as pipe, Et as OutputAtom, F as CallableOrObjectTree, Ft as RecordStatsMap, G as On, H as Translate, I as SettingEntry, It as Stat, J as DeciderInput, K as CreateLocalDir, L as AugmentedModuleMeta, Lt as StatsMap, M as generateEditableList, Mt as MaybePromise, N as reactivelyValidate, Nt as Progress, O as writeWithValue, Ot as WrappedFs, P as s, Pt as RecordStat, Q as RemoveRemote, R as ModuleMeta, Rt as Binary, S as SelectFromContext, St as MkdirAtom, T as concurrency, Tt as OptimizerOutput, U as TranslationResource, V as Snippet, W as Dispatch, X as Upload, Y as TaskFactory, Z as ResolveConflict, _ as Context, _t as CustomAtom, a as FsWrapperEntry, at as AddRecord, b as Translations, bt as InputAtom, c as RemoteFsEntry, ct as ConflictResolverPayload, d as RequestParam, dt as DatabaseAsync, et as RemoveLocal, f as RequestResponse, ft as DatabaseSync, g as SyncTerminateReason, gt as BatchOptimizer, h as SyncOptions, ht as StoreSync, i as DeciderEntry, it as CreateRemoteDir, j as LabelDefinition, jt as FolderStat, k as prefixWrapper, kt as WriteAtom, l as RemoteRequestMiddlewareEntry, lt as TaskNames, m as RemoteLister, mt as StoreOperations, n as CheckConnectionResult, nt as MoveLocal, o as LocalRequestMiddlewareEntry, ot as BaseTask, p as TriggerEntry, pt as StoreAsync, q as Decider, r as ConflictResolverEntry, rt as Download, s as OptimizerEntry, st as ConflictResolver, t as VaultRequest, tt as MoveRemote, u as Request, ut as RecordStore, v as Events, vt as DeleteAtom, w as chunkSize, wt as OptimizerInput, x as ExistingMemoryDB, xt as ListReporter, y as Settings, yt as Fs, z as Fragment } from "./index-lLeUlsPq.spec.js";
2
+ export { type AddRecord, type AugmentedModuleMeta, type BaseTask, type BatchOptimizer, type Binary, type CallableOrObjectTree, 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 LabelDefinition, 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 RemoteRequestMiddlewareEntry, type RemoveLocal, type RemoveRecord, type RemoveRemote, type Request, type RequestParam, type RequestResponse, type ResolveConflict, type RootFs, SelectFromContext, type SettingEntry, type Settings, type Snippet, type Stat, type StatsMap, type StoreAsync, type StoreOperations, type StoreSync, type SyncOptions, type SyncTerminateReason, type TaskFactory, type TaskNames, type Translate, type TranslationResource, type Translations, type TriggerEntry, type Upload, type VaultRequest, type WrappedFs, type WriteAtom, chunkSize, concurrency, digOriginal, generateEditableList, pipe, prefixWrapper, reactivelyValidate, readWithSize, s, setNeedMigration, writeWithValue };