1: <?php
2:
3: namespace LaravelUi5\Core\Ui5\Contracts;
4:
5: /**
6: * Interface Ui5AppInterface
7: *
8: * Defines a full-featured UI5 Application that is both a client-side OpenUI5 entry point
9: * and a backend-accessible OData service. Implementors who want to offer oData endpoints
10: * should extend the ServiceEndpointInterface required by `flat3/lodata`.
11: *
12: * Apps implementing this interface are registered via the Ui5Registry and can dynamically
13: * provide their UI5 manifest data, routing, UI bootstrap configuration, and static assets.
14: *
15: * The Laravel side will render a default `index.blade.php` layout and inject metadata,
16: * UI5 bootstrap attributes, resource roots, and any custom styles or inline scripts.
17: *
18: * @see Ui5ArtifactInterface
19: * @see HasAssetsInterface
20: * @see VendorTaggedInterface
21: * @see SluggableInterface
22: */
23: interface Ui5AppInterface extends Ui5ArtifactInterface, HasAssetsInterface, VendorTaggedInterface, SluggableInterface
24: {
25: /**
26: * Returns a key-value map of sap-ui bootstrap attributes
27: * (e.g. theme, async, compatVersion, oninit, etc.).
28: *
29: * These will be injected into the UI5 bootstrap script tag.
30: *
31: * @return array<string, string>
32: */
33: public function getUi5BootstrapAttributes(): array;
34:
35: /**
36: * Returns a list of all required resource roots for this app.
37: * The keys are the JS namespaces.
38: *
39: * Example: ['io.pragmatiqu.portal', 'io.pragmatiqu.tools']
40: *
41: * @return array<string, string>
42: */
43: public function getResourceNamespaces(): array;
44:
45: /**
46: * Optional inline JavaScript to be included in the <head> tag.
47: *
48: * Typically used for sap.ui.loader.config(...) blocks.
49: *
50: * @return string|null
51: */
52: public function getAdditionalHeadScript(): ?string;
53:
54: /**
55: * Optional inline CSS styles to be included in the <head> tag.
56: *
57: * @return string|null
58: */
59: public function getAdditionalInlineCss(): ?string;
60:
61: /**
62: * Returns the absolute path to the raw manifest.json file
63: * as shipped by the frontend UI5 application.
64: *
65: * This method is used by the Laravel ManifestController to read
66: * the complete manifest structure (`sap.app`, `sap.ui`, `sap.ui5`)
67: * without having to reconstruct it from PHP.
68: *
69: * @return string Absolute filesystem path to manifest.json
70: */
71: public function getManifestPath(): string;
72:
73: /**
74: * Returns Laravel-specific manifest data to be injected
75: * under the `laravel.ui5` root key in the final manifest.json.
76: *
77: * This section may include definitions such as `abilities`, `actions`,
78: * `settings`, `reports`, or other backend-managed frontend metadata.
79: *
80: * @return LaravelUi5ManifestInterface
81: */
82: public function getLaravelUiManifest(): LaravelUi5ManifestInterface;
83: }
84: