From 89a257456107910cc706165ca2f572a2b30007fc Mon Sep 17 00:00:00 2001 From: Luca Esposito Date: Fri, 27 Sep 2024 15:13:33 +0200 Subject: [PATCH] PA-4774 extended WhoamiV1 interface for Wonderwal --- src/ps-web-apis.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/ps-web-apis.ts b/src/ps-web-apis.ts index 53b436b..5216937 100644 --- a/src/ps-web-apis.ts +++ b/src/ps-web-apis.ts @@ -174,8 +174,31 @@ export interface WhoamiV1 { * @throws error */ getJaId(): string; + + /** + * will render the Wonderwall in the given container with the given props and call the callback after main functionality is done + * + * @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 callback - The callback that should be called after the main functionality is done. + * The callback should be a function + * + */ + renderWonderwall(container: HTMLElement, props: WonderwallProps, callback?: () => void): void; } +export type WonderwallProps = { + template: string; + variant: string; + headline?: string; + ctaText?: string; +}; + export interface UtilsV1 { fetchWithTimeout: Fetch; getRosettaEnvByKey: GetRosettaEnvByKey;