1+ declare module 'git-client' {
2+ export class Git {
3+ constructor ( options : { gitDir : string ; workTree ?: string } ) ;
4+ }
5+ }
6+
17declare module 'hologit' {
28 import { Git as GitClient } from 'git-client' ;
39 import { Docker } from 'dockerode' ;
@@ -60,15 +66,15 @@ declare module 'hologit' {
6066 }
6167
6268 export class Git {
63- static async get ( ) : Promise < typeof GitClient > ;
69+ static get ( ) : Promise < typeof GitClient > ;
6470 constructor ( options : GitOptions ) ;
6571 gitDir : string ;
6672 workTree ?: string ;
6773 }
6874
6975 export class BlobObject {
70- static async write ( repo : Repo , content : string ) : Promise < BlobObject > ;
71- static async writeFromFile ( repo : Repo , filePath : string ) : Promise < BlobObject > ;
76+ static write ( repo : Repo , content : string ) : Promise < BlobObject > ;
77+ static writeFromFile ( repo : Repo , filePath : string ) : Promise < BlobObject > ;
7278
7379 constructor ( repo : Repo , options : GitObjectOptions ) ;
7480
@@ -78,12 +84,12 @@ declare module 'hologit' {
7884 isBlob : boolean ;
7985 type : 'blob' ;
8086
81- async read ( ) : Promise < string > ;
87+ read ( ) : Promise < string > ;
8288 }
8389
8490 export class TreeObject {
8591 static getEmptyTreeHash ( ) : string ;
86- static async createFromRef ( repo : Repo , ref : string ) : Promise < TreeObject > ;
92+ static createFromRef ( repo : Repo , ref : string ) : Promise < TreeObject > ;
8793
8894 constructor ( repo : Repo , options ?: { hash ?: string ; parent ?: TreeObject | null } ) ;
8995
@@ -95,19 +101,19 @@ declare module 'hologit' {
95101 type : 'tree' ;
96102 mode : '040000' ;
97103
98- async getHash ( ) : Promise < string > ;
104+ getHash ( ) : Promise < string > ;
99105 getWrittenHash ( ) : string | null ;
100106 markDirty ( ) : void ;
101- async getChild ( childPath : string ) : Promise < TreeObject | BlobObject | CommitObject | null > ;
102- async writeChild ( childPath : string , content : string | BlobObject ) : Promise < BlobObject > ;
103- async getChildren ( ) : Promise < { [ key : string ] : TreeObject | BlobObject | CommitObject } > ;
104- async getBlobMap ( ) : Promise < { [ key : string ] : BlobObject } > ;
105- async deleteChild ( childPath : string ) : Promise < void > ;
106- async getSubtree ( subtreePath : string , create ?: boolean ) : Promise < TreeObject | null > ;
107- async getSubtreeStack ( subtreePath : string , create ?: boolean ) : Promise < TreeObject [ ] | null > ;
108- async write ( ) : Promise < string > ;
109- async merge ( input : TreeObject , options ?: MergeOptions , basePath ?: string , preloadChildren ?: boolean ) : Promise < void > ;
110- async clone ( ) : Promise < TreeObject > ;
107+ getChild ( childPath : string ) : Promise < TreeObject | BlobObject | CommitObject | null > ;
108+ writeChild ( childPath : string , content : string | BlobObject ) : Promise < BlobObject > ;
109+ getChildren ( ) : Promise < { [ key : string ] : TreeObject | BlobObject | CommitObject } > ;
110+ getBlobMap ( ) : Promise < { [ key : string ] : BlobObject } > ;
111+ deleteChild ( childPath : string ) : Promise < void > ;
112+ getSubtree ( subtreePath : string , create ?: boolean ) : Promise < TreeObject | null > ;
113+ getSubtreeStack ( subtreePath : string , create ?: boolean ) : Promise < TreeObject [ ] | null > ;
114+ write ( ) : Promise < string > ;
115+ merge ( input : TreeObject , options ?: MergeOptions , basePath ?: string , preloadChildren ?: boolean ) : Promise < void > ;
116+ clone ( ) : Promise < TreeObject > ;
111117 }
112118
113119 export class CommitObject {
@@ -128,10 +134,10 @@ declare module 'hologit' {
128134
129135 getWorkspace ( ) : Workspace ;
130136 getRepo ( ) : Repo ;
131- async readConfig ( ) : Promise < any > ;
132- async writeConfig ( config ?: any ) : Promise < void > ;
133- async getConfig ( ) : Promise < any > ;
134- async getCachedConfig ( ) : Promise < any > ;
137+ readConfig ( ) : Promise < any > ;
138+ writeConfig ( config ?: any ) : Promise < void > ;
139+ getConfig ( ) : Promise < any > ;
140+ getCachedConfig ( ) : Promise < any > ;
135141 }
136142
137143 export class Branch extends Configurable {
@@ -141,17 +147,17 @@ declare module 'hologit' {
141147
142148 getKind ( ) : 'holobranch' ;
143149 getConfigPath ( ) : string ;
144- async isDefined ( ) : Promise < boolean > ;
150+ isDefined ( ) : Promise < boolean > ;
145151 getMapping ( key : string ) : Mapping ;
146- async getMappings ( ) : Promise < Map < string , Mapping > > ;
147- async composite ( options : {
152+ getMappings ( ) : Promise < Map < string , Mapping > > ;
153+ composite ( options : {
148154 outputTree ?: TreeObject ;
149155 fetch ?: boolean | string [ ] ;
150156 cacheFrom ?: string | null ;
151157 cacheTo ?: string | null ;
152158 } ) : Promise < TreeObject > ;
153159 getLens ( name : string ) : Lens ;
154- async getLenses ( ) : Promise < Map < string , Lens > > ;
160+ getLenses ( ) : Promise < Map < string , Lens > > ;
155161 }
156162
157163 export class Source extends Configurable {
@@ -163,21 +169,21 @@ declare module 'hologit' {
163169
164170 getKind ( ) : 'holosource' ;
165171 getConfigPath ( ) : string ;
166- async getSpec ( ) : Promise < { hash : string ; ref : string ; data : any } > ;
167- async getCachedSpec ( ) : Promise < { hash : string ; ref : string ; data : any } > ;
168- async queryRef ( ) : Promise < { hash : string ; ref : string } | null > ;
169- async hashWorkTree ( ) : Promise < string | null > ;
170- async getOutputTree ( options ?: {
172+ getSpec ( ) : Promise < { hash : string ; ref : string ; data : any } > ;
173+ getCachedSpec ( ) : Promise < { hash : string ; ref : string ; data : any } > ;
174+ queryRef ( ) : Promise < { hash : string ; ref : string } | null > ;
175+ hashWorkTree ( ) : Promise < string | null > ;
176+ getOutputTree ( options ?: {
171177 working ?: boolean | null ;
172178 fetch ?: boolean | string [ ] ;
173179 cacheFrom ?: string | null ;
174180 cacheTo ?: string | null ;
175181 } ) : Promise < string > ;
176- async getHead ( options ?: { required ?: boolean ; working ?: boolean | null } ) : Promise < string | null > ;
177- async getCachedHead ( ) : Promise < string | null > ;
178- async getBranch ( ) : Promise < string | null > ;
179- async fetch ( options ?: { depth ?: number ; unshallow ?: boolean | null } , ...refs : string [ ] ) : Promise < { refs : string [ ] } > ;
180- async checkout ( options ?: { submodule ?: boolean } ) : Promise < {
182+ getHead ( options ?: { required ?: boolean ; working ?: boolean | null } ) : Promise < string | null > ;
183+ getCachedHead ( ) : Promise < string | null > ;
184+ getBranch ( ) : Promise < string | null > ;
185+ fetch ( options ?: { depth ?: number ; unshallow ?: boolean | null } , ...refs : string [ ] ) : Promise < { refs : string [ ] } > ;
186+ checkout ( options ?: { submodule ?: boolean } ) : Promise < {
181187 path : string ;
182188 head : string ;
183189 branch : string | null ;
@@ -195,21 +201,21 @@ declare module 'hologit' {
195201
196202 getKind ( ) : 'hololens' ;
197203 getConfigPath ( ) : string ;
198- async buildInputTree ( inputRoot ?: TreeObject ) : Promise < TreeObject > ;
199- async buildSpec ( inputTree : TreeObject ) : Promise < {
204+ buildInputTree ( inputRoot ?: TreeObject ) : Promise < TreeObject > ;
205+ buildSpec ( inputTree : TreeObject ) : Promise < {
200206 hash : string ;
201207 ref : string ;
202208 data : any ;
203209 } > ;
204- async executeSpec ( specHash : string , options : {
210+ executeSpec ( specHash : string , options : {
205211 refresh ?: boolean ;
206212 save ?: boolean ;
207213 repo ?: Repo | null ;
208214 cacheFrom ?: string | null ;
209215 cacheTo ?: string | null ;
210216 } ) : Promise < string > ;
211217
212- static async executeSpec ( specHash : string , options : {
218+ static executeSpec ( specHash : string , options : {
213219 refresh ?: boolean ;
214220 save ?: boolean ;
215221 repo ?: Repo | null ;
@@ -226,86 +232,86 @@ declare module 'hologit' {
226232 getWorkspace ( ) : Workspace ;
227233 getKind ( ) : 'holospace' ;
228234 getConfigPath ( ) : string ;
229- async writeWorkingChanges ( ) : Promise < void > ;
235+ writeWorkingChanges ( ) : Promise < void > ;
230236 getBranch ( name : string ) : Branch ;
231- async getBranches ( ) : Promise < Map < string , Branch > > ;
237+ getBranches ( ) : Promise < Map < string , Branch > > ;
232238 getSource ( name : string ) : Source ;
233- async getSources ( ) : Promise < Map < string , Source > > ;
234- async getLayers ( ) : Promise < Map < string , Map < string , Mapping > > > ;
239+ getSources ( ) : Promise < Map < string , Source > > ;
240+ getLayers ( ) : Promise < Map < string , Map < string , Mapping > > > ;
235241 getLens ( name : string ) : Lens ;
236- async getLenses ( ) : Promise < Map < string , Lens > > ;
242+ getLenses ( ) : Promise < Map < string , Lens > > ;
237243 }
238244
239245 export class Repo {
240- static async getFromEnvironment ( options ?: { ref ?: string ; working ?: boolean } ) : Promise < Repo > ;
246+ static getFromEnvironment ( options ?: { ref ?: string ; working ?: boolean } ) : Promise < Repo > ;
241247
242248 constructor ( options : RepoOptions ) ;
243249
244250 gitDir : string ;
245251 ref : string ;
246252 workTree : string | null ;
247253
248- async getWorkspace ( ) : Promise < Workspace > ;
249- async createWorkspaceFromRef ( ref : string ) : Promise < Workspace > ;
250- async createWorkspaceFromTreeHash ( hash : string ) : Promise < Workspace > ;
251- async getGit ( ) : Promise < GitClient > ;
252- async resolveRef ( ref ?: string | null ) : Promise < string | null > ;
254+ getWorkspace ( ) : Promise < Workspace > ;
255+ createWorkspaceFromRef ( ref : string ) : Promise < Workspace > ;
256+ createWorkspaceFromTreeHash ( hash : string ) : Promise < Workspace > ;
257+ getGit ( ) : Promise < GitClient > ;
258+ resolveRef ( ref ?: string | null ) : Promise < string | null > ;
253259 createBlob ( options : GitObjectOptions ) : BlobObject ;
254- async writeBlob ( content : string ) : Promise < BlobObject > ;
255- async writeBlobFromFile ( filePath : string ) : Promise < BlobObject > ;
260+ writeBlob ( content : string ) : Promise < BlobObject > ;
261+ writeBlobFromFile ( filePath : string ) : Promise < BlobObject > ;
256262 createTree ( options ?: { hash ?: string ; parent ?: TreeObject | null } ) : TreeObject ;
257- async createTreeFromRef ( ref : string ) : Promise < TreeObject > ;
263+ createTreeFromRef ( ref : string ) : Promise < TreeObject > ;
258264 createCommit ( options : GitObjectOptions ) : CommitObject ;
259- async hasCommit ( commit : string ) : Promise < boolean > ;
260- async hashWorkTree ( ) : Promise < string > ;
261- async watch ( options : { callback : ( treeHash : string , commitHash ?: string ) => void } ) : Promise < {
265+ hasCommit ( commit : string ) : Promise < boolean > ;
266+ hashWorkTree ( ) : Promise < string > ;
267+ watch ( options : { callback : ( treeHash : string , commitHash ?: string ) => void } ) : Promise < {
262268 watching : Promise < void > ;
263269 cancel : ( ) => void ;
264270 } > ;
265271 }
266272
267273 export class Projection {
268- static async projectBranch ( branch : Branch , options ?: ProjectionOptions ) : Promise < string > ;
274+ static projectBranch ( branch : Branch , options ?: ProjectionOptions ) : Promise < string > ;
269275
270276 constructor ( options : { branch : Branch } ) ;
271277
272278 branch : Branch ;
273279 workspace : Workspace ;
274280 output : Workspace ;
275281
276- async composite ( options : {
282+ composite ( options : {
277283 fetch ?: boolean | string [ ] ;
278284 cacheFrom ?: string | null ;
279285 cacheTo ?: string | null ;
280286 } ) : Promise < void > ;
281- async lens ( options : {
287+ lens ( options : {
282288 cacheFrom ?: string | null ;
283289 cacheTo ?: string | null ;
284290 } ) : Promise < void > ;
285- async commit ( ref : string , options ?: {
291+ commit ( ref : string , options ?: {
286292 parentCommit ?: string | null ;
287293 commitMessage ?: string | null ;
288294 } ) : Promise < string > ;
289295 }
290296
291297 export class Studio {
292- static async cleanup ( ) : Promise < void > ;
293- static async getHab ( ) : Promise < any > ;
294- static async getDocker ( ) : Promise < Docker > ;
295- static async isEnvironmentStudio ( ) : Promise < boolean > ;
296- static async get ( gitDir : string ) : Promise < Studio > ;
298+ static cleanup ( ) : Promise < void > ;
299+ static getHab ( ) : Promise < any > ;
300+ static getDocker ( ) : Promise < Docker > ;
301+ static isEnvironmentStudio ( ) : Promise < boolean > ;
302+ static get ( gitDir : string ) : Promise < Studio > ;
297303
298304 constructor ( options : { gitDir : string ; container : any } ) ;
299305
300306 container : any ;
301307 gitDir : string ;
302308
303309 isLocal ( ) : boolean ;
304- async habExec ( ...command : any [ ] ) : Promise < string > ;
305- async habPkgExec ( pkg : string , bin : string , ...args : any [ ] ) : Promise < string > ;
306- async holoExec ( ...command : any [ ] ) : Promise < string > ;
307- async holoLensExec ( spec : string ) : Promise < string > ;
308- async getPackage ( query : string , options ?: { install ?: boolean } ) : Promise < string | null > ;
310+ habExec ( ...command : any [ ] ) : Promise < string > ;
311+ habPkgExec ( pkg : string , bin : string , ...args : any [ ] ) : Promise < string > ;
312+ holoExec ( ...command : any [ ] ) : Promise < string > ;
313+ holoLensExec ( spec : string ) : Promise < string > ;
314+ getPackage ( query : string , options ?: { install ?: boolean } ) : Promise < string | null > ;
309315 }
310316
311317 export class Mapping extends Configurable {
@@ -319,13 +325,17 @@ declare module 'hologit' {
319325 getConfigPath ( ) : string ;
320326 }
321327
322- export class SpecObject extends BlobObject {
323- static async write ( repo : Repo , kind : string , data : any ) : Promise < {
328+ export class SpecObject {
329+ constructor ( repo : Repo , options : GitObjectOptions ) ;
330+
331+ repo : Repo ;
332+ hash : string ;
333+ isSpec : boolean ;
334+
335+ static write ( repo : Repo , kind : string , data : any ) : Promise < {
324336 hash : string ;
325337 ref : string ;
326338 } > ;
327339 static buildRef ( kind : string , hash : string ) : string ;
328-
329- isSpec : boolean ;
330340 }
331341}
0 commit comments