import { postcss } from "opticss"; import { RawSourceMap } from "source-map"; import { Configuration, ResolvedConfiguration } from "../configuration"; export declare enum Syntax { sass = "sass", scss = "scss", css = "css", less = "less", stylus = "styl", other = "other" } export declare function syntaxName(syntax: Syntax): string; export declare function syntaxFromExtension(extname: string): Syntax; export interface ProcessedFile { /** * The result of processing the file. * If processed with postcss, return the Result instead of a string for efficiency. */ content: string | postcss.Result; /** * If the file was processed during import, a sourcemap should be provided. * If a postcss.Result is returned for contents, the sourcemap from that * object will be used if this property is not set. */ sourceMap?: RawSourceMap | string; /** * If the file depends on other files that may change those dependencies should * be returned so that builds and caches can be correctly invalidated. */ dependencies?: string[]; } export declare type Preprocessor = (fullPath: string, content: string, configuration: ResolvedConfiguration, sourceMap?: RawSourceMap | string) => Promise; export declare type PreprocessorSync = (fullPath: string, content: string, configuration: ResolvedConfiguration, sourceMap?: RawSourceMap | string) => R; export declare type OptionalPreprocessor = Preprocessor; export declare type OptionalPreprocessorSync = PreprocessorSync; /** * A map of supported syntaxes to the preprocessor function for that syntax. * The keys must be one of the members of {Syntax}. * @see {Syntax} */ export declare type Preprocessors = { [S in Syntax]?: Preprocessor; }; export declare type PreprocessorsSync = { [S in Syntax]?: PreprocessorSync; }; /** * Postcss can only consume source maps if they are inline, this takes a * sourcemap from preprocessor output and adds it to the file's contents. This * should be called from within a css preprocessor function when an inline * sourcemap is needed and is provided for convenience. */ export declare function annotateCssContentWithSourceMap(configuration: Configuration, filename: string, content: string | postcss.Result, sourceMap: RawSourceMap | string): string; //# sourceMappingURL=preprocessing.d.ts.map