3 namespace Drupal\Core\Asset;
6 * Resolves the dependencies of asset (CSS/JavaScript) libraries.
8 interface LibraryDependencyResolverInterface {
11 * Gets the given libraries with their dependencies.
13 * Given ['core/a', 'core/b', 'core/c'], with core/a depending on core/c and
14 * core/b on core/d, returns ['core/a', 'core/b', 'core/c', 'core/d'].
16 * @param string[] $libraries
17 * A list of libraries, in the order they should be loaded.
20 * A list of libraries, in the order they should be loaded, including their
23 public function getLibrariesWithDependencies(array $libraries);
26 * Gets the minimal representative subset of the given libraries.
28 * A minimal representative subset means that any library in the given set of
29 * libraries that is a dependency of another library in the set, is removed.
31 * Hence a minimal representative subset is the most compact representation
32 * possible of a set of libraries.
34 * (Each asset library has dependencies and can therefore be seen as a tree.
35 * Hence the given list of libraries represent a forest. This function returns
36 * all roots of trees that are not a subtree of another tree in the forest.)
38 * @param string[] $libraries
42 * A representative subset of the given set of libraries.
44 public function getMinimalRepresentativeSubset(array $libraries);