UNPKG

weapp-tailwindcss

Version:

把 tailwindcss 原子化样式思想,带给小程序开发者们! bring tailwindcss to miniprogram developers!

31 lines (30 loc) 1.71 kB
import type { RuntimeCompilationSnapshot } from '../../compiler/index.js'; import type { TailwindcssRuntimeLike } from '../../types/index.js'; import type { IArbitraryValues } from '../../types/shared.js'; import { extractRawCandidatesWithPositions, extractValidCandidates } from '@tailwindcss-mangle/engine'; type ExtractValidCandidatesOptions = Parameters<typeof extractValidCandidates>[0]; type MemoryExtractValidCandidatesOptions = ExtractValidCandidatesOptions & { content?: string; extension?: string; }; type ExtractValidCandidatesFn = (options?: MemoryExtractValidCandidatesOptions) => Promise<string[]>; type ExtractRawCandidateResult = Awaited<ReturnType<typeof extractRawCandidatesWithPositions>>; type ExtractRawCandidatesFn = (content: string, extension?: string, options?: { bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined; }) => Promise<ExtractRawCandidateResult>; export interface RuntimeClassSetManager { sync: (runtime: TailwindcssRuntimeLike, snapshot: RuntimeCompilationSnapshot, options?: RuntimeClassSetSyncOptions) => Promise<Set<string>>; reset: () => Promise<void>; } export interface RuntimeClassSetSyncOptions { baseClassSet?: Set<string> | undefined; skipInitialFullScanWithBase?: boolean | undefined; } export interface CreateRuntimeClassSetManagerOptions { bareArbitraryValues?: IArbitraryValues['bareArbitraryValues'] | undefined; escapeMap?: Record<string, string> | undefined; extractCandidates?: ExtractValidCandidatesFn; extractRawCandidates?: ExtractRawCandidatesFn; } export declare function createRuntimeClassSetManager(options?: CreateRuntimeClassSetManagerOptions): RuntimeClassSetManager; export {};