import { ButtonStyle , Chain } from './interfaces' ; import { UALError } from './UALError' ; import { User } from './User' ; /**
 * Represents Button that is rendered for, and interfaces with, a specific Authenticator app.
 */ export abstract class Authenticator { /**
     * Default value for shouldInvalidateAfter(), 1 week in seconds
     */ private defaultInvalidateAfter = 604800 ; param chains param options constructor ( public chains , public options ? ) { } /**
     * Attempts to render the Authenticator and updates the authenticator's state, accordingly
     */ public abstract init ( ) ; /**
     * Resets the authenticator to its initial, default state then calls init method
     */ public abstract reset ( ) ; /**
     * Returns true if the authenticator has errored while initializing.
     */ public abstract isErrored ( ) ; /**
     * Returns a URL where the user can download and install the underlying authenticator
     * if it is not found by the UAL Authenticator.
     */ public abstract getOnboardingLink ( ) ; /**
     * Returns error (if available) if the authenticator has errored while initializing.
     */ public abstract getError ( ) ; /**
     * Returns true if the authenticator is loading while initializing its internal state.
     */ public abstract isLoading ( ) ; /**
     * Returns the style of the Button that will be rendered.
     */ public abstract getStyle ( ) ; /**
     * Returns whether or not the button should render based on the operating environment and other factors.
     * ie. If your Authenticator App does not support mobile, it returns false when running in a mobile browser.
     */ public abstract shouldRender ( ) ; /**
     * Returns whether or not the dapp should attempt to auto login with the Authenticator app.
     * Auto login will only occur when there is only one Authenticator that returns shouldRender() true and
     * shouldAutoLogin() true.
     */ public abstract shouldAutoLogin ( ) ; /**
     * Returns whether or not the button should show an account name input field.
     * This is for Authenticators that do not have a concept of account names.
     */ public abstract shouldRequestAccountName ( ) ; /**
     * Returns the amount of seconds after the authentication will be invalid for logging in on new
     * browser sessions.  Setting this value to zero will cause users to re-attempt authentication on
     * every new browser session.  Please note that the invalidate time will be saved client-side and
     * should not be relied on for security.
     */ public shouldInvalidateAfter ( ) { return this . defaultInvalidateAfter ; } param accountName public abstract login ( accountName ? ) ; /**
     * Logs the user out of the dapp. This will be strongly dependent on each Authenticator app's patterns.
     */ public abstract logout ( ) ; /**
     * Returns true if user confirmation is required for `getKeys`
     */ public abstract requiresGetKeyConfirmation ( ) ; /**
     * Returns the name of the authenticator.
     */ public abstract getName ( ) ; }