adding Less.RenderError to less.d.ts

This commit is contained in:
Tom Hasner 2015-04-14 17:07:08 -04:00
parent 74c2024d34
commit 311b9861ea
2 changed files with 14 additions and 4 deletions

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);
});

14
less/less.d.ts vendored
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>;