import { ParserOptions, ParseError } from '@babel/parser'; import { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types'; export { CssPreflightOptions, IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types'; import { SourceMap } from 'magic-string'; import { Result, Root, Document } from 'postcss'; import { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch'; import { I as IArbitraryValues, e as UserDefinedOptions, b as ICustomAttributesEntities, f as ICreateCacheReturnType, A as AppType } from './index-CoXntW_P.js'; export { D as DisabledOptions, a as ICustomAttributes, c as ItemOrItemArray, U as UniAppXComponentLocalStylesOptions, d as UniAppXUserDefinedOptions } from './index-CoXntW_P.js'; import 'node:buffer'; import 'webpack'; import 'lru-cache'; type AsyncableMethod = T extends (...args: infer A) => infer R ? (...args: A) => Promise> | Awaited : never; interface LinkedJsModuleResult { code: string; } interface JsHandlerResult { code: string; map?: SourceMap; error?: ParseError; /** * 因跨文件分析而被转换的额外模块,使用绝对文件路径作为键。 */ linked?: Record; } interface TailwindcssPatcherLike { packageInfo: TailwindcssPatcher['packageInfo']; majorVersion?: TailwindcssPatcher['majorVersion']; patch: TailwindcssPatcher['patch']; getClassSet: AsyncableMethod; getClassSetSync?: TailwindcssPatcher['getClassSetSync']; extract: TailwindcssPatcher['extract']; collectContentTokens?: TailwindcssPatcher['collectContentTokens']; options?: TailwindcssPatcher['options']; } interface RefreshTailwindcssPatcherOptions { clearCache?: boolean; } interface IJsHandlerOptions { escapeMap?: Record; classNameSet?: Set; /** * 兼容字段:不再参与 JS 候选判定。 * * JS 转译统一遵循 `classNameSet` 精确命中策略,仅转换 tailwindcss-patch 提供的类名集合。 */ staleClassNameFallback?: boolean; /** * 控制在 classNameSet 异常时的任意值兜底策略。 * * - `false`:关闭兜底。 * - `true`:在 class 语义上下文中允许任意值兜底。 * - `'auto'`:仅在 TailwindCSS v4 且 classNameSet 为空时启用。 */ jsArbitraryValueFallback?: boolean | 'auto'; /** * 当前 TailwindCSS 主版本号,用于自动兜底判定。 */ tailwindcssMajorVersion?: number; arbitraryValues?: IArbitraryValues; jsPreserveClass?: (keyword: string) => boolean | undefined; needEscaped?: boolean; generateMap?: boolean; alwaysEscape?: boolean; unescapeUnicode?: boolean; babelParserOptions?: ParserOptions; ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[]; ignoreCallExpressionIdentifiers?: (string | RegExp)[]; uniAppX?: boolean; moduleSpecifierReplacements?: Record; /** * 为 `true` 时将输入视作独立表达式,而非完整的程序。 * 适用于 `:class="{ 'foo bar': cond }"` 等模板绑定场景。 */ wrapExpression?: boolean; /** * 当前正在转换的模块绝对路径。 * 启用跨文件分析时必须提供。 */ filename?: string; /** * 配置跨文件模块图分析行为。 */ moduleGraph?: JsModuleGraphOptions; } interface JsHandler { (rawSource: string, set?: Set, options?: CreateJsHandlerOptions): JsHandlerResult; } interface ICommonReplaceOptions { keepEOL?: boolean; escapeMap?: Record; } interface ITemplateHandlerOptions extends ICommonReplaceOptions { customAttributesEntities?: ICustomAttributesEntities; escapeMap?: Record; inlineWxs?: boolean; jsHandler?: JsHandler; runtimeSet?: Set; disabledDefaultTemplateHandler?: boolean; quote?: string | null; ignoreHead?: boolean; wrapExpression?: boolean; } type InternalUserDefinedOptions = Required & { supportCustomLengthUnitsPatch: ILengthUnitsPatchOptions | boolean; templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise; styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise>; jsHandler: JsHandler; escapeMap: Record; customReplaceDictionary: Record; cache: ICreateCacheReturnType; twPatcher: TailwindcssPatcherLike; refreshTailwindcssPatcher: (options?: RefreshTailwindcssPatcherOptions) => Promise; }>; type InternalPostcssOptions = Pick; interface IBaseWebpackPlugin { options: InternalUserDefinedOptions; appType?: AppType; apply: (compiler: any) => void; } /** * @description InternalPatchResult */ interface InternalPatchResult { dataTypes?: string; processTailwindFeatures?: string; plugin?: string; } type CreateJsHandlerOptions = Omit; interface JsModuleGraphOptions { /** * 将导入的标识符解析为绝对文件路径。 */ resolve: (specifier: string, importer: string) => string | undefined; /** * 同步加载模块源码。 */ load: (id: string) => string | undefined; /** * 可选过滤器,用于跳过特定模块。 */ filter?: (id: string, specifier: string, importer: string) => boolean; /** * 最大遍历深度,默认无限制(`Infinity`)。 */ maxDepth?: number; } export { AppType, type CreateJsHandlerOptions, IArbitraryValues, type IBaseWebpackPlugin, type ICommonReplaceOptions, ICustomAttributesEntities, type IJsHandlerOptions, type ITemplateHandlerOptions, type InternalPatchResult, type InternalPostcssOptions, type InternalUserDefinedOptions, type JsHandler, type JsHandlerResult, type JsModuleGraphOptions, type LinkedJsModuleResult, type RefreshTailwindcssPatcherOptions, type TailwindcssPatcherLike, UserDefinedOptions };