import { Lane , NoLane , SyncLane , DefaultLane , Lanes , getHighestPriorityLane , InputContinuousLane , includesNonIdleWork , IdleLane , } from './ReactFiberLane' ; export type EventPriority = Lane ; export const DiscreteEventPriority = SyncLane ; export const DefaultEventPriority = DefaultLane ; export const ContinuousEventPriority = InputContinuousLane ; export const IdleEventPriority = IdleLane ; let currentUpdatePriority = NoLane ; returns export const getCurrentUpdatePriority = ( ) : EventPriority => { return currentUpdatePriority ; } ; param newPriority export const setCurrentUpdatePriority = ( newPriority ) : void => { currentUpdatePriority = newPriority ; } ; param a param b returns const isHigherEventPriority = ( a , b ) : boolean => { return a !== 0 && a < b ; } ; param lanes returns export const lanesToEventPriority = ( lanes ) : EventPriority => { const lane = getHighestPriorityLane ( lanes ) ; if ( ! isHigherEventPriority ( DiscreteEventPriority , lane ) ) return DiscreteEventPriority ; if ( ! isHigherEventPriority ( ContinuousEventPriority , lane ) ) { return ContinuousEventPriority ; } if ( includesNonIdleWork ( lane ) ) return DefaultEventPriority ; return IdleEventPriority ; } ;