4 * Contains \Drupal\bootstrap\Plugin\Provider\ProviderInterface.
7 namespace Drupal\bootstrap\Plugin\Provider;
9 use Drupal\Component\Plugin\DerivativeInspectionInterface;
10 use Drupal\Component\Plugin\PluginInspectionInterface;
15 * @ingroup plugins_provider
17 interface ProviderInterface extends PluginInspectionInterface, DerivativeInspectionInterface {
20 * Retrieves the API URL if set.
25 public function getApi();
28 * Retrieves Provider assets for the active provider, if any.
30 * @param string|array $types
31 * The type of asset to retrieve: "css" or "js", defaults to an array
32 * array containing both if not set.
35 * If $type is a string or an array with only one (1) item in it, the
36 * assets are returned as an indexed array of files. Otherwise, an
37 * associative array is returned keyed by the type.
39 public function getAssets($types = NULL);
42 * Retrieves the provider description.
45 * The provider description.
47 public function getDescription();
50 * Retrieves the provider human-readable label.
53 * The provider human-readable label.
55 public function getLabel();
58 * Retrieves the themes supported by the CDN provider.
61 * An array of themes. If the CDN provider does not support any it will
62 * just be an empty array.
64 public function getThemes();
67 * Retrieves the versions supported by the CDN provider.
70 * An array of versions. If the CDN provider does not support any it will
71 * just be an empty array.
73 public function getVersions();
76 * Flag indicating that the API data parsing failed.
81 public function hasError();
84 * Flag indicating that the API data was manually imported.
89 public function isImported();
92 * Processes the provider plugin definition upon discovery.
94 * @param array $definition
95 * The provider plugin definition.
96 * @param string $plugin_id
97 * The plugin identifier.
99 public function processDefinition(array &$definition, $plugin_id);
102 * Processes the provider plugin definition upon discovery.
105 * The JSON data retrieved from the API request.
106 * @param array $definition
107 * The provider plugin definition.
109 public function processApi(array $json, array &$definition);