import { postcss } from "opticss" ; import * as perfectionist from "perfectionist" ; import { Options } from "../../src/configuration" ; import cssBlocks = require ( ".././util/postcss-helper" ) ; export interface MockConfigOpts { dfnFiles ? : string [ ] ; } export class BEMProcessor { process ( filename , contents , cssBlocksOpts ? , mockConfigOpts ? ) { let processOpts = { from : filename } ; let cssBlocksProcessor = cssBlocks ( postcss ) ; return postcss ( [ cssBlocksProcessor ( cssBlocksOpts , mockConfigOpts ) , perfectionist ( { format : "compact" , indentSize : 2 } ) , ] ) . process ( contents , processOpts ) ; } }