-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
index.d.ts
108 lines (96 loc) · 2.43 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
declare module 'postcss-simple-vars' {
/**
* imports postcss
*/
import * as postcss from 'postcss'
/**
* Simple vars namespace
*/
namespace simpleVars {
/**
* variables Argument
* @interface IArgument
*/
type IArgument = {
[index: string]: any
}
/**
* Callable argument
* @type {function}
* @interface ICallableArgument
*/
type ICallableArgument = () => IArgument
/**
* Vars argument
* @export
* @interface ISimpleVarsArgument
*/
export interface ISimpleVarsArgument extends ISimpleVarsBase {
variables?: IArgument
}
/**
* Base options interface
* @interface ISimpleVarsBase
*/
interface ISimpleVarsBase {
/**
* Set value only for variables from this object. Other variables will not be changed.
* It is useful for PostCSS plugin developers.
* @type {*}
* @memberOf ISimpleVarsBase
*/
only?: any
/**
* Callback invoked once all variables in css are known.
* The callback receives an object representing the known variables,
* including those explicitly-declared by the variables option.
*/
onVariables?: (vars: string) => void
/**
* Left unknown variables in CSS and do not throw an error.
* @default {false}
* @type {boolean}
*/
silent?: boolean
/**
* Keep variables as is and not delete them.
* @default {false}
* @type {boolean}
*/
keep?: boolean
/**
* Callback on unknown variable name. It receives node instance, variable name and PostCSS Result object.
* @memberOf ISimpleVarsBase
*/
unknown?: (
node: postcss.Node,
name: string,
result: postcss.Result
) => void
}
/**
* Callable variables argument
* @export
* @interface ISimpleVarsCallableArgument
*/
export interface ISimpleVarsCallableArgument extends ISimpleVarsBase {
variables: ICallableArgument
}
}
/**
* Exported function
* @param {simpleVars.ISimpleVarsArgument} arg
* @returns {*}
*/
function simpleVars(arg?: simpleVars.ISimpleVarsArgument): any
/**
* Exported function
* @param {simpleVars.ISimpleVarsArgument} arg
* @returns {*}
*/
function simpleVars(arg: simpleVars.ISimpleVarsCallableArgument): any
/**
* Default export
*/
export = simpleVars
}