数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
1.5 KiB

import { SourceCodeTransformer, UnoGenerator } from '@unocss/core';
import MagicString from 'magic-string';
interface TransformerDirectivesOptions {
enforce?: SourceCodeTransformer['enforce'];
/**
* Throw an error if utils or themes are not found.
*
* @default true
*/
throwOnMissing?: boolean;
/**
* Treat CSS variables as @apply directives for CSS syntax compatible.
*
* Pass `false` to disable.
*
* @default ['--at-apply', '--uno-apply', '--uno']
*/
applyVariable?: false | string | string[];
/**
* Treat CSS variables as directives for CSS syntax compatible.
*
* Pass `false` to disable, or a string to use as a prefix.
*
* @deprecated use `applyVariable` to specify the full var name instead.
* @default '--at-'
*/
varStyle?: false | string;
}
interface TransformerDirectivesContext {
code: MagicString;
uno: UnoGenerator;
options: TransformerDirectivesOptions;
applyVariable: string[];
offset?: number;
filename?: string;
}
declare function transformerDirectives(options?: TransformerDirectivesOptions): SourceCodeTransformer;
declare function transformDirectives(code: MagicString, uno: UnoGenerator, options: TransformerDirectivesOptions, filename?: string, originalCode?: string, offset?: number): Promise<void>;
export { TransformerDirectivesContext, TransformerDirectivesOptions, transformerDirectives as default, transformDirectives };