@mieweb/wikigdrive
Version:
Google Drive to MarkDown synchronization
79 lines • 2.64 kB
TypeScript
import type { Logger } from 'winston';
import { UserConfig } from '../containers/google_folder/UserConfigService.js';
import { GitExecuter, SshParams } from './GitExecuter.js';
import { GitStash } from './GitStash.js';
import { GitReset } from './GitReset.js';
interface GitFileState {
isNew?: boolean;
isModified?: boolean;
isDeleted?: boolean;
}
export interface GitChange {
path: string;
state: GitFileState;
attachments?: number;
}
export interface Commiter {
name: string;
email: string;
}
export declare class GitScanner {
readonly logger: Logger;
readonly rootPath: string;
private email;
debug: boolean;
private companionFileResolver;
readonly executer: GitExecuter;
readonly stash: GitStash;
readonly reset: GitReset;
constructor(logger: Logger, rootPath: string, email: string);
private exec;
isRepo(): Promise<boolean>;
changes(opts?: {
includeAssets: boolean;
}): Promise<GitChange[]>;
resolveCompanionFiles(filePaths: string[]): Promise<string[]>;
commit(message: string, selectedFiles: string[], committer: Commiter): Promise<string>;
pullBranch(remoteBranch: string, sshParams?: SshParams): Promise<void>;
fetch(sshParams?: SshParams): Promise<void>;
pushToDir(dir: string): Promise<void>;
pushBranch(remoteBranch: string, sshParams?: SshParams, localBranch?: string): Promise<void>;
getRemoteUrl(): Promise<string | null>;
getOwnerRepo(): Promise<string>;
setRemoteUrl(url: string): Promise<void>;
diff(fileName: string): Promise<{
oldFile: string;
newFile: string;
txt: string;
patches: string[];
}[]>;
history(fileName: string, remoteBranch?: string): Promise<({
id: any;
author_name: string;
message: string;
date: null;
head: any;
remote: boolean;
} | null)[]>;
initialize(): Promise<void>;
setSafeDirectory(): Promise<void>;
getBranchCommit(branch: string): Promise<string | null>;
autoCommit(): Promise<void>;
countAheadBehind(remoteBranch: string): Promise<{
ahead: number;
behind: number;
}>;
getStats(userConfig: UserConfig): Promise<{
initialized: boolean;
headAhead: number;
headBehind: number;
unstaged: number;
remote_branch: string;
remote_url: string | null;
}>;
removeUntracked(): Promise<void>;
removeCached(filePath: string): Promise<void>;
setCompanionFileResolver(resolver: (filePath: string) => Promise<string[]>): void;
}
export {};
//# sourceMappingURL=GitScanner.d.ts.map