| 
									
										
										
										
											2024-08-11 12:03:24 +02:00
										 |  |  | import { Bypass, Each, Fuse, On } from "./Conversion" | 
					
						
							| 
									
										
										
										
											2024-10-17 04:06:03 +02:00
										 |  |  | import { ThemeConfigJson } from "../Json/ThemeConfigJson" | 
					
						
							| 
									
										
										
										
											2024-08-11 12:03:24 +02:00
										 |  |  | import Constants from "../../Constants" | 
					
						
							|  |  |  | import { DoesImageExist, ValidateLayerConfig } from "./Validation" | 
					
						
							|  |  |  | import { ValidateTheme } from "./ValidateTheme" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-10-17 04:06:03 +02:00
										 |  |  | export class ValidateThemeAndLayers extends Fuse<ThemeConfigJson> { | 
					
						
							| 
									
										
										
										
											2024-08-11 12:03:24 +02:00
										 |  |  |     constructor( | 
					
						
							|  |  |  |         doesImageExist: DoesImageExist, | 
					
						
							|  |  |  |         path: string, | 
					
						
							|  |  |  |         isBuiltin: boolean, | 
					
						
							| 
									
										
										
										
											2024-08-14 13:53:56 +02:00
										 |  |  |         sharedTagRenderings?: Set<string> | 
					
						
							| 
									
										
										
										
											2024-08-11 12:03:24 +02:00
										 |  |  |     ) { | 
					
						
							|  |  |  |         super( | 
					
						
							|  |  |  |             "Validates a theme and the contained layers", | 
					
						
							|  |  |  |             new ValidateTheme(doesImageExist, path, isBuiltin, sharedTagRenderings), | 
					
						
							|  |  |  |             new On( | 
					
						
							|  |  |  |                 "layers", | 
					
						
							|  |  |  |                 new Each( | 
					
						
							|  |  |  |                     new Bypass( | 
					
						
							|  |  |  |                         (layer) => Constants.added_by_default.indexOf(<any>layer.id) < 0, | 
					
						
							| 
									
										
										
										
											2024-08-14 13:53:56 +02:00
										 |  |  |                         new ValidateLayerConfig(undefined, isBuiltin, doesImageExist, false, true) | 
					
						
							|  |  |  |                     ) | 
					
						
							|  |  |  |                 ) | 
					
						
							|  |  |  |             ) | 
					
						
							| 
									
										
										
										
											2024-08-11 12:03:24 +02:00
										 |  |  |         ) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |