1
0

IFrontendDefinition.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * @copyright 2022 Carl Schwan <carl@carlschwan.eu>
  4. *
  5. * @license AGPL-3.0-or-later
  6. *
  7. * This code is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Affero General Public License, version 3,
  9. * as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU Affero General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Affero General Public License, version 3,
  17. * along with this program. If not, see <http://www.gnu.org/licenses/>
  18. *
  19. */
  20. namespace OCA\Files_External\Lib;
  21. interface IFrontendDefinition {
  22. public function getText(): string;
  23. public function setText(string $text): self;
  24. /**
  25. * @return array<string, DefinitionParameter>
  26. */
  27. public function getParameters(): array;
  28. /**
  29. * @param list<DefinitionParameter> $parameters
  30. */
  31. public function addParameters(array $parameters): self;
  32. public function addParameter(DefinitionParameter $parameter): self;
  33. /**
  34. * @return string[]
  35. */
  36. public function getCustomJs(): array;
  37. public function addCustomJs(string $custom): self;
  38. /**
  39. * Serialize into JSON for client-side JS
  40. */
  41. public function jsonSerializeDefinition(): array;
  42. /**
  43. * Check if parameters are satisfied in a StorageConfig
  44. */
  45. public function validateStorageDefinition(StorageConfig $storage): bool;
  46. }