import { Answerable , AnswersQuestions , Interaction , UsesAbilities } from '@serenity-js/core' ; import { formatted } from '@serenity-js/core/lib/io' ; import { promiseOf } from '../../promiseOf' ; import { BrowseTheWeb } from '../abilities' ; desc Instructs the  {@link @serenity-js/core/lib/screenplay/actor~Actor} to
 *  remove cookies from the browser.
 *
 *  example example example example see Navigate export class DeleteCookies { desc param { Answerable < string > } cookieName returns { link serenity-js static called ( cookieName ) { return new DeleteCookieCalled ( cookieName ) ; } desc returns { link serenity-js static all ( ) { return new DeletesAllCookies ( ) ; } } package class DeleteCookieCalled implements Interaction { constructor ( private readonly name ) { } 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 . name ) . then ( name => BrowseTheWeb . as ( actor ) . manage ( ) . deleteCookie ( name ) ) ; } desc Generates a description to be used when reporting this  {@link @serenity-js/core/lib/screenplay~Activity} .
     *
     *  returns { string } toString ( ) { return formatted `#actor deletes the "${ this . name }" cookie` ; } } package class DeletesAllCookies implements Interaction { 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 promiseOf ( BrowseTheWeb . as ( actor ) . manage ( ) . deleteAllCookies ( ) ) ; } desc Generates a description to be used when reporting this  {@link @serenity-js/core/lib/screenplay~Activity} .
     *
     *  returns { string } toString ( ) { return `#actor deletes all cookies` ; } }