123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- import * as postcss from './postcss';
- export default class CssSyntaxError implements postcss.CssSyntaxError, SyntaxError {
- /**
- * Contains full error text in the GNU error format.
- */
- message: string;
- /**
- * Contains the source line of the error. PostCSS will use the input
- * source map to detect the original error location. If you wrote a
- * Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you need
- * position in PostCSS input (e.g., to debug previous compiler), use
- * error.generated.line.
- */
- line: number;
- /**
- * Contains the source column of the error. PostCSS will use the input
- * source map to detect the original error location. If you wrote a
- * Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you
- * need position in PostCSS input (e.g., to debug previous compiler),
- * use error.generated.column.
- */
- column: number;
- /**
- * Contains the source code of the broken file. PostCSS will use the
- * input source map to detect the original error location. If you wrote
- * a Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you
- * need position in PostCSS input (e.g., to debug previous compiler),
- * use error.generated.source.
- */
- source: string;
- /**
- * If parser's from option is set, contains the absolute path to the
- * broken file. PostCSS will use the input source map to detect the
- * original error location. If you wrote a Sass file, compiled it
- * to CSS and then parsed it with PostCSS, PostCSS will show the
- * original position in the Sass file. If you need the position in
- * PostCSS input (e.g., to debug previous compiler), use
- * error.generated.file.
- */
- file: string;
- /**
- * Contains the PostCSS plugin name if the error didn't come from the
- * CSS parser.
- */
- plugin: string;
- name: string;
- /**
- * Contains only the error description.
- */
- reason: string;
- private columnNumber;
- private description;
- private lineNumber;
- private fileName;
- input: postcss.InputOrigin;
- /**
- * The CSS parser throws this error for broken CSS.
- */
- constructor(
- /**
- * Contains full error text in the GNU error format.
- */
- message: string,
- /**
- * Contains the source line of the error. PostCSS will use the input
- * source map to detect the original error location. If you wrote a
- * Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you need
- * position in PostCSS input (e.g., to debug previous compiler), use
- * error.generated.line.
- */
- line?: number,
- /**
- * Contains the source column of the error. PostCSS will use the input
- * source map to detect the original error location. If you wrote a
- * Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you
- * need position in PostCSS input (e.g., to debug previous compiler),
- * use error.generated.column.
- */
- column?: number,
- /**
- * Contains the source code of the broken file. PostCSS will use the
- * input source map to detect the original error location. If you wrote
- * a Sass file, compiled it to CSS and then parsed it with PostCSS,
- * PostCSS will show the original position in the Sass file. If you
- * need position in PostCSS input (e.g., to debug previous compiler),
- * use error.generated.source.
- */
- source?: string,
- /**
- * If parser's from option is set, contains the absolute path to the
- * broken file. PostCSS will use the input source map to detect the
- * original error location. If you wrote a Sass file, compiled it
- * to CSS and then parsed it with PostCSS, PostCSS will show the
- * original position in the Sass file. If you need the position in
- * PostCSS input (e.g., to debug previous compiler), use
- * error.generated.file.
- */
- file?: string,
- /**
- * Contains the PostCSS plugin name if the error didn't come from the
- * CSS parser.
- */
- plugin?: string);
- private setMessage();
- /**
- * @param color Whether arrow should be colored red by terminal color codes.
- * By default, PostCSS will use process.stdout.isTTY and
- * process.env.NODE_DISABLE_COLORS.
- * @returns A few lines of CSS source that caused the error. If CSS has
- * input source map without sourceContent this method will return an empty
- * string.
- */
- showSourceCode(color?: boolean): string;
- /**
- *
- * @returns Error position, message and source code of broken part.
- */
- toString(): string;
- generated: postcss.InputOrigin;
- }
|