/
raiden
/
obsidian-git-encrypt
Обзор
Документация
Войти
/
raiden
/
obsidian-git-encrypt
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/session/sessionState.ts
56 строк
2 KB
Robert Kuzhin
feat: add manual encrypted source control
09 авг 2026, 20:57
09 авг 2026, 20:57
3c8fa38
Код
Авторство
О чём код?
import type { KeyHandle } from "../crypto/index.js"; import type { SyncConflict } from "../sync/index.js"; import type { DiffTarget, PullChangesResult, SourceControlStatus, SourceDiff, } from "../sourceControl/index.js"; export type SessionStatus = | "locked" | "unlocking" | "syncing" | "unlocked" | "locking" | "error"; export interface SessionState { readonly status: SessionStatus; readonly hasKey: boolean; readonly message?: string; readonly conflicts?: readonly SyncConflict[]; } export interface TrackedFileInfo { readonly path: string; readonly size: number; readonly modifiedAt: number; readonly objectVersion: number; readonly deleted: boolean; } export interface SessionRuntime { readonly key: KeyHandle; start(): Promise<void>; listTrackedFiles(): Promise<readonly TrackedFileInfo[]>; getSourceControlStatus(): Promise<SourceControlStatus>; stage(fileId: string): Promise<void>; stageAll(): Promise<void>; unstage(fileId: string): Promise<void>; unstageAll(): Promise<void>; commitSelected(message: string): Promise<string>; fetchRemote(): Promise<SourceControlStatus>; pullRemote(): Promise<PullChangesResult>; pushRemote(): Promise<void>; getDiff(fileId: string, target: DiffTarget): Promise<SourceDiff>; flush(): Promise<void>; changePassword(newPassword: Uint8Array): Promise<void>; stop(): Promise<void>; } export interface SessionBackend { create(password: Uint8Array): Promise<SessionRuntime>; unlock(password: Uint8Array): Promise<SessionRuntime>; destroyKey(key: KeyHandle): void; }