import { AccessorT , Observer , Accessor } from "./observer" ; import { max } from "./max" ; import { min } from "./min" ; function _extent ( ) { const minFO = min ( ) ; const maxFO = max ( ) ; return { observe : ( value , idx ) => { minFO . observe ( value , idx ) ; maxFO . observe ( value , idx ) ; } , peek : ( ) => [ minFO . peek ( ) , maxFO . peek ( ) ] } ; } export type ExtentAccessor < T > = AccessorT < T , number > ; export function extent ( ) ; export function extent < T = any > ( callbackFn ) ; export function extent < T = any > ( callbackFn ? ) { return callbackFn ? Accessor ( _extent , callbackFn ) : _extent ( ) ; }