1- import type { UserConfig } from '@tailwindcss-mangle/config'
2- import type { CacheStrategy , InternalCacheOptions , InternalPatchOptions , PackageInfo , TailwindcssClassCache , TailwindcssPatcherOptions , TailwindcssRuntimeContext } from '../types'
3- import type { ExtractValidCandidatesOption } from './candidates'
1+ import type { PatchUserConfig } from '@tailwindcss-mangle/config'
2+ import type { InternalCacheOptions , InternalPatchOptions , PackageInfo , TailwindcssClassCache , TailwindcssPatcherOptions , TailwindcssRuntimeContext } from '../types'
43import { createRequire } from 'node:module'
54import process from 'node:process'
65import fs from 'fs-extra'
@@ -90,7 +89,7 @@ export class TailwindcssPatcher {
9089 return contexts . filter ( x => isObject ( x ) ) . map ( x => x . classCache )
9190 }
9291
93- async getClassCacheSet ( options ?: UserConfig [ 'patch' ] ) : Promise < Set < string > > {
92+ async getClassCacheSet ( options ?: PatchUserConfig ) : Promise < Set < string > > {
9493 const classSet = new Set < string > ( )
9594 const { output, tailwindcss } = options ?? { }
9695 if ( this . majorVersion === 4 ) {
@@ -162,7 +161,7 @@ export class TailwindcssPatcher {
162161 /**
163162 * @description 在多个 tailwindcss 上下文时,这个方法将被执行多次,所以策略上应该使用 append
164163 */
165- async getClassSet ( options ?: UserConfig [ 'patch' ] ) {
164+ async getClassSet ( options ?: PatchUserConfig ) {
166165 const { output, tailwindcss } = options ?? { }
167166 const cacheStrategy = this . cacheOptions . strategy ?? 'merge'
168167 const set = await this . getClassCacheSet ( {
@@ -185,7 +184,7 @@ export class TailwindcssPatcher {
185184 return set
186185 }
187186
188- async extract ( options ?: UserConfig [ 'patch' ] ) {
187+ async extract ( options ?: PatchUserConfig ) {
189188 const { output, tailwindcss } = options ?? { }
190189 if ( output && tailwindcss ) {
191190 const { filename, loose } = output
0 commit comments