Updated from some -dev modules to alpha, beta or full releases
[yaffs-website] / node_modules / uncss / node_modules / postcss / d.ts / node.d.ts
1 import Container from './container';
2 import CssSyntaxError from './css-syntax-error';
3 import postcss from './postcss';
4 import Result from './result';
5 export default class Node implements postcss.Node {
6     /**
7      * Returns a string representing the node's type. Possible values are
8      * root, atrule, rule, decl or comment.
9      */
10     type: string;
11     /**
12      * Contains information to generate byte-to-byte equal node string as it
13      * was in origin input.
14      */
15     raws: postcss.NodeRaws;
16     /**
17      * Returns the node's parent node.
18      */
19     parent: Container;
20     /**
21      * Returns the input source of the node. The property is used in source map
22      * generation. If you create a node manually (e.g., with postcss.decl() ),
23      * that node will not have a  source  property and will be absent from the
24      * source map. For this reason, the plugin developer should consider cloning
25      * nodes to create new ones (in which case the new node's source will
26      * reference the original, cloned node) or setting the source property
27      * manually.
28      */
29     source: postcss.NodeSource;
30     constructor(defaults?: Object);
31     /**
32      * This method produces very useful error messages. If present, an input
33      * source map will be used to get the original position of the source, even
34      * from a previous compilation step (e.g., from Sass compilation).
35      * @returns The original position of the node in the source, showing line
36      * and column numbers and also a small excerpt to facilitate debugging.
37      */
38     error(
39         /**
40          * Error description.
41          */
42         message: string, options?: postcss.NodeErrorOptions): CssSyntaxError;
43     /**
44      * Creates an instance of Warning and adds it to messages. This method is
45      * provided as a convenience wrapper for Result#warn.
46      * Note that `opts.node` is automatically passed to Result#warn for you.
47      * @param result The result that will receive the warning.
48      * @param text Warning message. It will be used in the `text` property of
49      * the message object.
50      * @param opts Properties to assign to the message object.
51      */
52     warn(result: Result, text: string, opts?: postcss.WarningOptions): void;
53     /**
54      * Removes the node from its parent and cleans the parent property in the
55      * node and its children.
56      * @returns This node for chaining.
57      */
58     remove(): this;
59     /**
60      * @returns A CSS string representing the node.
61      */
62     toString(stringifier?: any): string;
63     /**
64      * @param overrides New properties to override in the clone.
65      * @returns A clone of this node. The node and its (cloned) children will
66      * have a clean parent and code style properties.
67      */
68     clone(overrides?: Object): Node;
69     /**
70      * Shortcut to clone the node and insert the resulting cloned node before
71      * the current node.
72      * @param overrides New Properties to override in the clone.
73      * @returns The cloned node.
74      */
75     cloneBefore(overrides?: Object): Node;
76     /**
77      * Shortcut to clone the node and insert the resulting cloned node after
78      * the current node.
79      * @param overrides New Properties to override in the clone.
80      * @returns The cloned node.
81      */
82     cloneAfter(overrides?: Object): Node;
83     /**
84      * Inserts node(s) before the current node and removes the current node.
85      * @returns This node for chaining.
86      */
87     replaceWith(...nodes: (Node | Object)[]): this;
88     /**
89      * Removes the node from its current parent and inserts it at the end of
90      * newParent. This will clean the before and after code style properties
91      * from the node and replace them with the indentation style of newParent.
92      * It will also clean the between property if newParent is in another Root.
93      * @param newParent Where the current node will be moved.
94      * @returns This node for chaining.
95      */
96     moveTo(newParent: Container): this;
97     /**
98      * Removes the node from its current parent and inserts it into a new
99      * parent before otherNode. This will also clean the node's code style
100      * properties just as it would in node.moveTo(newParent).
101      * @param otherNode Will be after the current node after moving.
102      * @returns This node for chaining.
103      */
104     moveBefore(otherNode: Node): this;
105     /**
106      * Removes the node from its current parent and inserts it into a new
107      * parent after otherNode. This will also clean the node's code style
108      * properties just as it would in node.moveTo(newParent).
109      * @param otherNode Will be before the current node after moving.
110      * @returns This node for chaining.
111      */
112     moveAfter(otherNode: Node): this;
113     /**
114      * @returns The next child of the node's parent; or, returns undefined if
115      * the current node is the last child.
116      */
117     next(): Node;
118     /**
119      * @returns The previous child of the node's parent; or, returns undefined
120      * if the current node is the first child.
121      */
122     prev(): Node;
123     toJSON(): postcss.JsonNode;
124     /**
125      * @param prop Name or code style property.
126      * @param defaultType Name of default value. It can be easily missed if the
127      * value is the same as prop.
128      * @returns A code style property value. If the node is missing the code
129      * style property (because the node was manually built or cloned), PostCSS
130      * will try to autodetect the code style property by looking at other nodes
131      * in the tree.
132      */
133     raw(prop: string, defaultType?: string): any;
134     /**
135      * @returns The Root instance of the node's tree.
136      */
137     root(): any;
138     cleanRaws(keepBetween?: boolean): void;
139     positionInside(index: number): {
140         line: number;
141         column: number;
142     };
143     positionBy(options: any): {
144         column: number;
145         line: number;
146     };
147     /**
148      * Deprecated. Use Node#remove.
149      */
150     removeSelf(): void;
151     replace(nodes: any): this;
152     style(prop: string, defaultType?: string): any;
153     cleanStyles(keepBetween?: boolean): void;
154     before: string;
155     between: string;
156 }