UNPKG

@altostra/core

Version:

Core library for shared types and logic

21 lines (20 loc) 772 B
import type { Maybe } from "../../common/Maybe"; import type { StatusResult } from 'simple-git'; import type { RestorationPaths } from "./Common"; /** * An interface that describe a git-handling class */ export declare type GitClass = new (path: string) => GitInstance; /** * An interface that describe an instance of a git-handling class */ export interface GitInstance { readonly isRepoExists: Promise<boolean>; readonly path: string; getRemoteUrl(name?: string): Promise<Maybe<string>>; getRemotes(): Promise<Record<string, string>>; getStatus(): Promise<StatusResult>; isDirty(): Promise<boolean>; headHash(): Promise<string>; restoreFromCommit(commitHash: string, paths: RestorationPaths, commitMessage?: string): Promise<void>; }