UNPKG

@gogors/postcss-lightningcss-rs

Version:
115 lines (112 loc) 3.3 kB
/* tslint:disable */ /* eslint-disable */ /* auto-generated by NAPI-RS */ | { type: 'Bool', field0: boolean } | { type: 'Config', field0: CssModulesConfig } export interface AnalyzeDependenciesConfig { removeImports: boolean } export interface CssModulesConfig { pattern?: string container?: boolean dashedIdents?: boolean animation?: boolean grid?: boolean customIdents?: boolean pure?: boolean } export interface DraftsOptions { nesting?: boolean customMedia?: boolean deepSelectorCombinator?: boolean } export interface OwnedPseudoClasses { hover?: string active?: string focus?: string focusVisible?: string focusWithin?: string } export interface TransformBrowsers { android?: number chrome?: number edge?: number firefox?: number ie?: number iosSaf?: number opera?: number safari?: number samsung?: number } export interface TransformOptions { minify?: boolean targets?: TransformBrowsers include?: number exclude?: number unusedSymbols?: Array<string> sourceMap?: boolean inputSourceMap?: string errorRecovery?: boolean projectRoot?: string filename?: string pseudoClasses?: OwnedPseudoClasses analyzeDependencies?: AnalyzeDependenciesConfig cssModules?: CssModulesOption drafts?: DraftsOptions } | { type: 'Bool', field0: boolean } | { type: 'Inline' } | { type: 'Hidden' } export interface PluginOptions { minify?: boolean targets?: Array<string> include?: number exclude?: number unusedSymbols?: Array<string> errorRecovery?: boolean pseudoClasses?: OwnedPseudoClasses analyzeDependencies?: AnalyzeDependenciesConfig cssModules?: CssModulesOption drafts?: DraftsOptions } /** * General API for transforming CSS * @param {string} css - CSS string to transform * @param {TransformOptions} options - Transform configuration options * @param {Env} env - NAPI environment object * @returns {Promise<unknown>} Transformed result * @throws {Error} Throws error if transformation fails */ function transform(css: string, options: TransformOptions): Promise<{ code: string; map?: string; exports?: Record<string, { name: string; composes?: string[]; type: 'local' | 'global' | 'dependency' }[]>; references?: Record<string, { name: string; composes?: string[]; type: 'local' | 'global' | 'dependency' }[]>; dependencies?: { type: string; specifier: string; placeholder?: string; media?: string }[] }> /** * @typedef {Object} PluginOptions * @property {boolean | RegExp | 'auto' | undefined} cssModules * @param partialOptions {LightningcssPluginOptions} * @returns {import('postcss').Plugin} */ function postcssLightningcssPlugin(options: PluginOptions): import('postcss').Plugin export const enum Features { Nesting = 1, NotSelectorList = 2, DirSelector = 4, LangSelectorList = 8, IsSelector = 16, TextDecorationThicknessPercent = 32, MediaIntervalSyntax = 64, MediaRangeSyntax = 128, CustomMediaQueries = 256, ClampFunction = 512, ColorFunction = 1024, OklabColors = 2048, LabColors = 4096, P3Colors = 8192, HexAlphaColors = 16384, SpaceSeparatedColorNotation = 32768, FontFamilySystemUi = 65536, DoublePositionGradients = 131072, VendorPrefixes = 262144, LogicalProperties = 524288, Selectors = 31, MediaQueries = 448, Colors = 64512 }