Skip to content

Commit

Permalink
PA-4774 extended WhoamiV1 interface for Wonderwal
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca-Esposito committed Sep 27, 2024
1 parent 1d8045b commit 89a2574
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/ps-web-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 89a2574

Please sign in to comment.