Merge pull request #4113 from thasner/master

adding Less.RenderError to less.d.ts
This commit is contained in:
Masahiro Wakame
2015-04-15 23:54:42 +09:00
2 changed files with 14 additions and 4 deletions
+2 -2
View File
@@ -8,6 +8,6 @@ less.render(".class { width: (1 + 1) }").then((output) => {
less.render("fail").then((output) => {
throw new Error("promise should have been rejected");
}, () => {
console.log("rejected as expected");
}, (error: Less.RenderError) => {
console.log("rejected as expected on line number " + error.line);
});
+12 -2
View File
@@ -51,6 +51,16 @@ declare module Less {
rootFileInfo?: RootFileInfo;
}
interface RenderError {
column: number;
extract: string[];
filename: string;
index: number;
line: number;
message: string;
type: string;
}
interface RenderOutput {
css: string;
map: string;
@@ -59,8 +69,8 @@ declare module Less {
}
interface LessStatic {
render(input: string, callback: (output: Less.RenderOutput) => void): void;
render(input: string, options: Less.Options, callback: (output: Less.RenderOutput) => void): void;
render(input: string, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void;
render(input: string, options: Less.Options, callback: (error: Less.RenderError, output: Less.RenderOutput) => void): void;
render(input: string): Less.Promise<Less.RenderOutput>;
render(input: string, options: Less.Options): Less.Promise<Less.RenderOutput>;