import { Answerable , AnswersQuestions , Interaction , Question , UsesAbilities } from '@serenity-js/core' ; import { formatted } from '@serenity-js/core/lib/io' ; import { ElementFinder } from 'protractor' ; import { AlertPromise } from 'selenium-webdriver' ; import { withAnswerOf } from '../withAnswerOf' ; import { EnterBuilder } from './EnterBuilder' ; desc Instructs the  {@link @serenity-js/core/lib/screenplay/actor~Actor} to
 *  enter a value into a [form `input`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) field.
 *
 *  example example example see Target extends serenity-js export class Enter extends Interaction { desc Instantiates this  {@link @serenity-js/core/lib/screenplay~Interaction} .
     *
     *  param { Answerable < string | number > } value returns { EnterBuilder } static theValue ( value ) { return { into : ( field ) => new Enter ( value , field ) , } ; } param { serenity-js param { Question < ElementFinder > | ElementFinder | Question < AlertPromise > | AlertPromise } field constructor ( private readonly value , private readonly field ) { super ( ) ; } desc Makes the provided  {@link @serenity-js/core/lib/screenplay/actor~Actor} *  perform this  {@link @serenity-js/core/lib/screenplay~Interaction} .
     *
     *  param { UsesAbilities & AnswersQuestions } actor An  {@link @serenity-js/core/lib/screenplay/actor~Actor} to perform this  {@link @serenity-js/core/lib/screenplay~Interaction} returns { PromiseLike < void > } see {@link @serenity-js/core/lib/screenplay/actor~Actor} see {@link @serenity-js/core/lib/screenplay/actor~UsesAbilities} see {@link @serenity-js/core/lib/screenplay/actor~AnswersQuestions} performAs ( actor ) { return actor . answer ( this . value ) . then ( value => withAnswerOf ( actor , this . field , ( elf ) => elf . sendKeys ( `${ value }` ) ) ) ; } desc Generates a description to be used when reporting this  {@link @serenity-js/core/lib/screenplay~Activity} .
     *
     *  returns { string } toString ( ) { return formatted `#actor enters ${ this . value } into ${ this . field }` ; } }