picgo
Version:
A tool for image uploading
88 lines (87 loc) • 2.03 kB
TypeScript
import type { IConfig } from '../../types';
export declare enum SyncStatus {
SUCCESS = "success",
CONFLICT = "conflict",
FAILED = "failed"
}
export declare enum ConflictType {
CLEAN = "clean",
CONFLICT = "conflict",
ADDED = "added",
DELETED = "deleted",
MODIFIED = "modified"
}
export declare enum E2EVersion {
NONE = 0,
V1 = 1
}
export declare enum EncryptionMethod {
AUTO = "auto",
SSE = "sse",
E2EE = "e2ee"
}
export declare enum E2EAskPinReason {
SETUP = "setup",
DECRYPT = "decrypt",
RETRY = "retry"
}
export declare enum APPType {
GUI = "gui",
CLI = "cli"
}
export type ConfigValue = string | number | boolean | null | undefined | any[] | Record<string, any>;
export interface IE2EPayload {
e2eVersion: E2EVersion.V1;
clientKekSalt: string;
clientDekEncrypted: string;
config: string;
}
export interface IE2ERequestFields {
e2eVersion?: E2EVersion;
clientKekSalt?: string;
clientDekEncrypted?: string;
}
export interface IEncryptionSwitchContext {
from: EncryptionMethod;
to: EncryptionMethod;
}
export interface ISyncConfigResponse {
version: number;
config: string;
encryption?: {
e2eVersion?: number;
clientKekSalt?: string;
clientDekEncrypted?: string;
};
}
export interface ISyncOptions {
encryptionMethod?: EncryptionMethod;
skipEncryptionSwitchConfirm?: boolean;
}
export interface IApplyResolvedOptions {
useE2E?: boolean;
}
export interface ISnapshot {
version: number;
updatedAt: string;
data: ConfigValue;
}
export interface IDiffNode {
key: string;
status: ConflictType;
snapshotValue?: ConfigValue;
localValue?: ConfigValue;
remoteValue?: ConfigValue;
children?: IDiffNode[];
}
export interface IMergeResult {
value: ConfigValue;
conflict: boolean;
diffNode?: IDiffNode;
}
export interface ISyncResult {
status: SyncStatus;
message?: string;
diffTree?: IDiffNode;
mergedConfig?: IConfig;
}