3 namespace Drupal\libraries\ExternalLibrary\Definition;
6 * Provides an interface for library definition discoveries.
8 * This is similar to the plugin system's DiscoveryInterface, except that this
9 * does not require knowing all definitions upfront, so there is no
10 * getDefinitions() method.
12 * @see \Drupal\Component\Plugin\Discovery\DiscoveryInterface
16 interface DefinitionDiscoveryInterface {
19 * Checks whether a library definition exists.
25 * TRUE if a library definition with the given ID exists; FALSE otherwise.
27 public function hasDefinition($id);
30 * Gets a library definition by its ID.
36 * The library definition.
38 * @throws \Drupal\libraries\ExternalLibrary\Exception\LibraryDefinitionNotFoundException
40 * @todo Consider returning a classed object instead of an array or at least
41 * document and validate the array structure.
43 public function getDefinition($id);