postcss 8.4.20 → 8.4.22
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/lib/at-rule.d.ts +52 -43
- package/lib/comment.d.ts +35 -26
- package/lib/container.d.ts +23 -14
- package/lib/css-syntax-error.d.ts +22 -13
- package/lib/declaration.d.ts +45 -36
- package/lib/document.d.ts +21 -15
- package/lib/fromJSON.d.ts +6 -2
- package/lib/input.d.ts +80 -36
- package/lib/input.js +1 -1
- package/lib/lazy-result.d.ts +10 -1
- package/lib/list.d.ts +53 -47
- package/lib/no-work-result.d.ts +10 -1
- package/lib/node.d.ts +101 -90
- package/lib/parse.d.ts +6 -2
- package/lib/postcss.d.mts +72 -0
- package/lib/postcss.d.ts +236 -261
- package/lib/previous-map.d.ts +10 -1
- package/lib/processor.d.ts +10 -1
- package/lib/processor.js +1 -1
- package/lib/result.d.ts +39 -29
- package/lib/root.d.ts +44 -35
- package/lib/rule.d.ts +52 -43
- package/lib/stringifier.d.ts +10 -1
- package/lib/stringify.d.ts +6 -2
- package/lib/warning.d.ts +47 -38
- package/package.json +7 -4
package/lib/at-rule.d.ts
CHANGED
@@ -1,48 +1,53 @@
|
|
1
1
|
import Container, { ContainerProps } from './container.js'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
declare namespace AtRule {
|
4
|
+
export interface AtRuleRaws extends Record<string, unknown> {
|
5
|
+
/**
|
6
|
+
* The space symbols before the node. It also stores `*`
|
7
|
+
* and `_` symbols before the declaration (IE hack).
|
8
|
+
*/
|
9
|
+
before?: string
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
/**
|
12
|
+
* The space symbols after the last child of the node to the end of the node.
|
13
|
+
*/
|
14
|
+
after?: string
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
/**
|
17
|
+
* The space between the at-rule name and its parameters.
|
18
|
+
*/
|
19
|
+
afterName?: string
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
/**
|
22
|
+
* The symbols between the last parameter and `{` for rules.
|
23
|
+
*/
|
24
|
+
between?: string
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
/**
|
27
|
+
* Contains `true` if the last child has an (optional) semicolon.
|
28
|
+
*/
|
29
|
+
semicolon?: boolean
|
29
30
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
/**
|
32
|
+
* The rule’s selector with comments.
|
33
|
+
*/
|
34
|
+
params?: {
|
35
|
+
value: string
|
36
|
+
raw: string
|
37
|
+
}
|
36
38
|
}
|
37
|
-
}
|
38
39
|
|
39
|
-
export interface AtRuleProps extends ContainerProps {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
export interface AtRuleProps extends ContainerProps {
|
41
|
+
/** Name of the at-rule. */
|
42
|
+
name: string
|
43
|
+
/** Parameters following the name of the at-rule. */
|
44
|
+
params?: string | number
|
45
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
46
|
+
raws?: AtRuleRaws
|
47
|
+
}
|
48
|
+
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
50
|
+
export { AtRule_ as default }
|
46
51
|
}
|
47
52
|
|
48
53
|
/**
|
@@ -70,10 +75,10 @@ export interface AtRuleProps extends ContainerProps {
|
|
70
75
|
* media.nodes //=> []
|
71
76
|
* ```
|
72
77
|
*/
|
73
|
-
|
78
|
+
declare class AtRule_ extends Container {
|
74
79
|
type: 'atrule'
|
75
80
|
parent: Container | undefined
|
76
|
-
raws: AtRuleRaws
|
81
|
+
raws: AtRule.AtRuleRaws
|
77
82
|
|
78
83
|
/**
|
79
84
|
* The at-rule’s name immediately follows the `@`.
|
@@ -98,9 +103,13 @@ export default class AtRule extends Container {
|
|
98
103
|
*/
|
99
104
|
params: string
|
100
105
|
|
101
|
-
constructor(defaults?: AtRuleProps)
|
102
|
-
assign(overrides: object | AtRuleProps): this
|
103
|
-
clone(overrides?: Partial<AtRuleProps>): this
|
104
|
-
cloneBefore(overrides?: Partial<AtRuleProps>): this
|
105
|
-
cloneAfter(overrides?: Partial<AtRuleProps>): this
|
106
|
+
constructor(defaults?: AtRule.AtRuleProps)
|
107
|
+
assign(overrides: object | AtRule.AtRuleProps): this
|
108
|
+
clone(overrides?: Partial<AtRule.AtRuleProps>): this
|
109
|
+
cloneBefore(overrides?: Partial<AtRule.AtRuleProps>): this
|
110
|
+
cloneAfter(overrides?: Partial<AtRule.AtRuleProps>): this
|
106
111
|
}
|
112
|
+
|
113
|
+
declare class AtRule extends AtRule_ {}
|
114
|
+
|
115
|
+
export = AtRule
|
package/lib/comment.d.ts
CHANGED
@@ -1,28 +1,33 @@
|
|
1
1
|
import Container from './container.js'
|
2
2
|
import Node, { NodeProps } from './node.js'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
4
|
+
declare namespace Comment {
|
5
|
+
export interface CommentRaws extends Record<string, unknown> {
|
6
|
+
/**
|
7
|
+
* The space symbols before the node.
|
8
|
+
*/
|
9
|
+
before?: string
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
/**
|
12
|
+
* The space symbols between `/*` and the comment’s text.
|
13
|
+
*/
|
14
|
+
left?: string
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
}
|
16
|
+
/**
|
17
|
+
* The space symbols between the comment’s text.
|
18
|
+
*/
|
19
|
+
right?: string
|
20
|
+
}
|
20
21
|
|
21
|
-
export interface CommentProps extends NodeProps {
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
export interface CommentProps extends NodeProps {
|
23
|
+
/** Content of the comment. */
|
24
|
+
text: string
|
25
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
26
|
+
raws?: CommentRaws
|
27
|
+
}
|
28
|
+
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
30
|
+
export { Comment_ as default }
|
26
31
|
}
|
27
32
|
|
28
33
|
/**
|
@@ -38,19 +43,23 @@ export interface CommentProps extends NodeProps {
|
|
38
43
|
* Comments inside selectors, at-rule parameters, or declaration values
|
39
44
|
* will be stored in the `raws` properties explained above.
|
40
45
|
*/
|
41
|
-
|
46
|
+
declare class Comment_ extends Node {
|
42
47
|
type: 'comment'
|
43
48
|
parent: Container | undefined
|
44
|
-
raws: CommentRaws
|
49
|
+
raws: Comment.CommentRaws
|
45
50
|
|
46
51
|
/**
|
47
52
|
* The comment's text.
|
48
53
|
*/
|
49
54
|
text: string
|
50
55
|
|
51
|
-
constructor(defaults?: CommentProps)
|
52
|
-
assign(overrides: object | CommentProps): this
|
53
|
-
clone(overrides?: Partial<CommentProps>): this
|
54
|
-
cloneBefore(overrides?: Partial<CommentProps>): this
|
55
|
-
cloneAfter(overrides?: Partial<CommentProps>): this
|
56
|
+
constructor(defaults?: Comment.CommentProps)
|
57
|
+
assign(overrides: object | Comment.CommentProps): this
|
58
|
+
clone(overrides?: Partial<Comment.CommentProps>): this
|
59
|
+
cloneBefore(overrides?: Partial<Comment.CommentProps>): this
|
60
|
+
cloneAfter(overrides?: Partial<Comment.CommentProps>): this
|
56
61
|
}
|
62
|
+
|
63
|
+
declare class Comment extends Comment_ {}
|
64
|
+
|
65
|
+
export = Comment
|
package/lib/container.d.ts
CHANGED
@@ -4,20 +4,25 @@ import Comment from './comment.js'
|
|
4
4
|
import AtRule from './at-rule.js'
|
5
5
|
import Rule from './rule.js'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
declare namespace Container {
|
8
|
+
export interface ValueOptions {
|
9
|
+
/**
|
10
|
+
* An array of property names.
|
11
|
+
*/
|
12
|
+
props?: string[]
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
}
|
14
|
+
/**
|
15
|
+
* String that’s used to narrow down values and speed up the regexp search.
|
16
|
+
*/
|
17
|
+
fast?: string
|
18
|
+
}
|
19
|
+
|
20
|
+
export interface ContainerProps extends NodeProps {
|
21
|
+
nodes?: (ChildNode | ChildProps)[]
|
22
|
+
}
|
18
23
|
|
19
|
-
|
20
|
-
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
25
|
+
export { Container_ as default }
|
21
26
|
}
|
22
27
|
|
23
28
|
/**
|
@@ -27,7 +32,7 @@ export interface ContainerProps extends NodeProps {
|
|
27
32
|
* Note that all containers can store any content. If you write a rule inside
|
28
33
|
* a rule, PostCSS will parse it.
|
29
34
|
*/
|
30
|
-
|
35
|
+
declare abstract class Container_<
|
31
36
|
Child extends Node = ChildNode
|
32
37
|
> extends Node {
|
33
38
|
/**
|
@@ -390,7 +395,7 @@ export default abstract class Container<
|
|
390
395
|
*/
|
391
396
|
replaceValues(
|
392
397
|
pattern: string | RegExp,
|
393
|
-
options: ValueOptions,
|
398
|
+
options: Container.ValueOptions,
|
394
399
|
replaced: string | { (substring: string, ...args: any[]): string }
|
395
400
|
): this
|
396
401
|
replaceValues(
|
@@ -440,3 +445,7 @@ export default abstract class Container<
|
|
440
445
|
*/
|
441
446
|
index(child: Child | number): number
|
442
447
|
}
|
448
|
+
|
449
|
+
declare class Container<Child extends Node = ChildNode> extends Container_<Child> {}
|
450
|
+
|
451
|
+
export = Container
|
@@ -1,18 +1,23 @@
|
|
1
1
|
import { FilePosition } from './input.js'
|
2
2
|
|
3
|
-
|
4
|
-
* A position that is part of a range.
|
5
|
-
*/
|
6
|
-
export interface RangePosition {
|
3
|
+
declare namespace CssSyntaxError {
|
7
4
|
/**
|
8
|
-
*
|
5
|
+
* A position that is part of a range.
|
9
6
|
*/
|
10
|
-
|
7
|
+
export interface RangePosition {
|
8
|
+
/**
|
9
|
+
* The line number in the input.
|
10
|
+
*/
|
11
|
+
line: number
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
/**
|
14
|
+
* The column number in the input.
|
15
|
+
*/
|
16
|
+
column: number
|
17
|
+
}
|
18
|
+
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
20
|
+
export { CssSyntaxError_ as default }
|
16
21
|
}
|
17
22
|
|
18
23
|
/**
|
@@ -44,7 +49,7 @@ export interface RangePosition {
|
|
44
49
|
* }
|
45
50
|
* ```
|
46
51
|
*/
|
47
|
-
|
52
|
+
declare class CssSyntaxError_ {
|
48
53
|
/**
|
49
54
|
* Instantiates a CSS syntax error. Can be instantiated for a single position
|
50
55
|
* or for a range.
|
@@ -59,8 +64,8 @@ export default class CssSyntaxError {
|
|
59
64
|
*/
|
60
65
|
constructor(
|
61
66
|
message: string,
|
62
|
-
lineOrStartPos?: number | RangePosition,
|
63
|
-
columnOrEndPos?: number | RangePosition,
|
67
|
+
lineOrStartPos?: number | CssSyntaxError.RangePosition,
|
68
|
+
columnOrEndPos?: number | CssSyntaxError.RangePosition,
|
64
69
|
source?: string,
|
65
70
|
file?: string,
|
66
71
|
plugin?: string
|
@@ -237,3 +242,7 @@ export default class CssSyntaxError {
|
|
237
242
|
*/
|
238
243
|
showSourceCode(color?: boolean): string
|
239
244
|
}
|
245
|
+
|
246
|
+
declare class CssSyntaxError extends CssSyntaxError_ {}
|
247
|
+
|
248
|
+
export = CssSyntaxError
|
package/lib/declaration.d.ts
CHANGED
@@ -1,41 +1,46 @@
|
|
1
1
|
import Container from './container.js'
|
2
2
|
import Node from './node.js'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
4
|
+
declare namespace Declaration {
|
5
|
+
export interface DeclarationRaws extends Record<string, unknown> {
|
6
|
+
/**
|
7
|
+
* The space symbols before the node. It also stores `*`
|
8
|
+
* and `_` symbols before the declaration (IE hack).
|
9
|
+
*/
|
10
|
+
before?: string
|
10
11
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
/**
|
13
|
+
* The symbols between the property and value for declarations.
|
14
|
+
*/
|
15
|
+
between?: string
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
/**
|
18
|
+
* The content of the important statement, if it is not just `!important`.
|
19
|
+
*/
|
20
|
+
important?: string
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
/**
|
23
|
+
* Declaration value with comments.
|
24
|
+
*/
|
25
|
+
value?: {
|
26
|
+
value: string
|
27
|
+
raw: string
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
export interface DeclarationProps {
|
32
|
+
/** Name of the declaration. */
|
33
|
+
prop: string
|
34
|
+
/** Value of the declaration. */
|
25
35
|
value: string
|
26
|
-
|
36
|
+
/** Whether the declaration has an `!important` annotation. */
|
37
|
+
important?: boolean
|
38
|
+
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
39
|
+
raws?: DeclarationRaws
|
27
40
|
}
|
28
|
-
}
|
29
41
|
|
30
|
-
|
31
|
-
|
32
|
-
prop: string
|
33
|
-
/** Value of the declaration. */
|
34
|
-
value: string
|
35
|
-
/** Whether the declaration has an `!important` annotation. */
|
36
|
-
important?: boolean
|
37
|
-
/** Information used to generate byte-to-byte equal node string as it was in the origin input. */
|
38
|
-
raws?: DeclarationRaws
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
43
|
+
export { Declaration_ as default }
|
39
44
|
}
|
40
45
|
|
41
46
|
/**
|
@@ -55,10 +60,10 @@ export interface DeclarationProps {
|
|
55
60
|
* decl.toString() //=> ' color: black'
|
56
61
|
* ```
|
57
62
|
*/
|
58
|
-
|
63
|
+
declare class Declaration_ extends Node {
|
59
64
|
type: 'decl'
|
60
65
|
parent: Container | undefined
|
61
|
-
raws: DeclarationRaws
|
66
|
+
raws: Declaration.DeclarationRaws
|
62
67
|
|
63
68
|
/**
|
64
69
|
* The declaration's property name.
|
@@ -116,9 +121,13 @@ export default class Declaration extends Node {
|
|
116
121
|
*/
|
117
122
|
variable: boolean
|
118
123
|
|
119
|
-
constructor(defaults?: DeclarationProps)
|
120
|
-
assign(overrides: object | DeclarationProps): this
|
121
|
-
clone(overrides?: Partial<DeclarationProps>): this
|
122
|
-
cloneBefore(overrides?: Partial<DeclarationProps>): this
|
123
|
-
cloneAfter(overrides?: Partial<DeclarationProps>): this
|
124
|
+
constructor(defaults?: Declaration.DeclarationProps)
|
125
|
+
assign(overrides: object | Declaration.DeclarationProps): this
|
126
|
+
clone(overrides?: Partial<Declaration.DeclarationProps>): this
|
127
|
+
cloneBefore(overrides?: Partial<Declaration.DeclarationProps>): this
|
128
|
+
cloneAfter(overrides?: Partial<Declaration.DeclarationProps>): this
|
124
129
|
}
|
130
|
+
|
131
|
+
declare class Declaration extends Declaration_ {}
|
132
|
+
|
133
|
+
export = Declaration
|
package/lib/document.d.ts
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
import Container, { ContainerProps } from './container.js'
|
2
2
|
import { ProcessOptions } from './postcss.js'
|
3
3
|
import Result from './result.js'
|
4
|
-
import Root
|
4
|
+
import Root from './root.js'
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
declare namespace Document {
|
7
|
+
export interface DocumentProps extends ContainerProps {
|
8
|
+
nodes?: Root[]
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
}
|
10
|
+
/**
|
11
|
+
* Information to generate byte-to-byte equal node string as it was
|
12
|
+
* in the origin input.
|
13
|
+
*
|
14
|
+
* Every parser saves its own properties.
|
15
|
+
*/
|
16
|
+
raws?: Record<string, any>
|
17
|
+
}
|
17
18
|
|
18
|
-
|
19
|
-
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
20
|
+
export { Document_ as default }
|
21
|
+
}
|
20
22
|
|
21
23
|
/**
|
22
24
|
* Represents a file and contains all its parsed nodes.
|
@@ -32,11 +34,11 @@ type ChildProps = RootProps
|
|
32
34
|
* document.nodes.length //=> 2
|
33
35
|
* ```
|
34
36
|
*/
|
35
|
-
|
37
|
+
declare class Document_ extends Container<Root> {
|
36
38
|
type: 'document'
|
37
39
|
parent: undefined
|
38
40
|
|
39
|
-
constructor(defaults?: DocumentProps)
|
41
|
+
constructor(defaults?: Document.DocumentProps)
|
40
42
|
|
41
43
|
/**
|
42
44
|
* Returns a `Result` instance representing the document’s CSS roots.
|
@@ -55,3 +57,7 @@ export default class Document extends Container<Root> {
|
|
55
57
|
*/
|
56
58
|
toResult(options?: ProcessOptions): Result
|
57
59
|
}
|
60
|
+
|
61
|
+
declare class Document extends Document_ {}
|
62
|
+
|
63
|
+
export = Document
|
package/lib/fromJSON.d.ts
CHANGED
package/lib/input.d.ts
CHANGED
@@ -1,41 +1,46 @@
|
|
1
|
-
import { ProcessOptions } from './postcss.js'
|
1
|
+
import { CssSyntaxError, ProcessOptions } from './postcss.js'
|
2
2
|
import PreviousMap from './previous-map.js'
|
3
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
|
-
|
4
|
+
declare namespace Input {
|
5
|
+
export interface FilePosition {
|
6
|
+
/**
|
7
|
+
* URL for the source file.
|
8
|
+
*/
|
9
|
+
url: string
|
10
|
+
|
11
|
+
/**
|
12
|
+
* Absolute path to the source file.
|
13
|
+
*/
|
14
|
+
file?: string
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Line of inclusive start position in source file.
|
18
|
+
*/
|
19
|
+
line: number
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Column of inclusive start position in source file.
|
23
|
+
*/
|
24
|
+
column: number
|
25
|
+
|
26
|
+
/**
|
27
|
+
* Line of exclusive end position in source file.
|
28
|
+
*/
|
29
|
+
endLine?: number
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Column of exclusive end position in source file.
|
33
|
+
*/
|
34
|
+
endColumn?: number
|
29
35
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
36
|
+
/**
|
37
|
+
* Source code.
|
38
|
+
*/
|
39
|
+
source?: string
|
40
|
+
}
|
34
41
|
|
35
|
-
|
36
|
-
|
37
|
-
*/
|
38
|
-
source?: string
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
43
|
+
export { Input_ as default }
|
39
44
|
}
|
40
45
|
|
41
46
|
/**
|
@@ -46,7 +51,7 @@ export interface FilePosition {
|
|
46
51
|
* const input = root.source.input
|
47
52
|
* ```
|
48
53
|
*/
|
49
|
-
|
54
|
+
declare class Input_ {
|
50
55
|
/**
|
51
56
|
* Input CSS source.
|
52
57
|
*
|
@@ -139,7 +144,7 @@ export default class Input {
|
|
139
144
|
column: number,
|
140
145
|
endLine?: number,
|
141
146
|
endColumn?: number
|
142
|
-
): FilePosition | false
|
147
|
+
): Input.FilePosition | false
|
143
148
|
|
144
149
|
/**
|
145
150
|
* Converts source offset to line and column.
|
@@ -147,4 +152,43 @@ export default class Input {
|
|
147
152
|
* @param offset Source offset.
|
148
153
|
*/
|
149
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
|
150
190
|
}
|
191
|
+
|
192
|
+
declare class Input extends Input_ {}
|
193
|
+
|
194
|
+
export = Input
|
package/lib/input.js
CHANGED
@@ -108,7 +108,7 @@ class Input {
|
|
108
108
|
if (line && typeof line === 'object') {
|
109
109
|
let start = line
|
110
110
|
let end = column
|
111
|
-
if (typeof
|
111
|
+
if (typeof start.offset === 'number') {
|
112
112
|
let pos = this.fromOffset(start.offset)
|
113
113
|
line = pos.line
|
114
114
|
column = pos.col
|