// @bun
import{tb as z}from"./chunk-jfk0hw36.js";function C(F={}){let{preBuild:H=!1,postBuild:I=!0,onGenerated:J,onError:w,...q}=F,y=async()=>{try{let j=await z(q);J?.(j)}catch(j){let k=j instanceof Error?j:Error(String(j));if(w?.(k),!w)console.error("[dtsx] Generation failed:",k.message)}};return{name:"dtsx",async setup(j){let k=j.config;if(!q.entrypoints&&k.entrypoints)q.entrypoints=k.entrypoints;if(!q.outdir&&k.outdir)q.outdir=k.outdir;if(!q.root&&k.root)q.root=k.root;if(H)j.onStart(async()=>{await y()});if(I){let v=!1;j.onLoad({filter:/.*/},async(K)=>{if(!v)queueMicrotask(async()=>{if(!v)v=!0,await y()});return})}}}}var M=C,P=C;
export{C as fa,M as ga,P as ha};
