Urara-Blog/node_modules/.pnpm-store/v3/files/c1/295ed1036176259d47deb46f5f00ac7dc93106cd249f1e39ce2072a7d62e7a42330966c72a10d05f3747bcfab1a4ea10bdfddef97edea1b50e97d085011284
2022-08-14 01:14:53 +08:00

64 lines
2.5 KiB
Text

import * as Options from './options';
import type { Processed as SvelteProcessed, Preprocessor, PreprocessorGroup } from 'svelte/types/compiler/preprocess';
export { Options };
export { Processed as SvelteProcessed, PreprocessorGroup, Preprocessor, } from 'svelte/types/compiler/preprocess';
export declare type PreprocessorArgs = Preprocessor extends (options: infer T) => any ? T : never;
export declare type TransformerArgs<T> = {
content: string;
filename?: string;
attributes?: Record<string, any>;
map?: string | object;
markup?: string;
dianostics?: unknown[];
options?: T;
};
export declare type Processed = SvelteProcessed & {
diagnostics?: any[];
};
export declare type Transformer<T> = (args: TransformerArgs<T>) => Processed | Promise<Processed>;
export declare type TransformerOptions<T = any> = boolean | T | Transformer<T>;
export interface Transformers {
babel?: TransformerOptions<Options.Babel>;
typescript?: TransformerOptions<Options.Typescript>;
scss?: TransformerOptions<Options.Sass>;
sass?: TransformerOptions<Options.Sass>;
less?: TransformerOptions<Options.Less>;
stylus?: TransformerOptions<Options.Stylus>;
postcss?: TransformerOptions<Options.Postcss>;
coffeescript?: TransformerOptions<Options.Coffeescript>;
pug?: TransformerOptions<Options.Pug>;
globalStyle?: Options.GlobalStyle;
replace?: Options.Replace;
[language: string]: TransformerOptions;
}
export declare type AutoPreprocessGroup = PreprocessorGroup & {
defaultLanguages: Readonly<{
markup: string;
style: string;
script: string;
}>;
};
export declare type AutoPreprocessOptions = {
markupTagName?: string;
aliases?: Array<[string, string]>;
preserve?: string[];
/** @deprecated Don't use "defaults" anymore, define the language being used explicitly instead */
defaults?: {
markup?: string;
style?: string;
script?: string;
};
sourceMap?: boolean;
babel?: TransformerOptions<Options.Babel>;
typescript?: TransformerOptions<Options.Typescript>;
scss?: TransformerOptions<Options.Sass>;
sass?: TransformerOptions<Options.Sass>;
less?: TransformerOptions<Options.Less>;
stylus?: TransformerOptions<Options.Stylus>;
postcss?: TransformerOptions<Options.Postcss>;
coffeescript?: TransformerOptions<Options.Coffeescript>;
pug?: TransformerOptions<Options.Pug>;
globalStyle?: Options.GlobalStyle | boolean;
replace?: Options.Replace;
[languageName: string]: TransformerOptions;
};