import { OpenYoloCredential , OpenYoloCredentialHintOptions } from '../protocol/data' ; import { hintMessage , RpcMessageType } from '../protocol/rpc_messages' ; import { BaseRequest } from './base_request' ; /**
 * Handles the get hint request, by displaying the IFrame or not to let
 * the user selects a hint, if any is available.
 */ export class HintRequest extends BaseRequest < OpenYoloCredential , OpenYoloCredentialHintOptions | undefined > { /**
     * Starts the Hint Request flow.
     */ dispatchInternal ( options ) { this . registerHandler ( RpcMessageType . credential , ( credential ) => this . handleResult ( credential ) ) ; this . channel . send ( hintMessage ( this . id , options ) ) ; } /**
     * Handles the initial response from a hint request.
     */ private handleResult ( credential ) { this . resolve ( credential ) ; this . dispose ( ) ; } }