hexo/node_modules/sftp-sync-deploy/lib/syncTable.d.ts

48 lines
1.3 KiB
TypeScript
Raw Normal View History

2023-09-25 15:58:56 +08:00
import { SftpSyncOptions } from './config';
export declare type FileStatus = 'file' | 'dir' | 'excluded' | 'error';
export declare type TaskType = 'upload' | 'sync' | 'noop';
export interface SyncTask {
method: TaskType;
removeRemote: boolean;
hasError: boolean;
skip: boolean;
}
export declare class SyncTableEntry {
private table;
name: string;
path: string;
localStat: FileStatus;
remoteStat: FileStatus;
localTimestamp: number;
remoteTimestamp: number;
task: SyncTask;
constructor(table: SyncTable, name: string);
/**
* Get a task for this entry
*/
getTask(): SyncTask;
/**
* Output live run mode log
*/
liveRunLog(): void;
/**
* Output dry run mode log
*/
dryRunLog(): void;
/**
* Check if the path matches the exclude patterns
*/
detectExclusion(): void;
}
export declare class SyncTable {
relativePath: string;
options: SftpSyncOptions;
private registry;
constructor(relativePath: string, options: SftpSyncOptions);
get(filename: string): SyncTableEntry;
readonly all: SyncTableEntry[];
set(filename: string, stats: Object): SyncTableEntry;
has(filename: string): boolean;
forEach(fn: (stat: SyncTableEntry) => void): SyncTable;
}