import { ITGitRequestConfig } from '..'; import { ICommit, IFile, IFileEncoding, ITreeNode, ProjectId } from '../base'; export interface IFiles { ( params: { id: ProjectId; ref_name?: string; path?: string; recursive?: boolean; }, requestOptions?: ITGitRequestConfig, ): Promise; add: IFilesAdd; get: IFilesGet; modify: IFilesModify; delete: IFilesDelete; history: IHistory; } export type IFilesAdd = ( params: { id: ProjectId; branch_name: string; file_path: string; encoding?: IFileEncoding; content: string; commit_message: string; }, requestOptions?: ITGitRequestConfig, ) => Promise<{ file_path: string; file_name: string; branch_name: string; }>; export type IFilesGet = ( params: { id: ProjectId; ref?: string; file_path: string; }, requestOptions?: ITGitRequestConfig, ) => Promise; export type IHistory = ( params: { id: ProjectId; ref: string; file_path: string; line_number?: number; }, requestOptions?: ITGitRequestConfig, ) => Promise; export interface ICommitHistory { commit: ICommit; lines: string[]; number: number[]; } export type IFilesModify = ( params: { id: ProjectId; branch_name: string; file_path: string; encoding?: IFileEncoding; content: string; commit_message: string; }, requestOptions?: ITGitRequestConfig, ) => Promise<{ file_path: string; file_name: string; branch_name: string; }>; export type IFilesDelete = ( params: { id: ProjectId; file_path: string; branch_name: string; commit_message: string; }, requestOptions?: ITGitRequestConfig, ) => Promise<{ file_path: string; file_name: string; branch_name: string; }>;