1 import Processor from './processor';
2 import postcss from './postcss';
3 import Result from './result';
4 import Root from './root';
5 export default class LazyResult implements postcss.LazyResult {
13 * A promise proxy for the result of PostCSS transformations.
15 constructor(processor: Processor,
17 * String with input CSS or any object with toString() method, like a Buffer.
18 * Optionally, send Result instance and the processor will take the existing
19 * [Root] parser from it.
23 } | LazyResult | Result, opts?: postcss.ProcessOptions);
25 * @returns A processor used for CSS transformations.
29 * @returns Options from the Processor#process(css, opts) call that produced
30 * this Result instance.
32 opts: postcss.ResultOptions;
34 * Processes input CSS through synchronous plugins and converts Root to a
35 * CSS string. This property will only work with synchronous plugins. If
36 * the processor contains any asynchronous plugins it will throw an error.
37 * In this case, you should use LazyResult#then() instead.
41 * Alias for css property to use when syntaxes generate non-CSS output.
45 * Processes input CSS through synchronous plugins. This property will
46 * only work with synchronous plugins. If the processor contains any
47 * asynchronous plugins it will throw an error. In this case, you should
48 * use LazyResult#then() instead.
50 map: postcss.ResultMap;
52 * Processes input CSS through synchronous plugins. This property will only
53 * work with synchronous plugins. If the processor contains any asynchronous
54 * plugins it will throw an error. In this case, you should use
55 * LazyResult#then() instead.
59 * Processes input CSS through synchronous plugins. This property will only
60 * work with synchronous plugins. If the processor contains any asynchronous
61 * plugins it will throw an error. In this case, you should use
62 * LazyResult#then() instead.
64 messages: postcss.ResultMessage[];
66 * Processes input CSS through synchronous plugins and calls Result#warnings().
67 * This property will only work with synchronous plugins. If the processor
68 * contains any asynchronous plugins it will throw an error. In this case, you
69 * You should use LazyResult#then() instead.
71 warnings(): postcss.ResultMessage[];
73 * Alias for css property.
77 * Processes input CSS through synchronous and asynchronous plugins.
78 * @param onRejected Called if any plugin throws an error.
80 then(onFulfilled: (result: Result) => void, onRejected?: (error: Error) => void): Function | any;
82 * Processes input CSS through synchronous and asynchronous plugins.
83 * @param onRejected Called if any plugin throws an error.
85 catch(onRejected: (error: Error) => void): Function | any;
86 private handleError(error, plugin);
87 private asyncTick(resolve, reject);