@hesprs/sync-engine-sdk 3.1.4 → 3.1.5
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.
- package/dist/index.spec.d.ts +29 -28
- package/dist/tsdown-plugin.spec.d.ts +2 -3
- package/package.json +7 -7
package/dist/index.spec.d.ts
CHANGED
|
@@ -74,12 +74,13 @@ declare class EventBus {
|
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/modules/I18n.d.ts
|
|
76
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
|
|
78
|
-
type Fragment<A = undefined> = (
|
|
79
|
-
type
|
|
80
|
-
type
|
|
81
|
-
type
|
|
82
|
-
type
|
|
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;
|
|
83
84
|
declare class I18n {
|
|
84
85
|
private readonly targetLangs;
|
|
85
86
|
readonly i18n: {};
|
|
@@ -87,7 +88,7 @@ declare class I18n {
|
|
|
87
88
|
private readonly translate;
|
|
88
89
|
root: {
|
|
89
90
|
registerI18n: (code: ObsidianLanguageCode, resource: TranslationResource) => void;
|
|
90
|
-
translate: Translate<
|
|
91
|
+
translate: Translate<TranslationResource>;
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
//#endregion
|
|
@@ -209,7 +210,7 @@ declare class Observability {
|
|
|
209
210
|
//#region src/components/file-tree/index.d.ts
|
|
210
211
|
type FileTreeTranslations = {
|
|
211
212
|
selectAll: string;
|
|
212
|
-
xSelected:
|
|
213
|
+
xSelected: Snippet<number>;
|
|
213
214
|
};
|
|
214
215
|
//#endregion
|
|
215
216
|
//#region src/modules/Extensibility.d.ts
|
|
@@ -249,9 +250,9 @@ declare class Extensibility {
|
|
|
249
250
|
modules: Record<string, object>;
|
|
250
251
|
};
|
|
251
252
|
readonly i18n: {
|
|
252
|
-
failedToLoadModule: string
|
|
253
|
-
failedToDownloadModule: string
|
|
254
|
-
failedToFetchSource: string
|
|
253
|
+
failedToLoadModule: Snippet<string>;
|
|
254
|
+
failedToDownloadModule: Snippet<string>;
|
|
255
|
+
failedToFetchSource: Snippet<string>;
|
|
255
256
|
};
|
|
256
257
|
readonly events: {
|
|
257
258
|
moduleLoaded: string;
|
|
@@ -394,15 +395,15 @@ type LabelDefinition = {
|
|
|
394
395
|
color?: string;
|
|
395
396
|
textColor?: string;
|
|
396
397
|
};
|
|
397
|
-
declare function s(parent: (self: SettingTree) => AugmentedSettingDefinitionItem, children?: CallableOrObjectTree): CallableOrObjectTree;
|
|
398
|
-
declare function reactivelyValidate<T>({ text, parse, onSave, format, immediate }: {
|
|
398
|
+
export declare function s(parent: (self: SettingTree) => AugmentedSettingDefinitionItem, children?: CallableOrObjectTree): CallableOrObjectTree;
|
|
399
|
+
export declare function reactivelyValidate<T>({ text, parse, onSave, format, immediate }: {
|
|
399
400
|
text: TextComponent;
|
|
400
401
|
parse: (value: string) => T | undefined;
|
|
401
402
|
format?: (value: T) => string;
|
|
402
403
|
onSave: (value: T) => void;
|
|
403
404
|
immediate?: boolean;
|
|
404
405
|
}): void;
|
|
405
|
-
declare function generateEditableList<T>({ memoryDB, items, identifier, saveSettings, rerenderSettingTab, defaultValue, render, translations: { add, empty, heading }, extraButtons }: {
|
|
406
|
+
export declare function generateEditableList<T>({ memoryDB, items, identifier, saveSettings, rerenderSettingTab, defaultValue, render, translations: { add, empty, heading }, extraButtons }: {
|
|
406
407
|
memoryDB: DatabaseSync<EphemeralEditableListSchema>;
|
|
407
408
|
items: Array<T>;
|
|
408
409
|
identifier: string;
|
|
@@ -449,7 +450,7 @@ type DevelopmentSettingTranslations = {
|
|
|
449
450
|
moduleSources: string;
|
|
450
451
|
moduleSourcesDescription: string;
|
|
451
452
|
edit: string;
|
|
452
|
-
xConfigured:
|
|
453
|
+
xConfigured: Snippet<number>;
|
|
453
454
|
addSource: string;
|
|
454
455
|
noSourceConfigured: string;
|
|
455
456
|
moduleSourcePlaceholder: string;
|
|
@@ -507,7 +508,7 @@ type FeaturesSettingTranslations = {
|
|
|
507
508
|
scheduledSyncPlaceholder: string;
|
|
508
509
|
asymmetricStorage: string;
|
|
509
510
|
asymmetricStorageDescription: Fragment;
|
|
510
|
-
asymmetricStorageMigration: Fragment<
|
|
511
|
+
asymmetricStorageMigration: Fragment<boolean>;
|
|
511
512
|
} & MigrationModalTranslations;
|
|
512
513
|
//#endregion
|
|
513
514
|
//#region src/settings/filter.d.ts
|
|
@@ -517,7 +518,7 @@ type FilterSettingTranslations = {
|
|
|
517
518
|
inclusionRulesDescription: Fragment;
|
|
518
519
|
exclusionRules: string;
|
|
519
520
|
exclusionRulesDescription: Fragment;
|
|
520
|
-
xConfigured:
|
|
521
|
+
xConfigured: Snippet<number>;
|
|
521
522
|
addInclusionRule: string;
|
|
522
523
|
addExclusionRule: string;
|
|
523
524
|
noRuleConfigured: string;
|
|
@@ -540,7 +541,7 @@ type HeadSettingTranslations = {
|
|
|
540
541
|
checkConnection: string;
|
|
541
542
|
conflictResolveStrategy: string;
|
|
542
543
|
conflictResolveStrategyDescription: string;
|
|
543
|
-
xEnabled:
|
|
544
|
+
xEnabled: Snippet<number>;
|
|
544
545
|
settingTips: Fragment<{
|
|
545
546
|
labels: Array<LabelDefinition>;
|
|
546
547
|
addLabel: typeof addLabel;
|
|
@@ -564,7 +565,7 @@ type MiscellaneousSettingTranslations = {
|
|
|
564
565
|
customHeaders: string;
|
|
565
566
|
customHeadersDescription: string;
|
|
566
567
|
edit: string;
|
|
567
|
-
xConfigured:
|
|
568
|
+
xConfigured: Snippet<number>;
|
|
568
569
|
addHeader: string;
|
|
569
570
|
noHeaderConfigured: string;
|
|
570
571
|
headerKeyPlaceholder: string;
|
|
@@ -731,9 +732,9 @@ declare class ProgressModal extends Modal {
|
|
|
731
732
|
readonly i18n: {
|
|
732
733
|
syncProgress: string;
|
|
733
734
|
completed: string;
|
|
734
|
-
failedTasksDescription:
|
|
735
|
-
confirmDeleteDescription:
|
|
736
|
-
confirmTasksDescription:
|
|
735
|
+
failedTasksDescription: Snippet<number>;
|
|
736
|
+
confirmDeleteDescription: Snippet<number>;
|
|
737
|
+
confirmTasksDescription: Snippet<TaskCounts>;
|
|
737
738
|
hide: string;
|
|
738
739
|
confirm: string;
|
|
739
740
|
cancel: string;
|
|
@@ -817,17 +818,17 @@ declare function prefixWrapper(original: Fs, prefix: string): WrappedFs;
|
|
|
817
818
|
//#endregion
|
|
818
819
|
//#region src/utils/pipe.d.ts
|
|
819
820
|
declare const chunkSize: number, concurrency: number;
|
|
820
|
-
declare function pipe({ from, to, stat, key }: {
|
|
821
|
+
export declare function pipe({ from, to, stat, key }: {
|
|
821
822
|
from: Fs;
|
|
822
823
|
to: Fs;
|
|
823
824
|
key: string;
|
|
824
825
|
stat: FileStat;
|
|
825
826
|
}): Promise<string | undefined>;
|
|
826
|
-
declare function readWithSize(fs: Fs, key: string, stat: FileStat): Promise<Binary | ReadableStream<Binary> | undefined>;
|
|
827
|
-
declare function writeWithValue(fs: Fs, key: string, value: Binary | ReadableStream<Binary>, stat: FileStat): MaybePromise<string>;
|
|
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>;
|
|
828
829
|
//#endregion
|
|
829
830
|
//#region src/sdk/index.d.ts
|
|
830
|
-
declare function digOriginal(wrapped: Fs): RootFs;
|
|
831
|
-
type SelectFromContext<O extends object> = Context extends O ? O : never;
|
|
831
|
+
export declare function digOriginal(wrapped: Fs): RootFs;
|
|
832
|
+
export type SelectFromContext<O extends object> = Context extends O ? O : never;
|
|
832
833
|
//#endregion
|
|
833
|
-
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,
|
|
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 };
|
|
@@ -8,7 +8,7 @@ type ModuleMeta = Partial<Record<'name' | 'icon' | 'description' | 'source' | 'v
|
|
|
8
8
|
type ModuleMetaWithId = ModuleMeta & {
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
export default function syncEngineModule(meta?: ModuleMeta | Array<ModuleMetaWithId> | Record<string, ModuleMeta>): {
|
|
12
12
|
name: string;
|
|
13
13
|
renderChunk(code: string, chunk: {
|
|
14
14
|
name: string;
|
|
@@ -18,5 +18,4 @@ declare function syncEngineModule(meta?: ModuleMeta | Array<ModuleMetaWithId> |
|
|
|
18
18
|
} | undefined;
|
|
19
19
|
tsdownConfig(config: SyncEngineConfig): void;
|
|
20
20
|
};
|
|
21
|
-
//#endregion
|
|
22
|
-
export { syncEngineModule as default };
|
|
21
|
+
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hesprs/sync-engine-sdk",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "Official SDK for developing modules targeting Sync Engine, the extensible Obsidian syncing plugin.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"obsidian-plugin",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "Hēsperus",
|
|
17
|
-
"email": "hesprs@
|
|
17
|
+
"email": "hesprs@yandex.com"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -59,13 +59,13 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@repo/shared": "workspace:*",
|
|
62
|
-
"@unocss/postcss": "^66.
|
|
63
|
-
"postcss-merge-rules": "^
|
|
64
|
-
"solid-js": "^1.9.
|
|
62
|
+
"@unocss/postcss": "^66.10.0",
|
|
63
|
+
"postcss-merge-rules": "^9.0.3",
|
|
64
|
+
"solid-js": "^1.9.15",
|
|
65
65
|
"synthkernel": "./synthkernel.tgz",
|
|
66
66
|
"uni-kv": "../../uni-kv.tgz",
|
|
67
|
-
"unocss": "^66.
|
|
67
|
+
"unocss": "^66.10.0",
|
|
68
68
|
"unplugin-solid": "^2.0.0",
|
|
69
|
-
"verkit": "^0.
|
|
69
|
+
"verkit": "^0.4.0"
|
|
70
70
|
}
|
|
71
71
|
}
|