import { postcss } from "opticss"; import { Block } from "../BlockTree"; import { Options } from "../configuration"; import { BlockDefinitionCompiler, INLINE_DEFINITION_FILE } from "./BlockDefinitionCompiler"; export { BlockDefinitionCompiler, INLINE_DEFINITION_FILE } from "./BlockDefinitionCompiler"; export interface CompiledBlockAndDefinition { definitionPath: string; css: postcss.Root; definition: postcss.Root; } export interface CompiledBlockAndInlineDefinition { definitionPath: typeof INLINE_DEFINITION_FILE; css: postcss.Root; } /** * Compiler that, given a Block will return a transformed AST * interface is `BlockParser.parse`. */ export declare class BlockCompiler { private config; private postcss; private definitionCompiler?; constructor(postcssImpl: typeof postcss, opts?: Options); setDefinitionCompiler(definitionCompiler: BlockDefinitionCompiler): void; /** * Compiles the block and also produces a corresponding block definition file. * * Note: the definition file is not actually written to any path; it is the * responsibility of the caller to write the files to locations that allow * definition file to be found at the path specified. * @param definitionPath A relative path to the definition file from the block file. Pass the symbol INLINE_DEFINITION_FILE if you want the definition file to be inserted into the definition file. */ compileWithDefinition(block: Block, root: postcss.Root, reservedClassNames: Set, definitionPath: typeof INLINE_DEFINITION_FILE): CompiledBlockAndInlineDefinition; compileWithDefinition(block: Block, root: postcss.Root, reservedClassNames: Set, definitionPath: string): CompiledBlockAndDefinition; /** * Compile the block to a postcss AST by walking the postcss AST from parsing * and removing/replacing the css blocks' specific syntax with standard CSS. */ compile(block: Block, root: postcss.Root, reservedClassNames: Set): postcss.Root; /** * Process all `@block-debug` statements, output debug statement to console or in comment as requested. * @param sourceFile File name of block in question. * @param root PostCSS Root for block. * @param block Block to resolve references for */ processDebugStatements(sourceFile: string, root: postcss.Root, block: Block): void; } //# sourceMappingURL=index.d.ts.map