Interface ContactMethods

interface ContactMethods {
    close: () => Promise<boolean>;
    getServicePoints: () => Promise<EnrichedServicePoints>;
    isOpen: () => Promise<boolean>;
    open: (channel?: "chat" | "mail" | "digital-assistant") => Promise<boolean>;
    resetServicePoints: () => Promise<boolean>;
    setServicePoints: (
        args: Translatable<ServicePoints>,
    ) => Promise<Translatable<ServicePoints>>;
    toggle: () => Promise<boolean>;
}

Properties

close: () => Promise<boolean>

Close the contact panel.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      A promise that resolves to true if the contact panel was closed.

const isClosed = await globalHeaderClient.contact.close();
getServicePoints: () => Promise<EnrichedServicePoints>

Get the current service points

Type declaration

const servicePoints = await globalHeaderClient.contact.getServicePoints();
isOpen: () => Promise<boolean>

Check if the contact panel is open.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      A promise that resolves to true if the contact panel is open.

const isOpen = await globalHeaderClient.contact.isOpen();
open: (channel?: "chat" | "mail" | "digital-assistant") => Promise<boolean>

Open the contact panel with an optional channel.

Type declaration

    • (channel?: "chat" | "mail" | "digital-assistant"): Promise<boolean>
    • Parameters

      • Optionalchannel: "chat" | "mail" | "digital-assistant"

        The channel to open, either 'chat' or 'mail'. If no channel is specified, the contact panel overview is opened.

      Returns Promise<boolean>

      A promise that resolves to true if the contact panel was opened.

// Open the contact panel overview
const isOpen = await globalHeaderClient.contact.open();

// Open the chat directly
const isOpen = await globalHeaderClient.contact.open('chat');
resetServicePoints: () => Promise<boolean>

Reset the service points to the initial values from the configuration.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      A promise that resolves when the service points have been reset.

const success = await globalHeaderClient.contact.resetServicePoints();
setServicePoints: (
    args: Translatable<ServicePoints>,
) => Promise<Translatable<ServicePoints>>

Set the service points

Type declaration

const updatedServicePoints = await globalHeaderClient.contact.setServicePoints({
displayMode: "grouped",
groupLabel: "Neem contact op met een woonmaatschappij",
contextual: [
{ type: "contactOption", contactGroupId: "OVO002919" },
{ type: "contactOption", contactGroupId: "OVO002884" },
{ type: "contactOption", contactGroupId: "OVO002940" },
{ type: "contactOption", contactGroupId: "OVO039151" },
{ type: "contactOption", contactGroupId: "OVO025805" },
{ type: "contactOption", contactGroupId: "OVO002499" },
{ type: "link", href: "https://www.vlaanderen.be/wonen-in-vlaanderen/zoek-een-organisatie/", label: "Zoek een woonmaatschappij in uw buurt" }
],
defaults: [
{ type: "contactOption", contactGroupId: "vlaanderen", label: "Algemene contactopties van de Vlaamse overheid" },
{ type: "link", href: "https://www.google.be" }
]
});
toggle: () => Promise<boolean>

Toggle the contact panel.

Type declaration

    • (): Promise<boolean>
    • Returns Promise<boolean>

      A promise that resolves to true if the contact panel is now open.

const isToggled = await globalHeaderClient.contact.toggle();