Version 1
[yaffs-website] / node_modules / uncss / node_modules / postcss / d.ts / postcss.d.ts
1 import PreviousMap from './previous-map';
2 import Stringifier from './stringifier';
3 import _vendor from './vendor';
4 import _list from './list';
5 /**
6  * @param plugins Can also be included with the Processor#use method.
7  * @returns A processor that will apply plugins as CSS processors.
8  */
9 declare function postcss(plugins?: (typeof postcss.acceptedPlugin)[]): postcss.Processor;
10 declare function postcss(...plugins: (typeof postcss.acceptedPlugin)[]): postcss.Processor;
11 declare module postcss {
12     var acceptedPlugin: Plugin<any> | Transformer | {
13         postcss: TransformCallback | Processor;
14     } | Processor;
15     /**
16      * Creates a PostCSS plugin with a standard API.
17      * @param name Plugin name. Same as in name property in package.json. It will
18      * be saved in plugin.postcssPlugin property.
19      * @param initializer Will receive plugin options and should return functions
20      * to modify nodes in input CSS.
21      */
22     function plugin<T>(name: string, initializer: PluginInitializer<T>): Plugin<T>;
23     interface Plugin<T> extends Transformer {
24         (opts?: T): Transformer;
25         postcss: Transformer;
26         process: (css: string | {
27             toString(): string;
28         } | Result, opts?: any) => LazyResult;
29     }
30     interface Transformer extends TransformCallback {
31         postcssPlugin?: string;
32         postcssVersion?: string;
33     }
34     interface TransformCallback {
35         /**
36          * @returns Asynchronous plugins should return a promise.
37          */
38         (root: Root, result?: Result): void | Function | any;
39     }
40     interface PluginInitializer<T> {
41         (pluginOptions?: T): Transformer;
42     }
43     /**
44      * Contains the Vendor module, which contains helpers for working with
45      * vendor prefixes.
46      */
47     var vendor: typeof _vendor;
48     /**
49      * Default function to convert a node tree into a CSS string.
50      */
51     function stringify(node: Node, builder: Stringifier.Builder): void;
52     /**
53      * Parses source CSS.
54      * @param css The CSS to parse.
55      * @param options
56      * @returns {} A new Root node, which contains the source CSS nodes.
57      */
58     function parse(css: string | {
59         toString(): string;
60     } | LazyResult | Result, options?: {
61         from?: string;
62         map?: postcss.SourceMapOptions;
63     }): Root;
64     /**
65      * Contains the List module, which contains helpers for safely splitting
66      * lists of CSS values, preserving parentheses and quotes.
67      */
68     var list: typeof _list;
69     /**
70      * Creates a new Comment node.
71      * @param defaults Properties for the new Comment node.
72      * @returns The new node.
73      */
74     function comment(defaults?: CommentNewProps): Comment;
75     /**
76      * Creates a new AtRule node.
77      * @param defaults Properties for the new AtRule node.
78      * @returns The new node.
79      */
80     function atRule(defaults?: AtRuleNewProps): AtRule;
81     /**
82      * Creates a new Declaration node.
83      * @param defaults Properties for the new Declaration node.
84      * @returns The new node.
85      */
86     function decl(defaults?: DeclarationNewProps): Declaration;
87     /**
88      * Creates a new Rule node.
89      * @param defaults Properties for the new Rule node.
90      * @returns The new node.
91      */
92     function rule(defaults?: RuleNewProps): Rule;
93     /**
94      * Creates a new Root node.
95      * @param defaults Properties for the new Root node.
96      * @returns The new node.
97      */
98     function root(defaults?: Object): Root;
99     interface SourceMapOptions {
100         /**
101          * Indicates that the source map should be embedded in the output CSS as a
102          * Base64-encoded comment. By default, it is true. But if all previous maps
103          * are external, not inline, PostCSS will not embed the map even if you do
104          * not set this option.
105          *
106          * If you have an inline source map, the result.map property will be empty,
107          * as the source map will be contained within the text of result.css.
108          */
109         inline?: boolean;
110         /**
111          * Source map content from a previous processing step (e.g., Sass compilation).
112          * PostCSS will try to read the previous source map automatically (based on comments
113          * within the source CSS), but you can use this option to identify it manually.
114          * If desired, you can omit the previous map with prev: false.
115          */
116         prev?: any;
117         /**
118          * Indicates that PostCSS should set the origin content (e.g., Sass source)
119          * of the source map. By default, it is true. But if all previous maps do not
120          * contain sources content, PostCSS will also leave it out even if you do not set
121          * this option.
122          */
123         sourcesContent?: boolean;
124         /**
125          * Indicates that PostCSS should add annotation comments to the CSS. By default,
126          * PostCSS will always add a comment with a path to the source map. PostCSS will
127          * not add annotations to CSS files that do not contain any comments.
128          *
129          * By default, PostCSS presumes that you want to save the source map as
130          * opts.to + '.map' and will use this path in the annotation comment. A different
131          * path can be set by providing a string value for annotation.
132          *
133          * If you have set inline: true, annotation cannot be disabled.
134          */
135         annotation?: boolean | string;
136         /**
137          * If true, PostCSS will try to correct any syntax errors that it finds in the CSS.
138          * This is useful for legacy code filled with hacks. Another use-case is interactive
139          * tools with live input — for example, the Autoprefixer demo.
140          */
141         safe?: boolean;
142     }
143     /**
144      * A Processor instance contains plugins to process CSS. Create one
145      * Processor  instance, initialize its plugins, and then use that instance
146      * on numerous CSS files.
147      */
148     interface Processor {
149         /**
150          * Adds a plugin to be used as a CSS processor. Plugins can also be
151          * added by passing them as arguments when creating a postcss instance.
152          */
153         use(plugin: typeof acceptedPlugin): Processor;
154         /**
155          * Parses source CSS. Because some plugins can be asynchronous it doesn't
156          * make any transformations. Transformations will be applied in LazyResult's
157          * methods.
158          * @param css Input CSS or any object with toString() method, like a file
159          * stream. If a Result instance is passed the processor will take the
160          * existing Root parser from it.
161          */
162         process(css: string | {
163             toString(): string;
164         } | Result, options?: ProcessOptions): LazyResult;
165         /**
166          * Contains plugins added to this processor.
167          */
168         plugins: Plugin<any>[];
169         /**
170          * Contains the current version of PostCSS (e.g., "4.0.5").
171          */
172         version: string;
173     }
174     interface ProcessOptions extends Syntax {
175         /**
176          * The path of the CSS source file. You should always set from, because it is
177          * used in source map generation and syntax error messages.
178          */
179         from?: string;
180         /**
181          * The path where you'll put the output CSS file. You should always set it
182          * to generate correct source maps.
183          */
184         to?: string;
185         syntax?: Syntax;
186         /**
187          * Enable Safe Mode, in which PostCSS will try to fix CSS syntax errors.
188          */
189         safe?: boolean;
190         map?: postcss.SourceMapOptions;
191         /**
192          * Function to generate AST by string.
193          */
194         parser?: Parse | Syntax;
195         /**
196          * Class to generate string by AST.
197          */
198         stringifier?: Stringify | Syntax;
199     }
200     interface Syntax {
201         /**
202          * Function to generate AST by string.
203          */
204         parse?: Parse;
205         /**
206          * Class to generate string by AST.
207          */
208         stringify?: Stringify;
209     }
210     interface Parse {
211         (css?: string, opts?: postcss.SourceMapOptions): Root;
212     }
213     interface Stringify {
214         (node?: postcss.Node, builder?: any): postcss.Result | void;
215     }
216     /**
217      * A promise proxy for the result of PostCSS transformations.
218      */
219     interface LazyResult {
220         /**
221          * Processes input CSS through synchronous and asynchronous plugins.
222          * @param onRejected Called if any plugin throws an error.
223          */
224         then(onFulfilled: (result: Result) => void, onRejected?: (error: Error) => void): Function | any;
225         /**
226          * Processes input CSS through synchronous and asynchronous plugins.
227          * @param onRejected Called if any plugin throws an error.
228          */
229         catch(onRejected: (error: Error) => void): Function | any;
230         /**
231          * Alias for css property.
232          */
233         toString(): string;
234         /**
235          * Processes input CSS through synchronous plugins and converts Root to
236          * CSS string. This property will only work with synchronous plugins. If
237          * the processor contains any asynchronous plugins it will throw an error.
238          * In this case, you should use LazyResult#then() instead.
239          * @returns Result#css.
240          */
241         css: string;
242         /**
243          * Alias for css property to use when syntaxes generate non-CSS output.
244          */
245         content: string;
246         /**
247          * Processes input CSS through synchronous plugins. This property will
248          * work only with synchronous plugins. If processor contains any
249          * asynchronous plugins it will throw an error. You should use
250          * LazyResult#then() instead.
251          */
252         map: ResultMap;
253         /**
254          * Processes input CSS through synchronous plugins. This property will work
255          * only with synchronous plugins. If processor contains any asynchronous
256          * plugins it will throw an error. You should use LazyResult#then() instead.
257          */
258         root: Root;
259         /**
260          * Processes input CSS through synchronous plugins and calls Result#warnings().
261          * This property will only work with synchronous plugins. If the processor
262          * contains any asynchronous plugins it will throw an error. In this case,
263          * you should use LazyResult#then() instead.
264          */
265         warnings(): ResultMessage[];
266         /**
267          * Processes input CSS through synchronous plugins. This property will work
268          * only with synchronous plugins. If processor contains any asynchronous
269          * plugins it will throw an error. You should use LazyResult#then() instead.
270          */
271         messages: ResultMessage[];
272         /**
273          * @returns A processor used for CSS transformations.
274          */
275         processor: Processor;
276         /**
277          * @returns Options from the Processor#process(css, opts) call that produced
278          * this Result instance.
279          */
280         opts: ResultOptions;
281     }
282     /**
283      * Provides the result of the PostCSS transformations.
284      */
285     interface Result {
286         /**
287          * Alias for css property.
288          */
289         toString(): string;
290         /**
291          * Creates an instance of Warning and adds it to messages.
292          * @param message Used in the text property of the message object.
293          * @param options Properties for Message object.
294          */
295         warn(message: string, options?: WarningOptions): void;
296         /**
297          * @returns Warnings from plugins, filtered from messages.
298          */
299         warnings(): ResultMessage[];
300         /**
301          * A CSS string representing this Result's Root instance.
302          */
303         css: string;
304         /**
305          * Alias for css property to use with syntaxes that generate non-CSS output.
306          */
307         content: string;
308         /**
309          * An instance of the SourceMapGenerator class from the source-map library,
310          * representing changes to the Result's Root instance.
311          * This property will have a value only if the user does not want an inline
312          * source map. By default, PostCSS generates inline source maps, written
313          * directly into the processed CSS. The map property will be empty by default.
314          * An external source map will be generated — and assigned to map — only if
315          * the user has set the map.inline option to false, or if PostCSS was passed
316          * an external input source map.
317          */
318         map: ResultMap;
319         /**
320          * Contains the Root node after all transformations.
321          */
322         root: Root;
323         /**
324          * Contains messages from plugins (e.g., warnings or custom messages).
325          * Add a warning using Result#warn() and get all warnings
326          * using the Result#warnings() method.
327          */
328         messages: ResultMessage[];
329         /**
330          * The Processor instance used for this transformation.
331          */
332         processor: Processor;
333         /**
334          * Options from the Processor#process(css, opts) or Root#toResult(opts) call
335          * that produced this Result instance.
336          */
337         opts: ResultOptions;
338     }
339     interface ResultOptions extends ProcessOptions {
340         /**
341          * The CSS node that was the source of the warning.
342          */
343         node?: postcss.Node;
344         /**
345          * Name of plugin that created this warning. Result#warn() will fill it
346          * automatically with plugin.postcssPlugin value.
347          */
348         plugin?: string;
349     }
350     interface ResultMap {
351         /**
352          * Add a single mapping from original source line and column to the generated
353          * source's line and column for this source map being created. The mapping
354          * object should have the following properties:
355          * @param mapping
356          * @returns {}
357          */
358         addMapping(mapping: {
359             generated: {
360                 line: number;
361                 column: number;
362             };
363             original: {
364                 line: number;
365                 column: number;
366             };
367             /**
368              * The original source file (relative to the sourceRoot).
369              */
370             source: string;
371             name?: string;
372         }): void;
373         /**
374          * Set the source content for an original source file.
375          * @param sourceFile The URL of the original source file.
376          * @param sourceContent The content of the source file.
377          */
378         setSourceContent(sourceFile: string, sourceContent: string): void;
379         /**
380          * Applies a SourceMap for a source file to the SourceMap. Each mapping to
381          * the supplied source file is rewritten using the supplied SourceMap.
382          * Note: The resolution for the resulting mappings is the minimium of this
383          * map and the supplied map.
384          * @param sourceMapConsumer The SourceMap to be applied.
385          * @param sourceFile The filename of the source file. If omitted, sourceMapConsumer
386          * file will be used, if it exists. Otherwise an error will be thrown.
387          * @param sourceMapPath The dirname of the path to the SourceMap to be applied.
388          * If relative, it is relative to the SourceMap. This parameter is needed when
389          * the two SourceMaps aren't in the same directory, and the SourceMap to be
390          * applied contains relative source paths. If so, those relative source paths
391          * need to be rewritten relative to the SourceMap.
392          * If omitted, it is assumed that both SourceMaps are in the same directory;
393          * thus, not needing any rewriting (Supplying '.' has the same effect).
394          */
395         applySourceMap(sourceMapConsumer: any, sourceFile?: string, sourceMapPath?: string): void;
396         /**
397          * Renders the source map being generated to JSON.
398          */
399         toJSON: () => any;
400         /**
401          * Renders the source map being generated to a string.
402          */
403         toString: () => string;
404     }
405     interface ResultMessage {
406         type: string;
407         text?: string;
408         plugin?: string;
409         browsers?: string[];
410     }
411     /**
412      * Represents a plugin warning. It can be created using Result#warn().
413      */
414     interface Warning {
415         /**
416          * @returns Error position, message.
417          */
418         toString(): string;
419         /**
420          * Contains the warning message.
421          */
422         text: string;
423         /**
424          * Contains the name of the plugin that created this warning. When you
425          * call Result#warn(), it will fill this property automatically.
426          */
427         plugin: string;
428         /**
429          * The CSS node that caused the warning.
430          */
431         node: Node;
432         /**
433          * The line in the input file with this warning's source.
434          */
435         line: number;
436         /**
437          * Column in the input file with this warning's source.
438          */
439         column: number;
440     }
441     interface WarningOptions extends ResultOptions {
442         /**
443          * A word inside a node's string that should be highlighted as source
444          * of warning.
445          */
446         word?: string;
447         /**
448          * The index inside a node's string that should be highlighted as
449          * source of warning.
450          */
451         index?: number;
452     }
453     /**
454      * The CSS parser throws this error for broken CSS.
455      */
456     interface CssSyntaxError extends InputOrigin {
457         name: string;
458         /**
459          * @returns Error position, message and source code of broken part.
460          */
461         toString(): string;
462         /**
463          * @param color Whether arrow should be colored red by terminal color codes.
464          * By default, PostCSS will use process.stdout.isTTY and
465          * process.env.NODE_DISABLE_COLORS.
466          * @returns A few lines of CSS source that caused the error. If CSS has
467          * input source map without sourceContent this method will return an empty
468          * string.
469          */
470         showSourceCode(color?: boolean): string;
471         /**
472          * Contains full error text in the GNU error format.
473          */
474         message: string;
475         /**
476          * Contains only the error description.
477          */
478         reason: string;
479         /**
480          * Contains the PostCSS plugin name if the error didn't come from the
481          * CSS parser.
482          */
483         plugin?: string;
484         input?: InputOrigin;
485     }
486     interface InputOrigin {
487         /**
488          * If parser's from option is set, contains the absolute path to the
489          * broken file. PostCSS will use the input source map to detect the
490          * original error location. If you wrote a Sass file, then compiled it
491          * to CSS and parsed it with PostCSS, PostCSS will show the original
492          * position in the Sass file. If you need the position in the PostCSS
493          * input (e.g., to debug the previous compiler), use error.input.file.
494          */
495         file?: string;
496         /**
497          * Contains the source line of the error. PostCSS will use the input
498          * source map to detect the original error location. If you wrote a Sass
499          * file, then compiled it to CSS and parsed it with PostCSS, PostCSS
500          * will show the original position in the Sass file. If you need the
501          * position in the PostCSS input (e.g., to debug the previous
502          * compiler), use error.input.line.
503          */
504         line?: number;
505         /**
506          * Contains the source column of the error. PostCSS will use input
507          * source map to detect the original error location. If you wrote a
508          * Sass file, then compiled it to CSS and parsed it with PostCSS,
509          * PostCSS will show the original position in the Sass file. If you
510          * need the position in the PostCSS input (e.g., to debug the
511          * previous compiler), use error.input.column.
512          */
513         column?: number;
514         /**
515          * Contains the source code of the broken file. PostCSS will use the
516          * input source map to detect the original error location. If you wrote
517          * a Sass file, then compiled it to CSS and parsed it with PostCSS,
518          * PostCSS will show the original position in the Sass file. If you need
519          * the position in the PostCSS input (e.g., to debug the previous
520          * compiler), use error.input.source.
521          */
522         source?: string;
523     }
524     /**
525      * Represents the source CSS.
526      */
527     interface Input {
528         /**
529          * The absolute path to the CSS source file defined with the "from" option.
530          */
531         file: string;
532         /**
533          * The unique ID of the CSS source. Used if "from" option is not provided
534          * (because PostCSS does not know the file path).
535          */
536         id: string;
537         /**
538          * The CSS source identifier. Contains input.file if the user set the
539          * "from" option, or input.id if they did not.
540          */
541         from: string;
542         /**
543          * Represents the input source map passed from a compilation step before
544          * PostCSS (e.g., from the Sass compiler).
545          */
546         map: PreviousMap;
547         /**
548          * Reads the input source map.
549          * @returns A symbol position in the input source (e.g., in a Sass file
550          * that was compiled to CSS before being passed to PostCSS):
551          */
552         origin(line: number, column: number): InputOrigin;
553     }
554     interface Node {
555         /**
556          * Returns a string representing the node's type. Possible values are
557          * root, atrule, rule, decl or comment.
558          */
559         type: string;
560         /**
561          * Returns the node's parent node.
562          */
563         parent: Container;
564         /**
565          * Returns the input source of the node. The property is used in source
566          * map generation. If you create a node manually
567          * (e.g., with postcss.decl() ), that node will not have a source
568          * property and will be absent from the source map. For this reason, the
569          * plugin developer should consider cloning nodes to create new ones
570          * (in which case the new node's source will reference the original,
571          * cloned node) or setting the source property manually.
572          */
573         source: NodeSource;
574         /**
575          * Contains information to generate byte-to-byte equal node string as it
576          * was in origin input.
577          */
578         raws: NodeRaws;
579         /**
580          * @returns A CSS string representing the node.
581          */
582         toString(): string;
583         /**
584          * This method produces very useful error messages. If present, an input
585          * source map will be used to get the original position of the source, even
586          * from a previous compilation step (e.g., from Sass compilation).
587          * @returns The original position of the node in the source, showing line
588          * and column numbers and also a small excerpt to facilitate debugging.
589          */
590         error(
591             /**
592              * Error description.
593              */
594             message: string, options?: NodeErrorOptions): CssSyntaxError;
595         /**
596          * Creates an instance of Warning and adds it to messages. This method is
597          * provided as a convenience wrapper for Result#warn.
598          * Note that `opts.node` is automatically passed to Result#warn for you.
599          * @param result The result that will receive the warning.
600          * @param text Warning message. It will be used in the `text` property of
601          * the message object.
602          * @param opts Properties to assign to the message object.
603          */
604         warn(result: Result, text: string, opts?: WarningOptions): void;
605         /**
606          * @returns The next child of the node's parent; or, returns undefined if
607          * the current node is the last child.
608          */
609         next(): Node;
610         /**
611          * @returns The previous child of the node's parent; or, returns undefined
612          * if the current node is the first child.
613          */
614         prev(): Node;
615         /**
616          * @returns The Root instance of the node's tree.
617          */
618         root(): Root;
619         /**
620          * Removes the node from its parent and cleans the parent property in the
621          * node and its children.
622          * @returns This node for chaining.
623          */
624         remove(): Node;
625         /**
626          * Inserts node(s) before the current node and removes the current node.
627          * @returns This node for chaining.
628          */
629         replaceWith(...nodes: (Node | Object)[]): Node;
630         /**
631          * @param overrides New properties to override in the clone.
632          * @returns A clone of this node. The node and its (cloned) children will
633          * have a clean parent and code style properties.
634          */
635         clone(overrides?: Object): Node;
636         /**
637          * Shortcut to clone the node and insert the resulting cloned node before
638          * the current node.
639          * @param overrides New Properties to override in the clone.
640          * @returns The cloned node.
641          */
642         cloneBefore(overrides?: Object): Node;
643         /**
644          * Shortcut to clone the node and insert the resulting cloned node after
645          * the current node.
646          * @param overrides New Properties to override in the clone.
647          * @returns The cloned node.
648          */
649         cloneAfter(overrides?: Object): Node;
650         /**
651          * Removes the node from its current parent and inserts it at the end of
652          * newParent. This will clean the before and after code style properties
653          * from the node and replace them with the indentation style of newParent.
654          * It will also clean the between property if newParent is in another Root.
655          * @param newParent Where the current node will be moved.
656          * @returns This node for chaining.
657          */
658         moveTo(newParent: Container): Node;
659         /**
660          * Removes the node from its current parent and inserts it into a new
661          * parent before otherNode. This will also clean the node's code style
662          * properties just as it would in node.moveTo(newParent).
663          * @param otherNode Will be after the current node after moving.
664          * @returns This node for chaining.
665          */
666         moveBefore(otherNode: Node): Node;
667         /**
668          * Removes the node from its current parent and inserts it into a new
669          * parent after otherNode. This will also clean the node's code style
670          * properties just as it would in node.moveTo(newParent).
671          * @param otherNode Will be before the current node after moving.
672          * @returns This node for chaining.
673          */
674         moveAfter(otherNode: Node): Node;
675         /**
676          * @param prop Name or code style property.
677          * @param defaultType Name of default value. It can be easily missed if the
678          * value is the same as prop.
679          * @returns A code style property value. If the node is missing the code
680          * style property (because the node was manually built or cloned), PostCSS
681          * will try to autodetect the code style property by looking at other nodes
682          * in the tree.
683          */
684         raw(prop: string, defaultType?: string): any;
685     }
686     interface NodeNewProps {
687         raws?: NodeRaws;
688     }
689     interface NodeRaws {
690         /**
691          * The space symbols before the node. It also stores `*` and `_`
692          * symbols before the declaration (IE hack).
693          */
694         before?: string;
695         /**
696          * The space symbols after the last child of the node to the end of
697          * the node.
698          */
699         after?: string;
700         /**
701          * The symbols between the property and value for declarations,
702          * selector and "{" for rules, last parameter and "{" for at-rules.
703          */
704         between?: string;
705         /**
706          * True if last child has (optional) semicolon.
707          */
708         semicolon?: boolean;
709         /**
710          * The space between the at-rule's name and parameters.
711          */
712         afterName?: string;
713         /**
714          * The space symbols between "/*" and comment's text.
715          */
716         left?: string;
717         /**
718          * The space symbols between comment's text and "*\/".
719          */
720         right?: string;
721         /**
722          * The content of important statement, if it is not just "!important".
723          */
724         important?: string;
725     }
726     interface NodeSource {
727         input: Input;
728         /**
729          * The starting position of the node's source.
730          */
731         start?: {
732             column: number;
733             line: number;
734         };
735         /**
736          * The ending position of the node's source.
737          */
738         end?: {
739             column: number;
740             line: number;
741         };
742     }
743     interface NodeErrorOptions {
744         /**
745          * Plugin name that created this error. PostCSS will set it automatically.
746          */
747         plugin?: string;
748         /**
749          * A word inside a node's string, that should be highlighted as source
750          * of error.
751          */
752         word?: string;
753         /**
754          * An index inside a node's string that should be highlighted as source
755          * of error.
756          */
757         index?: number;
758     }
759     interface JsonNode {
760         /**
761          * Returns a string representing the node's type. Possible values are
762          * root, atrule, rule, decl or comment.
763          */
764         type?: string;
765         /**
766          * Returns the node's parent node.
767          */
768         parent?: JsonContainer;
769         /**
770          * Returns the input source of the node. The property is used in source
771          * map generation. If you create a node manually (e.g., with
772          * postcss.decl() ), that node will not have a  source  property and
773          * will be absent from the source map. For this reason, the plugin
774          * developer should consider cloning nodes to create new ones (in which
775          * case the new node's source will reference the original, cloned node)
776          * or setting the source property manually.
777          */
778         source?: NodeSource;
779         /**
780          * Contains information to generate byte-to-byte equal node string as it
781          * was in origin input.
782          */
783         raws?: NodeRaws;
784     }
785     /**
786      * Containers can store any content. If you write a rule inside a rule,
787      * PostCSS will parse it.
788      */
789     interface Container extends Node {
790         /**
791          * Returns the container's parent node.
792          */
793         parent: Container;
794         /**
795          * Contains the container's children.
796          */
797         nodes?: Node[];
798         /**
799          * @returns The container's first child.
800          */
801         first?: Node;
802         /**
803          * @returns The container's last child.
804          */
805         last?: Node;
806         /**
807          * @param overrides New properties to override in the clone.
808          * @returns A clone of this node. The node and its (cloned) children will
809          * have a clean parent and code style properties.
810          */
811         clone(overrides?: Object): Container;
812         /**
813          * @param child Child of the current container.
814          * @returns The child's index within the container's "nodes" array.
815          */
816         index(child: Node | number): number;
817         /**
818          * Determines whether all child nodes satisfy the specified test.
819          * @param callback A function that accepts up to three arguments. The
820          * every method calls the callback function for each node until the
821          * callback returns false, or until the end of the array.
822          * @returns True if the callback returns true for all of the container's
823          * children.
824          */
825         every(callback: (node: Node, index: number, nodes: Node[]) => any, thisArg?: any): boolean;
826         /**
827          * Determines whether the specified callback returns true for any child node.
828          * @param callback A function that accepts up to three arguments. The some
829          * method calls the callback for each node until the callback returns true,
830          * or until the end of the array.
831          * @param thisArg An object to which the this keyword can refer in the
832          * callback function. If thisArg is omitted, undefined is used as the
833          * this value.
834          * @returns True if callback returns true for (at least) one of the
835          * container's children.
836          */
837         some(callback: (node: Node, index: number, nodes: Node[]) => boolean, thisArg?: any): boolean;
838         /**
839          * Iterates through the container's immediate children, calling the
840          * callback function for each child. If you need to recursively iterate
841          * through all the container's descendant nodes, use container.walk().
842          * Unlike the for {} -cycle or Array#forEach() this iterator is safe if
843          * you are mutating the array of child nodes during iteration.
844          * @param callback Iterator. Returning false will break iteration. Safe
845          * if you are mutating the array of child nodes during iteration. PostCSS
846          * will adjust the current index to match the mutations.
847          * @returns False if the callback returns false during iteration.
848          */
849         each(callback: (node: Node, index: number) => any): boolean | void;
850         /**
851          * Traverses the container's descendant nodes, calling `callback` for each
852          * node. Like container.each(), this method is safe to use if you are
853          * mutating arrays during iteration. If you only need to iterate through
854          * the container's immediate children, use container.each().
855          * @param callback Iterator.
856          */
857         walk(callback: (node: Node, index: number) => any): boolean | void;
858         /**
859          * Traverses the container's descendant nodes, calling `callback` for each
860          * declaration. Like container.each(), this method is safe to use if you
861          * are mutating arrays during iteration.
862          * @param propFilter Filters declarations by property name. Only those
863          * declarations whose property matches propFilter will be iterated over.
864          * @param callback Called for each declaration node within the container.
865          */
866         walkDecls(propFilter: string | RegExp, callback?: (decl: Declaration, index: number) => any): boolean | void;
867         walkDecls(callback: (decl: Declaration, index: number) => any): boolean | void;
868         /**
869          * Traverses the container's descendant nodes, calling `callback` for each
870          * at-rule. Like container.each(), this method is safe to use if you are
871          * mutating arrays during iteration.
872          * @param nameFilter Filters at-rules by name. If provided, iteration
873          * will only happen over at-rules that have matching names.
874          * @param callback Iterator called for each at-rule node within the
875          * container.
876          */
877         walkAtRules(nameFilter: string | RegExp, callback: (atRule: AtRule, index: number) => any): boolean | void;
878         walkAtRules(callback: (atRule: AtRule, index: number) => any): boolean | void;
879         /**
880          * Traverses the container's descendant nodes, calling `callback` for each
881          * rule. Like container.each(), this method is safe to use if you are
882          * mutating arrays during iteration.
883          * @param selectorFilter Filters rules by selector. If provided,
884          * iteration will only happen over rules that have matching names.
885          * @param callback Iterator called for each rule node within the
886          * container.
887          */
888         walkRules(selectorFilter: string | RegExp, callback: (atRule: Rule, index: number) => any): boolean | void;
889         walkRules(callback: (atRule: Rule, index: number) => any): boolean | void;
890         walkRules(selectorFilter: any, callback?: (atRule: Rule, index: number) => any): boolean | void;
891         /**
892          * Traverses the container's descendant nodes, calling `callback` for each
893          * comment. Like container.each(), this method is safe to use if you are
894          * mutating arrays during iteration.
895          * @param callback Iterator called for each comment node within the container.
896          */
897         walkComments(callback: (comment: Comment, indexed: number) => any): void | boolean;
898         /**
899          * Passes all declaration values within the container that match pattern
900          * through the callback, replacing those values with the returned result of
901          * callback. This method is useful if you are using a custom unit or
902          * function and need to iterate through all values.
903          * @param pattern Pattern that we need to replace.
904          * @param options Options to speed up the search.
905          * @param callbackOrReplaceValue String to replace pattern or callback
906          * that will return a new value. The callback will receive the same
907          * arguments as those passed to a function parameter of String#replace.
908          */
909         replaceValues(pattern: string | RegExp, options: {
910             /**
911              * Property names. The method will only search for values that match
912              * regexp  within declarations of listed properties.
913              */
914             props?: string[];
915             /**
916              * Used to narrow down values and speed up the regexp search. Searching
917              * every single value with a regexp can be slow. If you pass a fast
918              * string, PostCSS will first check whether the value contains the fast
919              * string; and only if it does will PostCSS check that value against
920              * regexp. For example, instead of just checking for /\d+rem/ on all
921              * values, set fast: 'rem' to first check whether a value has the rem
922              * unit, and only if it does perform the regexp check.
923              */
924             fast?: string;
925         }, callbackOrReplaceValue: string | {
926             (substring: string, ...args: any[]): string;
927         }): Container;
928         replaceValues(pattern: string | RegExp, callbackOrReplaceValue: string | {
929             (substring: string, ...args: any[]): string;
930         }): Container;
931         /**
932          * Inserts new nodes to the beginning of the container.
933          * Because each node class is identifiable by unique properties, use the
934          * following shortcuts to create nodes in insert methods:
935          *     root.prepend({ name: '@charset', params: '"UTF-8"' }); // at-rule
936          *     root.prepend({ selector: 'a' });                       // rule
937          *     rule.prepend({ prop: 'color', value: 'black' });       // declaration
938          *     rule.prepend({ text: 'Comment' })                      // comment
939          * A string containing the CSS of the new element can also be used. This
940          * approach is slower than the above shortcuts.
941          *     root.prepend('a {}');
942          *     root.first.prepend('color: black; z-index: 1');
943          * @param nodes New nodes.
944          * @returns This container for chaining.
945          */
946         prepend(...nodes: (Node | Object | string)[]): Container;
947         /**
948          * Inserts new nodes to the end of the container.
949          * Because each node class is identifiable by unique properties, use the
950          * following shortcuts to create nodes in insert methods:
951          *     root.append({ name: '@charset', params: '"UTF-8"' }); // at-rule
952          *     root.append({ selector: 'a' });                       // rule
953          *     rule.append({ prop: 'color', value: 'black' });       // declaration
954          *     rule.append({ text: 'Comment' })                      // comment
955          * A string containing the CSS of the new element can also be used. This
956          * approach is slower than the above shortcuts.
957          *     root.append('a {}');
958          *     root.first.append('color: black; z-index: 1');
959          * @param nodes New nodes.
960          * @returns This container for chaining.
961          */
962         append(...nodes: (Node | Object | string)[]): Container;
963         /**
964          * Insert newNode before oldNode within the container.
965          * @param oldNode Child or child's index.
966          * @returns This container for chaining.
967          */
968         insertBefore(oldNode: Node | number, newNode: Node | Object | string): Container;
969         /**
970          * Insert newNode after oldNode within the container.
971          * @param oldNode Child or child's index.
972          * @returns This container for chaining.
973          */
974         insertAfter(oldNode: Node | number, newNode: Node | Object | string): Container;
975         /**
976          * Removes the container from its parent and cleans the parent property in the
977          * container and its children.
978          * @returns This container for chaining.
979          */
980         remove(): Container;
981         /**
982          * Removes child from the container and cleans the parent properties
983          * from the node and its children.
984          * @param child Child or child's index.
985          * @returns This container for chaining.
986          */
987         removeChild(child: Node | number): Container;
988         /**
989          * Removes all children from the container and cleans their parent
990          * properties.
991          * @returns This container for chaining.
992          */
993         removeAll(): Container;
994     }
995     interface ContainerNewProps extends NodeNewProps {
996         /**
997          * Contains the container's children.
998          */
999         nodes?: Node[];
1000         raws?: ContainerRaws;
1001     }
1002     interface ContainerRaws extends NodeRaws {
1003         indent?: string;
1004     }
1005     interface JsonContainer extends JsonNode {
1006         /**
1007          * Contains the container's children.
1008          */
1009         nodes?: Node[];
1010         /**
1011          * @returns The container's first child.
1012          */
1013         first?: Node;
1014         /**
1015          * @returns The container's last child.
1016          */
1017         last?: Node;
1018     }
1019     /**
1020      * Represents a CSS file and contains all its parsed nodes.
1021      */
1022     interface Root extends Container {
1023         /**
1024          * Inherited from Container. Should always be undefined for a Root node.
1025          */
1026         parent: Container;
1027         /**
1028          * @param overrides New properties to override in the clone.
1029          * @returns A clone of this node. The node and its (cloned) children will
1030          * have a clean parent and code style properties.
1031          */
1032         clone(overrides?: Object): Root;
1033         /**
1034          * @returns A Result instance representing the root's CSS.
1035          */
1036         toResult(options?: {
1037             /**
1038              * The path where you'll put the output CSS file. You should always
1039              * set "to" to generate correct source maps.
1040              */
1041             to?: string;
1042             map?: SourceMapOptions;
1043         }): Result;
1044         /**
1045          * Deprecated. Use Root#removeChild.
1046          */
1047         remove(child?: Node | number): Root;
1048         /**
1049          * Removes child from the root node, and the parent properties of node and
1050          * its children.
1051          * @param child Child or child's index.
1052          * @returns This root node for chaining.
1053          */
1054         removeChild(child: Node | number): Root;
1055     }
1056     interface RootNewProps extends ContainerNewProps {
1057     }
1058     interface JsonRoot extends JsonContainer {
1059     }
1060     /**
1061      * Represents an at-rule. If it's followed in the CSS by a {} block, this
1062      * node will have a nodes property representing its children.
1063      */
1064     interface AtRule extends Container {
1065         /**
1066          * The identifier that immediately follows the @.
1067          */
1068         name: string;
1069         /**
1070          * These are the values that follow the at-rule's name, but precede any {}
1071          * block. The spec refers to this area as the at-rule's "prelude".
1072          */
1073         params: string;
1074         /**
1075          * @param overrides New properties to override in the clone.
1076          * @returns A clone of this node. The node and its (cloned) children will
1077          * have a clean parent and code style properties.
1078          */
1079         clone(overrides?: Object): AtRule;
1080     }
1081     interface AtRuleNewProps extends ContainerNewProps {
1082         /**
1083          * The identifier that immediately follows the @.
1084          */
1085         name?: string;
1086         /**
1087          * These are the values that follow the at-rule's name, but precede any {}
1088          * block. The spec refers to this area as the at-rule's "prelude".
1089          */
1090         params?: string | number;
1091         raws?: AtRuleRaws;
1092     }
1093     interface AtRuleRaws extends NodeRaws {
1094         params?: string;
1095     }
1096     interface JsonAtRule extends JsonContainer {
1097         /**
1098          * The identifier that immediately follows the @.
1099          */
1100         name?: string;
1101         /**
1102          * These are the values that follow the at-rule's name, but precede any {}
1103          * block. The spec refers to this area as the at-rule's "prelude".
1104          */
1105         params?: string;
1106     }
1107     /**
1108      * Represents a CSS rule: a selector followed by a declaration block.
1109      */
1110     interface Rule extends Container {
1111         /**
1112          * Returns the rule's parent node.
1113          */
1114         parent: Container;
1115         /**
1116          * The rule's full selector. If there are multiple comma-separated selectors,
1117          * the entire group will be included.
1118          */
1119         selector: string;
1120         /**
1121          * An array containing the rule's individual selectors.
1122          * Groups of selectors are split at commas.
1123          */
1124         selectors?: string[];
1125         /**
1126          * @param overrides New properties to override in the clone.
1127          * @returns A clone of this node. The node and its (cloned) children will
1128          * have a clean parent and code style properties.
1129          */
1130         clone(overrides?: Object): Rule;
1131     }
1132     interface RuleNewProps extends ContainerNewProps {
1133         /**
1134          * The rule's full selector. If there are multiple comma-separated selectors,
1135          * the entire group will be included.
1136          */
1137         selector?: string;
1138         /**
1139          * An array containing the rule's individual selectors. Groups of selectors
1140          * are split at commas.
1141          */
1142         selectors?: string[];
1143         raws?: RuleRaws;
1144     }
1145     interface RuleRaws extends ContainerRaws {
1146         /**
1147         * The rule's full selector. If there are multiple comma-separated selectors,
1148         * the entire group will be included.
1149         */
1150         selector?: string;
1151     }
1152     interface JsonRule extends JsonContainer {
1153         /**
1154          * The rule's full selector. If there are multiple comma-separated selectors,
1155          * the entire group will be included.
1156          */
1157         selector?: string;
1158         /**
1159          * An array containing the rule's individual selectors.
1160          * Groups of selectors are split at commas.
1161          */
1162         selectors?: string[];
1163     }
1164     /**
1165      * Represents a CSS declaration.
1166      */
1167     interface Declaration extends Node {
1168         /**
1169          * The declaration's property name.
1170          */
1171         prop: string;
1172         /**
1173          * The declaration's value. This value will be cleaned of comments. If the
1174          * source value contained comments, those comments will be available in the
1175          * _value.raws property. If you have not changed the value, the result of
1176          * decl.toString() will include the original raws value (comments and all).
1177          */
1178         value: string;
1179         /**
1180          * True if the declaration has an !important annotation.
1181          */
1182         important: boolean;
1183         /**
1184          * @param overrides New properties to override in the clone.
1185          * @returns A clone of this node. The node and its (cloned) children will
1186          * have a clean parent and code style properties.
1187          */
1188         clone(overrides?: Object): Declaration;
1189     }
1190     interface DeclarationNewProps {
1191         /**
1192          * The declaration's property name.
1193          */
1194         prop?: string;
1195         /**
1196          * The declaration's value. This value will be cleaned of comments. If the
1197          * source value contained comments, those comments will be available in the
1198          * _value.raws property. If you have not changed the value, the result of
1199          * decl.toString() will include the original raws value (comments and all).
1200          */
1201         value?: string;
1202         raws?: DeclarationRaws;
1203     }
1204     interface DeclarationRaws extends NodeRaws {
1205         /**
1206          * The declaration's value. This value will be cleaned of comments.
1207          * If the source value contained comments, those comments will be
1208          * available in the _value.raws property. If you have not changed the value, the result of
1209          * decl.toString() will include the original raws value (comments and all).
1210          */
1211         value?: string;
1212     }
1213     interface JsonDeclaration extends JsonNode {
1214         /**
1215          * True if the declaration has an !important annotation.
1216          */
1217         important?: boolean;
1218     }
1219     /**
1220      * Represents a comment between declarations or statements (rule and at-rules).
1221      * Comments inside selectors, at-rule parameters, or declaration values will
1222      * be stored in the Node#raws properties.
1223      */
1224     interface Comment extends Node {
1225         /**
1226          * The comment's text.
1227          */
1228         text: string;
1229         /**
1230          * @param overrides New properties to override in the clone.
1231          * @returns A clone of this node. The node and its (cloned) children will
1232          * have a clean parent and code style properties.
1233          */
1234         clone(overrides?: Object): Comment;
1235     }
1236     interface CommentNewProps {
1237         /**
1238          * The comment's text.
1239          */
1240         text?: string;
1241     }
1242     interface JsonComment extends JsonNode {
1243     }
1244 }
1245 export default postcss;