File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { ProcessOptions } from './postcss.js'
1+ import { CssSyntaxError , ProcessOptions } from './postcss.js'
22import PreviousMap from './previous-map.js'
33
44export interface FilePosition {
@@ -147,4 +147,32 @@ export default class Input {
147147 * @param offset Source offset.
148148 */
149149 fromOffset ( offset : number ) : { line : number ; col : number } | null
150+
151+ /**
152+ * Returns `CssSyntaxError` with information about the error and its position
153+ *
154+ * @param message Error message.
155+ * @param line The line number in the input or a position that is part of a range.
156+ * @param column The column number in the input or a position that is part of a range.
157+ * @param opts Object contains `plugin` key with PostCSS plugin name, if error came from a plugin.
158+ * @return `CssSyntaxError`
159+ */
160+ error (
161+ message : string ,
162+ line :
163+ | number
164+ | {
165+ offset ?: number
166+ line : number
167+ column : number
168+ } ,
169+ column ?:
170+ | number
171+ | {
172+ offset ?: number
173+ line : number
174+ column : number
175+ } ,
176+ opts ?: { plugin ?: CssSyntaxError [ 'plugin' ] }
177+ ) : CssSyntaxError
150178}
You can’t perform that action at this time.
0 commit comments