IFrontendDefinition.php 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\Files_External\Lib;
  7. interface IFrontendDefinition {
  8. public function getText(): string;
  9. public function setText(string $text): self;
  10. /**
  11. * @return array<string, DefinitionParameter>
  12. */
  13. public function getParameters(): array;
  14. /**
  15. * @param list<DefinitionParameter> $parameters
  16. */
  17. public function addParameters(array $parameters): self;
  18. public function addParameter(DefinitionParameter $parameter): self;
  19. /**
  20. * @return string[]
  21. */
  22. public function getCustomJs(): array;
  23. public function addCustomJs(string $custom): self;
  24. /**
  25. * Serialize into JSON for client-side JS
  26. */
  27. public function jsonSerializeDefinition(): array;
  28. /**
  29. * Check if parameters are satisfied in a StorageConfig
  30. */
  31. public function validateStorageDefinition(StorageConfig $storage): bool;
  32. }