import * as git from "@fluidframework/gitresources" ; import * as api from "@fluidframework/protocol-definitions" ; import { IWholeSummaryPayload , IWholeFlatSummary , IWriteSummaryResponse , IWholeSummaryPayloadType , } from "./storageContracts" ; /**
 * Required params to create ref with config
 */ export interface ICreateRefParamsExternal extends git . ICreateRefParams { config ? : IExternalWriterConfig ; } /**
 * Required params to get ref with config
 */ export interface IGetRefParamsExternal { config ? : IExternalWriterConfig ; } /**
 * Required params to patch ref with config
 */ export interface IPatchRefParamsExternal extends git . IPatchRefParams { config ? : IExternalWriterConfig ; } interface IExternalWriterConfig { enabled : boolean ; } /**
 * Git cache data
 */ export interface IGitCache { blobs : git . IBlob [ ] ; refs : { [ key ] : string ; } ; trees : git . ITree [ ] ; commits : git . ICommit [ ] ; } /**
 * Interface to a generic Git provider
 */ export interface IGitService { getBlob ( sha ) : Promise < git . IBlob > ; createBlob ( blob ) : Promise < git . ICreateBlobResponse > ; getContent ( path , ref ) : Promise < any > ; getCommits ( sha , count ) : Promise < git . ICommitDetails [ ] > ; getCommit ( sha ) : Promise < git . ICommit > ; createCommit ( commit ) : Promise < git . ICommit > ; getRefs ( ) : Promise < git . IRef [ ] > ; getRef ( ref ) : Promise < git . IRef > ; createRef ( params ) : Promise < git . IRef > ; updateRef ( ref , params ) : Promise < git . IRef > ; deleteRef ( ref ) : Promise < void > ; createTag ( tag ) : Promise < git . ITag > ; getTag ( tag ) : Promise < git . ITag > ; createTree ( tree ) : Promise < git . ITree > ; getTree ( sha , recursive ) : Promise < git . ITree > ; createSummary ( summary ) : Promise < IWriteSummaryResponse > ; deleteSummary ( softDelete ) : Promise < void > ; getSummary ( sha ) : Promise < IWholeFlatSummary > ; } /**
 * The Historian extends the git service by providing access to document header information stored in
 * the repository
 */ export interface IHistorian extends IGitService { endpoint : string ; /**
     * Retrieves the header for the given document
     */ getHeader ( sha ) : Promise < git . IHeader > ; getFullTree ( sha ) : Promise < any > ; } export interface IGitManager { getHeader ( id , sha ) : Promise < api . ISnapshotTree > ; getFullTree ( sha ) : Promise < any > ; getCommit ( sha ) : Promise < git . ICommit > ; getCommits ( sha , count ) : Promise < git . ICommitDetails [ ] > ; getTree ( root , recursive ) : Promise < git . ITree > ; getBlob ( sha ) : Promise < git . IBlob > ; getRawUrl ( sha ) : string ; getContent ( commit , path ) : Promise < git . IBlob > ; createBlob ( content , encoding ) : Promise < git . ICreateBlobResponse > ; createGitTree ( params ) : Promise < git . ITree > ; createTree ( files ) : Promise < git . ITree > ; createCommit ( commit ) : Promise < git . ICommit > ; getRef ( ref ) : Promise < git . IRef > ; createRef ( branch , sha ) : Promise < git . IRef > ; upsertRef ( branch , commitSha ) : Promise < git . IRef > ; write ( branch , inputTree , parents , message ) : Promise < git . ICommit > ; createSummary ( summary ) : Promise < IWriteSummaryResponse > ; deleteSummary ( softDelete ) : Promise < void > ; getSummary ( sha ) : Promise < IWholeFlatSummary > ; } /**
 * Uploads a summary to storage.
 */ export interface ISummaryUploadManager { param summaryTree param parentHandle param summaryType param sequenceNumber returns writeSummaryTree ( summaryTree , parentHandle , summaryType , sequenceNumber ? ) : Promise < string > ; }