mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-20 16:14:57 +08:00
add definition for methods modifyVars, refreshStyles, watch
This commit is contained in:
10
types/less/index.d.ts
vendored
10
types/less/index.d.ts
vendored
@@ -1,6 +1,8 @@
|
||||
// Type definitions for LESS
|
||||
// Project: http://lesscss.org/
|
||||
// Definitions by: Tom Hasner <https://github.com/thasner>, Pranay Prakash <https://github.com/pranaygp>
|
||||
// Definitions by: Tom Hasner <https://github.com/thasner>
|
||||
// Pranay Prakash <https://github.com/pranaygp>
|
||||
// Daniel Waxweiler <https://github.com/dwaxweiler>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace Less {
|
||||
@@ -79,6 +81,10 @@ declare namespace Less {
|
||||
interface LessStatic {
|
||||
options: Less.StaticOptions;
|
||||
|
||||
modifyVars(vars: { [name: string]: string }): void;
|
||||
|
||||
refreshStyles(): 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;
|
||||
|
||||
@@ -86,6 +92,8 @@ interface LessStatic {
|
||||
render(input: string, options: Less.Options): Promise<Less.RenderOutput>;
|
||||
|
||||
version: number[];
|
||||
|
||||
watch(): void;
|
||||
}
|
||||
|
||||
declare module "less" {
|
||||
|
||||
@@ -35,3 +35,12 @@ var options: Less.Options = {
|
||||
};
|
||||
|
||||
less.render("h1 { background: red; }", options);
|
||||
|
||||
less.modifyVars({
|
||||
'@buttonFace': '#5B83AD',
|
||||
'@buttonText': '#D9EEF2'
|
||||
});
|
||||
|
||||
less.refreshStyles();
|
||||
|
||||
less.watch();
|
||||
|
||||
Reference in New Issue
Block a user