@govflanders/vl-widget-global-header-types 1.0.22 → 1.0.24

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/README.md CHANGED
@@ -82,12 +82,12 @@ import { GlobalHeaderClient, MainLink } from '@govflanders/vl-widget-global-head
82
82
  const client: GlobalHeaderClient = window.globalHeaderClient;
83
83
 
84
84
  const contactLink: MainLink = {
85
- title: 'Contact',
85
+ label: 'Contact',
86
86
  href: '/contact',
87
87
  };
88
88
 
89
89
  const feedbackLink: MainLink = {
90
- title: 'Feedback',
90
+ label: 'Feedback',
91
91
  href: 'https://example.com/feedback',
92
92
  isExternal: true,
93
93
  target: '_blank',
@@ -156,6 +156,18 @@ The `contact` object contains methods related to managing service points.
156
156
  - **resetServicePoints(): Promise\<boolean\>**
157
157
  Reset the service points to the initial values defined in the widget’s configuration.
158
158
 
159
+ - **open(): Promise\<boolean\>**
160
+ Opens the contact interface.
161
+
162
+ - **close(): Promise\<boolean\>**
163
+ Closes the contact interface.
164
+
165
+ - **toggle(): Promise\<boolean\>**
166
+ Toggles the visibility of the contact interface.
167
+
168
+ - **isOpen(): Promise\<boolean\>**
169
+ Checks whether the contact interface is currently open.
170
+
159
171
  ### accessMenu
160
172
 
161
173
  The `accessMenu` object contains methods for managing the access menu's links and profile.
@@ -183,6 +195,10 @@ Enable or disable the host and branding navigation.
183
195
 
184
196
  The `mount` method allows you to control where the **Global Header Widget** is rendered on the page. There are two main ways to integrate the widget, depending on whether you want to manually control its placement or let it render automatically:
185
197
 
198
+ ### unmount(): Promise\<boolean\>
199
+
200
+ The `unmount` method unmounts the widget from the element it's mounted at.
201
+
186
202
  1. **Using the 'entry' script**:
187
203
  When you include the widget via the following script:
188
204
 
@@ -249,25 +265,25 @@ For example, `setMainLinks` can accept single-language or multi-language links:
249
265
 
250
266
  ```typescript
251
267
  const singleLanguageLink: Translatable<MainLink> = {
252
- title: 'Home',
268
+ label: 'Home',
253
269
  href: 'https://www.example.com',
254
270
  };
255
271
 
256
272
  const multiLanguageLink: Translatable<MainLink> = {
257
273
  nl: {
258
- title: 'Startpagina',
274
+ label: 'Startpagina',
259
275
  href: 'https://www.example.com/nl',
260
276
  },
261
277
  en: {
262
- title: 'Home',
278
+ label: 'Home',
263
279
  href: 'https://www.example.com/en',
264
280
  },
265
281
  fr: {
266
- title: 'Accueil',
282
+ label: 'Accueil',
267
283
  href: 'https://www.example.com/fr',
268
284
  },
269
285
  de: {
270
- title: 'Startseite',
286
+ label: 'Startseite',
271
287
  href: 'https://www.example.com/de',
272
288
  },
273
289
  };
@@ -27,13 +27,13 @@ export interface CitizenProfileConfig {
27
27
  mainLinks?: MainLink[];
28
28
  }
29
29
  export interface MainLink {
30
- title: string;
30
+ label: string;
31
31
  href: string;
32
32
  isExternal?: boolean;
33
33
  target?: '_blank' | '_self' | '_parent' | '_top';
34
34
  }
35
35
  export interface ApplicationLink {
36
- title: string;
36
+ label: string;
37
37
  href: string;
38
38
  target?: string;
39
39
  icon?: 'e-desk' | 'e-desk-lock';
package/dist/client.d.ts CHANGED
@@ -138,6 +138,15 @@ export type Handlers = {
138
138
  * @returns A promise that resolves to true if the element was mounted, false otherwise
139
139
  */
140
140
  mount: Handler<HTMLElement | void, boolean>;
141
+ /**
142
+ * Unmount an element
143
+ * @returns A promise that resolves to true if the element was unmounted, false otherwise
144
+ */
145
+ unmount: Handler<undefined, boolean>;
146
+ openContact: Handler<undefined, boolean>;
147
+ closeContact: Handler<undefined, boolean>;
148
+ toggleContact: Handler<undefined, boolean>;
149
+ isContactOpen: Handler<undefined, boolean>;
141
150
  };
142
151
  type PromiseResolver<T> = (value: T | PromiseLike<T>) => void;
143
152
  type PromiseRejecter = (reason?: any) => void;
@@ -168,6 +177,10 @@ export interface GlobalHeaderClient {
168
177
  getServicePoints: ClientMethods['getServicePoints'];
169
178
  setServicePoints: ClientMethods['setServicePoints'];
170
179
  resetServicePoints: ClientMethods['resetServicePoints'];
180
+ open: ClientMethods['openContact'];
181
+ close: ClientMethods['closeContact'];
182
+ toggle: ClientMethods['toggleContact'];
183
+ isOpen: ClientMethods['isContactOpen'];
171
184
  };
172
185
  accessMenu: {
173
186
  setMainLinks: ClientMethods['setMainLinks'];
@@ -192,6 +205,7 @@ export interface GlobalHeaderClient {
192
205
  setNavigationEnabled: ClientMethods['setNavigationEnabled'];
193
206
  getConfig: ClientMethods['getConfig'];
194
207
  mount: ClientMethods['mount'];
208
+ unmount: ClientMethods['unmount'];
195
209
  }
196
210
  declare global {
197
211
  interface Window {
package/dist/idp.d.ts CHANGED
@@ -34,6 +34,6 @@ interface Authorization {
34
34
  }
35
35
  export interface IDPData {
36
36
  active: Authorization;
37
- identities: Authorization[];
37
+ identities?: Authorization[];
38
38
  }
39
39
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@govflanders/vl-widget-global-header-types",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "license": "MIT",
5
5
  "description": "TypeScript definitions for GlobalHeaderClient",
6
6
  "main": "",