import * as errorCreators from '../../errorCreators' ; import type { BlowoutParams } from '@opentrons/shared-data/protocol/types/schemaV3' ; import type { Command , CommandCreatorError , CommandCreator } from '../../types' ; export const blowout = ( args , invariantContext , prevRobotState ) => { /** Blowout with given args. Requires tip. */ const { pipette , labware , well , offsetFromBottomMm , flowRate } = args ; const actionName = 'blowout' ; const errors = [ ] ; const pipetteData = prevRobotState . pipettes [ pipette ] ; if ( ! pipetteData ) { errors . push ( errorCreators . pipetteDoesNotExist ( { actionName , pipette , } ) ) ; } if ( ! prevRobotState . tipState . pipettes [ pipette ] ) { errors . push ( errorCreators . noTipOnPipette ( { actionName , pipette , labware , well , } ) ) ; } if ( ! labware || ! prevRobotState . labware [ labware ] ) { errors . push ( errorCreators . labwareDoesNotExist ( { actionName , labware , } ) ) ; } if ( errors . length > 0 ) { return { errors , } ; } const commands = [ { command : 'blowout' , params : { pipette , labware , well , flowRate , offsetFromBottomMm , } , } , ] ; return { commands , } ; } ;