| 
									
										
										
										
											2020-09-14 11:24:15 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | import {NgDevConfig} from '../../utils/config'; | 
					
						
							|  |  |  | import {GitClient} from '../../utils/git/index'; | 
					
						
							|  |  |  | import {CaretakerConfig} from '../config'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** The BaseModule to extend modules for caretaker checks from. */ | 
					
						
							|  |  |  | export abstract class BaseModule<Data> { | 
					
						
							|  |  |  |   /** The data for the module. */ | 
					
						
							|  |  |  |   readonly data = this.retrieveData(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   constructor( | 
					
						
							|  |  |  |       protected git: GitClient, protected config: NgDevConfig<{caretaker: CaretakerConfig}>) {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /** Asyncronously retrieve data for the module. */ | 
					
						
							| 
									
										
										
										
											2020-11-04 19:58:29 -05:00
										 |  |  |   protected abstract retrieveData(): Promise<Data>; | 
					
						
							| 
									
										
										
										
											2020-09-14 11:24:15 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   /** Print the information discovered for the module to the terminal. */ | 
					
						
							| 
									
										
										
										
											2020-11-04 19:58:29 -05:00
										 |  |  |   abstract printToTerminal(): Promise<void>; | 
					
						
							| 
									
										
										
										
											2020-09-14 11:24:15 -07:00
										 |  |  | } |