/** Angular 2 */ import * as ng from "@angular/core"; import * as ngRouter from "@angular/router"; /** Core */ import { CoreComponent } from "cmf.core/src/core"; import { SecurityAuthConfig } from "cmf.core/src/domain/extensions/security"; import Cmf from "cmf.lbos"; import { AuthProvider } from "../authProvider"; export declare enum ReadPhase { Token = 0, Pin = 1 } /** * @whatItDoes * * Authentication by Token Provider. * It waits for a Token to be scanned and asks for password if needed. * When the user is validated, it dispatches an event. * * When an username is given, it will be used and will just ask for the secret. * * ### Inputs * `boolean` : **showRememberMe** - Show the Remember Me box * `string` : **username** - Indicates if this is an authentication or validation * * ### Outputs * * `Cmf.Foundation.Security.User` : **authenticate** - Event triggered when the authentication is successful * * ### Example * * ```html * * * ``` */ export declare class AuthToken extends CoreComponent implements ng.OnInit, ng.OnDestroy { private _elementRef; private authProvider; private _ngRouter; /** * Last key stoke time */ private lastKeyStrokeTime; /** * Number of characters to read from the token */ private numberOfCharsToRead; /** * Flag to indicate if this is loading or validating the given data */ private isValidating; /** * Flag to indicate if the PIN phase was forced by the token analysis */ private forcePin; /** * It can be one of the following values: "None" | "KeyboardWedge" | "KeyboardWedgeAndCamera" | "Camera" * Default is "KeyboardWedge" */ private _tokenMode; /** * It can be one of the following values: "All" | "QRCode" | "BarCode" * Default is "All" */ private _cameraMode; /** * If set to true will use keypress detection instead of input detection */ private _useKeyboardEmulation; /** * Controls if the emulation trigger happens only on the keyup event and closes keyboard * after timeout */ private _singleEmulationTrigger; /** * Id attribute of the hidden input element */ private _hiddenInputId; /** * HTML input element */ private _hiddenInput; /** * Last key stoke time */ private _currentTimeout; /** * Maximum delay in milliseconds between keystrokes */ private _maximumDelay; /** * Minimum bar code length */ private _minBarCodeLength; /** * Code being read */ private _code; /** * Hide keyboard timeout function reference */ private _hideKeyboardTimeout; /** * Controls if the activation key is pressed */ private _activatorPressed; /** * Current token */ token: string; /** * Current pin */ pin: string; /** * Current phase/mode */ mode: ReadPhase; /** * Username that this login refers to */ username: string; /** * Event that signals that the external authentication completed. * Could be an Cmf.Foundation.Security.User */ authenticate: ng.EventEmitter; /** * Settings for authentication by token */ settings: SecurityAuthConfig; /** * Placeholder to use in the PIN box */ pinPlaceholder: string; /** * Defines if the camera button should appear */ isCameraButtonHidden: boolean; /** * Defines if the camera button should be enabled */ isCameraButtonVisibleDisabled: boolean; constructor(_elementRef: ng.ElementRef, authProvider: AuthProvider, _ngRouter: ngRouter.Router); /** * Handles a key pressed in the window when this component is active */ private onKeyPressed; /** * Resets the current state to the default. * Removes the token and pin. */ private reset; /** * Submits this form (token+pin) to the authentication provider. * If an username was given, it will try to use the application user token or the username. * After submitting, it resets the data. */ private onSubmit; ngOnInit(): void; /** * Instantiates the input element bellow the body tag */ instantiatedHiddenInput(): void; /** * Handles a key pressed in the window when this component is active */ private onActivatorKeyDown; /** * Handles a key pressed in the window when this component is active */ private onActivatorKeyUp; /** * Destroys the hidden input in body tag and the event handlers */ destroyHiddenInput(): void; ngOnDestroy(): void; /** * Process any change to the token. * This was exported from the SL implementation.* * @param newToken Token to be analyzed * @param newChar Last token char */ onTokenInputChange(newToken: string, newChar: string): void; /** * Process any change to the token. * This was exported from the SL implementation. * @param newToken Token to be analyzed */ onTokenChange(newToken: string): void; /** * Process any change to the pin. * @param pin Pin to be analyzed */ onPinInputChange(pin: string): void; /** * Changes the current phase. * If the new phase is the PIN, than it may have the change to be forced. * Forced PIN means that it was activated/changed by the token analysis. * @param mode New phase * @param forcePin Should force the pin */ changePhase(mode: ReadPhase, forcePin?: boolean): void; /** * Cancels the current process. * Right now, just reset this component. */ cancel(): void; onCameraButtonClick(): void; } export declare class AuthTokenModule { }