3 namespace Drupal\Core\Render;
6 * Defines an interface for responses that can expose #attached metadata.
8 * @todo If in Drupal 9, we remove attachments other than assets (libraries +
9 * drupalSettings), then we can look into unifying this with
10 * \Drupal\Core\Asset\AttachedAssetsInterface.
12 * @see \Drupal\Core\Render\AttachmentsTrait
14 interface AttachmentsInterface {
22 public function getAttachments();
27 * @param array $attachments
28 * The attachments to add.
32 public function addAttachments(array $attachments);
37 * @param array $attachments
38 * The attachments to set.
42 public function setAttachments(array $attachments);