postcss 8.4.24 → 8.4.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of postcss might be problematic. Click here for more details.
- package/README.md +3 -8
- package/lib/at-rule.d.ts +21 -21
- package/lib/comment.d.ts +14 -12
- package/lib/container.d.ts +212 -212
- package/lib/container.js +239 -239
- package/lib/css-syntax-error.d.ts +95 -95
- package/lib/css-syntax-error.js +1 -1
- package/lib/declaration.d.ts +50 -35
- package/lib/document.d.ts +6 -1
- package/lib/input.d.ts +70 -70
- package/lib/input.js +64 -64
- package/lib/lazy-result.d.ts +54 -54
- package/lib/lazy-result.js +226 -226
- package/lib/list.d.ts +14 -14
- package/lib/list.js +9 -9
- package/lib/map-generator.js +188 -188
- package/lib/no-work-result.d.ts +12 -12
- package/lib/no-work-result.js +30 -30
- package/lib/node.d.ts +276 -229
- package/lib/node.js +201 -199
- package/lib/parser.js +286 -286
- package/lib/postcss.d.ts +124 -124
- package/lib/previous-map.d.ts +13 -13
- package/lib/previous-map.js +33 -33
- package/lib/processor.d.ts +37 -37
- package/lib/processor.js +19 -19
- package/lib/result.d.ts +44 -44
- package/lib/result.js +4 -4
- package/lib/root.d.ts +13 -9
- package/lib/root.js +10 -10
- package/lib/rule.d.ts +18 -18
- package/lib/stringifier.d.ts +21 -21
- package/lib/stringifier.js +139 -139
- package/lib/terminal-highlight.js +11 -11
- package/lib/tokenize.js +1 -1
- package/lib/warning.d.ts +38 -38
- package/lib/warning.js +1 -1
- package/package.json +1 -1
@@ -6,14 +6,14 @@ declare namespace CssSyntaxError {
|
|
6
6
|
*/
|
7
7
|
export interface RangePosition {
|
8
8
|
/**
|
9
|
-
* The
|
9
|
+
* The column number in the input.
|
10
10
|
*/
|
11
|
-
|
11
|
+
column: number
|
12
12
|
|
13
13
|
/**
|
14
|
-
* The
|
14
|
+
* The line number in the input.
|
15
15
|
*/
|
16
|
-
|
16
|
+
line: number
|
17
17
|
}
|
18
18
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
@@ -51,60 +51,45 @@ declare namespace CssSyntaxError {
|
|
51
51
|
*/
|
52
52
|
declare class CssSyntaxError_ {
|
53
53
|
/**
|
54
|
-
*
|
55
|
-
* or for a range.
|
56
|
-
* @param message Error message.
|
57
|
-
* @param lineOrStartPos If for a single position, the line number, or if for
|
58
|
-
* a range, the inclusive start position of the error.
|
59
|
-
* @param columnOrEndPos If for a single position, the column number, or if for
|
60
|
-
* a range, the exclusive end position of the error.
|
61
|
-
* @param source Source code of the broken file.
|
62
|
-
* @param file Absolute path to the broken file.
|
63
|
-
* @param plugin PostCSS plugin name, if error came from plugin.
|
64
|
-
*/
|
65
|
-
constructor(
|
66
|
-
message: string,
|
67
|
-
lineOrStartPos?: number | CssSyntaxError.RangePosition,
|
68
|
-
columnOrEndPos?: number | CssSyntaxError.RangePosition,
|
69
|
-
source?: string,
|
70
|
-
file?: string,
|
71
|
-
plugin?: string
|
72
|
-
)
|
73
|
-
|
74
|
-
stack: string
|
75
|
-
|
76
|
-
/**
|
77
|
-
* Always equal to `'CssSyntaxError'`. You should always check error type
|
78
|
-
* by `error.name === 'CssSyntaxError'`
|
79
|
-
* instead of `error instanceof CssSyntaxError`,
|
80
|
-
* because npm could have several PostCSS versions.
|
54
|
+
* Source column of the error.
|
81
55
|
*
|
82
56
|
* ```js
|
83
|
-
*
|
84
|
-
*
|
85
|
-
* }
|
57
|
+
* error.column //=> 1
|
58
|
+
* error.input.column //=> 4
|
86
59
|
* ```
|
60
|
+
*
|
61
|
+
* PostCSS will use the input source map to detect the original location.
|
62
|
+
* If you need the position in the PostCSS input, use `error.input.column`.
|
87
63
|
*/
|
88
|
-
|
64
|
+
column?: number
|
89
65
|
|
90
66
|
/**
|
91
|
-
*
|
67
|
+
* Source column of the error's end, exclusive. Provided if the error pertains
|
68
|
+
* to a range.
|
92
69
|
*
|
93
70
|
* ```js
|
94
|
-
* error.
|
71
|
+
* error.endColumn //=> 1
|
72
|
+
* error.input.endColumn //=> 4
|
95
73
|
* ```
|
74
|
+
*
|
75
|
+
* PostCSS will use the input source map to detect the original location.
|
76
|
+
* If you need the position in the PostCSS input, use `error.input.endColumn`.
|
96
77
|
*/
|
97
|
-
|
78
|
+
endColumn?: number
|
98
79
|
|
99
80
|
/**
|
100
|
-
*
|
101
|
-
*
|
81
|
+
* Source line of the error's end, exclusive. Provided if the error pertains
|
82
|
+
* to a range.
|
102
83
|
*
|
103
84
|
* ```js
|
104
|
-
* error.
|
85
|
+
* error.endLine //=> 3
|
86
|
+
* error.input.endLine //=> 4
|
105
87
|
* ```
|
88
|
+
*
|
89
|
+
* PostCSS will use the input source map to detect the original location.
|
90
|
+
* If you need the position in the PostCSS input, use `error.input.endLine`.
|
106
91
|
*/
|
107
|
-
|
92
|
+
endLine?: number
|
108
93
|
|
109
94
|
/**
|
110
95
|
* Absolute path to the broken file.
|
@@ -120,68 +105,55 @@ declare class CssSyntaxError_ {
|
|
120
105
|
file?: string
|
121
106
|
|
122
107
|
/**
|
123
|
-
*
|
124
|
-
*
|
125
|
-
*
|
126
|
-
*
|
127
|
-
*
|
128
|
-
* ```
|
129
|
-
*
|
130
|
-
* PostCSS will use the input source map to detect the original location.
|
131
|
-
* If you need the position in the PostCSS input, use `error.input.line`.
|
132
|
-
*/
|
133
|
-
line?: number
|
134
|
-
|
135
|
-
/**
|
136
|
-
* Source column of the error.
|
108
|
+
* Input object with PostCSS internal information
|
109
|
+
* about input file. If input has source map
|
110
|
+
* from previous tool, PostCSS will use origin
|
111
|
+
* (for example, Sass) source. You can use this
|
112
|
+
* object to get PostCSS input source.
|
137
113
|
*
|
138
114
|
* ```js
|
139
|
-
* error.
|
140
|
-
* error.
|
115
|
+
* error.input.file //=> 'a.css'
|
116
|
+
* error.file //=> 'a.sass'
|
141
117
|
* ```
|
142
|
-
*
|
143
|
-
* PostCSS will use the input source map to detect the original location.
|
144
|
-
* If you need the position in the PostCSS input, use `error.input.column`.
|
145
118
|
*/
|
146
|
-
|
119
|
+
input?: FilePosition
|
147
120
|
|
148
121
|
/**
|
149
|
-
* Source line of the error
|
150
|
-
* to a range.
|
122
|
+
* Source line of the error.
|
151
123
|
*
|
152
124
|
* ```js
|
153
|
-
* error.
|
154
|
-
* error.input.
|
125
|
+
* error.line //=> 2
|
126
|
+
* error.input.line //=> 4
|
155
127
|
* ```
|
156
128
|
*
|
157
129
|
* PostCSS will use the input source map to detect the original location.
|
158
|
-
* If you need the position in the PostCSS input, use `error.input.
|
130
|
+
* If you need the position in the PostCSS input, use `error.input.line`.
|
159
131
|
*/
|
160
|
-
|
132
|
+
line?: number
|
161
133
|
|
162
134
|
/**
|
163
|
-
*
|
164
|
-
*
|
135
|
+
* Full error text in the GNU error format
|
136
|
+
* with plugin, file, line and column.
|
165
137
|
*
|
166
138
|
* ```js
|
167
|
-
* error.
|
168
|
-
* error.input.endColumn //=> 4
|
139
|
+
* error.message //=> 'a.css:1:1: Unclosed block'
|
169
140
|
* ```
|
170
|
-
*
|
171
|
-
* PostCSS will use the input source map to detect the original location.
|
172
|
-
* If you need the position in the PostCSS input, use `error.input.endColumn`.
|
173
141
|
*/
|
174
|
-
|
142
|
+
message: string
|
175
143
|
|
176
144
|
/**
|
177
|
-
*
|
145
|
+
* Always equal to `'CssSyntaxError'`. You should always check error type
|
146
|
+
* by `error.name === 'CssSyntaxError'`
|
147
|
+
* instead of `error instanceof CssSyntaxError`,
|
148
|
+
* because npm could have several PostCSS versions.
|
178
149
|
*
|
179
150
|
* ```js
|
180
|
-
* error.
|
181
|
-
*
|
151
|
+
* if (error.name === 'CssSyntaxError') {
|
152
|
+
* error //=> CssSyntaxError
|
153
|
+
* }
|
182
154
|
* ```
|
183
155
|
*/
|
184
|
-
|
156
|
+
name: 'CssSyntaxError'
|
185
157
|
|
186
158
|
/**
|
187
159
|
* Plugin name, if error came from plugin.
|
@@ -193,31 +165,46 @@ declare class CssSyntaxError_ {
|
|
193
165
|
plugin?: string
|
194
166
|
|
195
167
|
/**
|
196
|
-
*
|
197
|
-
* about input file. If input has source map
|
198
|
-
* from previous tool, PostCSS will use origin
|
199
|
-
* (for example, Sass) source. You can use this
|
200
|
-
* object to get PostCSS input source.
|
168
|
+
* Error message.
|
201
169
|
*
|
202
170
|
* ```js
|
203
|
-
* error.
|
204
|
-
* error.file //=> 'a.sass'
|
171
|
+
* error.message //=> 'Unclosed block'
|
205
172
|
* ```
|
206
173
|
*/
|
207
|
-
|
174
|
+
reason: string
|
208
175
|
|
209
176
|
/**
|
210
|
-
*
|
177
|
+
* Source code of the broken file.
|
211
178
|
*
|
212
179
|
* ```js
|
213
|
-
* error.
|
214
|
-
*
|
215
|
-
* // | ^"
|
180
|
+
* error.source //=> 'a { b {} }'
|
181
|
+
* error.input.source //=> 'a b { }'
|
216
182
|
* ```
|
217
|
-
*
|
218
|
-
* @return Error position, message and source code.
|
219
183
|
*/
|
220
|
-
|
184
|
+
source?: string
|
185
|
+
|
186
|
+
stack: string
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Instantiates a CSS syntax error. Can be instantiated for a single position
|
190
|
+
* or for a range.
|
191
|
+
* @param message Error message.
|
192
|
+
* @param lineOrStartPos If for a single position, the line number, or if for
|
193
|
+
* a range, the inclusive start position of the error.
|
194
|
+
* @param columnOrEndPos If for a single position, the column number, or if for
|
195
|
+
* a range, the exclusive end position of the error.
|
196
|
+
* @param source Source code of the broken file.
|
197
|
+
* @param file Absolute path to the broken file.
|
198
|
+
* @param plugin PostCSS plugin name, if error came from plugin.
|
199
|
+
*/
|
200
|
+
constructor(
|
201
|
+
message: string,
|
202
|
+
lineOrStartPos?: CssSyntaxError.RangePosition | number,
|
203
|
+
columnOrEndPos?: CssSyntaxError.RangePosition | number,
|
204
|
+
source?: string,
|
205
|
+
file?: string,
|
206
|
+
plugin?: string
|
207
|
+
)
|
221
208
|
|
222
209
|
/**
|
223
210
|
* Returns a few lines of CSS source that caused the error.
|
@@ -241,6 +228,19 @@ declare class CssSyntaxError_ {
|
|
241
228
|
* @return Few lines of CSS source that caused the error.
|
242
229
|
*/
|
243
230
|
showSourceCode(color?: boolean): string
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Returns error position, message and source code of the broken part.
|
234
|
+
*
|
235
|
+
* ```js
|
236
|
+
* error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
|
237
|
+
* // > 1 | a {
|
238
|
+
* // | ^"
|
239
|
+
* ```
|
240
|
+
*
|
241
|
+
* @return Error position, message and source code.
|
242
|
+
*/
|
243
|
+
toString(): string
|
244
244
|
}
|
245
245
|
|
246
246
|
declare class CssSyntaxError extends CssSyntaxError_ {}
|
package/lib/css-syntax-error.js
CHANGED
package/lib/declaration.d.ts
CHANGED
@@ -23,20 +23,20 @@ declare namespace Declaration {
|
|
23
23
|
* Declaration value with comments.
|
24
24
|
*/
|
25
25
|
value?: {
|
26
|
-
value: string
|
27
26
|
raw: string
|
27
|
+
value: string
|
28
28
|
}
|
29
29
|
}
|
30
30
|
|
31
31
|
export interface DeclarationProps {
|
32
|
-
/** Name of the declaration. */
|
33
|
-
prop: string
|
34
|
-
/** Value of the declaration. */
|
35
|
-
value: string
|
36
32
|
/** Whether the declaration has an `!important` annotation. */
|
37
33
|
important?: boolean
|
34
|
+
/** Name of the declaration. */
|
35
|
+
prop: string
|
38
36
|
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
39
37
|
raws?: DeclarationRaws
|
38
|
+
/** Value of the declaration. */
|
39
|
+
value: string
|
40
40
|
}
|
41
41
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
@@ -44,88 +44,103 @@ declare namespace Declaration {
|
|
44
44
|
}
|
45
45
|
|
46
46
|
/**
|
47
|
-
*
|
47
|
+
* It represents a class that handles
|
48
|
+
* [CSS declarations](https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax#css_declarations)
|
48
49
|
*
|
49
50
|
* ```js
|
50
51
|
* Once (root, { Declaration }) {
|
51
|
-
*
|
52
|
+
* const color = new Declaration({ prop: 'color', value: 'black' })
|
52
53
|
* root.append(color)
|
53
54
|
* }
|
54
55
|
* ```
|
55
56
|
*
|
56
57
|
* ```js
|
57
58
|
* const root = postcss.parse('a { color: black }')
|
58
|
-
* const decl = root.first
|
59
|
+
* const decl = root.first?.first
|
60
|
+
*
|
59
61
|
* decl.type //=> 'decl'
|
60
62
|
* decl.toString() //=> ' color: black'
|
61
63
|
* ```
|
62
64
|
*/
|
63
65
|
declare class Declaration_ extends Node {
|
64
|
-
|
66
|
+
/**
|
67
|
+
* It represents a specificity of the declaration.
|
68
|
+
*
|
69
|
+
* If true, the CSS declaration will have an
|
70
|
+
* [important](https://developer.mozilla.org/en-US/docs/Web/CSS/important)
|
71
|
+
* specifier.
|
72
|
+
*
|
73
|
+
* ```js
|
74
|
+
* const root = postcss.parse('a { color: black !important; color: red }')
|
75
|
+
*
|
76
|
+
* root.first.first.important //=> true
|
77
|
+
* root.first.last.important //=> undefined
|
78
|
+
* ```
|
79
|
+
*/
|
80
|
+
important: boolean
|
81
|
+
|
65
82
|
parent: Container | undefined
|
66
|
-
raws: Declaration.DeclarationRaws
|
67
83
|
|
68
84
|
/**
|
69
|
-
* The
|
85
|
+
* The property name for a CSS declaration.
|
70
86
|
*
|
71
87
|
* ```js
|
72
88
|
* const root = postcss.parse('a { color: black }')
|
73
89
|
* const decl = root.first.first
|
90
|
+
*
|
74
91
|
* decl.prop //=> 'color'
|
75
92
|
* ```
|
76
93
|
*/
|
77
94
|
prop: string
|
78
95
|
|
96
|
+
raws: Declaration.DeclarationRaws
|
97
|
+
|
98
|
+
type: 'decl'
|
99
|
+
|
79
100
|
/**
|
80
|
-
* The
|
101
|
+
* The property value for a CSS declaration.
|
102
|
+
*
|
103
|
+
* Any CSS comments inside the value string will be filtered out.
|
104
|
+
* CSS comments present in the source value will be available in
|
105
|
+
* the `raws` property.
|
81
106
|
*
|
82
|
-
*
|
83
|
-
*
|
84
|
-
* If you have not changed the value, the result of `decl.toString()`
|
85
|
-
* will include the original raws value (comments and all).
|
107
|
+
* Assigning new `value` would ignore the comments in `raws`
|
108
|
+
* property while compiling node to string.
|
86
109
|
*
|
87
110
|
* ```js
|
88
111
|
* const root = postcss.parse('a { color: black }')
|
89
112
|
* const decl = root.first.first
|
113
|
+
*
|
90
114
|
* decl.value //=> 'black'
|
91
115
|
* ```
|
92
116
|
*/
|
93
117
|
value: string
|
94
118
|
|
95
119
|
/**
|
96
|
-
* `true` if
|
97
|
-
*
|
98
|
-
* ```js
|
99
|
-
* const root = postcss.parse('a { color: black !important; color: red }')
|
100
|
-
* root.first.first.important //=> true
|
101
|
-
* root.first.last.important //=> undefined
|
102
|
-
* ```
|
103
|
-
*/
|
104
|
-
important: boolean
|
105
|
-
|
106
|
-
/**
|
107
|
-
* `true` if declaration is declaration of CSS Custom Property
|
108
|
-
* or Sass variable.
|
120
|
+
* It represents a getter that returns `true` if a declaration starts with
|
121
|
+
* `--` or `$`, which are used to declare variables in CSS and SASS/SCSS.
|
109
122
|
*
|
110
123
|
* ```js
|
111
124
|
* const root = postcss.parse(':root { --one: 1 }')
|
112
|
-
*
|
125
|
+
* const one = root.first.first
|
126
|
+
*
|
113
127
|
* one.variable //=> true
|
114
128
|
* ```
|
115
129
|
*
|
116
130
|
* ```js
|
117
131
|
* const root = postcss.parse('$one: 1')
|
118
|
-
*
|
132
|
+
* const one = root.first
|
133
|
+
*
|
119
134
|
* one.variable //=> true
|
120
135
|
* ```
|
121
136
|
*/
|
122
137
|
variable: boolean
|
123
138
|
|
124
139
|
constructor(defaults?: Declaration.DeclarationProps)
|
125
|
-
assign(overrides:
|
126
|
-
clone(overrides?: Partial<Declaration.DeclarationProps>):
|
127
|
-
|
128
|
-
|
140
|
+
assign(overrides: Declaration.DeclarationProps | object): this
|
141
|
+
clone(overrides?: Partial<Declaration.DeclarationProps>): Declaration
|
142
|
+
cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): Declaration
|
143
|
+
cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): Declaration
|
129
144
|
}
|
130
145
|
|
131
146
|
declare class Declaration extends Declaration_ {}
|
package/lib/document.d.ts
CHANGED
@@ -35,11 +35,16 @@ declare namespace Document {
|
|
35
35
|
* ```
|
36
36
|
*/
|
37
37
|
declare class Document_ extends Container<Root> {
|
38
|
-
type: 'document'
|
39
38
|
parent: undefined
|
39
|
+
type: 'document'
|
40
40
|
|
41
41
|
constructor(defaults?: Document.DocumentProps)
|
42
42
|
|
43
|
+
assign(overrides: Document.DocumentProps | object): this
|
44
|
+
clone(overrides?: Partial<Document.DocumentProps>): Document
|
45
|
+
cloneAfter(overrides?: Partial<Document.DocumentProps>): Document
|
46
|
+
cloneBefore(overrides?: Partial<Document.DocumentProps>): Document
|
47
|
+
|
43
48
|
/**
|
44
49
|
* Returns a `Result` instance representing the document’s CSS roots.
|
45
50
|
*
|
package/lib/input.d.ts
CHANGED
@@ -4,39 +4,39 @@ import PreviousMap from './previous-map.js'
|
|
4
4
|
declare namespace Input {
|
5
5
|
export interface FilePosition {
|
6
6
|
/**
|
7
|
-
*
|
7
|
+
* Column of inclusive start position in source file.
|
8
8
|
*/
|
9
|
-
|
9
|
+
column: number
|
10
10
|
|
11
11
|
/**
|
12
|
-
*
|
12
|
+
* Column of exclusive end position in source file.
|
13
13
|
*/
|
14
|
-
|
14
|
+
endColumn?: number
|
15
15
|
|
16
16
|
/**
|
17
|
-
* Line of
|
17
|
+
* Line of exclusive end position in source file.
|
18
18
|
*/
|
19
|
-
|
19
|
+
endLine?: number
|
20
20
|
|
21
21
|
/**
|
22
|
-
*
|
22
|
+
* Absolute path to the source file.
|
23
23
|
*/
|
24
|
-
|
24
|
+
file?: string
|
25
25
|
|
26
26
|
/**
|
27
|
-
* Line of
|
27
|
+
* Line of inclusive start position in source file.
|
28
28
|
*/
|
29
|
-
|
29
|
+
line: number
|
30
30
|
|
31
31
|
/**
|
32
|
-
*
|
32
|
+
* Source code.
|
33
33
|
*/
|
34
|
-
|
34
|
+
source?: string
|
35
35
|
|
36
36
|
/**
|
37
|
-
*
|
37
|
+
* URL for the source file.
|
38
38
|
*/
|
39
|
-
|
39
|
+
url: string
|
40
40
|
}
|
41
41
|
|
42
42
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
@@ -62,16 +62,6 @@ declare class Input_ {
|
|
62
62
|
*/
|
63
63
|
css: string
|
64
64
|
|
65
|
-
/**
|
66
|
-
* The input source map passed from a compilation step before PostCSS
|
67
|
-
* (for example, from Sass compiler).
|
68
|
-
*
|
69
|
-
* ```js
|
70
|
-
* root.source.input.map.consumer().sources //=> ['a.sass']
|
71
|
-
* ```
|
72
|
-
*/
|
73
|
-
map: PreviousMap
|
74
|
-
|
75
65
|
/**
|
76
66
|
* The absolute path to the CSS source file defined
|
77
67
|
* with the `from` option.
|
@@ -83,6 +73,11 @@ declare class Input_ {
|
|
83
73
|
*/
|
84
74
|
file?: string
|
85
75
|
|
76
|
+
/**
|
77
|
+
* The flag to indicate whether or not the source code has Unicode BOM.
|
78
|
+
*/
|
79
|
+
hasBOM: boolean
|
80
|
+
|
86
81
|
/**
|
87
82
|
* The unique ID of the CSS source. It will be created if `from` option
|
88
83
|
* is not provided (because PostCSS does not know the file path).
|
@@ -96,9 +91,14 @@ declare class Input_ {
|
|
96
91
|
id?: string
|
97
92
|
|
98
93
|
/**
|
99
|
-
* The
|
94
|
+
* The input source map passed from a compilation step before PostCSS
|
95
|
+
* (for example, from Sass compiler).
|
96
|
+
*
|
97
|
+
* ```js
|
98
|
+
* root.source.input.map.consumer().sources //=> ['a.sass']
|
99
|
+
* ```
|
100
100
|
*/
|
101
|
-
|
101
|
+
map: PreviousMap
|
102
102
|
|
103
103
|
/**
|
104
104
|
* @param css Input CSS source.
|
@@ -106,6 +106,43 @@ declare class Input_ {
|
|
106
106
|
*/
|
107
107
|
constructor(css: string, opts?: ProcessOptions)
|
108
108
|
|
109
|
+
error(
|
110
|
+
message: string,
|
111
|
+
start:
|
112
|
+
| {
|
113
|
+
column: number
|
114
|
+
line: number
|
115
|
+
}
|
116
|
+
| {
|
117
|
+
offset: number
|
118
|
+
},
|
119
|
+
end:
|
120
|
+
| {
|
121
|
+
column: number
|
122
|
+
line: number
|
123
|
+
}
|
124
|
+
| {
|
125
|
+
offset: number
|
126
|
+
},
|
127
|
+
opts?: { plugin?: CssSyntaxError['plugin'] }
|
128
|
+
): CssSyntaxError
|
129
|
+
|
130
|
+
/**
|
131
|
+
* Returns `CssSyntaxError` with information about the error and its position.
|
132
|
+
*/
|
133
|
+
error(
|
134
|
+
message: string,
|
135
|
+
line: number,
|
136
|
+
column: number,
|
137
|
+
opts?: { plugin?: CssSyntaxError['plugin'] }
|
138
|
+
): CssSyntaxError
|
139
|
+
|
140
|
+
error(
|
141
|
+
message: string,
|
142
|
+
offset: number,
|
143
|
+
opts?: { plugin?: CssSyntaxError['plugin'] }
|
144
|
+
): CssSyntaxError
|
145
|
+
|
109
146
|
/**
|
110
147
|
* The CSS source identifier. Contains `Input#file` if the user
|
111
148
|
* set the `from` option, or `Input#id` if they did not.
|
@@ -119,7 +156,12 @@ declare class Input_ {
|
|
119
156
|
* ```
|
120
157
|
*/
|
121
158
|
get from(): string
|
122
|
-
|
159
|
+
/**
|
160
|
+
* Converts source offset to line and column.
|
161
|
+
*
|
162
|
+
* @param offset Source offset.
|
163
|
+
*/
|
164
|
+
fromOffset(offset: number): { col: number; line: number } | null
|
123
165
|
/**
|
124
166
|
* Reads the input source map and returns a symbol position
|
125
167
|
* in the input source (e.g., in a Sass file that was compiled
|
@@ -144,49 +186,7 @@ declare class Input_ {
|
|
144
186
|
column: number,
|
145
187
|
endLine?: number,
|
146
188
|
endColumn?: number
|
147
|
-
): Input.FilePosition
|
148
|
-
|
149
|
-
/**
|
150
|
-
* Converts source offset to line and column.
|
151
|
-
*
|
152
|
-
* @param offset Source offset.
|
153
|
-
*/
|
154
|
-
fromOffset(offset: number): { line: number; col: number } | null
|
155
|
-
|
156
|
-
/**
|
157
|
-
* Returns `CssSyntaxError` with information about the error and its position.
|
158
|
-
*/
|
159
|
-
error(
|
160
|
-
message: string,
|
161
|
-
line: number,
|
162
|
-
column: number,
|
163
|
-
opts?: { plugin?: CssSyntaxError['plugin'] }
|
164
|
-
): CssSyntaxError
|
165
|
-
error(
|
166
|
-
message: string,
|
167
|
-
offset: number,
|
168
|
-
opts?: { plugin?: CssSyntaxError['plugin'] }
|
169
|
-
): CssSyntaxError
|
170
|
-
error(
|
171
|
-
message: string,
|
172
|
-
start:
|
173
|
-
| {
|
174
|
-
offset: number
|
175
|
-
}
|
176
|
-
| {
|
177
|
-
line: number
|
178
|
-
column: number
|
179
|
-
},
|
180
|
-
end:
|
181
|
-
| {
|
182
|
-
offset: number
|
183
|
-
}
|
184
|
-
| {
|
185
|
-
line: number
|
186
|
-
column: number
|
187
|
-
},
|
188
|
-
opts?: { plugin?: CssSyntaxError['plugin'] }
|
189
|
-
): CssSyntaxError
|
189
|
+
): false | Input.FilePosition
|
190
190
|
}
|
191
191
|
|
192
192
|
declare class Input extends Input_ {}
|