-
Notifications
You must be signed in to change notification settings - Fork 172
/
LuigiContainer.svelte.d.ts
205 lines (179 loc) · 6.13 KB
/
LuigiContainer.svelte.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
export declare interface WebComponentSettings {
type?: string;
selfRegistered?: boolean;
tagName?: string;
}
export default class LuigiContainer extends HTMLElement {
/**
* The URL of the microfrontend to be rendered
*
* @since 1.0.0
*/
viewurl: string;
/**
* If set to true defers from initializing the microfronted automatically. In that case init() can be used
*
* @since 1.0.0
*/
deferInit: boolean;
/**
* The stringified context object to be passed to the microfrontend
* @since 1.0.0
*/
context: string;
/**
* Label information for the microfrontend
* @since 1.0.0
*/
label: string;
/**
* Predicate that sets whether the microfrontend is to be rendered in a web component or not. It can also be an object with the following attributes:
* @param {boolean} specifies if a microfrontend is a webcomponent or not without any other settings.
* @param {Object} [WebComponentSettings] specifies that the microfrontend is a webcomponent with addtional settings.
* @param {string} WebComponentSettings.type: string, like module.
* @param {boolean} WebComponentSettings.selfRegistered: if it is true, the web component bundle will be added via script tag.
* @param {string} WebComponentSettings.tagName: tag name where web component is added to DOM.
* @param {string} string must be a stringified boolean or JSON object from type `WebComponentSettings`.
*
* </br></br>
* <blockquote class="warning">
* <p>
* <strong>Note:</strong> If you have to use the mechanism of `selfRegistered`, we recommend using the following code in your web component:
* </p>
* </blockquote>
* <pre><code>
* window.Luigi._registerWebcomponent(new URL(document.currentScript?.getAttribute('src'), location), <YOUR_WEBCOMPONENT_CLASS>);
* </code></pre>
* The advantage of this line of code is: you don't have to specify a tag name, thus avoiding the duplication of self-defined tag names.
* </br>
* @since 1.0.0
*/
webcomponent: boolean | WebComponentSettings | string;
/**
* The locale to be passed to the web-component-based micro frontend
* @since 1.0.0
*/
locale: string;
/**
* The theme to be passed to the web-component-based micro frontend
* @since 1.0.0
*/
theme: string;
/**
* The list of active feature toggles to be passed to the web-component-based micro frontend
* @since 1.0.0
*/
activeFeatureToggleList: string[];
/**
* If set to true, skips handshake and ready event is fired immediately
* @since 1.0.0
*/
skipInitCheck: boolean;
/**
* The parameters to be passed to the web-component-based micro frontend. Will not be passed to the compound children.
* @since 1.0.0
*/
nodeParams: Object;
/**
* If set to true, the Luigi container webcomponent will not use the shadow DOM for rendering.
* @since NEXTRELEASE
*/
noShadow: boolean;
/**
* The search parameters to be passed to the web-component-based micro frontend.
* @since 1.0.0
*/
searchParams: Object;
/**
* The path parameters to be passed to the web-component-based micro frontend.
* @since 1.0.0
*/
pathParams: Object;
/**
* The clientPermissions to be passed to the web-component-based micro frontend.
* @since 1.0.0
*/
clientPermissions: Object;
/**
* The user settings to be passed to the web-component-based micro frontend
* @since 1.0.0
*/
userSettings: Object;
/**
* The anchor value to be passed to the web-component-based micro frontend.
* @since 1.0.0
*/
anchor: string;
/**
* The list of rules for the content in the iframe, managed by the HTML `allow` attribute.
* You can use one or more rules by adding them to the array, for example allowRules: ["microphone", "camera"].
* @since NEXT_RELEASE_CONTAINER
*/
allowRules: string[];
/**
* The list of rules for the content in the iframe, managed by the HTML `sandbox` attribute.
* You can use one or more rules by adding them to the array, for example sandboxRules: ["allow-scripts", "allow-same-origin"].
* @since NEXT_RELEASE_CONTAINER
*/
sandboxRules: string[];
/**
* The document title value to be passed to the web-component-based micro frontend.
* @since NEXT_RELEASE_CONTAINER
*/
documentTitle: string;
/**
* The hasBack value to be passed to the web-component-based micro frontend.
* It indicates that there is one or more preserved views. Useful when you need to show a back button.
* @since NEXT_RELEASE_CONTAINER
*/
hasBack: string;
/**
* The dirty status value to be passed to the web-component-based micro frontend.
* It's used to indicate that there are unsaved changes when navigating away.
* @since NEXT_RELEASE_CONTAINER
*/
dirtyStatus: boolean;
/**
* Function that updates the context of the microfrontend
* @param {Object} contextObj The context data
* @param {Object} internal internal luigi legacy data used for iframes
*
* @example
* containerElement.updateContext({newContextData: 'some data'})
* @since 1.0.0
*/
updateContext(contextObj: Object, internal?: Object): void;
/**
* Send a custom message to the microfronted
* @param id a string containing the message id
* @param data data to be sent alongside the custom message
*
* @example
* containerElement.sendCustomMessage('my-message-id', {dataToSend: 'some data'})
* @since 1.0.0
*/
sendCustomMessage(id: string, data?: Object): void;
/**
* A function that notifies the microfrontend that the opened alert has been closed
* @param id the id of the opened alert
* @param dismissKey the key specifying which dismiss link was clicked on the alert message
*
* @example
* containerElement.closeAlert('my-alert-id', 'my-dismiss-key')
* @since 1.0.0
*/
closeAlert(id: string, dismissKey: string): void;
/**
* Manually triggers the micro frontend rendering process when using defer-init attribute
*
* @example
* containerElement.init()
* @since 1.0.0
*/
init(): void;
/**
* The authData value to be passed to the iframe-based micro frontend.
* @since NEXT_RELEASE_CONTAINER
*/
authData: Object;
}