interface.LessEngine.inc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Interface \LessEngineInterface
  4. */
  5. interface LessEngineInterface {
  6. /**
  7. * Set list of lookup directories for @import statements.
  8. *
  9. * @param string[] $directories
  10. * Flat array of paths relative to DRUPAL_ROOT.
  11. */
  12. public function setImportDirectories(array $directories);
  13. /**
  14. * Enable
  15. *
  16. * @param bool $enabled
  17. * Set the source maps flag.
  18. * @param string $base_path
  19. * Leading value to be stripped from each source map URL.
  20. * @link http://lesscss.org/usage/#command-line-usage-source-map-basepath
  21. * @param string $root_path
  22. * Value to be prepended to each source map URL.
  23. * @link http://lesscss.org/usage/#command-line-usage-source-map-rootpath
  24. */
  25. public function setSourceMaps($enabled, $base_path, $root_path);
  26. /**
  27. * Set/override variables.
  28. *
  29. * Variables defined here work in the "modify" method. They are applied after
  30. * parsing but before compilation.
  31. *
  32. * @param string[] $variables
  33. *
  34. * @link http://lesscss.org/usage/#command-line-usage-modify-variable
  35. */
  36. public function modifyVariables(array $variables);
  37. /**
  38. * Returns list of dependencies.
  39. *
  40. * Returns a list of files that included through @import statements. This list
  41. * is used to determine if parent file needs to be recompiled based on changes
  42. * in dependencies.
  43. *
  44. * @return string[]
  45. * List of paths relative to DRUPAL_ROOT
  46. */
  47. public function getDependencies();
  48. /**
  49. * This returns the compiled output from the LESS engine.
  50. *
  51. * All output, including source maps, should be contained within the returned
  52. * string.
  53. *
  54. * @return string
  55. * Plain CSS.
  56. *
  57. * @throws Exception
  58. * Rethrows exception from implementation library.
  59. */
  60. public function compile();
  61. }