processor.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031
  1. import LazyResult from './lazy-result';
  2. import * as postcss from './postcss';
  3. import Result from './result';
  4. export default class Processor implements postcss.Processor {
  5. /**
  6. * Contains the current version of PostCSS (e.g., "5.0.19").
  7. */
  8. version: '5.0.19';
  9. /**
  10. * Contains plugins added to this processor.
  11. */
  12. plugins: postcss.Plugin<any>[];
  13. constructor(plugins?: (typeof postcss.acceptedPlugin)[]);
  14. /**
  15. * Adds a plugin to be used as a CSS processor. Plugins can also be
  16. * added by passing them as arguments when creating a postcss instance.
  17. */
  18. use(plugin: typeof postcss.acceptedPlugin): this;
  19. /**
  20. * Parses source CSS. Because some plugins can be asynchronous it doesn't
  21. * make any transformations. Transformations will be applied in LazyResult's
  22. * methods.
  23. * @param css Input CSS or any object with toString() method, like a file
  24. * stream. If a Result instance is passed the processor will take the
  25. * existing Root parser from it.
  26. */
  27. process(css: string | {
  28. toString(): string;
  29. } | Result, options?: postcss.ProcessOptions): LazyResult;
  30. private normalize(plugins);
  31. }