3 namespace Drupal\bootstrap\Plugin\Provider;
5 use Drupal\Component\Plugin\DerivativeInspectionInterface;
6 use Drupal\Component\Plugin\PluginInspectionInterface;
11 * @ingroup plugins_provider
13 interface ProviderInterface extends PluginInspectionInterface, DerivativeInspectionInterface {
16 * Retrieves the API URL if set.
21 public function getApi();
24 * Retrieves Provider assets for the active provider, if any.
26 * @param string|array $types
27 * The type of asset to retrieve: "css" or "js", defaults to an array
28 * array containing both if not set.
31 * If $type is a string or an array with only one (1) item in it, the
32 * assets are returned as an indexed array of files. Otherwise, an
33 * associative array is returned keyed by the type.
35 public function getAssets($types = NULL);
38 * Retrieves the provider description.
41 * The provider description.
43 public function getDescription();
46 * Retrieves the provider human-readable label.
49 * The provider human-readable label.
51 public function getLabel();
54 * Retrieves the themes supported by the CDN provider.
57 * An array of themes. If the CDN provider does not support any it will
58 * just be an empty array.
60 public function getThemes();
63 * Retrieves the versions supported by the CDN provider.
66 * An array of versions. If the CDN provider does not support any it will
67 * just be an empty array.
69 public function getVersions();
72 * Flag indicating that the API data parsing failed.
77 public function hasError();
80 * Flag indicating that the API data was manually imported.
85 public function isImported();
88 * Processes the provider plugin definition upon discovery.
90 * @param array $definition
91 * The provider plugin definition.
92 * @param string $plugin_id
93 * The plugin identifier.
95 public function processDefinition(array &$definition, $plugin_id);
98 * Processes the provider plugin definition upon discovery.
101 * The JSON data retrieved from the API request.
102 * @param array $definition
103 * The provider plugin definition.
105 public function processApi(array $json, array &$definition);