import type { ProcessOptions } from 'postcss'; import * as sass from 'sass'; /** RGBA channels plus the hex representation of a Sass color. */ export interface SassColorValue { r: number; g: number; b: number; a: number; hex: string; } /** A single exported Sass variable value, discriminated by `type`. */ export type SassVariable = { type: 'SassMap'; value: Record; } | { type: 'SassList'; value: Array; } | { type: 'SassColor'; value: SassColorValue; } | { type: 'SassString'; value: string; } | { type: 'SassBoolean'; value: boolean; } | { type: 'SassNumber'; value: number; unit: string; } | { type: 'unknown'; value: unknown; }; /** The exported Sass variables, keyed by variable name including the leading `$`. */ export type SassVariables = Record; type SassConfig = sass.StringOptions; /** * Transforms the parsed variables passed to the Sass custom function into a regular JSON object. * * @param value parsed variables passed to the Sass custom function * @returns regular JSON object */ export declare function toJSON(value: any): SassVariable | undefined; /** * Gets the Sass variables from a given path to a Sass file synchronously. * * @param filepath path to the Sass file * @param postCssConfig user provided PostCSS configuration * @param sassConfig user provided Sass configuration * @param safeKeyWord safe keyword for the variable and custom Sass function * @returns an object containing the Sass variables */ export declare function getSassVariablesSync(filepath: string, postCssConfig?: ProcessOptions, sassConfig?: SassConfig<'sync'>, safeKeyWord?: string): SassVariables; /** * Gets the Sass variables from a given path to a Sass file asynchronously. * * @param filepath path to the Sass file * @param postCssConfig user provided PostCSS configuration * @param sassConfig user provided Sass configuration * @param safeKeyWord safe keyword for the variable and custom Sass function * @returns a Promise which resolves an object containing the Sass variables */ export declare function getSassVariablesAsync(filepath: string, postCssConfig?: ProcessOptions, sassConfig?: SassConfig<'async'>, safeKeyWord?: string): Promise; /** * Gets the Sass variables from a given Sass content as a string synchronously. * * @param sassContent Sass content as a string * @param postCssConfig user provided PostCSS configuration * @param sassConfig user provided Sass configuration * @param safeKeyWord safe keyword for the variable and custom Sass function * @returns an object containing the Sass variables */ export declare function getSassVariablesStringSync(sassContent: string, postCssConfig?: ProcessOptions, sassConfig?: SassConfig<'sync'>, safeKeyWord?: string): SassVariables; /** * Gets the Sass variables from a given Sass content as a string asynchronously. * * @param sassContent Sass content as a string * @param postCssConfig user provided PostCSS configuration * @param sassConfig user provided Sass configuration * @param safeKeyWord safe keyword for the variable and custom Sass function * @returns a Promise which resolves an object containing the Sass variables */ export declare function getSassVariablesStringAsync(sassContent: string, postCssConfig?: ProcessOptions, sassConfig?: SassConfig<'async'>, safeKeyWord?: string): Promise; export {};