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