From 55fca1d5c5e9cd4f23f14eab930e2ae089bc52fe Mon Sep 17 00:00:00 2001 From: eschmittel Date: Mon, 7 Oct 2024 16:57:04 +0200 Subject: [PATCH] feat PA-4828: Adjust renderAuthComponent interface --- src/ps-web-apis.ts | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/ps-web-apis.ts b/src/ps-web-apis.ts index 153142a..a927132 100644 --- a/src/ps-web-apis.ts +++ b/src/ps-web-apis.ts @@ -181,13 +181,17 @@ export interface WhoamiV1 { * @param container - The HTML element in which the Wonderwall should be rendered. * The container should be an HTML element. * - * @param props - The props that should be passed, which will be used to render the Wonderwall. - * The props should contain the template and variant. - * The props can optional contain the headline and ctaText. + * @param {Object} props - The props that should be passed, which will be passed to the auth component. + * @param {String} props.template - valid choices are "register" and "login" + * @param {String} props.variant - variant of the brand that should be shown e.g bild or welt + * @param {boolean} [props.abortable] - user can leave auth screen if true (not yet implemented) + * @param {String} [props.loginHeadline] + * @param {String} [props.registerHeadline] + * @param {String} [props.loginCta] + * @param {String} [props.registerCta] * - * @param abortable - If true, the Wonderwall can be aborted by the user. */ - renderAuthComponent(container: HTMLElement, props: WonderwallProps, abortable: boolean): Promise; + renderAuthComponent(container: HTMLElement, props: WonderwallProps): Promise; } export interface AuthRes { @@ -195,11 +199,28 @@ export interface AuthRes { message: string; } +export type WonderwallVariant = + | "welt" + | "bild" + | "bild-tv" + | "sportbild" + | "bild-markenshop" + | "osp" + | "computerbild-vip-lounge" + | "autobild" + | "autobild-vip-lounge" + | "sportbild-fanmeile" + | "lidlbild" + | "bz"; + export type WonderwallProps = { template: "login" | "register"; - variant: string; - headline?: string; - ctaText?: string; + variant: WonderwallVariant; + abortable?: boolean; + loginHeadline: string; + registerHeadline: string; + loginCta?: string; + registerCta?: string; }; export interface UtilsV1 {