import type { MultiFn2 } from "@thi.ng/defmulti" ; import { defmulti } from "@thi.ng/defmulti/defmulti" ; import type { IShape } from "@thi.ng/geom-api" ; import { AABB } from "./api/aabb.js" ; import { Rect } from "./api/rect.js" ; import { __unionBounds } from "./internal/bounds.js" ; import { __dispatch } from "./internal/dispatch.js" ; export const union = defmulti < any , any , IShape [ ] > ( __dispatch , { } , { aabb : ( a , b ) => [ new AABB ( ... __unionBounds ( a . pos , a . size , b . pos , b . size ) ) , ] , rect : ( a , b ) => [ new Rect ( ... __unionBounds ( a . pos , a . size , b . pos , b . size ) ) , ] , } ) ;