2023-07-24 03:13:08 +00:00
|
|
|
import { SourceMapConsumer } from 'source-map-js'
|
|
|
|
|
|
|
|
import { ProcessOptions } from './postcss.js'
|
|
|
|
|
2023-09-06 01:51:55 +00:00
|
|
|
declare namespace PreviousMap {
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
|
|
export { PreviousMap_ as default }
|
|
|
|
}
|
|
|
|
|
2023-07-24 03:13:08 +00:00
|
|
|
/**
|
|
|
|
* Source map information from input CSS.
|
|
|
|
* For example, source map after Sass compiler.
|
|
|
|
*
|
|
|
|
* This class will automatically find source map in input CSS or in file system
|
|
|
|
* near input file (according `from` option).
|
|
|
|
*
|
|
|
|
* ```js
|
|
|
|
* const root = parse(css, { from: 'a.sass.css' })
|
|
|
|
* root.input.map //=> PreviousMap
|
|
|
|
* ```
|
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
declare class PreviousMap_ {
|
2023-07-24 03:13:08 +00:00
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* `sourceMappingURL` content.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
annotation?: string
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* The CSS source identifier. Contains `Input#file` if the user
|
|
|
|
* set the `from` option, or `Input#id` if they did not.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
file?: string
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* Was source map inlined by data-uri to input CSS.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
inline: boolean
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* Path to source map file.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
mapFile?: string
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* The directory with source map file, if source map is in separated file.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
root?: string
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2023-09-06 01:51:55 +00:00
|
|
|
* Source map file content.
|
2023-07-24 03:13:08 +00:00
|
|
|
*/
|
2023-09-06 01:51:55 +00:00
|
|
|
text?: string
|
2023-07-24 03:13:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @param css Input CSS source.
|
|
|
|
* @param opts Process options.
|
|
|
|
*/
|
|
|
|
constructor(css: string, opts?: ProcessOptions)
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a instance of `SourceMapGenerator` class
|
|
|
|
* from the `source-map` library to work with source map information.
|
|
|
|
*
|
|
|
|
* It is lazy method, so it will create object only on first call
|
|
|
|
* and then it will use cache.
|
|
|
|
*
|
|
|
|
* @return Object with source map information.
|
|
|
|
*/
|
|
|
|
consumer(): SourceMapConsumer
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Does source map contains `sourcesContent` with input source text.
|
|
|
|
*
|
|
|
|
* @return Is `sourcesContent` present.
|
|
|
|
*/
|
|
|
|
withContent(): boolean
|
|
|
|
}
|
2023-09-06 01:51:55 +00:00
|
|
|
|
|
|
|
declare class PreviousMap extends PreviousMap_ {}
|
|
|
|
|
|
|
|
export = PreviousMap
|