Skip to content

Commit

Permalink
Merge pull request #71 from spring-media/PA-4774
Browse files Browse the repository at this point in the history
PA-4774 extended WhoamiV1 interface for Wonderwal
  • Loading branch information
Luca-Esposito authored Oct 1, 2024
2 parents 1d8045b + e31e0a8 commit 1c1f67e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/ps-web-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,34 @@ 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 abortable - If true, the Wonderwall can be aborted by the user.
*/
renderAuthComponent(container: HTMLElement, props: WonderwallProps, abortable: boolean): Promise<AuthRes>;
}

export interface AuthRes {
isLoggedIn: boolean;
message: string;
}

export type WonderwallProps = {
template: "login" | "register";
variant: string;
headline?: string;
ctaText?: string;
};

export interface UtilsV1 {
fetchWithTimeout: Fetch;
getRosettaEnvByKey: GetRosettaEnvByKey;
Expand Down

0 comments on commit 1c1f67e

Please sign in to comment.