import { TemplateAnalysis , TemplateIntegrationOptions , TemplateTypes } from "@opticss/template-api" ; import { ParsedCssFile } from "../CssFile" ; import { Initializers } from "../initializers" ; import { OptiCSSOptions } from "../OpticssOptions" ; import { OptimizationPass } from "../OptimizationPass" ; export interface OptimizationConstructor { new ( options , templateOptions ) : Optimization ; } export interface SingleFileOptimization { name : string ; readonly initializers : Array < keyof Initializers > ; optimizeSingleFile ( pass , analyses , file ) : void ; } export interface MultiFileOptimization { name : string ; readonly initializers : Array < keyof Initializers > ; optimizeAllFiles ( pass , analyses , files ) : void ; } export function isMultiFileOptimization ( optimization ) { return ! ! ( < MultiFileOptimization > optimization ) . optimizeAllFiles ; } export function isSingleFileOptimization ( optimization ) { return ! ! ( < SingleFileOptimization > optimization ) . optimizeSingleFile ; } export type Optimization = SingleFileOptimization | MultiFileOptimization | SingleFileOptimization & MultiFileOptimization ;