@luigi-project/container 0.0.1 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LuigiCompoundContainer.svelte.d.ts +21 -0
- package/LuigiContainer.svelte.d.ts +8 -0
- package/README.md +4 -0
- package/bundle.js +2 -1472
- package/bundle.js.map +1 -1
- package/communication.service.d.ts +3 -0
- package/container.service.d.ts +8 -0
- package/index.d.ts +2 -0
- package/package.json +2 -1
- package/web-component-helpers.d.ts +44 -0
- package/webcomponents.service.d.ts +68 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ContainerService } from './container.service';
|
|
2
|
+
/** Methods for dealing with web components based micro frontend handling */
|
|
3
|
+
export declare class WebComponentService {
|
|
4
|
+
containerService: ContainerService;
|
|
5
|
+
constructor();
|
|
6
|
+
dynamicImport(viewUrl: any): Promise<any>;
|
|
7
|
+
processViewUrl(viewUrl: string, data?: any): string;
|
|
8
|
+
/** Creates a web component with tagname wc_id and adds it to wcItemContainer,
|
|
9
|
+
* if attached to wc_container
|
|
10
|
+
*/
|
|
11
|
+
attachWC(wc_id: any, wcItemPlaceholder: any, wc_container: any, ctx: any, viewUrl: any, nodeId: any): void;
|
|
12
|
+
createClientAPI(eventBusElement: any, nodeId: any, wc_id: any): {
|
|
13
|
+
linkManager: () => void;
|
|
14
|
+
uxManager: () => {
|
|
15
|
+
showAlert: (alertSettings: any) => void;
|
|
16
|
+
showConfirmationModal: (settings: any) => Promise<unknown>;
|
|
17
|
+
};
|
|
18
|
+
getCurrentLocale: () => void;
|
|
19
|
+
publishEvent: (ev: any) => void;
|
|
20
|
+
};
|
|
21
|
+
initWC(wc: any, wc_id: any, eventBusElement: any, viewUrl: any, ctx: any, nodeId: any): void;
|
|
22
|
+
/** Generates a unique web component id (tagname) based on the viewUrl
|
|
23
|
+
* returns a string that can be used as part of a tagname, only alphanumeric
|
|
24
|
+
* characters and no whitespaces.
|
|
25
|
+
*/
|
|
26
|
+
generateWCId(viewUrl: any): string;
|
|
27
|
+
/** Does a module import from viewUrl and defines a new web component
|
|
28
|
+
* with the default export of the module or the first export extending HTMLElement if no default is
|
|
29
|
+
* specified.
|
|
30
|
+
* @returns a promise that gets resolved after successfull import */
|
|
31
|
+
registerWCFromUrl(viewUrl: any, wc_id: any): Promise<unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Handles the import of self registered web component bundles, i.e. the web component
|
|
34
|
+
* is added to the customElements registry by the bundle code rather than by luigi.
|
|
35
|
+
*
|
|
36
|
+
* @param {*} node the corresponding navigation node
|
|
37
|
+
* @param {*} viewUrl the source of the wc bundle
|
|
38
|
+
* @param {*} onload callback function executed after script attached and loaded
|
|
39
|
+
*/
|
|
40
|
+
includeSelfRegisteredWCFromUrl(node: any, viewUrl: any, onload: any): void;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if a url is allowed to be included, based on 'navigation.validWebcomponentUrls' in luigi config.
|
|
43
|
+
* Returns true, if allowed.
|
|
44
|
+
*
|
|
45
|
+
* @param {*} url the url string to check
|
|
46
|
+
*/
|
|
47
|
+
checkWCUrl(url: any): boolean;
|
|
48
|
+
/** Adds a web component defined by viewUrl to the wc_container and sets the node context.
|
|
49
|
+
* If the web component is not defined yet, it gets imported.
|
|
50
|
+
*/
|
|
51
|
+
renderWebComponent(viewUrl: any, wc_container: any, context: any, node: any, nodeId: any): void;
|
|
52
|
+
/**
|
|
53
|
+
* Creates a compound container according to the given renderer.
|
|
54
|
+
* Returns a promise that gets resolved with the created container DOM element.
|
|
55
|
+
*
|
|
56
|
+
* @param {DefaultCompoundRenderer} renderer
|
|
57
|
+
*/
|
|
58
|
+
createCompoundContainerAsync(renderer: any, ctx: any): Promise<HTMLElement>;
|
|
59
|
+
/**
|
|
60
|
+
* Responsible for rendering web component compounds based on a renderer or a nesting
|
|
61
|
+
* micro frontend.
|
|
62
|
+
*
|
|
63
|
+
* @param {*} navNode the navigation node defining the compound
|
|
64
|
+
* @param {*} wc_container the web component container dom element
|
|
65
|
+
* @param {*} context the luigi node context
|
|
66
|
+
*/
|
|
67
|
+
renderWebComponentCompound(navNode: any, wc_container: any, context: any): Promise<unknown>;
|
|
68
|
+
}
|