@types/stylus
- Version 0.48.43
- Published
- 49.5 kB
- 1 dependency
- MIT license
Install
npm i @types/stylus
yarn add @types/stylus
pnpm add @types/stylus
Overview
TypeScript definitions for stylus
Index
Variables
Interfaces
Type Aliases
Namespaces
Variables
variable stylus
var stylus: Stylus.Static;
Interfaces
interface RenderOptions
interface RenderOptions {}
property Evaluator
Evaluator?: typeof Stylus.Evaluator | undefined;
property filename
filename?: string | undefined;
property functions
functions?: Stylus.Dictionary<any> | undefined;
property globals
globals?: Stylus.Dictionary<any> | undefined;
property imports
imports?: string[] | undefined;
property paths
paths?: string[] | undefined;
Type Aliases
type RenderCallback
type RenderCallback = (err: Error, css: string, js: string) => void;
Namespaces
namespace Stylus
namespace Stylus {}
class Compiler
class Compiler {}
class Evaluator
class Evaluator {}
class Parser
class Parser {}
class Visitor
class Visitor {}
interface Dictionary
interface Dictionary<T> {}
index signature
[key: string]: T;
interface ExceptionOptions
interface ExceptionOptions {}
interface Functions
interface Functions {}
method "-math-prop"
'-math-prop': (prop: Nodes.String) => Nodes.Unit;
Return the opposites of the given
positions
.
method "-prefix-classes"
'-prefix-classes': (prefix: Nodes.String, block: Nodes.Block) => Nodes.Block;
Prefix css classes in a block
method "add-property"
'add-property': (name: Nodes.String, expr: Nodes.Expression) => Nodes.Property;
Add property
name
with the givenexpr
to the mixin-able block.
method "base-convert"
'base-convert': ( num: Nodes.Number, base: Nodes.Number, width: Nodes.Number) => Nodes.Literal;
Return a
Literal
num
converted to the providedbase
, padded towidth
with zeroes (default width is 2)
method "current-media"
'current-media': () => Nodes.String;
Returns the string for the current block
method "image-size"
'image-size': (img: Nodes.String, ignoreErr: Nodes.Boolean) => Nodes.Expression;
Return the width and height of the given
img
path.
method "list-separator"
'list-separator': (list: Nodes.Expression) => Nodes.String;
Return the separator of the given
list
.
method "opposite-position"
'opposite-position': (positions: Nodes.Expression) => Nodes.Expression;
Return the opposites of the given
positions
.
method "type-of"
'type-of': (node: Nodes.Node) => string;
Return type of
node
.
method adjust
adjust: { (rgba: Nodes.RGBA, prop: Nodes.String, amount: Nodes.Unit): Nodes.RGBA; (hsla: Nodes.HSLA, prop: Nodes.String, amount: Nodes.Unit): Nodes.RGBA;};
Adjust HSL
color
prop
byamount
.
method alpha
alpha: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the alpha component of the given
color
, or set the alpha component to the optional secondvalue
argument.
method basename
basename: { (path: Nodes.String): string; (path: Nodes.String, ext: Nodes.String): string;};
Return component
name
for the givencolor
.
method blend
blend: { (top: Nodes.RGBA): Nodes.RGBA; (top: Nodes.RGBA, bottom: Nodes.RGBA): Nodes.RGBA; (top: Nodes.RGBA, bottom: Nodes.HSLA): Nodes.RGBA; (top: Nodes.HSLA): Nodes.RGBA; (top: Nodes.HSLA, bottom: Nodes.RGBA): Nodes.RGBA; (top: Nodes.HSLA, bottom: Nodes.HSLA): Nodes.RGBA;};
Blend the
top
color over thebottom
method blue
blue: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the blue component of the given
color
, or set the blue component to the optional secondvalue
argument.
method clone
clone: (expr: Nodes.Expression) => Nodes.Expression;
Return a clone of the given
expr
.
method component
component: { (color: Nodes.RGBA, name: Nodes.String): Nodes.Unit; (color: Nodes.HSLA, name: Nodes.String): Nodes.Unit;};
Return component
name
for the givencolor
.
method contrast
contrast: { (top: Nodes.RGBA): Nodes.Object; (top: Nodes.RGBA, bottom: Nodes.RGBA): Nodes.Object; (top: Nodes.RGBA, bottom: Nodes.HSLA): Nodes.Object; (top: Nodes.HSLA): Nodes.Object; (top: Nodes.HSLA, bottom: Nodes.RGBA): Nodes.Object; (top: Nodes.HSLA, bottom: Nodes.HSLA): Nodes.Object;};
Returns the contrast ratio object between
top
andbottom
colors, based on http://leaverou.github.io/contrast-ratio/ and https://github.com/LeaVerou/contrast-ratio/blob/gh-pages/color.js#L108
method convert
convert: (str: Nodes.String) => Nodes.Node;
Like
unquote
but tries to convert the givenstr
to a Stylus node.
method define
define: { (name: Nodes.String, expr: Nodes.Expression): Nodes.Null; ( name: Nodes.String, expr: Nodes.Expression, global: Nodes.Boolean ): Nodes.Null;};
Set a variable
name
on current scope.
method dirname
dirname: (path: Nodes.String) => string;
Return the dirname of
path
.
method error
error: (msg: Nodes.String) => void;
Throw an error with the given
msg
.
method extend
extend: (dest: Nodes.Object, ...objs: Nodes.Object[]) => Nodes.Object;
Merge the object
dest
with the given args.
method extname
extname: (path: Nodes.String) => string;
Return the extension of
path
.
method green
green: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the green component of the given
color
, or set the green component to the optional secondvalue
argument.
method hsl
hsl: { (rgba: Nodes.RGBA): Nodes.HSLA; (hsla: Nodes.HSLA): Nodes.HSLA; (hue: Nodes.Unit, saturation: Nodes.Unit, lightness: Nodes.Unit): Nodes.HSLA;};
Convert the given
color
to anHSLA
node, or h,s,l component values.
method hsla
hsla: { (rgba: Nodes.RGBA): Nodes.HSLA; (hsla: Nodes.HSLA): Nodes.HSLA; ( hue: Nodes.Unit, saturation: Nodes.Unit, lightness: Nodes.Unit, alpha: Nodes.Unit ): Nodes.HSLA;};
Convert the given
color
to anHSLA
node, or h,s,l,a component values.
method hue
hue: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the hue component of the given
color
, or set the hue component to the optional secondvalue
argument.
method json
json: ( path: Nodes.String, local: Nodes.Boolean, namePrefix: Nodes.String) => any;
Convert a .json file into stylus variables or object. Nested variable object keys are joined with a dash (-)
Given this sample media-queries.json file: { "small": "screen and (max-width:400px)", "tablet": { "landscape": "screen and (min-width:600px) and (orientation:landscape)", "portrait": "screen and (min-width:600px) and (orientation:portrait)" } }
method length
length: { (expr: Nodes.Expression): Nodes.Unit; (...expr: Nodes.Expression[]): Nodes.Null;};
Return length of the given
expr
.Inspect the given
expr
.
method lightness
lightness: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the lightness component of the given
color
, or set the lightness component to the optional secondvalue
argument.
method lookup
lookup: (name: Nodes.String) => Nodes.Node;
Lookup variable
name
or return Null.
method luminosity
luminosity: { (rgba: Nodes.RGBA): Nodes.Unit; (rgba: Nodes.HSLA): Nodes.Unit };
Returns the relative luminance of the given
color
, see http://www.w3.org/TR/WCAG20/#relativeluminancedef
method match
match: { (pattern: Nodes.String, val: Nodes.String): Nodes.Boolean; (pattern: Nodes.String, val: Nodes.Ident): Nodes.Boolean;};
Test if
val
matches the givenpattern
.
method math
math: (n: Nodes.Unit, fn: Nodes.String) => Nodes.Unit;
Return the tangent of the given
angle
.
method merge
merge: (dest: Nodes.Object, ...objs: Nodes.Object[]) => Nodes.Object;
Merge the object
dest
with the given args.
method operate
operate: (op: Nodes.String, left: Nodes.Node, right: Nodes.Node) => Nodes.Node;
Perform
op
on theleft
andright
operands.
method pathjoin
pathjoin: (...paths: Nodes.String[]) => string;
Joins given paths
method pop
pop: (expr: Nodes.Expression) => Nodes.Node;
Pop a value from
expr
.
method prepend
prepend: (expr: Nodes.Expression, ...nodes: Nodes.Node[]) => Nodes.Unit;
Unshift the given args to
expr
..
method push
push: (expr: Nodes.Expression, ...nodes: Nodes.Node[]) => Nodes.Unit;
Push the given args to
expr
.
method red
red: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the red component of the given
color
, or set the red component to the optional secondvalue
argument.
method replace
replace: { ( pattern: Nodes.String, replacement: Nodes.String, val: Nodes.String ): Nodes.String; ( pattern: Nodes.String, replacement: Nodes.String, val: Nodes.Ident ): Nodes.Ident;};
Returns string with all matches of
pattern
replaced byreplacement
in givenval
method rgb
rgb: { (rgba: Nodes.RGBA): Nodes.RGBA; (hsla: Nodes.HSLA): Nodes.RGBA; ( hue: Nodes.Unit, saturation: Nodes.Unit, lightness: Nodes.Unit, alpha: Nodes.Unit ): Nodes.RGBA;};
Return a
RGBA
from the r,g,b channels.
method rgba
rgba: { (rgba: Nodes.RGBA): Nodes.RGBA; (hsla: Nodes.HSLA): Nodes.RGBA; ( hue: Nodes.Unit, saturation: Nodes.Unit, lightness: Nodes.Unit, alpha: Nodes.Unit ): Nodes.RGBA;};
Return a
RGBA
from the r,g,b,a channels.
method s
s: (fmt: Nodes.String, ...nodes: Nodes.Node[]) => Nodes.Literal;
Return a
Literal
with the givenfmt
, and variable number of arguments.
method saturation
saturation: { (color: Nodes.RGBA): Nodes.Unit; (color: Nodes.HSLA): Nodes.Unit; (color: Nodes.RGBA, value: Nodes.Unit): Nodes.RGBA; (color: Nodes.HSLA, value: Nodes.Unit): Nodes.RGBA;};
Return the saturation component of the given
color
, or set the saturation component to the optional secondvalue
argument.
method selector
selector: { (): string; (sel: Nodes.String): string };
Return the current selector or compile
sel
selector.
method shift
shift: (expr: Nodes.Expression) => Nodes.Node;
Shift a value from
expr
.
method split
split: { (pattern: Nodes.String, val: Nodes.String): Nodes.Expression; (pattern: Nodes.String, val: Nodes.Ident): Nodes.Expression;};
Splits the given
val
bydelim
method substr
substr: { (val: Nodes.String, start: Nodes.Number, length: Nodes.Number): Nodes.String; (val: Nodes.Ident, start: Nodes.Number, length: Nodes.Number): Nodes.Ident;};
Returns substring of the given
val
.
method tan
tan: (angle: Nodes.Unit) => Nodes.Unit;
Return the tangent of the given
angle
.
method trace
trace: () => Nodes.Null;
Output stack trace.
method transparentify
transparentify: { (top: Nodes.RGBA): Nodes.Object; (top: Nodes.RGBA, bottom: Nodes.RGBA, alpha?: Nodes.Unit): Nodes.Object; (top: Nodes.RGBA, bottom: Nodes.HSLA, alpha?: Nodes.Unit): Nodes.Object; (top: Nodes.HSLA): Nodes.Object; (top: Nodes.HSLA, bottom: Nodes.RGBA, alpha?: Nodes.Unit): Nodes.Object; (top: Nodes.HSLA, bottom: Nodes.HSLA, alpha?: Nodes.Unit): Nodes.Object;};
Returns the transparent version of the given
top
color, as if it was blend over the givenbottom
color.
method type
type: (node: Nodes.Node) => string;
Return type of
node
.
method typeof
typeof: (node: Nodes.Node) => string;
Return type of
node
.
method unit
unit: (unit: Nodes.Unit, type: Nodes.String) => Nodes.Unit;
Assign
type
to the givenunit
or returnunit
's type.
method unquote
unquote: (str: Nodes.String) => Nodes.Literal;
Unquote the given
string
.
method unshift
unshift: (expr: Nodes.Expression, ...nodes: Nodes.Node[]) => Nodes.Unit;
Unshift the given args to
expr
.
method use
use: { (plugin: Nodes.String): void; (plugin: Nodes.String, options: any): void;};
Use the given
plugin
.
method warn
warn: (msg: Nodes.String) => Nodes.Null;
Warn with the given
msg
prefixed by "Warning: ".
interface LiteralFunction
interface LiteralFunction {}
property raw
raw: boolean;
call signature
(url: string): Nodes.Literal;
interface NodeStatic
interface NodeStatic {}
property Arguments
Arguments: typeof Nodes.Arguments;
property Atblock
Atblock: typeof Nodes.Atblock;
property Atrule
Atrule: typeof Nodes.Atrule;
property BinOp
BinOp: typeof Nodes.BinOp;
property Block
Block: typeof Nodes.Block;
property Boolean
Boolean: typeof Nodes.Boolean;
property Call
Call: typeof Nodes.Call;
property Charset
Charset: typeof Nodes.Charset;
property Comment
Comment: typeof Nodes.Comment;
property Each
Each: typeof Nodes.Each;
property Expression
Expression: typeof Nodes.Expression;
property Extend
Extend: typeof Nodes.Extend;
property false
false: Nodes.Boolean;
property Function
Function: typeof Nodes.Function;
property Group
Group: typeof Nodes.Group;
property HSLA
HSLA: typeof Nodes.HSLA;
property Ident
Ident: typeof Nodes.Ident;
property If
If: typeof Nodes.If;
property Import
Import: typeof Nodes.Import;
property Keyframes
Keyframes: typeof Nodes.Keyframes;
property Literal
Literal: typeof Nodes.Literal;
property Media
Media: typeof Nodes.Media;
property Member
Member: typeof Nodes.Member;
property Namespace
Namespace: typeof Nodes.Namespace;
property Node
Node: typeof Nodes.Node;
property null
null: Nodes.Null;
property Null
Null: typeof Nodes.Null;
property Object
Object: typeof Nodes.Object;
property Params
Params: typeof Nodes.Params;
property Property
Property: typeof Nodes.Property;
property Query
Query: typeof Nodes.Query;
property QueryExpr
QueryExpr: typeof Nodes.QueryExpr;
property QueryList
QueryList: typeof Nodes.QueryList;
property Return
Return: typeof Nodes.Return;
property RGBA
RGBA: typeof Nodes.RGBA;
property Root
Root: typeof Nodes.Root;
property Selector
Selector: typeof Nodes.Selector;
property String
String: typeof Nodes.String;
property Ternary
Ternary: typeof Nodes.Ternary;
property true
true: Nodes.Boolean;
property UnaryOp
UnaryOp: typeof Nodes.UnaryOp;
property Unit
Unit: typeof Nodes.Unit;
interface Static
interface Static {}
property Compiler
Compiler: typeof Compiler;
property Evaluator
Evaluator: typeof Evaluator;
property functions
functions: Functions;
Expose BIFs.
property nodes
nodes: NodeStatic;
Expose nodes.
property Parser
Parser: typeof Parser;
property url
url: UrlFunction;
Return a url() function with the given
options
.
property utils
utils: Utils;
Expose utils.
property version
version: string;
Library version.
property Visitor
Visitor: typeof Visitor;
method convertCSS
convertCSS: (css: string) => string;
Convert the given
css
tostylus
source.
method middleware
middleware: { (dir: string): Middleware; (options: any): Middleware };
Expose middleware.
method render
render: { (str: string): string; (str: string, options: stylus.RenderOptions): string; (str: string, callback: stylus.RenderCallback): void; ( str: string, options: stylus.RenderOptions, callback: stylus.RenderCallback ): void;};
Render the given
str
withoptions
and callbackfn(err, css)
. Returns the rendered string if no callback is given.
method resolver
resolver: (options: any) => LiteralFunction;
Return a url() function with the given
options
.
call signature
(str: string): Renderer;
Return a new
Renderer
for the givenstr
andoptions
.
call signature
(str: string, options: stylus.RenderOptions): Renderer;
interface UrlFunction
interface UrlFunction {}
property mimes
mimes: { '.gif': string; '.png': string; '.jpg': string; '.jpeg': string; '.svg': string; '.ttf': string; '.eot': string; '.woff': string;};
call signature
(options?: UrlOptions): LiteralFunction;
interface UrlOptions
interface UrlOptions {}
interface Utils
interface Utils {}
method absolute
absolute: (path: string) => boolean;
Check if
path
looks absolute.
method assertColor
assertColor: (node: Nodes.Node, param: string) => void;
Assert that
node
is aRGBA
orHSLA
.
method assertPresent
assertPresent: (node: Nodes.Node, name: string) => void;
Assert that param
name
is given, aka thenode
is passed.
method assertString
assertString: (node: Nodes.Node, param: string) => void;
Assert that
node
is aString
orIdent
.
method assertType
assertType: (node: Nodes.Node, type: string, param: string) => void;
Assert that
node
is of the giventype
, or throw.
method coerce
coerce: { (val: any): Nodes.Node; (val: any, raw: boolean): Nodes.Node };
Coerce JavaScript values to their Stylus equivalents.
method coerceArray
coerceArray: { (val: any): Nodes.Expression; (val: any, raw: boolean): Nodes.Expression;};
Coerce a javascript
Array
to a StylusExpression
.
method coerceObject
coerceObject: { (obj: any): Nodes.Expression; (obj: any, raw: boolean): Nodes.Expression;};
Coerce a javascript object to a Stylus
Expression
orObject
.For example
{ foo: 'bar', bar: 'baz' }
would become the expression(foo 'bar') (bar 'baz')
. Ifraw
is true givenobj
would become a Stylus hash object.
method compileSelectors
compileSelectors: (arr: string[], leaveHidden: boolean) => string[];
Compile selector strings in
arr
from the bottom-up to produce the selector combinations. For example the following Stylus:
method find
find: (path: string, paths: string, ignore: string) => string[];
Like
utils.lookup
but usesglob
to find files.
method formatException
formatException: (err: Error, options: ExceptionOptions) => Error;
Format the given
err
with the givenoptions
.
method lookup
lookup: ( path: string, paths: string, ignore: string, resolveURL: boolean) => string;
Attempt to lookup
path
withinpaths
from tail to head. Optionally a path toignore
may be passed.
method lookupIndex
lookupIndex: (path: string, paths: string, filename: string) => string[];
Attempt to lookup
path
withinpaths
from tail to head. Optionally a path toignore
may be passed.
method merge
merge: (a: any, b: any) => any;
Merge object
b
witha
.
method params
params: (fn: (...args: any[]) => any) => string[];
Return param names for
fn
.
method uniq
uniq: (arr: any[]) => any[];
Returns an array with unique values.
method unwrap
unwrap: (expr: Nodes.Expression) => Nodes.Node;
Unwrap
expr
.Takes an expressions with length of 1 such as
((1 2 3))
and unwraps it to(1 2 3)
.
type Middleware
type Middleware = (req: any, res: any, next: (...args: any[]) => any) => void;
namespace Stylus.Nodes
namespace Stylus.Nodes {}
class Arguments
class Arguments extends Expression {}
constructor
constructor();
property map
map: Dictionary<Node>;
method toJSON
toJSON: () => { __type: string; map: Dictionary<Node>; isList: boolean; preserve: boolean; nodes: Node[]; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Atblock
class Atblock extends Node {}
constructor
constructor();
property block
block: Block;
property nodes
nodes: Node[];
method toJSON
toJSON: () => { __type: string; block: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Atrule
class Atrule extends Node {}
constructor
constructor(type: globalThis.String);
property hasOnlyProperties
hasOnlyProperties: globalThis.Boolean;
property type
type: globalThis.String;
method toJSON
toJSON: () => { __type: string; type: string; segments: Node[]; block?: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class BinOp
class BinOp extends Node {}
constructor
constructor(op: globalThis.String, left: Expression, right: Expression);
property left
left: Expression;
property op
op: globalThis.String;
property right
right: Expression;
method toJSON
toJSON: () => { __type: string; op: string; left: Expression; right: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Block
class Block extends Node {}
constructor
constructor(parent: Block);
constructor
constructor(parent: Block, node: Node);
property hasMedia
hasMedia: globalThis.Boolean;
property hasProperties
hasProperties: globalThis.Boolean;
property isEmpty
isEmpty: globalThis.Boolean;
property node
node: Node;
property nodes
nodes: Node[];
property parent
parent: Block;
property scope
scope: globalThis.Boolean;
method push
push: (node: Node) => void;
Push a
node
to this block.
method toJSON
toJSON: () => { __type: string; nodes: Node[]; scope: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Boolean
class Boolean extends Node {}
constructor
constructor();
constructor
constructor(val: globalThis.Boolean);
property isFalse
isFalse: globalThis.Boolean;
property isTrue
isTrue: globalThis.Boolean;
property val
val: globalThis.Boolean;
method inspect
inspect: () => string;
Return 'Boolean'.
method negate
negate: () => Boolean;
Negate the value.
method toJSON
toJSON: () => { __type: string; val: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Call
class Call extends Node {}
constructor
constructor(name: globalThis.String, args: Expression);
property args
args: Expression;
property name
name: globalThis.String;
method toJSON
toJSON: () => { __type: string; name: string; args: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Charset
class Charset extends Node {}
constructor
constructor(val: globalThis.String);
property val
val: globalThis.String;
method toJSON
toJSON: () => { __type: string; val: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Comment
class Comment extends Node {}
constructor
constructor( str: globalThis.String, suppress: globalThis.Boolean, inline: globalThis.Boolean);
property inline
inline: globalThis.Boolean;
property str
str: globalThis.String;
property suppress
suppress: globalThis.Boolean;
method toJSON
toJSON: () => { __type: string; str: string; suppress: boolean; inline: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Each
class Each extends Node {}
property block
block: Block;
property expr
expr: Expression;
property key
key: globalThis.String;
property val
val: globalThis.String;
method toJSON
toJSON: () => { __type: string; val: string; key: string; expr: Expression; block: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Expression
class Expression extends Node {}
constructor
constructor(isList: globalThis.Boolean);
property first
first: Node;
property isEmpty
isEmpty: globalThis.Boolean;
property isList
isList: globalThis.Boolean;
property nodes
nodes: Node[];
method push
push: (node: Node) => void;
Push the given node.
method toJSON
toJSON: () => { __type: string; nodes: Node[]; isList: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Extend
class Extend extends Node {}
constructor
constructor(selectors: Selector[]);
property selectors
selectors: Selector[];
method toJSON
toJSON: () => { __type: string; selectors: Selector[]; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Function
class Function extends Node {}
constructor
constructor(name: globalThis.String, params: Params, body: Block);
property block
block: Block;
property name
name: globalThis.String;
property params
params: Params;
method toJSON
toJSON: () => { __type: string; name: string; params: Params; block: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Group
class Group extends Node {}
constructor
constructor();
property block
block: Block;
property hasOnlyPlaceholders
hasOnlyPlaceholders: globalThis.Boolean;
property nodes
nodes: Node[];
method push
push: (node: Node) => void;
Push the given
selector
node.
method toJSON
toJSON: () => { __type: string; nodes: Node[]; block: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class HSLA
class HSLA extends Node {}
constructor
constructor( h: globalThis.Number, s: globalThis.Number, l: globalThis.Number, a: globalThis.Number);
property a
a: globalThis.Number;
property h
h: globalThis.Number;
property hsla
hsla: HSLA;
property l
l: globalThis.Number;
property rgba
rgba: RGBA;
property s
s: globalThis.Number;
method add
add: (h: number, s: number, l: number) => HSLA;
Add h,s,l to the current component values
method adjustHue
adjustHue: (deg: number) => HSLA;
djust hue by
deg
.
method adjustLightness
adjustLightness: (percent: number) => HSLA;
Adjust lightness by
percent
.
method fromRGBA
static fromRGBA: (rgba: RGBA) => HSLA;
Return a
HSLA
from the givenhsla
.
method substract
substract: (h: number, s: number, l: number) => HSLA;
Subtract h,s,l from the current component values
method toJSON
toJSON: () => { __type: string; h: number; s: number; l: number; a: number; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Ident
class Ident extends Node {}
constructor
constructor(name: globalThis.String, val: Node);
constructor
constructor(name: globalThis.String, val: Node, mixin: globalThis.Boolean);
property isEmpty
isEmpty: globalThis.Boolean;
property mixin
mixin: globalThis.Boolean;
property name
name: globalThis.String;
property string
string: globalThis.String;
property val
val: Node;
method toJSON
toJSON: () => { __type: string; name: string; val: Node; mixin: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class If
class If extends Node {}
constructor
constructor(cond: Expression, negate: globalThis.Boolean);
constructor
constructor(cond: Expression, block: Block);
property block
block: Block;
property cond
cond: Expression;
property elses
elses: Expression[];
property negate
negate: globalThis.Boolean;
method toJSON
toJSON: () => { __type: string; cond: Expression; elses: Expression[]; block: Block; negate: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Import
class Import extends Node {}
constructor
constructor(path: Expression);
constructor
constructor(path: Expression, once: globalThis.Boolean);
property once
once: globalThis.Boolean;
property path
path: Expression;
method toJSON
toJSON: () => { __type: string; path: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Keyframes
class Keyframes extends Node {}
constructor
constructor(segs: Node[]);
constructor
constructor(segs: Node[], prefix: globalThis.String);
property prefix
prefix: globalThis.String;
property segments
segments: Node[];
method toJSON
toJSON: () => { __type: string; segments: Node[]; prefix: string; block: Block; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Literal
class Literal extends Node {}
constructor
constructor(str: globalThis.String);
property prefixed
prefixed: globalThis.Boolean;
property string
string: globalThis.String;
property val
val: globalThis.String;
method toJSON
toJSON: () => { __type: string; string: string; val: string; prefixed: boolean; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Media
class Media extends Node {}
constructor
constructor(val: globalThis.String);
property val
val: globalThis.String;
method toJSON
toJSON: () => { __type: string; val: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Member
class Member extends Node {}
constructor
constructor(left: Node, right: Node);
property left
left: Node;
property right
right: Node;
method toJSON
toJSON: () => { __type: string; left: Node; right: Node; val?: string | undefined; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Namespace
class Namespace extends Node {}
constructor
constructor(val: globalThis.String, prefix: globalThis.String);
property prefix
prefix: globalThis.String;
property val
val: globalThis.String;
method toJSON
toJSON: () => { __type: string; val: string; prefix: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Node
class Node {}
constructor
constructor();
property column
column: globalThis.Number;
property filename
filename: globalThis.String;
property first
first: Node;
property hash
hash: globalThis.String;
property lineno
lineno: globalThis.Number;
property nodeName
nodeName: globalThis.String;
method clone
clone: () => Node;
Return a clone of this node.
method coerce
coerce: (other: Node) => Node;
Default coercion throws.
method eval
eval: () => Node;
Nodes by default evaluate to themselves.
method operate
operate: (op: string, right: Node) => Node;
Operate on
right
with the givenop
.
method shouldCoerce
shouldCoerce: (op: string) => boolean;
Return false if
op
is generally not coerced.
method toBoolean
toBoolean: () => Boolean;
Return true.
method toExpression
toExpression: () => Expression;
Return the expression, or wrap this node in an expression.
method toJSON
toJSON: () => { lineno: number; column: number; filename: string };
Return a JSON representation of this node.
class Null
class Null extends Node {}
constructor
constructor();
property isNull
isNull: globalThis.Boolean;
method toJSON
toJSON: () => { __type: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Number
class Number extends Node {}
class Object
class Object extends Node {}
constructor
constructor();
property length
length: globalThis.Number;
property vals
vals: Dictionary<Node>;
method get
get: (key: string) => Node;
Get
key
.
method has
has: (key: string) => boolean;
Has
key
?
method set
set: (key: string, value: Node) => this;
Set
key
toval
.
method toBlock
toBlock: () => string;
Convert object to string with properties.
method toJSON
toJSON: () => { __type: string; vals: Dictionary<Node>; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Params
class Params extends Node {}
class Property
class Property extends Node {}
constructor
constructor(segs: Node[], expr: Expression);
property expr
expr: Expression;
property segments
segments: Node[];
method toJSON
toJSON: () => { __type: string; segments: Node[]; name: string; expr?: Expression; literal?: Literal; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Query
class Query extends Node {}
constructor
constructor();
property nodes
nodes: QueryExpr[];
property predicate
predicate: globalThis.String;
property resolvedPredicate
resolvedPredicate: globalThis.String;
property resolvedType
resolvedType: globalThis.String;
property type
type: globalThis.String;
method merge
merge: (other: Query) => Query;
Merges this query with the
other
.
method push
push: (expr: QueryExpr) => void;
Push the given
expr
.
method toJSON
toJSON: () => { __type: string; nodes: QueryExpr[]; predicate: string; type: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class QueryExpr
class QueryExpr extends Node {}
constructor
constructor(segs: Node[]);
property expr
expr: Expression;
property segments
segments: Node[];
method toJSON
toJSON: () => { __type: string; segments: Node[]; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class QueryList
class QueryList extends Node {}
constructor
constructor();
property nodes
nodes: Node[];
method merge
merge: (other: QueryList) => QueryList;
Merges this query list with the
other
.
method push
push: (node: Node) => void;
Push the given
node
.
method toJSON
toJSON: () => { __type: string; nodes: Node[]; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Return
class Return extends Node {}
constructor
constructor(expr: Expression);
property expr
expr: Expression;
method toJSON
toJSON: () => { __type: string; expr: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class RGBA
class RGBA extends Node {}
constructor
constructor( r: globalThis.Number, g: globalThis.Number, b: globalThis.Number, a: globalThis.Number);
property a
a: globalThis.Number;
property b
b: globalThis.Number;
property g
g: globalThis.Number;
property hsla
hsla: HSLA;
property r
r: globalThis.Number;
property rgba
rgba: RGBA;
method add
add: (r: number, g: number, b: number, a: number) => RGBA;
Add r,g,b,a to the current component values
method divide
divide: (n: number) => RGBA;
Divide rgb components by
n
.
method fromHSLA
static fromHSLA: (hsla: HSLA) => RGBA;
Return a
RGBA
from the givenhsla
.
method multiply
multiply: (n: number) => RGBA;
Multiply rgb components by
n
.
method substract
substract: (r: number, g: number, b: number, a: number) => RGBA;
Subtract r,g,b,a from the current component values
method toJSON
toJSON: () => { __type: string; r: number; g: number; b: number; a: number; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
method withoutClamping
static withoutClamping: (r: number, g: number, b: number, a: number) => RGBA;
Return an
RGBA
without clamping values.
class Root
class Root extends Node {}
property nodes
nodes: Node[];
method push
push: (node: Node) => void;
Push a
node
to this block.
method toJSON
toJSON: () => { nodes: Node[]; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
method unshift
unshift: (node: Node) => void;
Unshift a
node
to this block.
class Selector
class Selector extends Node {}
constructor
constructor(segs: Node[]);
property inherits
inherits: globalThis.Boolean;
property segments
segments: Node[];
method toJSON
toJSON: () => { __type: string; segments: Node[]; inherits: boolean; val: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class String
class String extends Node {}
constructor
constructor(val: globalThis.String);
constructor
constructor(val: globalThis.String, quote: globalThis.String);
property prefixed
prefixed: globalThis.Boolean;
property quote
quote: globalThis.String;
property string
string: globalThis.String;
property val
val: globalThis.String;
method toJSON
toJSON: () => { val: string; quote: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Ternary
class Ternary extends Node {}
constructor
constructor(op: globalThis.String, trueExpr: Expression, falseExpr: Expression);
property falseExpr
falseExpr: Expression;
property op
op: globalThis.String;
property trueExpr
trueExpr: Expression;
method toJSON
toJSON: () => { __type: string; op: string; trueExpr: Expression; falseExpr: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class UnaryOp
class UnaryOp extends Node {}
constructor
constructor(op: globalThis.String, expr: Expression);
property expr
expr: Expression;
property op
op: globalThis.String;
method toJSON
toJSON: () => { __type: string; op: string; expr: Expression; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
class Unit
class Unit extends Node {}
constructor
constructor(val: globalThis.Number, type: globalThis.String);
property type
type: globalThis.String;
property val
val: globalThis.Number;
method toJSON
toJSON: () => { __type: string; val: number; type: string; lineno: number; column: number; filename: string;};
Return a JSON representation of this node.
Package Files (1)
Dependencies (1)
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/stylus
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/stylus)
- HTML<a href="https://www.jsdocs.io/package/@types/stylus"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 8623 ms. - Missing or incorrect documentation? Open an issue for this package.