import { Bounds , Radius , RectWithWH } from './interface' ; enum Type { 'null' = 'null' , 'undefined' = 'undefined' , 'number' = 'number' , 'boolean' = 'boolean' , 'string' = 'string' , 'array' = 'array' , 'object' = 'object' , 'function' = 'function' , 'regexp' = 'regexp' } function detectType ( obj ) ; function detectType ( obj , type ) ; function detectType ( obj , type ? ) { const name = { } . toString . call ( obj ) . split ( /[\s\]]/ ) [ 1 ] . toLowerCase ( ) ; if ( type ) { return name === type ; } return name ; } function isNumber ( obj ) { return detectType ( obj , Type . number ) ; } function isRegExp ( obj ) { return detectType ( obj , Type . regexp ) ; } function isRect ( obj ? ) { if ( obj ?. centerX && obj ?. centerY && obj ?. intersect ) { return true ; } return false ; } function isUiObject ( obj ? ) { if ( obj ?. findOne && obj ?. click ) { return true ; } return false ; } function isBounds ( obj ) { if ( obj && isRect ( obj . bounds ) ) { return true ; } return false ; } function isRectWithWH ( obj ) { if ( obj && isNumber ( obj . w ) && isNumber ( obj . h ) ) { return true ; } return false ; } function isRadius ( obj ) { if ( obj && isNumber ( obj . x ) && isNumber ( obj . y ) ) { return true ; } return false ; } function isImage ( obj ) { if ( obj ?. getWidth && obj ?. getHeight && obj ?. saveTo && obj ?. pixel && obj ?. recycle ) { return true ; } return false ; } export { detectType , isNumber , isRegExp , isRect , isUiObject , isBounds , isRectWithWH , isRadius , isImage , } ;