3 namespace Drupal\libraries\Plugin\libraries\Type;
5 use Drupal\libraries\ExternalLibrary\Asset\AssetLibrary;
6 use Drupal\libraries\ExternalLibrary\Asset\AttachableAssetLibraryRegistrationInterface;
7 use Drupal\libraries\ExternalLibrary\LibraryInterface;
8 use Drupal\libraries\ExternalLibrary\LibraryManagerInterface;
9 use Drupal\libraries\ExternalLibrary\Type\LibraryTypeBase;
12 * @LibraryType("asset")
14 class AssetLibraryType extends LibraryTypeBase implements AttachableAssetLibraryRegistrationInterface {
19 public function getLibraryClass() {
20 return AssetLibrary::class;
26 public function getAttachableAssetLibraries(LibraryInterface $library, LibraryManagerInterface $library_manager) {
27 assert('$library instanceof \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface');
28 /** @var \Drupal\libraries\ExternalLibrary\Asset\AssetLibraryInterface $library */
29 return [$library->getId() => $library->getAttachableAssetLibrary($library_manager)];