Repository URL to install this package:
|
Version:
1.2.13 ▾
|
import './root';
/**
* @typedef {object} filePosition
* @property {string} file - path to file
* @property {number} line - source line in file
* @property {number} column - source column in file
*/
/**
* Represents the source CSS.
*
* @example
* const root = postcss.parse(css, { from: file });
* const input = root.source.input;
*/
declare class Input {
css: string | string[];
file?: string | any;
id?: string | number | any;
/**
* @param {object} [opts] - {@link Processor#process} options
*/
constructor(css: string, opts?: {});
error(message: string, line?: string | number, column?: string | number, opts?: {}): any;
/**
* Reads the input source map and returns a symbol position
* in the input source (e.g., in a Sass file that was compiled
* to CSS before being passed to PostCSS).
* @return {filePosition} position in input source
*
* @example
* root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
*/
origin(line: number, column: number): false | {
file: any;
line: any;
column: any;
};
mapResolve(file: string): any;
/**
* The CSS source identifier. Contains {@link Input#file} if the user
* set the `from` option, or {@link Input#id} if they did not.
* @type {string}
*
* @example
* const root = postcss.parse(css, { from: 'a.css' });
* root.source.input.from //=> "/home/ai/a.css"
*
* const root = postcss.parse(css);
* root.source.input.from //=> "<input css 1>"
*/
readonly from: any;
}
export default Input;