add preprocessors to plugins

This commit is contained in:
Xiaohan Zhang
2015-07-21 21:36:09 -07:00
parent 6baa15a0d7
commit cc42d530f8
2 changed files with 42 additions and 0 deletions
+18
View File
@@ -30,12 +30,30 @@ declare module Less {
class PluginManager {
constructor(less: LessStatic);
addPreProcessor(preProcessor: PreProcessor, priority?: number): void;
}
interface Plugin {
install: (less: LessStatic, pluginManager: PluginManager) => void;
}
interface PreProcessor {
process: (src: string, extra: PreProcessorExtraInfo) => string;
}
interface PreProcessorExtraInfo {
context: {
pluginManager: PluginManager;
};
fileInfo: RootFileInfo;
imports: {
[key: string]: any;
};
}
interface SourceMapOption {
sourceMapURL: string;
sourceMapBasepath: string;