import type { PointerInput } from '../pointer' ; import type { UserEventApi } from '.' ; import { setupDirect } from './setup' ; import { Config } from './config' ; export function clear ( element ) { return setupDirect ( ) . api . clear ( element ) ; } export function click ( element , options = { } ) { return setupDirect ( options , element ) . api . click ( element ) ; } export function copy ( options = { } ) { return setupDirect ( options ) . api . copy ( ) ; } export function cut ( options = { } ) { return setupDirect ( options ) . api . cut ( ) ; } export function dblClick ( element , options = { } ) { return setupDirect ( options ) . api . dblClick ( element ) ; } export function deselectOptions ( select , values , options = { } ) { return setupDirect ( options ) . api . deselectOptions ( select , values ) ; } export function hover ( element , options = { } ) { return setupDirect ( options ) . api . hover ( element ) ; } export async function keyboard ( text , options = { } ) { const { config , api } = setupDirect ( options ) ; return api . keyboard ( text ) . then ( ( ) => config . keyboardState ) ; } export async function pointer ( input , options = { } ) { const { config , api } = setupDirect ( options ) ; return api . pointer ( input ) . then ( ( ) => config . pointerState ) ; } export function paste ( clipboardData ? , options ? ) { return setupDirect ( options ) . api . paste ( clipboardData ) ; } export function selectOptions ( select , values , options = { } ) { return setupDirect ( options ) . api . selectOptions ( select , values ) ; } export function tripleClick ( element , options = { } ) { return setupDirect ( options ) . api . tripleClick ( element ) ; } export function type ( element , text , options = { } ) { return setupDirect ( options , element ) . api . type ( element , text , options ) ; } export function unhover ( element , options = { } ) { const { config , api } = setupDirect ( options ) ; config . pointerState . position . mouse . target = element ; return api . unhover ( element ) ; } export function upload ( element , fileOrFiles , options = { } ) { return setupDirect ( options ) . api . upload ( element , fileOrFiles ) ; } export function tab ( options = { } ) { return setupDirect ( ) . api . tab ( options ) ; }