@stacksjs/dtsx 0.9.19 → 0.9.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +5 -5
- package/dist/{chunk-fg4cjy7w.js → chunk-0cfb4831.js} +1 -1
- package/dist/{chunk-w71syh0b.js → chunk-0d5r9n78.js} +1 -1
- package/dist/{chunk-s30jnjb4.js → chunk-1hy2eypj.js} +1 -1
- package/dist/chunk-380wx22t.js +2 -0
- package/dist/{chunk-1z1w3s0k.js → chunk-4mtbtmee.js} +11 -11
- package/dist/{chunk-m68323h2.js → chunk-4zdjnqrz.js} +1 -1
- package/dist/chunk-7hy98p24.js +62 -0
- package/dist/{chunk-gg6xh82k.js → chunk-9asxz2at.js} +1 -1
- package/dist/{chunk-2qyt67jt.js → chunk-a0gah6hn.js} +1 -1
- package/dist/{chunk-nwvqfthk.js → chunk-aaba58v4.js} +1 -1
- package/dist/chunk-af12rv0y.js +80 -0
- package/dist/{chunk-kwmhsx3n.js → chunk-bymtns9a.js} +1 -1
- package/dist/chunk-cdv5r51q.js +156 -0
- package/dist/{chunk-fmhrt2ca.js → chunk-dymmh9x0.js} +1 -1
- package/dist/chunk-eqfegkc1.js +2 -0
- package/dist/{chunk-69rnp3hs.js → chunk-ft0nf9jb.js} +1 -1
- package/dist/{chunk-9ycwkhxh.js → chunk-fvgc14nk.js} +1 -1
- package/dist/chunk-m94gn6yx.js +2 -0
- package/dist/chunk-nmmv0nrk.js +2 -0
- package/dist/{chunk-x4jgc4bx.js → chunk-nqwz71ak.js} +1 -1
- package/dist/{chunk-fbradttj.js → chunk-rd7n0yj1.js} +1 -1
- package/dist/chunk-sp1xrnfe.js +2 -0
- package/dist/{chunk-7pwy4m0c.js → chunk-vx4a5crm.js} +1 -1
- package/dist/chunk-wr3swrge.js +2 -0
- package/dist/{chunk-dv8haj2p.js → chunk-ww6wqbda.js} +1 -1
- package/dist/{chunk-ezrgnecm.js → chunk-wzbwr7a3.js} +1 -1
- package/dist/chunk-xw9wfq8f.js +17 -0
- package/dist/{chunk-jjwwkrfk.js → chunk-y2pe3jq3.js} +1 -1
- package/dist/{chunk-mr4jjsps.js → chunk-yzhdn85p.js} +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/plugins/bun.js +1 -1
- package/dist/src/plugins/esbuild.js +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/tsup.js +1 -1
- package/dist/src/plugins/vite.js +1 -1
- package/dist/src/plugins/webpack.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-2n9mmg2c.js +0 -2
- package/dist/chunk-4jw8qvts.js +0 -16
- package/dist/chunk-7g7axw9t.js +0 -2
- package/dist/chunk-7zsd1qqw.js +0 -80
- package/dist/chunk-9qe2wx58.js +0 -2
- package/dist/chunk-a3txc27m.js +0 -33
- package/dist/chunk-q0k7xs9f.js +0 -2
- package/dist/chunk-sbmecr6t.js +0 -2
- package/dist/chunk-trm0gptj.js +0 -134
- package/dist/chunk-w1k33gyv.js +0 -2
package/dist/bin/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{dd as Y}from"../chunk-mcdb3q06.js";import V from"process";var f=V.argv[2];if(f==="stdin"||f==="emit"||f==="--project"){if(f==="stdin"){let{processSource:q}=await import("../chunk-
|
|
3
|
-
`)}else if(f==="--project"){let{readdirSync:q,readFileSync:Q,writeFileSync:K,mkdirSync:N}=await import("fs"),A=typeof globalThis.Bun<"u",J=A?globalThis.Bun:null,$=V.argv.slice(3),z="",B="",G=!1;for(let X=0;X<$.length;X++)if($[X]==="--outdir"&&$[X+1])B=$[X+1],X++;else if($[X]==="--isolated-declarations")G=!0;else if(!z)z=$[X];N(B,{recursive:!0});let j=q(z).filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")),Z=j.length,E=Array(Z),M=Array(Z);for(let X=0;X<Z;X++)E[X]=`${z}/${j[X]}`,M[X]=`${B}/${j[X].slice(0,-3)}.d.ts`;let T=["bun"],R=A&&Z>=64,I=!1,_=null;if(R){let X=null;try{let{createWorkerPool:F,calculateOptimalBatchSize:D}=await import("../chunk-3xqchdwd.js"),{cpus:C}=await import("os"),w=Math.max(1,C().length-1),U=Math.min(64,Math.max(8,D(Z,w)*2)),L=Z>=256,a=!0,l=Z>=256;if(!L&&Z>=256){_=Array(Z);for(let x=0;x<Z;x++)_[x]=J.file(E[x]).text()}let O=Math.ceil(Z/U),u=Math.min(O,Math.max(2,w*2));X=F({maxWorkers:w,initialWorkers:w,recycleAfter:Math.max(100,O+1)}),await X.init();let d=X,i=0,r=Date.now(),t=async()=>{for(;;){let x=i++;if(x>=O)return;let S=x*U;if(S>=Z)return;let g=Math.min(Z,S+U)-S,m;if(l){let P=Array(g),y=Array(g),b;if(L)for(let W=0;W<g;W++){let v=S+W;P[W]=E[v],y[W]=M[v]}else{let W=Array(g);for(let v=0;v<g;v++){let c=S+v;P[v]=E[c],y[v]=M[c],W[v]=_?_[c]:J.file(E[c]).text()}b=await Promise.all(W)}m=await d.submit({id:`batch-${r}-${x}`,type:"process-batch",filePath:P[0]||"",filePaths:P,sources:b,outPaths:y,writeOutput:!0,config:{keepComments:!0,importOrder:T,isolatedDeclarations:G}})}else{let P=Array(g);if(L)for(let y=0;y<g;y++){let b=S+y;P[y]={filePath:E[b],outPath:M[b]}}else{let y=Array(g);for(let W=0;W<g;W++){let v=S+W;y[W]=_?_[v]:J.file(E[v]).text()}let b=await Promise.all(y);for(let W=0;W<g;W++){let v=S+W;P[W]={filePath:E[v],sourceCode:b[W],outPath:M[v]}}}m=await d.submit({id:`batch-${r}-${x}`,type:"process-batch",filePath:E[S]||"",files:P,writeOutput:!0,config:{keepComments:!0,importOrder:T,isolatedDeclarations:G}})}if(!m.success)throw Error(m.error||`Worker batch failed for ${E[S]}`);if(m.batchResults?.length){let P=m.batchResults[0];throw Error(P?.error||m.error||`Worker failed for ${E[S]}`)}}},n=[];for(let x=0;x<u;x++)n.push(t());await Promise.all(n),I=!0}catch{I=!1}finally{if(X)await X.shutdown()}}if(!I){let{scanDeclarations:X}=await import("../chunk-
|
|
2
|
+
import{dd as Y}from"../chunk-mcdb3q06.js";import V from"process";var f=V.argv[2];if(f==="stdin"||f==="emit"||f==="--project"){if(f==="stdin"){let{processSource:q}=await import("../chunk-eqfegkc1.js"),Q=[];for await(let N of V.stdin)Q.push(N);let K=Buffer.concat(Q).toString("utf-8");if(K.trim())V.stdout.write(q(K,"stdin.ts")),V.stdout.write(`
|
|
3
|
+
`)}else if(f==="--project"){let{readdirSync:q,readFileSync:Q,writeFileSync:K,mkdirSync:N}=await import("fs"),A=typeof globalThis.Bun<"u",J=A?globalThis.Bun:null,$=V.argv.slice(3),z="",B="",G=!1;for(let X=0;X<$.length;X++)if($[X]==="--outdir"&&$[X+1])B=$[X+1],X++;else if($[X]==="--isolated-declarations")G=!0;else if(!z)z=$[X];N(B,{recursive:!0});let j=q(z).filter((X)=>X.endsWith(".ts")&&!X.endsWith(".d.ts")),Z=j.length,E=Array(Z),M=Array(Z);for(let X=0;X<Z;X++)E[X]=`${z}/${j[X]}`,M[X]=`${B}/${j[X].slice(0,-3)}.d.ts`;let T=["bun"],R=A&&Z>=64,I=!1,_=null;if(R){let X=null;try{let{createWorkerPool:F,calculateOptimalBatchSize:D}=await import("../chunk-3xqchdwd.js"),{cpus:C}=await import("os"),w=Math.max(1,C().length-1),U=Math.min(64,Math.max(8,D(Z,w)*2)),L=Z>=256,a=!0,l=Z>=256;if(!L&&Z>=256){_=Array(Z);for(let x=0;x<Z;x++)_[x]=J.file(E[x]).text()}let O=Math.ceil(Z/U),u=Math.min(O,Math.max(2,w*2));X=F({maxWorkers:w,initialWorkers:w,recycleAfter:Math.max(100,O+1)}),await X.init();let d=X,i=0,r=Date.now(),t=async()=>{for(;;){let x=i++;if(x>=O)return;let S=x*U;if(S>=Z)return;let g=Math.min(Z,S+U)-S,m;if(l){let P=Array(g),y=Array(g),b;if(L)for(let W=0;W<g;W++){let v=S+W;P[W]=E[v],y[W]=M[v]}else{let W=Array(g);for(let v=0;v<g;v++){let c=S+v;P[v]=E[c],y[v]=M[c],W[v]=_?_[c]:J.file(E[c]).text()}b=await Promise.all(W)}m=await d.submit({id:`batch-${r}-${x}`,type:"process-batch",filePath:P[0]||"",filePaths:P,sources:b,outPaths:y,writeOutput:!0,config:{keepComments:!0,importOrder:T,isolatedDeclarations:G}})}else{let P=Array(g);if(L)for(let y=0;y<g;y++){let b=S+y;P[y]={filePath:E[b],outPath:M[b]}}else{let y=Array(g);for(let W=0;W<g;W++){let v=S+W;y[W]=_?_[v]:J.file(E[v]).text()}let b=await Promise.all(y);for(let W=0;W<g;W++){let v=S+W;P[W]={filePath:E[v],sourceCode:b[W],outPath:M[v]}}}m=await d.submit({id:`batch-${r}-${x}`,type:"process-batch",filePath:E[S]||"",files:P,writeOutput:!0,config:{keepComments:!0,importOrder:T,isolatedDeclarations:G}})}if(!m.success)throw Error(m.error||`Worker batch failed for ${E[S]}`);if(m.batchResults?.length){let P=m.batchResults[0];throw Error(P?.error||m.error||`Worker failed for ${E[S]}`)}}},n=[];for(let x=0;x<u;x++)n.push(t());await Promise.all(n),I=!0}catch{I=!1}finally{if(X)await X.shutdown()}}if(!I){let{scanDeclarations:X}=await import("../chunk-nmmv0nrk.js"),{processDeclarations:F}=await import("../chunk-dymmh9x0.js"),D=Array(Z);if(A){let U=_?await Promise.all(_):await Promise.all(E.map((L)=>J.file(L).text()));for(let L=0;L<Z;L++)D[L]=U[L]}else for(let U=0;U<Z;U++)D[U]=Q(E[U],"utf-8");let C=Array(Z),w={filePath:"",sourceCode:"",declarations:[]};for(let U=0;U<Z;U++){let L=X(D[U],j[U],!0,G);w.filePath=j[U],w.sourceCode=D[U],w.declarations=L,C[U]=F(L,w,!0,T)}if(A){let U=Array(Z);for(let L=0;L<Z;L++)U[L]=J.write(M[L],C[L]);await Promise.all(U)}else for(let U=0;U<Z;U++)K(M[U],C[U])}}else{let{processSource:q}=await import("../chunk-eqfegkc1.js"),{readFileSync:Q,writeFileSync:K,mkdirSync:N}=await import("fs"),A=typeof globalThis.Bun<"u",J=A?globalThis.Bun:null,$=V.argv[3],z=A?await J.file($).text():Q($,"utf-8"),B=V.argv[4];if(B){let{dirname:G}=await import("path");N(G(B),{recursive:!0});let j=`${q(z,$)}
|
|
4
4
|
`;if(A)await J.write(B,j);else K(B,j)}else V.stdout.write(q(z,$)),V.stdout.write(`
|
|
5
|
-
`)}V.exit(0)}var{resolve:h}=await import("path"),{CLI:s}=await import("../chunk-
|
|
6
|
-
Total: ${R}B -> ${R-T}B (-${I}%)`)}catch(Q){console.error("Error optimizing files:",Q),V.exit(1)}});k.command("docs","Generate API documentation from source files").option("--root <path>","Root directory to scan for source files",{default:"./src"}).option("--outdir <path>","Output directory for documentation",{default:"./docs"}).option("--format <format>","Output format: markdown or html",{default:"markdown"}).option("--title <title>","Documentation title",{default:"API Documentation"}).option("--include-private","Include private members (prefixed with _)",{default:!1}).option("--include-internal","Include internal members (@internal)",{default:!1}).option("--group-by-category","Group entries by @category tag",{default:!1}).option("--source-url <url>","Base URL for source links").example("dtsx docs").example("dtsx docs --format html --outdir ./api-docs").example('dtsx docs --group-by-category --title "My API"').action(async(q)=>{try{let{generateDocs:Q}=await import("../chunk-
|
|
5
|
+
`)}V.exit(0)}var{resolve:h}=await import("path"),{CLI:s}=await import("../chunk-cdv5r51q.js"),{version:e}=await import("../chunk-380wx22t.js"),{getConfig:o}=await import("../chunk-0d5r9n78.js"),{generate:qq,processSource:Hq,watch:Kq}=await import("../chunk-sp1xrnfe.js"),k=new s("dtsx"),H={cwd:V.cwd(),root:"./src",entrypoints:["**/*.ts"],outdir:"./dist",keepComments:!0,clean:!1,tsconfigPath:"tsconfig.json",verbose:!1,importOrder:["bun"],dryRun:!1,stats:!1,continueOnError:!1,logLevel:"info",exclude:[],outputFormat:"text",progress:!1,diff:!1,validate:!1,parallel:!1,concurrency:4};k.command("generate","Generate TypeScript declaration files").option("--cwd <path>","Current working directory",{default:H.cwd}).option("--root <path>","Root directory of the project",{default:H.root}).option("--entrypoints <files>","Entry point files (comma-separated)",{default:H.entrypoints?.join(","),type:[String]}).option("--outdir <path>","Output directory for generated .d.ts files",{default:H.outdir}).option("--keep-comments","Keep comments in generated .d.ts files",{default:H.keepComments}).option("--clean","Clean output directory before generation",{default:H.clean}).option("--tsconfig <path>","Path to tsconfig.json",{default:H.tsconfigPath}).option("--verbose","Enable verbose logging",{default:H.verbose}).option("--import-order <patterns>","Import order priority patterns (comma-separated)",{default:H.importOrder?.join(","),type:[String]}).option("--dry-run","Show what would be generated without writing files",{default:H.dryRun}).option("--stats","Show statistics after generation",{default:H.stats}).option("--continue-on-error","Continue processing other files if one fails",{default:H.continueOnError}).option("--log-level <level>","Log level (debug, info, warn, error, silent)",{default:H.logLevel}).option("--exclude <patterns>","Glob patterns to exclude (comma-separated)",{default:H.exclude?.join(","),type:[String]}).option("--output-format <format>","Output format: text or json",{default:H.outputFormat}).option("--progress","Show progress during generation",{default:H.progress}).option("--diff","Show diff of changes compared to existing files",{default:H.diff}).option("--validate","Validate generated .d.ts files against TypeScript",{default:H.validate}).option("--parallel","Process files in parallel",{default:H.parallel}).option("--concurrency <number>","Number of concurrent workers (with --parallel)",{default:H.concurrency}).option("--declaration-map","Generate declaration map files (.d.ts.map)",{default:!1}).option("--bundle","Bundle all declarations into a single output file",{default:!1}).option("--bundle-output <file>","Output filename when bundling (relative to outdir)",{default:"index.d.ts"}).option("--config <path>","Path to config file (dtsx.config.ts)",{default:""}).option("--incremental","Enable incremental builds (only regenerate changed files)",{default:!1}).option("--clear-cache","Clear the incremental build cache before generating",{default:!1}).option("--indent-style <style>","Indentation style: spaces or tabs",{default:"spaces"}).option("--indent-size <size>","Number of spaces for indentation",{default:2}).option("--prettier","Use Prettier for output formatting if available",{default:!1}).example("dtsx generate").example("dtsx generate --entrypoints src/index.ts,src/utils.ts --outdir dist/types").example('dtsx generate --import-order "node:,bun,@myorg/"').example("dtsx generate --dry-run --stats").example('dtsx generate --exclude "**/*.test.ts,**/__tests__/**"').example("dtsx generate --stats --output-format json").example("dtsx generate --bundle --bundle-output types.d.ts").action(async(q)=>{try{let Q=h(q.cwd||H.cwd),K=await o(Q),N={entrypoints:q.entrypoints?q.entrypoints:K.entrypoints||H.entrypoints,cwd:Q,root:h(q.root||K.root||H.root),outdir:h(q.outdir||K.outdir||H.outdir),tsconfigPath:h(q.tsconfigPath||K.tsconfigPath||H.tsconfigPath),keepComments:q.keepComments??K.keepComments??H.keepComments,clean:q.clean??K.clean??H.clean,verbose:q.verbose??K.verbose??H.verbose,importOrder:q.importOrder||K.importOrder||H.importOrder,dryRun:q.dryRun??K.dryRun??H.dryRun,stats:q.stats??K.stats??H.stats,continueOnError:q.continueOnError??K.continueOnError??H.continueOnError,logLevel:q.logLevel??K.logLevel??H.logLevel,exclude:q.exclude?q.exclude.flatMap((J)=>J.split(",").map(($)=>$.trim()).filter(Boolean)):K.exclude||H.exclude,outputFormat:q.outputFormat??K.outputFormat??H.outputFormat,progress:q.progress??K.progress??H.progress,diff:q.diff??K.diff??H.diff,validate:q.validate??K.validate??H.validate,parallel:q.parallel??K.parallel??H.parallel,concurrency:Number(q.concurrency)||K.concurrency||H.concurrency,declarationMap:q.declarationMap??K.declarationMap??!1,bundle:q.bundle??K.bundle??!1,bundleOutput:q.bundleOutput??K.bundleOutput??"index.d.ts",incremental:q.incremental??K.incremental??!1,clearCache:q.clearCache??!1,indentStyle:q.indentStyle??K.indentStyle??"spaces",indentSize:Number(q.indentSize)||K.indentSize||2,prettier:q.prettier??K.prettier??!1,plugins:K.plugins},A=await qq(N);if(A.filesFailed>0&&A.filesGenerated===0)V.exit(1);else if(A.filesFailed>0)V.exit(2)}catch(Q){console.error("Error generating .d.ts files:",Q),V.exit(1)}});k.command("watch","Watch for changes and regenerate .d.ts files").option("--cwd <path>","Current working directory",{default:H.cwd}).option("--root <path>","Root directory of the project",{default:H.root}).option("--entrypoints <files>","Entry point files (comma-separated)",{default:H.entrypoints?.join(","),type:[String]}).option("--outdir <path>","Output directory for generated .d.ts files",{default:H.outdir}).option("--keep-comments","Keep comments in generated .d.ts files",{default:H.keepComments}).option("--exclude <patterns>","Glob patterns to exclude (comma-separated)",{default:H.exclude?.join(","),type:[String]}).option("--log-level <level>","Log level (debug, info, warn, error, silent)",{default:H.logLevel}).example("dtsx watch").example("dtsx watch --root src --outdir dist/types").action(async(q)=>{try{let Q={entrypoints:q.entrypoints?q.entrypoints:H.entrypoints,cwd:h(q.cwd||H.cwd),root:h(q.root||H.root),outdir:h(q.outdir||H.outdir),keepComments:q.keepComments??H.keepComments,exclude:q.exclude?q.exclude.flatMap((K)=>K.split(",").map((N)=>N.trim()).filter(Boolean)):H.exclude,logLevel:q.logLevel??H.logLevel};await Kq(Q)}catch(Q){console.error("Error in watch mode:",Q),V.exit(1)}});k.command("stdin","Process TypeScript from stdin and output .d.ts to stdout").option("--keep-comments","Keep comments in generated .d.ts files",{default:!0}).option("--import-order <patterns>","Import order priority patterns (comma-separated)",{default:"bun",type:[String]}).example(`echo "export const foo: string = 'bar'" | dtsx stdin`).example("cat src/index.ts | dtsx stdin").action(async(q)=>{try{let Q=[];for await(let J of V.stdin)Q.push(J);let K=Buffer.concat(Q).toString("utf-8");if(!K.trim())console.error("Error: No input received from stdin"),V.exit(1);let N=["bun"];if(q.importOrder){if(Array.isArray(q.importOrder))N=q.importOrder.flatMap((J)=>J.split(",").map(($)=>$.trim()).filter(Boolean));else if(typeof q.importOrder==="string")N=q.importOrder.split(",").map((J)=>J.trim()).filter(Boolean)}let A=Hq(K,"stdin.ts",q.keepComments??!0,N);console.log(A)}catch(Q){console.error("Error processing stdin:",Q),V.exit(1)}});k.command("optimize","Optimize declaration files").option("--files <patterns>","Glob patterns for .d.ts files to optimize",{default:"**/*.d.ts",type:[String]}).option("--outdir <path>","Output directory (defaults to in-place)",{default:""}).option("--remove-unused-imports","Remove unused type imports",{default:!0}).option("--deduplicate","Remove duplicate declarations",{default:!0}).option("--merge-interfaces","Merge interface declarations with same name",{default:!0}).option("--inline-types","Inline simple type aliases",{default:!1}).option("--remove-empty","Remove empty interfaces",{default:!0}).option("--sort","Sort declarations alphabetically",{default:!1}).option("--sort-imports","Sort imports",{default:!0}).option("--minify","Minify output (remove whitespace)",{default:!1}).option("--remove-comments","Remove comments",{default:!1}).example('dtsx optimize --files "dist/**/*.d.ts"').example("dtsx optimize --minify --remove-comments").action(async(q)=>{try{let{optimizeFile:Q}=await import("../chunk-m94gn6yx.js"),{Glob:K}=awaitPromise.resolve(globalThis.Bun),{resolve:N,join:A,relative:J,dirname:$,basename:z}=await import("path"),{mkdirSync:B,copyFileSync:G,existsSync:j}=await import("fs"),Z=V.cwd(),E=q.files||["**/*.d.ts"],M=[];for(let _ of E){let X=new K(_);for await(let F of X.scan({cwd:Z,absolute:!0,onlyFiles:!0}))if(F.endsWith(".d.ts")&&!F.includes("node_modules"))M.push(F)}if(M.length===0)console.error("No .d.ts files found"),V.exit(1);console.log(`Optimizing ${M.length} declaration files...`);let T=0,R=0;for(let _ of M){let X=_;if(q.outdir){let C=J(Z,_);X=A(N(q.outdir),C);let w=$(X);if(!j(w))B(w,{recursive:!0});G(_,X)}let F=await Q(X,{removeUnusedImports:q.removeUnusedImports??!0,deduplicateDeclarations:q.deduplicate??!0,mergeInterfaces:q.mergeInterfaces??!0,inlineSimpleTypes:q.inlineTypes??!1,removeEmptyInterfaces:q.removeEmpty??!0,sortDeclarations:q.sort??!1,sortImports:q.sortImports??!0,minify:q.minify??!1,removeComments:q.removeComments??!1});R+=F.originalSize,T+=F.savings;let D=J(Z,X);console.log(` ${D}: ${F.originalSize}B -> ${F.optimizedSize}B (-${F.savingsPercent}%)`)}let I=R>0?Math.round(T/R*100):0;console.log(`
|
|
6
|
+
Total: ${R}B -> ${R-T}B (-${I}%)`)}catch(Q){console.error("Error optimizing files:",Q),V.exit(1)}});k.command("docs","Generate API documentation from source files").option("--root <path>","Root directory to scan for source files",{default:"./src"}).option("--outdir <path>","Output directory for documentation",{default:"./docs"}).option("--format <format>","Output format: markdown or html",{default:"markdown"}).option("--title <title>","Documentation title",{default:"API Documentation"}).option("--include-private","Include private members (prefixed with _)",{default:!1}).option("--include-internal","Include internal members (@internal)",{default:!1}).option("--group-by-category","Group entries by @category tag",{default:!1}).option("--source-url <url>","Base URL for source links").example("dtsx docs").example("dtsx docs --format html --outdir ./api-docs").example('dtsx docs --group-by-category --title "My API"').action(async(q)=>{try{let{generateDocs:Q}=await import("../chunk-a0gah6hn.js"),{Glob:K}=awaitPromise.resolve(globalThis.Bun),{resolve:N}=await import("path"),A=N(q.root||"./src"),J=new K("**/*.ts"),$=[];for await(let z of J.scan({cwd:A,absolute:!0,onlyFiles:!0}))if(!z.endsWith(".d.ts")&&!z.includes("node_modules"))$.push(z);if($.length===0)console.error("No TypeScript files found"),V.exit(1);console.log(`Found ${$.length} source files`),await Q($,{format:q.format||"markdown",outdir:N(q.outdir||"./docs"),title:q.title||"API Documentation",includePrivate:q.includePrivate??!1,includeInternal:q.includeInternal??!1,groupByCategory:q.groupByCategory??!1,includeSourceLinks:!!q.sourceUrl,sourceBaseUrl:q.sourceUrl})}catch(Q){console.error("Error generating documentation:",Q),V.exit(1)}});k.command("workspace","Generate declarations for all projects in a monorepo/workspace").option("--cwd <path>","Workspace root directory",{default:V.cwd()}).option("--parallel","Process projects in parallel",{default:!1}).option("--continue-on-error","Continue if a project fails",{default:!0}).option("--log-level <level>","Log level (debug, info, warn, error, silent)",{default:"info"}).example("dtsx workspace").example("dtsx workspace --cwd /path/to/monorepo").action(async(q)=>{try{let{generateMonorepo:Q,generateFromPackageWorkspaces:K}=await import("../chunk-wr3swrge.js"),{existsSync:N}=await import("fs"),{join:A,resolve:J}=await import("path"),$=J(q.cwd||V.cwd()),z=A($,"tsconfig.json"),B;if(N(z))B=await Q($,{logLevel:q.logLevel||"info",continueOnError:q.continueOnError??!0});else B=await K($,{logLevel:q.logLevel||"info",continueOnError:q.continueOnError??!0});if(!B.success)V.exit(1)}catch(Q){console.error("Error generating workspace declarations:",Q),V.exit(1)}});k.command("lsp","Start the Language Server Protocol server for IDE integration").example("dtsx lsp").action(async()=>{let{startLSPServer:q}=await import("../chunk-nqwz71ak.js");q()});k.command("check","Type check TypeScript files or validate generated declarations").option("--files <patterns>","Glob patterns for files to check",{default:"**/*.ts",type:[String]}).option("--declarations-only","Only check .d.ts files",{default:!1}).option("--tsconfig <path>","Path to tsconfig.json",{default:"tsconfig.json"}).option("--strict","Enable strict type checking",{default:!1}).option("--skip-lib-check","Skip checking library definitions",{default:!0}).option("--warnings-as-errors","Treat warnings as errors",{default:!1}).option("--max-errors <number>","Maximum errors before stopping",{default:0}).option("--isolated-declarations","Check if code follows isolated declarations best practices (recommended)",{default:!1}).option("--format <format>","Output format: text or json",{default:"text"}).example("dtsx check").example('dtsx check --files "src/**/*.ts" --strict').example('dtsx check --declarations-only --files "dist/**/*.d.ts"').example("dtsx check --isolated-declarations").action(async(q)=>{try{let{typeCheck:Q,checkIsolatedDeclarations:K,formatTypeCheckResults:N}=await import("../chunk-sw3m29sw.js"),{Glob:A}=awaitPromise.resolve(globalThis.Bun),{resolve:J,relative:$}=await import("path"),z=V.cwd(),B=q.files||["**/*.ts"],G=[];for(let Z of B){let E=new A(Z);for await(let M of E.scan({cwd:z,absolute:!0,onlyFiles:!0}))if(!M.includes("node_modules"))if(q.declarationsOnly){if(M.endsWith(".d.ts"))G.push(M)}else G.push(M)}if(G.length===0)console.error("No files found to check"),V.exit(1);if(q.isolatedDeclarations){console.log(`Checking ${G.length} files for isolated declarations best practices...`);let Z=await K(G,q.tsconfig?J(q.tsconfig):void 0),E=0,M=[];for(let[T,R]of Z){let I=$(z,T);if(!R.compatible)if(E+=R.issues.length,q.format==="json")M.push({file:I,compatible:!1,issues:R.issues});else{console.log(`
|
|
7
7
|
\u2717 ${I}`);for(let _ of R.issues)if(console.log(` ${_.line}:${_.column} - ${_.message}`),_.missingAnnotation)console.log(` Missing: ${_.missingAnnotation} type annotation`)}else if(q.format==="json")M.push({file:I,compatible:!0,issues:[]})}if(q.format==="json")console.log(JSON.stringify(M,null,2));else if(E>0)console.log(`
|
|
8
8
|
${G.length} files checked, ${E} recommendations found`),console.log("Tip: Adding explicit type annotations improves .d.ts accuracy");else console.log(`
|
|
9
|
-
${G.length} files checked, all follow isolated declarations best practices`);V.exit(E>0?1:0)}console.log(`Type checking ${G.length} files...`);let j=await Q(G,{tsconfigPath:q.tsconfig?J(q.tsconfig):void 0,strict:q.strict??!1,declarationsOnly:q.declarationsOnly??!1,skipLibCheck:q.skipLibCheck??!0,warningsAsErrors:q.warningsAsErrors??!1,maxErrors:q.maxErrors||void 0});if(q.format==="json")console.log(JSON.stringify(j,null,2));else console.log(N(j));V.exit(j.success?0:1)}catch(Q){console.error("Error during type checking:",Q),V.exit(1)}});k.command("convert","Convert TypeScript types to different schema formats").option("--files <patterns>","Glob patterns for TypeScript files",{default:"**/*.ts",type:[String]}).option("--format <format>","Output format: json-schema, zod, valibot, io-ts, yup, arktype",{default:"json-schema"}).option("--outdir <path>","Output directory for converted files",{default:"./schemas"}).option("--include-descriptions","Include JSDoc descriptions in output",{default:!0}).option("--all-optional","Make all properties optional",{default:!1}).option("--use-infer","Include inferred types (for Zod, Valibot, etc.)",{default:!0}).option("--json-schema-draft <version>","JSON Schema draft version: 2020-12, 2019-09, draft-07",{default:"2020-12"}).example("dtsx convert --format zod").example('dtsx convert --format json-schema --files "src/types/**/*.ts"').example("dtsx convert --format valibot --outdir ./validation").action(async(q)=>{try{let Q=await import("../chunk-xtee8g1a.js"),{extractDeclarations:K}=await import("../chunk-
|
|
9
|
+
${G.length} files checked, all follow isolated declarations best practices`);V.exit(E>0?1:0)}console.log(`Type checking ${G.length} files...`);let j=await Q(G,{tsconfigPath:q.tsconfig?J(q.tsconfig):void 0,strict:q.strict??!1,declarationsOnly:q.declarationsOnly??!1,skipLibCheck:q.skipLibCheck??!0,warningsAsErrors:q.warningsAsErrors??!1,maxErrors:q.maxErrors||void 0});if(q.format==="json")console.log(JSON.stringify(j,null,2));else console.log(N(j));V.exit(j.success?0:1)}catch(Q){console.error("Error during type checking:",Q),V.exit(1)}});k.command("convert","Convert TypeScript types to different schema formats").option("--files <patterns>","Glob patterns for TypeScript files",{default:"**/*.ts",type:[String]}).option("--format <format>","Output format: json-schema, zod, valibot, io-ts, yup, arktype",{default:"json-schema"}).option("--outdir <path>","Output directory for converted files",{default:"./schemas"}).option("--include-descriptions","Include JSDoc descriptions in output",{default:!0}).option("--all-optional","Make all properties optional",{default:!1}).option("--use-infer","Include inferred types (for Zod, Valibot, etc.)",{default:!0}).option("--json-schema-draft <version>","JSON Schema draft version: 2020-12, 2019-09, draft-07",{default:"2020-12"}).example("dtsx convert --format zod").example('dtsx convert --format json-schema --files "src/types/**/*.ts"').example("dtsx convert --format valibot --outdir ./validation").action(async(q)=>{try{let Q=await import("../chunk-xtee8g1a.js"),{extractDeclarations:K}=await import("../chunk-rd7n0yj1.js"),{Glob:N}=awaitPromise.resolve(globalThis.Bun),{resolve:A,relative:J,join:$,dirname:z,basename:B}=await import("path"),{mkdirSync:G,existsSync:j,readFileSync:Z,writeFileSync:E}=await import("fs"),M=V.cwd(),T=q.files||["**/*.ts"],R=q.format||"json-schema",I=A(q.outdir||"./schemas"),_=[];for(let D of T){let C=new N(D);for await(let w of C.scan({cwd:M,absolute:!0,onlyFiles:!0}))if(!w.endsWith(".d.ts")&&!w.includes("node_modules"))_.push(w)}if(_.length===0)console.error("No TypeScript files found"),V.exit(1);if(console.log(`Converting ${_.length} files to ${R} format...`),!j(I))G(I,{recursive:!0});let X=0,F=0;for(let D of _){let C=Z(D,"utf-8"),U=K(C,D).filter((d)=>d.kind==="interface"||d.kind==="type");if(U.length===0)continue;let L=Q.convertToFormat(U,{format:R,includeDescriptions:q.includeDescriptions??!0,allOptional:q.allOptional??!1,useInfer:q.useInfer??!0,jsonSchemaDraft:q.jsonSchemaDraft||"2020-12"}),a=J(M,D),l=B(D,".ts"),p=Q.getFormatExtension(R),O=$(I,z(a),`${l}${p}`),u=z(O);if(!j(u))G(u,{recursive:!0});E(O,L),X+=U.length,F++,console.log(` ${J(M,O)} (${U.length} types)`)}console.log(`
|
|
10
10
|
Converted ${X} declarations from ${F} files`)}catch(Q){console.error("Error converting files:",Q),V.exit(1)}});k.command("circular","Detect circular dependencies in TypeScript files").option("--files <patterns>","Glob patterns for files to check",{default:"**/*.ts",type:[String]}).option("--root <path>","Root directory for resolution",{default:"."}).option("--ignore <patterns>","Glob patterns to ignore (comma-separated)",{default:"",type:[String]}).option("--types-only","Only report type-level cycles",{default:!1}).option("--max-depth <number>","Maximum depth for cycle detection",{default:100}).option("--include-node-modules","Include node_modules in analysis",{default:!1}).option("--format <format>","Output format: text, json, dot",{default:"text"}).option("--summary","Show graph summary statistics",{default:!1}).example("dtsx circular").example('dtsx circular --files "src/**/*.ts"').example('dtsx circular --ignore "**/*.test.ts,**/__tests__/**"').example("dtsx circular --format dot > deps.dot").example("dtsx circular --summary").action(async(q)=>{try{let{analyzeCircularDependencies:Q,formatCircularAnalysis:K,getGraphSummary:N,exportGraphAsDot:A,exportGraphAsJson:J}=await import("../chunk-tne5n3h1.js"),{Glob:$}=awaitPromise.resolve(globalThis.Bun),{resolve:z,relative:B}=await import("path"),G=V.cwd(),j=z(q.root||"."),Z=q.files||["**/*.ts"],E=[];for(let T of Z){let R=new $(T);for await(let I of R.scan({cwd:j,absolute:!0,onlyFiles:!0}))if(!I.endsWith(".d.ts")){if(!q.includeNodeModules&&I.includes("node_modules"))continue;E.push(I)}}if(E.length===0)console.error("No TypeScript files found"),V.exit(1);console.log(`Analyzing ${E.length} files for circular dependencies...`);let M=await Q(E,{rootDir:j,ignore:q.ignore?.filter(Boolean),typesOnly:q.typesOnly??!1,maxDepth:q.maxDepth??100,includeNodeModules:q.includeNodeModules??!1});if(q.format==="json")console.log(J(M.graph,j));else if(q.format==="dot")console.log(A(M.graph,j));else if(console.log(K(M,j)),q.summary){let T=N(M.graph);if(console.log(`
|
|
11
11
|
--- Dependency Graph Summary ---`),console.log(`Total files: ${T.totalFiles}`),console.log(`Total dependencies: ${T.totalDependencies}`),console.log(`Average dependencies per file: ${T.avgDependencies.toFixed(2)}`),T.maxDependencies.count>0)console.log(`Most dependencies: ${B(j,T.maxDependencies.file)} (${T.maxDependencies.count})`);if(T.mostDepended.count>0)console.log(`Most depended on: ${B(j,T.mostDepended.file)} (${T.mostDepended.count} dependents)`);if(T.isolatedFiles.length>0)console.log(`Isolated files (no dependencies): ${T.isolatedFiles.length}`)}V.exit(M.hasCircular?1:0)}catch(Q){console.error("Error analyzing dependencies:",Q),V.exit(1)}});k.command("version","Show the version of dtsx").action(()=>{console.log(e)});k.version(e);k.help();k.parse();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ec as _}from"./chunk-
|
|
2
|
+
import{ec as _}from"./chunk-ft0nf9jb.js";import{existsSync as w,readFileSync as U,writeFileSync as q}from"fs";function Z(G){let j=[],J=/\b([A-Z][a-zA-Z0-9]*)\b/g,L;while((L=J.exec(G))!==null){let K=L[1];if(!N(K))j.push(K)}return[...new Set(j)]}function N(G){return new Set(["Array","Object","String","Number","Boolean","Symbol","BigInt","Function","Promise","Map","Set","WeakMap","WeakSet","Date","RegExp","Error","TypeError","RangeError","SyntaxError","Partial","Required","Readonly","Pick","Omit","Record","Exclude","Extract","NonNullable","ReturnType","Parameters","ConstructorParameters","InstanceType","ThisType","Uppercase","Lowercase","Capitalize","Uncapitalize","Awaited","NoInfer","Generator","AsyncGenerator","IterableIterator","AsyncIterableIterator","PropertyKey","Iterable","AsyncIterable","ArrayLike","PromiseLike","ArrayBuffer","SharedArrayBuffer","DataView","Int8Array","Uint8Array","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"]).has(G)}function C(G){if(G.kind!=="type")return!1;let j=G.typeAnnotation||"";if(G.generics)return!1;if(j.includes("{")||j.includes("(")||j.includes("<"))return!1;return/^[\w\s|&]+$/.test(j)}function E(G){if(G.kind!=="interface")return!1;if(!G.members||G.members.length===0){if(!G.extends)return!0}return!1}function D(G,j){let J={...G,members:[...G.members||[],...j.members||[]],leadingComments:[...G.leadingComments||[],...j.leadingComments||[]]};if(G.extends&&j.extends){let L=G.extends.split(",").map((H)=>H.trim()),K=j.extends.split(",").map((H)=>H.trim());J.extends=[...new Set([...L,...K])].join(", ")}else J.extends=G.extends||j.extends;return J}function F(G){let j={import:0,interface:1,type:2,class:3,enum:4,function:5,variable:6,export:7};return[...G].sort((J,L)=>{let K=j[J.kind]??99,H=j[L.kind]??99;if(K!==H)return K-H;return J.name.localeCompare(L.name)})}function k(G){let j=[],J=[];for(let K=0;K<G.length;K++){let H=G[K];if(H.kind==="import")j.push(H);else J.push(H)}return[...[...j].sort((K,H)=>{let M=K.source||"",O=H.source||"",Q=M.startsWith("node:")||M==="bun",V=O.startsWith("node:")||O==="bun";if(Q&&!V)return-1;if(!Q&&V)return 1;let X=!M.startsWith("."),W=!O.startsWith(".");if(X&&!W)return-1;if(!X&&W)return 1;return M.localeCompare(O)}),...J]}function R(G){let j=new Set;for(let K of G){if(K.kind==="import")continue;let H=K.text||"",M=K.typeAnnotation||"",O=K.returnType||"",Q=K.extends||"",V=K.implements?.join(" ")||"",X=`${H} ${M} ${O} ${Q} ${V}`;for(let W of Z(X))j.add(W);if(K.members)for(let W of K.members){let Y=`${W.typeAnnotation||""} ${W.returnType||""}`;for(let $ of Z(Y))j.add($)}if(K.parameters){for(let W of K.parameters)if(W.type)for(let Y of Z(W.type))j.add(Y)}}let J=0;return{declarations:G.map((K)=>{if(K.kind!=="import"||!K.specifiers)return K;let H=K.specifiers.filter((M)=>{let O=M.alias||M.name;return j.has(O)});if(H.length===0){if(!K.isSideEffect)return J++,null}if(H.length<(K.specifiers?.length||0))return J+=(K.specifiers?.length||0)-H.length,{...K,specifiers:H};return K}).filter((K)=>K!==null),removed:J}}function A(G){let j=new Map,J=0;for(let L of G){if(L.kind==="import"){let H=`import:${L.source}`;if(j.has(H)){let M=j.get(H),O=[...M.specifiers||[],...L.specifiers||[]],Q=Array.from(new Map(O.map((V)=>[V.alias||V.name,V])).values());j.set(H,{...M,specifiers:Q}),J++}else j.set(H,L);continue}let K=`${L.kind}:${L.name}`;if(j.has(K))J++;else j.set(K,L)}return{declarations:Array.from(j.values()),removed:J}}function z(G){let j=new Map,J=[];for(let H of G)if(H.kind==="interface"){let M=H.name;if(!j.has(M))j.set(M,[]);j.get(M).push(H)}else J.push(H);let L=0,K=[];for(let[H,M]of j)if(M.length>1){let O=M[0];for(let Q=1;Q<M.length;Q++)O=D(O,M[Q]),L++;K.push(O)}else K.push(M[0]);return{declarations:[...J,...K],merged:L}}function P(G){let j=new Map,J=new Set;for(let H of G)if(C(H))j.set(H.name,H.typeAnnotation||""),J.add(H.name);if(j.size===0)return{declarations:G,inlined:0};function L(H){let M=H;for(let[O,Q]of j){let V=new RegExp(`\\b${O}\\b`,"g");M=M.replace(V,Q)}return M}return{declarations:G.filter((H)=>H.kind!=="type"||!J.has(H.name)).map((H)=>{if(H.typeAnnotation)H={...H,typeAnnotation:L(H.typeAnnotation)};if(H.returnType)H={...H,returnType:L(H.returnType)};if(H.extends)H={...H,extends:L(H.extends)};return H}),inlined:j.size}}function v(G){let j=G.length,J=G.filter((L)=>!E(L));return{declarations:J,removed:j-J.length}}function B(G,j={}){let J=[...G],L={originalSize:0,optimizedSize:0,savings:0,savingsPercent:0,removedImports:0,removedDeclarations:0,mergedInterfaces:0,inlinedTypes:0};if(j.removeUnusedImports){let{declarations:K,removed:H}=R(J);J=K,L.removedImports=H}if(j.deduplicateDeclarations){let{declarations:K,removed:H}=A(J);J=K,L.removedDeclarations+=H}if(j.mergeInterfaces){let{declarations:K,merged:H}=z(J);J=K,L.mergedInterfaces=H}if(j.removeEmptyInterfaces){let{declarations:K,removed:H}=v(J);J=K,L.removedDeclarations+=H}if(j.inlineSimpleTypes){let{declarations:K,inlined:H}=P(J);J=K,L.inlinedTypes=H}if(j.sortImports)J=k(J);if(j.sortDeclarations)J=F(J);return{declarations:J,result:L}}async function g(G,j={}){if(!w(G))throw Error(`File not found: ${G}`);let J=U(G,"utf-8"),L=Buffer.byteLength(J,"utf-8"),K=_(J,G,!j.removeComments),{declarations:H,result:M}=B(K,j),O=h(H,j);if(j.minify)O=x(O);let Q=Buffer.byteLength(O,"utf-8");return M.originalSize=L,M.optimizedSize=Q,M.savings=L-Q,M.savingsPercent=Math.round(M.savings/L*100),q(G,O),M}function h(G,j){let J=[];for(let L of G){if(!j.removeComments&&L.leadingComments)for(let K of L.leadingComments)J.push(K);if(L.text)J.push(L.text);else J.push(S(L));J.push("")}return J.join(`
|
|
3
3
|
`)}function S(G){let j=[];if(G.isExported)j.push("export");if(G.isDefault)j.push("default");switch(G.kind){case"import":if(G.isTypeOnly)j.push("import type");else j.push("import");if(G.specifiers&&G.specifiers.length>0){let J=G.specifiers.map((L)=>{let K=L.isType?"type ":"";return L.alias?`${K}${L.name} as ${L.alias}`:`${K}${L.name}`}).join(", ");j.push(`{ ${J} }`)}j.push("from"),j.push(`'${G.source}'`);break;case"function":if(j.push("declare function"),j.push(G.name),G.generics)j.push(G.generics);if(j.push(`(${I(G.parameters)})`),G.returnType)j.push(`: ${G.returnType}`);break;case"variable":if(j.push("declare const"),j.push(G.name),G.typeAnnotation)j.push(`: ${G.typeAnnotation}`);break;case"interface":if(j.push("interface"),j.push(G.name),G.generics)j.push(G.generics);if(G.extends)j.push(`extends ${G.extends}`);if(j.push("{"),G.members)for(let J of G.members)j.push(` ${J.name}${J.typeAnnotation?`: ${J.typeAnnotation}`:""}`);j.push("}");break;case"type":if(j.push("type"),j.push(G.name),G.generics)j.push(G.generics);j.push("="),j.push(G.typeAnnotation||"unknown");break;case"class":if(j.push("declare class"),j.push(G.name),G.generics)j.push(G.generics);if(G.extends)j.push(`extends ${G.extends}`);if(G.implements?.length)j.push(`implements ${G.implements.join(", ")}`);j.push("{ }");break;case"enum":j.push("declare enum"),j.push(G.name),j.push("{ }");break;default:return G.text||""}return j.join(" ")}function I(G){if(!G)return"";return G.map((j)=>{let J="";if(j.rest)J+="...";if(J+=j.name,j.optional)J+="?";if(j.type)J+=`: ${j.type}`;return J}).join(", ")}function x(G){return G.replace(/(?<!\/\*\*)\/\/[^\n]*/g,"").replace(/^\s*[\r\n]/gm,"").replace(/ {2,}/g," ").replace(/\s*([{}[\]();,:])\s*/g,"$1").replace(/(\w)(\{)/g,"$1 $2").replace(/(\})([a-z])/gi,"$1 $2").replace(/(export|import|type|interface|class|function|const|let|var|extends|implements|declare)\s*/g,"$1 ").trim()}
|
|
4
4
|
export{B as a,g as b,x as c};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pc as a,Qc as b,Rc as c,Sc as d,Tc as e,Uc as f}from"./chunk-
|
|
2
|
+
import{Pc as a,Qc as b,Rc as c,Sc as d,Tc as e,Uc as f}from"./chunk-7hy98p24.js";import"./chunk-gssantc8.js";import"./chunk-mcdb3q06.js";export{c as resetConfig,b as getConfig,e as defineConfigAsync,d as defineConfig,a as defaultConfig,f as config};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ec as K}from"./chunk-
|
|
2
|
+
import{ec as K}from"./chunk-ft0nf9jb.js";import{Wc as _}from"./chunk-gssantc8.js";import{existsSync as j,mkdirSync as w,readFileSync as b,writeFileSync as V}from"fs";import{basename as H,join as R}from"path";function N(q){let z={description:"",params:[],examples:[],tags:{},see:[],throws:[]};if(!q||q.length===0)return z;for(let A of q){let G=A.replace(/^\/\*\*/,"").replace(/\*\/$/,"").split(`
|
|
3
3
|
`).map((X)=>X.replace(/^\s*\*\s?/,"")).join(`
|
|
4
4
|
`).trim(),Q=G.search(/@\w+/);if(Q===-1){z.description=G;continue}else if(Q>0)z.description=G.slice(0,Q).trim(),G=G.slice(Q);let U=/@(\w+)(?:\s+\{([^}]+)\})?\s*([^\n@]*(?:\n(?!@)[^\n@]*)*)/g,W;while((W=U.exec(G))!==null){let[,X,Y,Z]=W,$=Z.trim();switch(X){case"param":{let v=$.match(/^(\[)?(\w+)\]?\s*(?:-\s*)?(.*)/);if(v)z.params.push({name:v[2],type:Y,description:v[3].trim(),optional:!!v[1]});break}case"returns":case"return":z.returns={type:Y,description:$};break;case"example":z.examples.push($);break;case"deprecated":z.deprecated=$||"Deprecated";break;case"since":z.since=$;break;case"see":z.see.push($);break;case"throws":case"throw":z.throws.push({type:Y,description:$});break;case"category":z.category=$;break;default:if(!z.tags[X])z.tags[X]=[];z.tags[X].push($)}}}return z}function M(q,z){let A=N(q.leadingComments),G="";switch(q.kind){case"function":G=h(q);break;case"variable":G=T(q);break;case"interface":G=F(q);break;case"type":G=S(q);break;case"class":G=k(q);break;case"enum":G=x(q);break;default:G=q.text||q.name}let Q={name:q.name,kind:q.kind,signature:G,jsdoc:A,isExported:q.isExported,isDefault:q.isDefault,sourceFile:z};if(q.members&&q.members.length>0)Q.members=q.members.map((U)=>M(U,z));return Q}function h(q){let z=[];if(q.isExported)z.push("export");if(q.isDefault)z.push("default");if(z.push("function"),z.push(q.name),q.generics)z.push(q.generics);if(q.parameters){let A=q.parameters.map((G)=>{let Q="";if(G.rest)Q+="...";if(Q+=G.name,G.optional)Q+="?";if(G.type)Q+=`: ${G.type}`;return Q}).join(", ");z.push(`(${A})`)}else z.push("()");if(q.returnType)z.push(`: ${q.returnType}`);return z.join(" ").replace(/\s+/g," ")}function T(q){let z=[];if(q.isExported)z.push("export");if(z.push("const"),z.push(q.name),q.typeAnnotation)z.push(`: ${q.typeAnnotation}`);return z.join(" ")}function F(q){let z=[];if(q.isExported)z.push("export");if(z.push("interface"),z.push(q.name),q.generics)z.push(q.generics);if(q.extends)z.push(`extends ${q.extends}`);return z.join(" ")}function S(q){let z=[];if(q.isExported)z.push("export");if(z.push("type"),z.push(q.name),q.generics)z.push(q.generics);if(z.push("="),q.typeAnnotation)z.push(q.typeAnnotation);return z.join(" ")}function k(q){let z=[];if(q.isExported)z.push("export");if(q.isDefault)z.push("default");if(z.push("class"),z.push(q.name),q.generics)z.push(q.generics);if(q.extends)z.push(`extends ${q.extends}`);if(q.implements&&q.implements.length>0)z.push(`implements ${q.implements.join(", ")}`);return z.join(" ")}function x(q){let z=[];if(q.isExported)z.push("export");return z.push("enum"),z.push(q.name),z.join(" ")}async function P(q,z={}){let A=[],G=new Map;for(let Q of q){if(!j(Q)){_.warn(`File not found: ${Q}`);continue}let U=b(Q,"utf-8"),W=K(U,Q,!0);for(let X of W){if(X.kind==="import")continue;if(!z.includePrivate&&X.name.startsWith("_"))continue;if(!z.includeInternal&&X.leadingComments?.some((Z)=>Z.includes("@internal")))continue;let Y=M(X,Q);if(A.push(Y),z.groupByCategory&&Y.jsdoc.category){let Z=Y.jsdoc.category;if(!G.has(Z))G.set(Z,[]);G.get(Z).push(Y)}}}return{title:z.title||"API Documentation",description:z.description,entries:A,categories:G,generatedAt:new Date}}function B(q,z={}){let A=[];if(A.push(`# ${q.title}`),A.push(""),q.description)A.push(q.description),A.push("");if(A.push(`> Generated on ${q.generatedAt.toISOString()}`),A.push(""),A.push("## Table of Contents"),A.push(""),z.groupByCategory&&q.categories.size>0)for(let G of q.categories.keys())A.push(`- [${G}](#${E(G)})`);else{let G=I(q.entries);for(let[Q,U]of G)if(U.length>0)A.push(`- [${O(Q)}](#${E(O(Q))})`)}if(A.push(""),z.groupByCategory&&q.categories.size>0)for(let[G,Q]of q.categories){A.push(`## ${G}`),A.push("");for(let U of Q)A.push(...L(U,z))}else{let G=I(q.entries);for(let[Q,U]of G)if(U.length>0){A.push(`## ${O(Q)}`),A.push("");for(let W of U)A.push(...L(W,z))}}return A.join(`
|
|
5
5
|
`)}function L(q,z){let A=[];if(A.push(`### ${q.name}`),A.push(""),q.jsdoc.deprecated)A.push(`> **Deprecated:** ${q.jsdoc.deprecated}`),A.push("");if(A.push("```typescript"),A.push(q.signature),A.push("```"),A.push(""),q.jsdoc.description)A.push(q.jsdoc.description),A.push("");if(q.jsdoc.params.length>0){A.push("**Parameters:**"),A.push(""),A.push("| Name | Type | Description |"),A.push("|------|------|-------------|");for(let G of q.jsdoc.params){let Q=G.optional?" (optional)":"",U=G.type||"any";A.push(`| \`${G.name}\`${Q} | \`${U}\` | ${G.description} |`)}A.push("")}if(q.jsdoc.returns){A.push("**Returns:**"),A.push("");let G=q.jsdoc.returns.type?`\`${q.jsdoc.returns.type}\``:"";A.push(`${G} ${q.jsdoc.returns.description}`),A.push("")}if(q.jsdoc.throws.length>0){A.push("**Throws:**"),A.push("");for(let G of q.jsdoc.throws){let Q=G.type?`\`${G.type}\``:"";A.push(`- ${Q} ${G.description}`)}A.push("")}if(q.jsdoc.examples.length>0){A.push("**Examples:**"),A.push("");for(let G of q.jsdoc.examples)A.push("```typescript"),A.push(G),A.push("```"),A.push("")}if(q.jsdoc.see.length>0){A.push("**See also:**"),A.push("");for(let G of q.jsdoc.see)A.push(`- ${G}`);A.push("")}if(q.jsdoc.since)A.push(`*Since: ${q.jsdoc.since}*`),A.push("");if(z.includeSourceLinks&&q.sourceFile){let G=q.sourceFile;if(z.sourceBaseUrl)A.push(`[Source](${z.sourceBaseUrl}/${G})`);else A.push(`*Source: ${G}*`);A.push("")}if(q.members&&q.members.length>0){A.push("**Members:**"),A.push("");for(let G of q.members)if(A.push(`#### ${G.name}`),A.push(""),A.push("```typescript"),A.push(G.signature),A.push("```"),A.push(""),G.jsdoc.description)A.push(G.jsdoc.description),A.push("")}return A.push("---"),A.push(""),A}function C(q,z={}){let A=B(q,z);return`<!DOCTYPE html>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./chunk-mcdb3q06.js";var e="@stacksjs/dtsx",i="module",n="0.9.21",r=!0,u="A modern, fast .d.ts generation tool, powered by Bun.",c="Chris Breuer <chris@stacksjs.org>",o="MIT",p="https://github.com/stacksjs/dtsx#readme",a={type:"git",url:"git+https://github.com/stacksjs/dtsx.git"},b={url:"https://github.com/stacksjs/dtsx/issues"},d=["dts","generation","isolated declarations","development","bun","stacks","typescript","javascript"],m={".":{import:"./dist/index.js"},"./*":{import:"./dist/*"}},g="./dist/index.js",l="./dist/index.d.ts",x={dtsx:"./dist/cli.js"},k=["dist"],h={benchmark:"bun benchmark/index.ts",build:"bun --filter './packages/dtsx' build",test:"bun test",lint:"bun x --bun pickier .","lint:fix":"bun x --bun pickier . --fix",format:"bun x --bun pickier . --format","format:fix":"bun x --bun pickier . --format --write",changelog:"bun x logsmith --verbose","changelog:generate":"bun x logsmith --output CHANGELOG.md",release:"bun --bun run changelog:generate && bun x --bun bumpx prompt --recursive","release:patch":"bun --bun run changelog:generate && bun x --bun bumpx patch --recursive --yes",typecheck:"bun x tsc --noEmit","dev:docs":"bun --bun vitepress dev docs","build:docs":"bun --bun vitepress build docs","preview:docs":"bun --bun vitepress preview docs"},v={"@stacksjs/bumpx":"^0.2.4","@stacksjs/bunpress":"^0.1.4","@stacksjs/clapp":"^0.2.0",pickier:"^0.1.20","@stacksjs/gitlint":"^0.1.5","@stacksjs/logsmith":"^0.2.1","@types/bun":"^1.3.11","@typescript/native-preview":"^7.0.0-dev.20260311.1","buddy-bot":"^0.9.18","bun-git-hooks":"^0.3.1","bun-plugin-dtsx":"workspace:*",mitata:"^1.0.34","oxc-transform":"^0.121.0",typescript:"^5.9.3"},j=["packages/*"],y={name:e,type:i,version:n,private:r,description:u,author:c,license:o,homepage:p,repository:a,bugs:b,keywords:d,exports:m,module:g,types:l,bin:x,files:k,scripts:h,devDependencies:v,workspaces:j,"git-hooks":{"pre-commit":{"staged-lint":{"*.{js,ts,json,yaml,yml,md}":"bun x --bun pickier lint --fix"}},"commit-msg":"bun x gitlint --edit .git/COMMIT_EDITMSG"}};export{j as workspaces,n as version,l as types,i as type,h as scripts,a as repository,r as private,e as name,g as module,o as license,d as keywords,p as homepage,k as files,m as exports,v as devDependencies,u as description,y as default,b as bugs,x as bin,c as author};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
function y(D){return D===32||D===9||D===10||D===13}function Bj(D){return D>=65&&D<=90||D>=97&&D<=122||D===95||D===36||D>127}function W(D){return Bj(D)||D>=48&&D<=57}function lj(D){if(D.charCodeAt(0)===82&&D.startsWith("Record<"))return!0;if(D.charCodeAt(0)===65&&D.startsWith("Array<"))return!0;if(D.charCodeAt(0)===123&&D.includes("[")&&D.includes("]:"))return!0;if(D==="any"||D==="object"||D==="unknown")return!0;return!1}var qj=["public","protected","private","readonly","override"];function dj(D,Hj,T=!0,l=!1){let Z=D,c=T,b=l,V=Z.length,L=[],P=new Map,x=new Set,j=0;if(j<V&&Z.charCodeAt(j)===65279)j++;function v(J,H){if(J<H){let U=Z.charCodeAt(J),X=Z.charCodeAt(H-1);if(U!==32&&U!==9&&U!==10&&U!==13&&X!==32&&X!==9&&X!==10&&X!==13)return Z.slice(J,H)}while(J<H&&y(Z.charCodeAt(J)))J++;while(H>J&&y(Z.charCodeAt(H-1)))H--;return Z.slice(J,H)}function O(){if(j>=V)return;let J=Z.charCodeAt(j);if(J!==32&&J!==9&&J!==10&&J!==13&&J!==47)return;while(j<V){let H=Z.charCodeAt(j);if(H===32||H===9||H===10||H===13){j++;continue}if(H===47&&j+1<V){let U=Z.charCodeAt(j+1);if(U===47){let X=Z.indexOf(`
|
|
3
|
-
`,j+2);j=X===-1?V:X+1;continue}if(U===42){let X=Z.indexOf("*/",j+2);j=X===-1?V:X+2;continue}}break}}function
|
|
4
|
-
`,j+2);j=X===-1?V:X+1;continue}if(U===42){let X=Z.indexOf("*/",j+2);j=X===-1?V:X+2;continue}j++;continue}if(H===123){J[J.length-1]++,j++;continue}if(H===125){let U=J[J.length-1];if(U===0){J.pop(),j++;continue}J[J.length-1]=U-1,j++;continue}j++}}function f(){let J=Z.charCodeAt(j);if(J===39||J===34)return h(J),!0;if(J===96)return t(),!0;if(J===47&&j+1<V){let H=Z.charCodeAt(j+1);if(H===47){let U=Z.indexOf(`
|
|
5
|
-
`,j+2);return j=U===-1?V:U+1,!0}if(H===42){let U=Z.indexOf("*/",j+2);return j=U===-1?V:U+2,!0}if(
|
|
3
|
+
`,j+2);j=X===-1?V:X+1;continue}if(U===42){let X=Z.indexOf("*/",j+2);j=X===-1?V:X+2;continue}}break}}function fj(J){let H=J.length,U=0,X=H;for(let Y=0;Y<H;Y++){let $=J.charCodeAt(Y);if(U){if($===92){Y++;continue}if($===U)U=0;continue}if($===39||$===34||$===96){U=$;continue}if($===47&&Y+1<H){let G=J.charCodeAt(Y+1);if(G===47){X=Y;while(X>0&&(J.charCodeAt(X-1)===32||J.charCodeAt(X-1)===9))X--;return J.slice(0,X)}if(G===42){let B=J.indexOf("*/",Y+2);if(B!==-1){J=`${J.slice(0,Y)} ${J.slice(B+2)}`,Y--;continue}}}}X=H;while(X>0&&(J.charCodeAt(X-1)===32||J.charCodeAt(X-1)===9||J.charCodeAt(X-1)===13))X--;return X<H?J.slice(0,X):J}function h(J){j++;let H=J===39?"'":'"';while(j<V){let U=Z.indexOf(H,j);if(U===-1){j=V;return}let X=0,Y=U-1;while(Y>=0&&Z.charCodeAt(Y)===92)X++,Y--;if(X%2===0){j=U+1;return}j=U+1}}function t(){j++;let J=[];while(j<V){let H=Z.charCodeAt(j);if(J.length===0){if(H===92){j+=2;continue}if(H===96){j++;return}if(H===36&&j+1<V&&Z.charCodeAt(j+1)===123){j+=2,J.push(0);continue}j++;continue}if(H===39||H===34){h(H);continue}if(H===96){t();continue}if(H===47&&j+1<V){let U=Z.charCodeAt(j+1);if(U===47){let X=Z.indexOf(`
|
|
4
|
+
`,j+2);j=X===-1?V:X+1;continue}if(U===42){let X=Z.indexOf("*/",j+2);j=X===-1?V:X+2;continue}if(Nj()){Rj();continue}j++;continue}if(H===123){J[J.length-1]++,j++;continue}if(H===125){let U=J[J.length-1];if(U===0){J.pop(),j++;continue}J[J.length-1]=U-1,j++;continue}j++}}function f(){let J=Z.charCodeAt(j);if(J===39||J===34)return h(J),!0;if(J===96)return t(),!0;if(J===47&&j+1<V){let H=Z.charCodeAt(j+1);if(H===47){let U=Z.indexOf(`
|
|
5
|
+
`,j+2);return j=U===-1?V:U+1,!0}if(H===42){let U=Z.indexOf("*/",j+2);return j=U===-1?V:U+2,!0}if(Nj())return Rj(),!0}return!1}function Nj(){let J=j-1;while(J>=0&&(Z.charCodeAt(J)===32||Z.charCodeAt(J)===9||Z.charCodeAt(J)===10||Z.charCodeAt(J)===13))J--;if(J<0)return!0;let H=Z.charCodeAt(J);if(H===61||H===40||H===91||H===33||H===38||H===124||H===63||H===58||H===44||H===59||H===123||H===125||H===94||H===126||H===43||H===45||H===42||H===37||H===60||H===62)return!0;if(W(H)){let U=J;while(U>=0&&W(Z.charCodeAt(U)))U--;let X=Z.slice(U+1,J+1);if(X==="return"||X==="typeof"||X==="void"||X==="delete"||X==="throw"||X==="new"||X==="in"||X==="of"||X==="case"||X==="instanceof"||X==="yield"||X==="await")return!0}return!1}function Rj(){j++;let J=!1;while(j<V){let H=Z.charCodeAt(j);if(H===92){j+=2;continue}if(J){if(H===93)J=!1;j++;continue}if(H===91){J=!0,j++;continue}if(H===47){j++;break}if(H===10||H===13)break;j++}while(j<V&&W(Z.charCodeAt(j)))j++}function E(){let J=j;while(j<V&&W(Z.charCodeAt(j)))j++;return Z.slice(J,j)}function z(J){if(j+J.length>V)return!1;for(let H=0;H<J.length;H++)if(Z.charCodeAt(j+H)!==J.charCodeAt(H))return!1;if(j+J.length<V&&W(Z.charCodeAt(j+J.length)))return!1;return!0}function Jj(J){let H=j+J;while(H<V){let U=Z.charCodeAt(H);if(U===32||U===9||U===10||U===13){H++;continue}return U!==46&&U!==61}return!1}function yj(){if(j>=V)return!1;switch(Z.charCodeAt(j)){case 101:return z("export")||z("enum");case 105:return z("import")||z("interface");case 102:return z("function");case 99:return z("class")||z("const");case 116:return z("type");case 108:return z("let");case 118:return z("var");case 100:return z("declare")||z("default");case 109:return z("module");case 110:return z("namespace");case 97:return z("abstract")||z("async");default:return!1}}function a(){let J=Z.charCodeAt(j);if(J!==10&&J!==13)return!1;let H=j;if(j++,J===13&&j<V&&Z.charCodeAt(j)===10)j++;while(j<V){let X=Z.charCodeAt(j);if(X===32||X===9||X===13||X===10){j++;continue}if(X===47&&j+1<V){let Y=Z.charCodeAt(j+1);if(Y===47){let $=Z.indexOf(`
|
|
6
6
|
`,j+2);j=$===-1?V:$+1;continue}if(Y===42){let $=Z.indexOf("*/",j+2);j=$===-1?V:$+2;continue}}break}let U=j>=V||yj()||Z.charCodeAt(j)===125;return j=H,U}function e(){let J=Z.charCodeAt(j);if(J!==10&&J!==13)return!1;let H=j;if(j++,J===13&&j<V&&Z.charCodeAt(j)===10)j++;while(j<V){let X=Z.charCodeAt(j);if(X===32||X===9||X===13||X===10){j++;continue}if(X===47&&j+1<V&&Z.charCodeAt(j+1)===47){let Y=Z.indexOf(`
|
|
7
|
-
`,j+2);j=Y===-1?V:Y+1;continue}break}if(j>=V)return j=H,!0;let U=Z.charCodeAt(j);if(U===124||U===38||U===46||U===63||U===58)return j=H,!1;if(z("extends")||z("keyof")||z("typeof")||z("infer")||z("is")||z("as")||z("in"))return j=H,!1;return j=H,!0}let Aj=/[{}'"`\/]/g,Tj=/[()'"`\/]/g,kj=/[[\]'"`\/]/g,Cj=/[<>'"`\/]/g;function A(J,H){let U=1;j++;let X=J===123?Aj:J===40?Tj:J===91?kj:Cj;X.lastIndex=j;let Y;while((Y=X.exec(Z))!==null){let $=Y.index,G=Z.charCodeAt($);if(G===39||G===34){j=$,h(G),X.lastIndex=j;continue}if(G===96){j=$,t(),X.lastIndex=j;continue}if(G===47){if(j=$,f()){X.lastIndex=j;continue}X.lastIndex=$+1;continue}if(G===J)U++;else if(G===H){if(H===62&&$>0&&Z.charCodeAt($-1)===61){X.lastIndex=$+1;continue}if(U--,U===0)return j=$+1,j}X.lastIndex=$+1}return j=V,j}function S(){return j>0&&Z.charCodeAt(j-1)===61}function Xj(){return j+1<V&&Z.charCodeAt(j+1)===62}let k=/[{};'"`\/\n\r()[\]]/g;function I(){let J=0,H=0,U=0;k.lastIndex=j;let X;while((X=k.exec(Z))!==null){let Y=X.index,$=Z.charCodeAt(Y);if($===39||$===34){j=Y,h($),k.lastIndex=j;continue}if($===96){j=Y,t(),k.lastIndex=j;continue}if($===47){if(j=Y,f()){k.lastIndex=j;continue}k.lastIndex=Y+1;continue}if($===40){H++,k.lastIndex=Y+1;continue}if($===41){H--,k.lastIndex=Y+1;continue}if($===91){U++,k.lastIndex=Y+1;continue}if($===93){U--,k.lastIndex=Y+1;continue}if($===123){J++,k.lastIndex=Y+1;continue}if($===125){if(J--,J<=0&&H<=0&&U<=0){j=Y+1;return}k.lastIndex=Y+1;continue}if($===59&&J===0&&H===0&&U===0){j=Y+1;return}if(($===10||$===13)&&J===0&&H===0&&U===0){if(j=Y,a())return}k.lastIndex=Y+1}j=V}function
|
|
8
|
-
`));continue}break}if(U.length===0)return;return U.reverse(),U}function Sj(J){let H=J,U=!1;while(j<V){let Q=Z.charCodeAt(j);if(Q===59){j++;break}if(Q===39||Q===34){h(Q),U=!0;while(j<V&&(Z.charCodeAt(j)===32||Z.charCodeAt(j)===9))j++;if(j<V&&Z.charCodeAt(j)===59)j++;break}if(Q===10&&U)break;j++}let X=v(H,j),Y=X.charCodeAt(7)===116&&(X.startsWith("import type ")||X.startsWith("import type{")),$=!1;{let Q=6;while(Q<X.length&&(X.charCodeAt(Q)===32||X.charCodeAt(Q)===9))Q++;if(Q<X.length&&X.charCodeAt(Q)===116&&X.startsWith("type",Q)){Q+=4;while(Q<X.length&&(X.charCodeAt(Q)===32||X.charCodeAt(Q)===9))Q++}if(Q<X.length){let K=X.charCodeAt(Q);$=K===39||K===34}}let G="";{let Q=X.indexOf("from ");if(Q!==-1){let K=Q+5;while(K<X.length&&(X.charCodeAt(K)===32||X.charCodeAt(K)===9))K++;if(K<X.length){let q=X.charCodeAt(K);if(q===39||q===34){let _=X.indexOf(String.fromCharCode(q),K+1);if(_!==-1)G=X.slice(K+1,_)}}}else if($){let K=6;while(K<X.length&&X.charCodeAt(K)!==39&&X.charCodeAt(K)!==34)K++;if(K<X.length){let q=X.charCodeAt(K),_=X.indexOf(String.fromCharCode(q),K+1);if(_!==-1)G=X.slice(K+1,_)}}}let B=C(H);return{kind:"import",name:"",text:X,isExported:!1,isTypeOnly:Y,isSideEffect:$,source:G,leadingComments:B,start:H,end:j}}function Yj(){let J=j;return A(123,125),Z.slice(J,j)}function
|
|
9
|
-
`),X=[],Y=[],$=[],G=!1,B=1/0;for(let q=0;q<U.length;q++){let _=U[q];if(H){if(G){if(_.includes("*/"))G=!1;continue}let g=_.trim();if(g.length===0)continue;let R=g.charCodeAt(0);if(R===47){let w=g.charCodeAt(1);if(w===47)continue;if(w===42){if(!g.includes("*/"))G=!0;continue}}if(R===42)continue;let F=
|
|
7
|
+
`,j+2);j=Y===-1?V:Y+1;continue}break}if(j>=V)return j=H,!0;let U=Z.charCodeAt(j);if(U===124||U===38||U===46||U===63||U===58)return j=H,!1;if(z("extends")||z("keyof")||z("typeof")||z("infer")||z("is")||z("as")||z("in"))return j=H,!1;return j=H,!0}let Aj=/[{}'"`\/]/g,Tj=/[()'"`\/]/g,kj=/[[\]'"`\/]/g,Cj=/[<>'"`\/]/g;function A(J,H){let U=1;j++;let X=J===123?Aj:J===40?Tj:J===91?kj:Cj;X.lastIndex=j;let Y;while((Y=X.exec(Z))!==null){let $=Y.index,G=Z.charCodeAt($);if(G===39||G===34){j=$,h(G),X.lastIndex=j;continue}if(G===96){j=$,t(),X.lastIndex=j;continue}if(G===47){if(j=$,f()){X.lastIndex=j;continue}X.lastIndex=$+1;continue}if(G===J)U++;else if(G===H){if(H===62&&$>0&&Z.charCodeAt($-1)===61){X.lastIndex=$+1;continue}if(U--,U===0)return j=$+1,j}X.lastIndex=$+1}return j=V,j}function S(){return j>0&&Z.charCodeAt(j-1)===61}function Xj(){return j+1<V&&Z.charCodeAt(j+1)===62}let k=/[{};'"`\/\n\r()[\]]/g;function I(){let J=0,H=0,U=0;k.lastIndex=j;let X;while((X=k.exec(Z))!==null){let Y=X.index,$=Z.charCodeAt(Y);if($===39||$===34){j=Y,h($),k.lastIndex=j;continue}if($===96){j=Y,t(),k.lastIndex=j;continue}if($===47){if(j=Y,f()){k.lastIndex=j;continue}k.lastIndex=Y+1;continue}if($===40){H++,k.lastIndex=Y+1;continue}if($===41){H--,k.lastIndex=Y+1;continue}if($===91){U++,k.lastIndex=Y+1;continue}if($===93){U--,k.lastIndex=Y+1;continue}if($===123){J++,k.lastIndex=Y+1;continue}if($===125){if(J--,J<=0&&H<=0&&U<=0){j=Y+1;return}k.lastIndex=Y+1;continue}if($===59&&J===0&&H===0&&U===0){j=Y+1;return}if(($===10||$===13)&&J===0&&H===0&&U===0){if(j=Y,a())return}k.lastIndex=Y+1}j=V}function _j(){A(123,125);while(j<V&&y(Z.charCodeAt(j)))j++;if(z("from")){j+=4;while(j<V&&y(Z.charCodeAt(j)))j++;if(j<V){let J=Z.charCodeAt(j);if(J===39||J===34)h(J)}}while(j<V&&(Z.charCodeAt(j)===32||Z.charCodeAt(j)===9))j++;if(j<V&&Z.charCodeAt(j)===59)j++}function gj(){j++;while(j<V&&y(Z.charCodeAt(j)))j++;if(z("as")){j+=2;while(j<V&&y(Z.charCodeAt(j)))j++;E();while(j<V&&y(Z.charCodeAt(j)))j++}if(z("from")){j+=4;while(j<V&&y(Z.charCodeAt(j)))j++;if(j<V){let J=Z.charCodeAt(j);if(J===39||J===34)h(J)}}while(j<V&&(Z.charCodeAt(j)===32||Z.charCodeAt(j)===9))j++;if(j<V&&Z.charCodeAt(j)===59)j++}function Uj(J){let H=J.indexOf("from ");if(H===-1)return;let U=H+5;while(U<J.length&&(J.charCodeAt(U)===32||J.charCodeAt(U)===9))U++;if(U>=J.length)return;let X=J.charCodeAt(U);if(X!==39&&X!==34)return;let Y=J.indexOf(J[U],U+1);if(Y===-1)return;return J.slice(U+1,Y)}function C(J){if(!c)return;let H=J-1;while(H>=0&&y(Z.charCodeAt(H)))H--;if(H<0)return;let U=[],X=!1;while(H>=0){if(H>=1&&Z.charCodeAt(H)===47&&Z.charCodeAt(H-1)===42){let G=Z.lastIndexOf("/*",H-2);if(G>=0){U.push(Z.slice(G,H+1)),X=!0,H=G-1;while(H>=0&&y(Z.charCodeAt(H)))H--;continue}break}let Y=H;while(Y>0&&Z.charCodeAt(Y-1)!==10)Y--;let $=v(Y,H+1);if($.startsWith("//")){if(X)break;let G=[$];H=Y-1;while(H>=0&&(Z.charCodeAt(H)===10||Z.charCodeAt(H)===13))H--;while(H>=0){let B=H;while(B>0&&Z.charCodeAt(B-1)!==10)B--;let Q=v(B,H+1);if(Q.startsWith("//")){G.push(Q),H=B-1;while(H>=0&&(Z.charCodeAt(H)===10||Z.charCodeAt(H)===13))H--}else if(Q===""){H=B-1;while(H>=0&&(Z.charCodeAt(H)===10||Z.charCodeAt(H)===13))H--}else break}G.reverse(),U.push(G.join(`
|
|
8
|
+
`));continue}break}if(U.length===0)return;return U.reverse(),U}function Sj(J){let H=J,U=!1;while(j<V){let Q=Z.charCodeAt(j);if(Q===59){j++;break}if(Q===39||Q===34){h(Q),U=!0;while(j<V&&(Z.charCodeAt(j)===32||Z.charCodeAt(j)===9))j++;if(j<V&&Z.charCodeAt(j)===59)j++;break}if(Q===10&&U)break;j++}let X=v(H,j),Y=X.charCodeAt(7)===116&&(X.startsWith("import type ")||X.startsWith("import type{")),$=!1;{let Q=6;while(Q<X.length&&(X.charCodeAt(Q)===32||X.charCodeAt(Q)===9))Q++;if(Q<X.length&&X.charCodeAt(Q)===116&&X.startsWith("type",Q)){Q+=4;while(Q<X.length&&(X.charCodeAt(Q)===32||X.charCodeAt(Q)===9))Q++}if(Q<X.length){let K=X.charCodeAt(Q);$=K===39||K===34}}let G="";{let Q=X.indexOf("from ");if(Q!==-1){let K=Q+5;while(K<X.length&&(X.charCodeAt(K)===32||X.charCodeAt(K)===9))K++;if(K<X.length){let q=X.charCodeAt(K);if(q===39||q===34){let _=X.indexOf(String.fromCharCode(q),K+1);if(_!==-1)G=X.slice(K+1,_)}}}else if($){let K=6;while(K<X.length&&X.charCodeAt(K)!==39&&X.charCodeAt(K)!==34)K++;if(K<X.length){let q=X.charCodeAt(K),_=X.indexOf(String.fromCharCode(q),K+1);if(_!==-1)G=X.slice(K+1,_)}}}let B=C(H);return{kind:"import",name:"",text:X,isExported:!1,isTypeOnly:Y,isSideEffect:$,source:G,leadingComments:B,start:H,end:j}}function Yj(){let J=j;return A(123,125),Z.slice(J,j)}function Lj(J){let H=J.indexOf("(");if(H===-1)return J;let U=J.slice(H);if(U.indexOf("=")===-1)return J;let X=!1;for(let Q=0;Q<U.length;Q++)if(U.charCodeAt(Q)===61){let q=Q>0?U.charCodeAt(Q-1):0,_=Q+1<U.length?U.charCodeAt(Q+1):0;if(q!==61&&q!==33&&q!==60&&q!==62&&_!==61&&_!==62){X=!0;break}}if(!X)return J;let Y=0,$=-1;for(let Q=H;Q<J.length;Q++){let K=J.charCodeAt(Q);if(K===40)Y++;else if(K===41){if(Y--,Y===0){$=Q;break}}}if($===-1)return J;let G=J.slice(H,$+1),B=n(G);return J.slice(0,H)+B+J.slice($+1)}function Mj(J){let H=J.indexOf("//")!==-1||J.indexOf("/*")!==-1,U=J.split(`
|
|
9
|
+
`),X=[],Y=[],$=[],G=!1,B=1/0;for(let q=0;q<U.length;q++){let _=U[q];if(H){if(G){if(_.includes("*/"))G=!1;continue}let g=_.trim();if(g.length===0)continue;let R=g.charCodeAt(0);if(R===47){let w=g.charCodeAt(1);if(w===47)continue;if(w===42){if(!g.includes("*/"))G=!0;continue}}if(R===42)continue;let F=fj(_);if(F.charCodeAt(F.length-1)===59)F=F.slice(0,-1);F=Lj(F);let N=F.trim();if(!N)continue;X.push(F),Y.push(N);let M=0;while(M<F.length&&y(F.charCodeAt(M)))M++;if(N!=="{"&&N!=="}"){if(M<B)B=M}$.push(M)}else{let g=_.length;while(g>0&&(_.charCodeAt(g-1)===32||_.charCodeAt(g-1)===9||_.charCodeAt(g-1)===13))g--;if(g===0)continue;let R=g<_.length?_.slice(0,g):_;if(R.charCodeAt(R.length-1)===59)R=R.slice(0,-1);R=Lj(R);let F=R.trim();if(!F)continue;X.push(R),Y.push(F);let N=0;while(N<R.length&&y(R.charCodeAt(N)))N++;if(F!=="{"&&F!=="}"){if(N<B)B=N}$.push(N)}}if(X.length===0)return"{}";if(B===1/0||B<=2)return X.join(`
|
|
10
10
|
`);let Q=B-2,K=Array(X.length);for(let q=0;q<X.length;q++){let _=Y[q];if(_==="{"){K[q]=_;continue}let g=$[q];if(g>B)K[q]=X[q];else if(g===B&&(_.charCodeAt(0)===125||_.charCodeAt(0)===93||_.charCodeAt(0)===41))K[q]=X[q];else{let R=Math.max(0,g-Q);K[q]=" ".repeat(R)+_}}return K.join(`
|
|
11
11
|
`)}function u(){if(j>=V||Z.charCodeAt(j)!==60)return"";let J=j;A(60,62);let H=Z.slice(J,j);if(H.includes(`
|
|
12
12
|
`)){let U="",X=!1;for(let Y=0;Y<H.length;Y++){let $=H.charCodeAt(Y);if($===32||$===9||$===10||$===13){if(!X&&U.length>0)U+=" ",X=!0}else U+=H[Y],X=!1}if(U.charCodeAt(1)===32)U=`<${U.slice(2)}`;if(U.charCodeAt(U.length-2)===32)U=`${U.slice(0,-2)}>`;return U}return H}function m(){if(j>=V||Z.charCodeAt(j)!==40)return"()";let J=j;return A(40,41),Z.slice(J,j)}function n(J){let H=J.slice(1,-1).trim();if(!H)return"()";if(J.indexOf(`
|
|
13
13
|
`)===-1&&H.indexOf(":")!==-1&&H.indexOf("{")===-1&&H.indexOf("[")===-1&&H.indexOf("=")===-1&&H.indexOf("@")===-1&&H.indexOf("...")===-1){let Q=0,K=0,q=0;for(let _=0;_<H.length;_++){let g=H.charCodeAt(_);if(g===40||g===60||g===123)q++;else if(g===41||g===62||g===125)q--;else if(q===0){if(g===58)Q++;else if(g===44)K++}}if(Q>=K+1){let _=!1;for(let g=0;g<qj.length;g++){let R=qj[g],F=H.indexOf(R);if(F!==-1){let N=F+R.length;if((F===0||!W(H.charCodeAt(F-1)))&&(N>=H.length||!W(H.charCodeAt(N)))){_=!0;break}}}if(!_)return J}}let U=[],X=0,Y=0,$=!1,G=0;for(let Q=0;Q<=H.length;Q++){if(Q===H.length){U.push(H.slice(X).trim());break}let K=H.charCodeAt(Q);if($){if(K===92){Q++;continue}if(K===G)$=!1;continue}if(K===47&&Q+1<H.length){let q=H.charCodeAt(Q+1);if(q===42){Q+=2;while(Q+1<H.length&&!(H.charCodeAt(Q)===42&&H.charCodeAt(Q+1)===47))Q++;Q++;continue}if(q===47){while(Q<H.length&&H.charCodeAt(Q)!==10)Q++;continue}}if(K===39||K===34||K===96){$=!0,G=K;continue}if(K===40||K===123||K===91||K===60)Y++;else if(K===41||K===125||K===93||K===62&&!(Q>0&&H.charCodeAt(Q-1)===61))Y--;else if(K===44&&Y===0)U.push(H.slice(X,Q).trim()),X=Q+1}let B=[];for(let Q of U){if(!Q)continue;let K=Q.trim();if(K.startsWith("//")||K.startsWith("/*"))continue;let q=Q;{let _=!1,g=0,R=0,F=0;for(let N=0;N<q.length-1;N++){let M=q.charCodeAt(N);if(M===10){F=N+1;continue}if(_){if(M===92){N++;continue}if(M===g)_=!1;continue}if(M===39||M===34||M===96){_=!0,g=M;continue}if(M===123||M===91||M===40||M===60){R++;continue}if(M===125||M===93||M===41||M===62){if(R>0)R--;continue}if(M===47&&q.charCodeAt(N+1)===47){if(R===0){q=q.slice(0,N).trimEnd();break}let w=q.indexOf(`
|
|
14
|
-
`,N);if(w===-1){q=q.slice(0,F).trimEnd();break}let s=q.slice(0,F),hj=q.slice(w+1);q=`${s}${hj}`,N=F-1}}}if(!q.trim())continue;B.push(
|
|
15
|
-
`))H=H.slice(0,-1);U++;let B=0;while(U<J.length){let Q=J.charCodeAt(U);if(Q===39||Q===34||Q===96){let K=Q;U++;while(U<J.length){if(J.charCodeAt(U)===92){U+=2;continue}if(J.charCodeAt(U)===K){U++;break}U++}continue}if(Q===123||Q===91||Q===40)B++;else if(Q===125||Q===93||Q===41){if(B===0)break;B--}else if(Q===44&&B===0)break;U++}continue}if(X===1&&G===46&&U+2<J.length&&J.charCodeAt(U+1)===46&&J.charCodeAt(U+2)===46){U+=3;continue}H+=J[U],U++}return H}function
|
|
14
|
+
`,N);if(w===-1){q=q.slice(0,F).trimEnd();break}let s=q.slice(0,F),hj=q.slice(w+1);q=`${s}${hj}`,N=F-1}}}if(!q.trim())continue;B.push(Dj(q))}return`(${B.join(", ")})`}function Wj(J){if(!J.startsWith("{")&&!J.startsWith("["))return J;let H="",U=0,X=0,Y=!1,$=0;while(U<J.length){let G=J.charCodeAt(U);if(Y){if(G===92&&U+1<J.length){H+=J[U]+J[U+1],U+=2;continue}if(G===$)Y=!1;H+=J[U],U++;continue}if(G===47&&U+1<J.length){let B=J.charCodeAt(U+1);if(B===42){let Q=U;U+=2;while(U+1<J.length&&!(J.charCodeAt(U)===42&&J.charCodeAt(U+1)===47))U++;U=Math.min(U+2,J.length),H+=J.slice(Q,U);continue}if(B===47){let Q=U;while(U<J.length&&J.charCodeAt(U)!==10)U++;H+=J.slice(Q,U);continue}}if(G===39||G===34||G===96){Y=!0,$=G,H+=J[U],U++;continue}if(G===123||G===91||G===40)X++;else if(G===125||G===93||G===41)X--;if(X>=1&&G===61&&(U+1>=J.length||J.charCodeAt(U+1)!==61&&J.charCodeAt(U+1)!==62)){while(H.length>0&&(H[H.length-1]===" "||H[H.length-1]==="\t"||H[H.length-1]===`
|
|
15
|
+
`))H=H.slice(0,-1);U++;let B=0;while(U<J.length){let Q=J.charCodeAt(U);if(Q===39||Q===34||Q===96){let K=Q;U++;while(U<J.length){if(J.charCodeAt(U)===92){U+=2;continue}if(J.charCodeAt(U)===K){U++;break}U++}continue}if(Q===123||Q===91||Q===40)B++;else if(Q===125||Q===93||Q===41){if(B===0)break;B--}else if(Q===44&&B===0)break;U++}continue}if(X===1&&G===46&&U+2<J.length&&J.charCodeAt(U+1)===46&&J.charCodeAt(U+2)===46){U+=3;continue}H+=J[U],U++}return H}function Dj(J){let H=J.trim(),U=H.startsWith("...");if(U)H=H.slice(3).trim();while(H.startsWith("@")){let F=1;while(F<H.length&&W(H.charCodeAt(F)))F++;if(F<H.length&&H.charCodeAt(F)===40){let N=1;F++;while(F<H.length&&N>0){if(H.charCodeAt(F)===40)N++;else if(H.charCodeAt(F)===41)N--;F++}}H=H.slice(F).trim()}let X=!0;while(X){X=!1;for(let F of qj)if(H.startsWith(F)&&H.length>F.length&&!W(H.charCodeAt(F.length))){let N=H.slice(F.length).trim();if(N.charCodeAt(0)===58||N.charCodeAt(0)===63&&N.length>1&&N.charCodeAt(1)===58)break;H=N,X=!0;break}}let Y=-1,$=-1,G=0,B=!1,Q=0;for(let F=0;F<H.length;F++){let N=H.charCodeAt(F);if(B){if(N===92){F++;continue}if(N===Q)B=!1;continue}if(N===47&&F+1<H.length){let M=H.charCodeAt(F+1);if(M===42){F+=2;while(F+1<H.length&&!(H.charCodeAt(F)===42&&H.charCodeAt(F+1)===47))F++;F++;continue}if(M===47){while(F<H.length&&H.charCodeAt(F)!==10)F++;continue}}if(N===39||N===34||N===96){B=!0,Q=N;continue}if(N===40||N===123||N===91||N===60)G++;else if(N===41||N===125||N===93||N===62&&!(F>0&&H.charCodeAt(F-1)===61))G--;else if(G===0){if(N===58&&Y===-1)Y=F;else if(N===61&&$===-1&&(F===0||H.charCodeAt(F-1)!==61)&&(F+1>=H.length||H.charCodeAt(F+1)!==61&&H.charCodeAt(F+1)!==62))$=F}}let K,q,_=$!==-1;if(Y!==-1&&($===-1||Y<$))if(K=H.slice(0,Y).trim(),$!==-1)q=H.slice(Y+1,$).trim();else q=H.slice(Y+1).trim();else if($!==-1)K=H.slice(0,$).trim(),q=Zj(H.slice($+1).trim());else K=H,q="unknown";if(K=Wj(K),(K.startsWith("{")||K.startsWith("["))&&K.includes(`
|
|
16
16
|
`)){let F=K.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(F.length<=40)K=F;else K=K.split(`
|
|
17
17
|
`).map((M)=>{let w=M.trim();if(!w)return"";if(w==="{"||w==="}"||w==="["||w==="]"||w.startsWith("}")||w.startsWith("]"))return w;return` ${w}`}).join(`
|
|
18
|
-
`)}let g=K.endsWith("?")||_;if(K.endsWith("?"))K=K.slice(0,-1).trim();let R=g&&!U?"?":"";if(U)return`...${K}: ${q}`;return`${K}${R}: ${q}`}function
|
|
18
|
+
`)}let g=K.endsWith("?")||_;if(K.endsWith("?"))K=K.slice(0,-1).trim();let R=g&&!U?"?":"";if(U)return`...${K}: ${q}`;return`${K}${R}: ${q}`}function Pj(J){let H=0;if(H<J.length&&J.charCodeAt(H)===45)H++;if(H>=J.length)return!1;let U=J.charCodeAt(H);if(U<48||U>57)return!1;while(H<J.length&&J.charCodeAt(H)>=48&&J.charCodeAt(H)<=57)H++;if(H<J.length&&J.charCodeAt(H)===46){if(H++,H>=J.length||J.charCodeAt(H)<48||J.charCodeAt(H)>57)return!1;while(H<J.length&&J.charCodeAt(H)>=48&&J.charCodeAt(H)<=57)H++}return H===J.length}function Zj(J){let H=J.trim();if(H==="true"||H==="false")return"boolean";if(Pj(H))return"number";if(H.startsWith("'")&&H.endsWith("'")||H.startsWith('"')&&H.endsWith('"'))return"string";if(H.startsWith("["))return"unknown[]";if(H.startsWith("{"))return"Record<string, unknown>";return"unknown"}function $j(J){let H=J.trim();if(H==="true"||H==="false")return H;if(Pj(H))return H;if(H.startsWith("'")&&H.endsWith("'")||H.startsWith('"')&&H.endsWith('"'))return H;return"unknown"}function Qj(J){if(J.endsWith("as const"))return null;let H=0,U=-1;for(let Y=0;Y<J.length;Y++){let $=J.charCodeAt(Y);if($===123||$===91||$===40)H++;else if($===125||$===93||$===41)H--;else if(H===0&&$===32&&Y+4<=J.length&&J.substring(Y,Y+4)===" as ")U=Y}if(U===-1)return null;return J.slice(U+4).trim()||null}function jj(){if(O(),j<V&&Z.charCodeAt(j)===58){j++,O();let J=j,H=0;while(j<V){if(f())continue;let U=Z.charCodeAt(j);if(U===40||U===91||U===60)H++;else if(U===41||U===93||U===62&&!S())H--;else if(U===123)if(H>0)H++;else{let X=v(J,j),Y=($)=>{let G=X.length-$.length;return G>=0&&X.endsWith($)&&(G===0||!W(X.charCodeAt(G-1)))};if(X.length===0||X.endsWith("|")||X.endsWith("&")||Y("is")||Y("extends"))H++;else break}else if(U===125){if(H===0)break;H--}else if(H===0&&U===59)break;if(H===0&&e())break;j++}return v(J,j)}return""}function d(J,H,U,X){j+=8,O();let Y=j<V&&Z.charCodeAt(j)===42;if(Y)j++,O();let $=E();if(!$&&!X)return null;O();let G=u();O();let B=m();O();let Q=jj();if(!Q)if(U&&Y)Q="AsyncGenerator<unknown, void, unknown>";else if(Y)Q="Generator<unknown, void, unknown>";else if(U)Q="Promise<void>";else Q="void";O();let K=!1;if(j<V&&Z.charCodeAt(j)===123)K=!0,A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;let q=n(B),g=`${H?X?"export default function ":"export declare function ":"declare function "}${$||"default"}${G}${q}: ${Q};`,R=C(J);if(K)x.add(L.length);return{kind:"function",name:$||"default",text:g,isExported:H,isDefault:X,isAsync:U,isGenerator:Y,returnType:Q,generics:G||void 0,leadingComments:R,start:J,end:j}}function r(J,H,U){j+=H.length,O();let X=[];do{if(O(),j>=V)break;let Y=Z.charCodeAt(j);if(Y===123||Y===91)return I(),X;let $=E();if(!$)return I(),X;O();let G,B,Q=!1;if(j<V&&Z.charCodeAt(j)===58){j++,O();let _=j,g=0;while(j<V){if(f())continue;let R=Z.charCodeAt(j);if(R===40||R===123||R===91||R===60)g++;else if(R===41||R===125||R===93||R===62&&!S())g--;else if(g===0&&(R===59||R===44))break;else if(g===0&&R===61&&!Xj())break;if(g===0&&a())break;j++}G=v(_,j)}if(j<V&&Z.charCodeAt(j)===61)if(b&&G&&!lj(G))I();else{j++,O();let _=j,g=0,R=0;while(j<V){if(f())continue;let F=Z.charCodeAt(j);if(F===40||F===123||F===91)g++;else if(F===41||F===125||F===93)g--;else if(F===60&&g===0){if(j+1>=V||Z.charCodeAt(j+1)!==61)R++}else if(F===62&&g===0&&!S()){if(R>0&&(j+1>=V||Z.charCodeAt(j+1)!==61))R--}else if(g===0&&R===0&&(F===59||F===44))break;if(g===0&&R===0&&a())break;j++}if(B=v(_,j),B.endsWith(" as const")||B==="const"){if(Q=!0,!G){let F=B.endsWith(" as const")?B.slice(0,-9).trim():B,N=$j(F);G=N!=="unknown"?N:void 0}}else if(!G){let F=Qj(B);if(F)G=F}}if(j<V){let _=Z.charCodeAt(j);if(_===44){j++;continue}if(_===59)j++}let K=C(J),q=`${U?"export ":""}declare ${H} ${$}: ${G||"unknown"};`;X.push({kind:"variable",name:$,text:q,isExported:U,typeAnnotation:G,value:B,modifiers:Q?[H,"const assertion"]:[H],leadingComments:K,start:J,end:j});break}while(j<V);return X}function Kj(J,H){j+=9,O();let U=E();O();let X=u();O();let Y="";if(z("extends")){j+=7,O();let K=j,q=0;while(j<V){if(f())continue;let _=Z.charCodeAt(j);if(_===60)q++;else if(_===62&&!S())q--;else if(_===123&&q===0)break;j++}Y=v(K,j)}O();let $=j<V&&Z.charCodeAt(j)===123?Yj():"{}",G=Mj($),B=`${H?"export ":""}declare interface ${U}${X}${Y?` extends ${Y}`:""} ${G}`,Q=C(J);return{kind:"interface",name:U,text:B,isExported:H,extends:Y||void 0,generics:X||void 0,leadingComments:Q,start:J,end:j}}function Vj(J,H){j+=4,O();let U=E();O();let X=u();if(O(),j<V&&Z.charCodeAt(j)===61)j++;O();let Y=j,$=0;while(j<V){if(f())continue;let K=Z.charCodeAt(j);if(K===40||K===123||K===91||K===60)$++;else if(K===41||K===125||K===93||K===62&&!S())$--;else if($===0&&K===59)break;if($===0&&a())break;j++}let G=v(Y,j);if(j<V&&Z.charCodeAt(j)===59)j++;let B=`${H?"export ":""}type ${U}${X} = ${G}`,Q=C(J);return{kind:"type",name:U,text:B,isExported:H,generics:X||void 0,leadingComments:Q,start:J,end:j}}function i(J,H,U){j+=4,O();let X=E();O();let Y=j;if(j<V&&Z.charCodeAt(j)===123)A(123,125);let $=v(J,j),G=C(J);return{kind:"enum",name:X,text:$,isExported:H,modifiers:U?["const"]:void 0,leadingComments:G,start:J,end:j}}function p(J,H,U,X=!1){j+=5,O();let Y=E()||"AnonymousClass";O();let $=u();O();let G="";if(z("extends")){j+=7,O();let g=j,R=0;while(j<V){if(f())continue;let F=Z.charCodeAt(j);if(F===60)R++;else if(F===62&&!S())R--;else if(R===0&&(F===123||z("implements")))break;j++}G=v(g,j)}let B;if(z("implements")){j+=10,O();let g=j,R=0;while(j<V){if(f())continue;let N=Z.charCodeAt(j);if(N===60)R++;else if(N===62&&!S())R--;else if(R===0&&N===123)break;j++}let F=v(g,j);if(F)B=F.split(",").map((N)=>N.trim())}O();let Q=zj(),q=`${H?X?"export default ":"export declare ":"declare "}${U?"abstract ":""}class ${Y}${$}${G?` extends ${G}`:""}${B&&B.length>0?` implements ${B.join(", ")}`:""} ${Q}`,_=C(J);return{kind:"class",name:Y,text:q,isExported:H,isDefault:X,extends:G||void 0,implements:B,generics:$||void 0,modifiers:U?["abstract"]:void 0,leadingComments:_,start:J,end:j}}function zj(){if(j>=V||Z.charCodeAt(j)!==123)return"{}";j++;let J=[];while(j<V){if(O(),j>=V)break;if(Z.charCodeAt(j)===125){j++;break}if(Z.charCodeAt(j)===59){j++;continue}if(z("static")&&bj("static")===123){j+=6,O(),A(123,125);continue}let H=!1,U=!1,X=!1,Y=!1,$=!1,G=!1,B=!1,Q=!1,K=!0;while(K){if(O(),z("private")){H=!0,j+=7;continue}if(z("protected")){U=!0,j+=9;continue}if(z("public")){j+=6;continue}if(z("static")){X=!0,j+=6;continue}if(z("abstract")){Y=!0,j+=8;continue}if(z("readonly")){$=!0,j+=8;continue}if(z("override")){G=!0,j+=8;continue}if(z("accessor")){B=!0,j+=8;continue}if(z("async")){Q=!0,j+=5;continue}if(z("declare")){j+=7;continue}break}if(O(),j>=V||Z.charCodeAt(j)===125)break;if(Z.charCodeAt(j)===35)H=!0;if(H){Fj();continue}let q=" ";if(U)q+="protected ";if(X)q+="static ";if(Y)q+="abstract ";if($)q+="readonly ";if(z("constructor")){j+=11,O();let _=m();if(O(),uj(_,J),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;let g=n(_);J.push(` constructor${g};`)}else if(z("get"))if(j+=3,O(),j<V&&(Bj(Z.charCodeAt(j))||Z.charCodeAt(j)===91||Z.charCodeAt(j)===35)){let _=Oj();if(_.startsWith("#")){if(O(),j<V&&Z.charCodeAt(j)===40)m();if(O(),jj(),O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;continue}O(),m(),O();let g=jj()||"unknown";if(O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;J.push(`${q}get ${_}(): ${g};`)}else wj("get",q,X,$,Q,J);else if(z("set"))if(j+=3,O(),j<V&&(Bj(Z.charCodeAt(j))||Z.charCodeAt(j)===91||Z.charCodeAt(j)===35)){let _=Oj();if(_.startsWith("#")){if(O(),j<V&&Z.charCodeAt(j)===40)m();if(O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;continue}O();let g=m();if(O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;let R=n(g);J.push(`${q}set ${_}${R};`)}else wj("set",q,X,$,Q,J);else{let _=Z.charCodeAt(j)===42;if(_)j++,O();let g=Oj();if(!g){Fj();continue}vj(g,q,X,$,_,Y,Q,J)}}return`{
|
|
19
19
|
${J.join(`
|
|
20
20
|
`)}
|
|
21
|
-
}`}function Oj(){if(j>=V)return"";let J=Z.charCodeAt(j);if(J===91){let H=j;return A(91,93),Z.slice(H,j)}if(J===35)return j++,`#${E()}`;return E()}function
|
|
21
|
+
}`}function Oj(){if(j>=V)return"";let J=Z.charCodeAt(j);if(J===91){let H=j;return A(91,93),Z.slice(H,j)}if(J===35)return j++,`#${E()}`;return E()}function bj(J){let H=j+J.length;while(H<V&&y(Z.charCodeAt(H)))H++;return H<V?Z.charCodeAt(H):0}function Fj(){let J=0;while(j<V){if(f())continue;let H=Z.charCodeAt(j);if(H===123||H===40)J++;else if(H===125||H===41){if(J===0)return;J--}else if(H===59&&J===0){j++;return}if(J===0&&e())return;j++}}function wj(J,H,U,X,Y,$){vj(J,H,U,X,!1,!1,Y,$)}function vj(J,H,U,X,Y,$,G,B){if(O(),j>=V)return;let Q=Z.charCodeAt(j),K=!1;if(Q===63)K=!0,j++,O();if(j<V&&Z.charCodeAt(j)===33)j++,O();let q=j<V?Z.charCodeAt(j):0;if(q===40||q===60){let _=q===60?u():"";O();let g=m();O();let R=jj();if(!R)if(G&&Y)R="AsyncGenerator<unknown, void, unknown>";else if(Y)R="Generator<unknown, void, unknown>";else if(G)R="Promise<void>";else R="void";if(O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;let F=n(g),N=K?"?":"",M=Y?"*":"";B.push(`${H}${M}${J}${N}${_}${F}: ${R};`)}else if(q===58||q===61||q===59||q===125||q===10||q===13){let _="";if(q===58){j++,O();let F=j,N=0;while(j<V){if(f())continue;let M=Z.charCodeAt(j);if(M===40||M===123||M===91||M===60)N++;else if(M===41||M===125||M===93||M===62&&!S()){if(N===0)break;N--}else if(N===0&&(M===59||M===44))break;else if(N===0&&M===61&&!Xj())break;if(N===0&&e())break;j++}_=v(F,j)}let g="";if(j<V&&Z.charCodeAt(j)===61)if(b&&_){j++;let F=0;while(j<V){if(f())continue;let N=Z.charCodeAt(j);if(N===40||N===123||N===91)F++;else if(N===41||N===125||N===93){if(F===0&&N===125)break;F--}else if(F===0&&N===59)break;if(F===0&&e())break;j++}}else{j++,O();let F=j,N=0;while(j<V){if(f())continue;let M=Z.charCodeAt(j);if(M===40||M===123||M===91)N++;else if(M===41||M===125||M===93){if(N===0&&M===125)break;N--}else if(N===0&&M===59)break;if(N===0&&e())break;j++}g=v(F,j)}if(j<V&&Z.charCodeAt(j)===59)j++;if(!_)if(g){let F=Qj(g);if(F)_=F;else _=U&&X?$j(g):Zj(g)}else _="unknown";let R=K?"?":"";B.push(`${H}${J}${R}: ${_};`)}else Fj()}function uj(J,H){let U=J.slice(1,-1).trim();if(!U)return;let X=[],Y=0,$=0,G=!1,B=0;for(let Q=0;Q<=U.length;Q++){if(Q===U.length){X.push(U.slice(Y).trim());break}let K=U.charCodeAt(Q);if(G){if(K===92){Q++;continue}if(K===B)G=!1;continue}if(K===39||K===34||K===96){G=!0,B=K;continue}if(K===40||K===123||K===91||K===60)$++;else if(K===41||K===125||K===93||K===62&&!(Q>0&&U.charCodeAt(Q-1)===61))$--;else if(K===44&&$===0)X.push(U.slice(Y,Q).trim()),Y=Q+1}for(let Q of X){let K=Q.startsWith("public ")||Q.startsWith("public\t"),q=Q.startsWith("protected ")||Q.startsWith("protected\t"),_=Q.startsWith("private ")||Q.startsWith("private\t"),g=Q.includes("readonly ");if(!K&&!q&&!_&&!g)continue;if(_)continue;let R=Q,F=[];if(K){let w=6;while(w<R.length&&y(R.charCodeAt(w)))w++;R=R.slice(w),F.push("public")}if(q){let w=9;while(w<R.length&&y(R.charCodeAt(w)))w++;R=R.slice(w),F.push("protected")}if(g){let w=R.indexOf("readonly ");if(w!==-1){let s=w+8;while(s<R.length&&y(R.charCodeAt(s)))s++;R=R.slice(0,w)+R.slice(s)}F.push("readonly")}let N=F.length>0?`${F.join(" ")} `:"",M=Dj(R);H.push(` ${N}${M};`)}}function Gj(J=" "){if(j>=V||Z.charCodeAt(j)!==123)return"{}";j++;let H=[];while(j<V){if(O(),j>=V)break;if(Z.charCodeAt(j)===125){j++;break}if(Z.charCodeAt(j)===59){j++;continue}let U=!1;if(z("export"))U=!0,j+=6,O();if(z("declare"))j+=7,O();let X=U?"export ":"";if(z("function")||z("async")&&xj("async","function")){let Y=!1;if(z("async"))Y=!0,j+=5,O();if(j+=8,O(),j<V&&Z.charCodeAt(j)===42)j++,O();let G=E();O();let B=u();O();let Q=m();O();let K=jj();if(!K)K=Y?"Promise<void>":"void";if(O(),j<V&&Z.charCodeAt(j)===123)A(123,125);else if(j<V&&Z.charCodeAt(j)===59)j++;let q=n(Q);H.push(`${J}${X}function ${G}${B}${q}: ${K};`)}else if(z("const")||z("let")||z("var")){let Y=z("const")?"const":z("let")?"let":"var";j+=Y.length,O();let $=E();if(!$){I();continue}O();let G="";if(j<V&&Z.charCodeAt(j)===58){j++,O();let Q=j,K=0;while(j<V){if(f())continue;let q=Z.charCodeAt(j);if(q===40||q===123||q===91||q===60)K++;else if(q===41||q===125||q===93||q===62&&!S())K--;else if(K===0&&(q===59||q===44))break;else if(K===0&&q===61&&!Xj())break;if(K===0&&a())break;j++}G=v(Q,j)}let B="";if(j<V&&Z.charCodeAt(j)===61){j++,O();let Q=j,K=0;while(j<V){if(f())continue;let q=Z.charCodeAt(j);if(q===40||q===123||q===91||q===60)K++;else if(q===41||q===125||q===93||q===62&&!S())K--;else if(K===0&&(q===59||q===44))break;if(K===0&&a())break;j++}B=v(Q,j)}if(j<V&&Z.charCodeAt(j)===59)j++;if(!G&&B){let Q=Qj(B);if(Q)G=Q;else if(Y==="const")G=$j(B);else G=Zj(B)}if(!G)G="unknown";H.push(`${J}${X}${Y} ${$}: ${G};`)}else if(z("interface")){j+=9,O();let Y=E();O();let $=u();O();let G="";if(z("extends")){let Q=j;while(j<V&&Z.charCodeAt(j)!==123){if(f())continue;j++}G=Z.slice(Q,j)}let B=Mj(Yj());H.push(`${J}${X}interface ${Y}${$}${G} ${B}`)}else if(z("type")){j+=4,O();let Y=E();O();let $=u();if(O(),j<V&&Z.charCodeAt(j)===61){j++,O();let G=j,B=0;while(j<V){if(f())continue;let K=Z.charCodeAt(j);if(K===40||K===123||K===91||K===60)B++;else if(K===41||K===125||K===93||K===62&&!S())B--;else if(B===0&&K===59)break;if(B===0&&a())break;j++}let Q=v(G,j);if(j<V&&Z.charCodeAt(j)===59)j++;H.push(`${J}${X}type ${Y}${$} = ${Q}`)}}else if(z("class")){j+=5,O();let Y=E();O();let $=u();O();let G=j;while(j<V&&Z.charCodeAt(j)!==123){if(f())continue;j++}let B=v(G,j),Q=B?` ${B}`:"",K=zj();H.push(`${J}${X}class ${Y}${$}${Q} ${K}`)}else if(z("enum")){j+=4,O();let Y=E();O();let $=Yj();H.push(`${J}${X}enum ${Y} ${$}`)}else if(z("namespace")||z("module")){let Y=z("namespace")?"namespace":"module";j+=Y.length,O();let $=E();O();let G=Gj(J);H.push(`${J}${X}${Y} ${$} ${G}`)}else if(z("abstract"))if(j+=8,O(),z("class")){j+=5,O();let Y=E();O();let $=u();O();let G=j;while(j<V&&Z.charCodeAt(j)!==123){if(f())continue;j++}let B=v(G,j),Q=B?` ${B}`:"",K=zj();H.push(`${J}${X}abstract class ${Y}${$}${Q} ${K}`)}else I();else if(U&&z("default")){j+=7,O();let Y=j;I();let $=v(Y,j);if($.charCodeAt($.length-1)===59)$=$.slice(0,-1);if($)H.push(`${J}export default ${$};`)}else if(!U&&(Z.charCodeAt(j)===39||Z.charCodeAt(j)===34||Z.charCodeAt(j)===96))I();else I()}if(H.length===0)return"{}";return`{
|
|
22
22
|
${H.join(`
|
|
23
23
|
`)}
|
|
24
|
-
}`}function xj(J,H){let U=j+J.length;while(U<V&&y(Z.charCodeAt(U)))U++;for(let X=0;X<H.length;X++)if(U+X>=V||Z.charCodeAt(U+X)!==H.charCodeAt(X))return!1;return U+H.length>=V||!W(Z.charCodeAt(U+H.length))}function o(J,H,U){j+=U.length,O();let X="",Y=Z.charCodeAt(j);if(Y===39||Y===34){let K=j;h(Y),X=Z.slice(K,j)}else{X=E();while(j<V&&Z.charCodeAt(j)===46)j++,X+=`.${E()}`}O();let $=j<V&&Z.charCodeAt(j)===123?Gj():"{}",G=`${H?"export ":""}declare ${U} ${X} ${$}`,B=C(J),Q=X.startsWith("'")||X.startsWith('"');return{kind:"module",name:X,text:G,isExported:H,source:Q?X.slice(1,-1):void 0,leadingComments:B,start:J,end:j}}while(j<V){if(O(),j>=V)break;let J=j,H=Z.charCodeAt(j);if(H===105&&z("import"))L.push(Sj(J));else if(H===101&&z("export")){j+=6,O();let U=Z.charCodeAt(j);if(U===100&&z("default")){j+=7,O();let X=Z.charCodeAt(j);if(X===102&&z("function")){let Y=d(J,!0,!1,!0);if(Y)L.push(Y)}else if(X===97&&z("async")&&
|
|
24
|
+
}`}function xj(J,H){let U=j+J.length;while(U<V&&y(Z.charCodeAt(U)))U++;for(let X=0;X<H.length;X++)if(U+X>=V||Z.charCodeAt(U+X)!==H.charCodeAt(X))return!1;return U+H.length>=V||!W(Z.charCodeAt(U+H.length))}function o(J,H,U){j+=U.length,O();let X="",Y=Z.charCodeAt(j);if(Y===39||Y===34){let K=j;h(Y),X=Z.slice(K,j)}else{X=E();while(j<V&&Z.charCodeAt(j)===46)j++,X+=`.${E()}`}O();let $=j<V&&Z.charCodeAt(j)===123?Gj():"{}",G=`${H?"export ":""}declare ${U} ${X} ${$}`,B=C(J),Q=X.startsWith("'")||X.startsWith('"');return{kind:"module",name:X,text:G,isExported:H,source:Q?X.slice(1,-1):void 0,leadingComments:B,start:J,end:j}}while(j<V){if(O(),j>=V)break;let J=j,H=Z.charCodeAt(j);if(H===105&&z("import"))L.push(Sj(J));else if(H===101&&z("export")){j+=6,O();let U=Z.charCodeAt(j);if(U===100&&z("default")){j+=7,O();let X=Z.charCodeAt(j);if(X===102&&z("function")){let Y=d(J,!0,!1,!0);if(Y)L.push(Y)}else if(X===97&&z("async")&&bj("async")!==59)if(j+=5,O(),z("function")){let Y=d(J,!0,!0,!0);if(Y)L.push(Y)}else{I();let Y=v(J,j);L.push({kind:"export",name:"default",text:Y,isExported:!0,isTypeOnly:!1,start:J,end:j})}else if(X===99&&z("class")){let Y=p(J,!0,!1,!0);L.push(Y)}else if(X===97&&z("abstract")){if(j+=8,O(),z("class")){let Y=p(J,!0,!0,!0);L.push(Y)}}else{I();let Y=v(J,j),$=C(J);L.push({kind:"export",name:"default",text:Y,isExported:!0,isTypeOnly:!1,leadingComments:$,start:J,end:j})}}else if(U===116&&z("type")){let X=j;if(j+=4,O(),j<V&&Z.charCodeAt(j)===123){_j();let Y=v(J,j),$=C(J);L.push({kind:"export",name:"",text:Y,isExported:!0,isTypeOnly:!0,source:Uj(Y),leadingComments:$,start:J,end:j})}else if(j<V&&Z.charCodeAt(j)===42){gj();let Y=v(J,j);L.push({kind:"export",name:"",text:Y,isExported:!0,isTypeOnly:!0,source:Uj(Y),start:J,end:j})}else{j=X;let Y=Vj(J,!0);L.push(Y)}}else if(U===105&&z("interface")){let X=Kj(J,!0);L.push(X)}else if(U===102&&z("function")){let X=d(J,!0,!1,!1);if(X)L.push(X)}else if(U===97&&z("async"))if(j+=5,O(),z("function")){let X=d(J,!0,!0,!1);if(X)L.push(X)}else I();else if(U===99)if(z("class")){let X=p(J,!0,!1);L.push(X)}else if(z("const")){let X=j;if(j+=5,O(),z("enum")){j=X+5,O();let Y=i(J,!0,!0);L.push(Y)}else{j=X;let Y=r(J,"const",!0);for(let $=0;$<Y.length;$++)L.push(Y[$])}}else I();else if(U===97&&z("abstract")){if(j+=8,O(),z("class")){let X=p(J,!0,!0);L.push(X)}}else if(U===108&&z("let")){let X=r(J,"let",!0);for(let Y=0;Y<X.length;Y++)L.push(X[Y])}else if(U===118&&z("var")){let X=r(J,"var",!0);for(let Y=0;Y<X.length;Y++)L.push(X[Y])}else if(U===101&&z("enum")){let X=i(J,!0,!1);L.push(X)}else if(U===100&&z("declare"))j+=7,O(),Ij(J,!0);else if(U===110&&z("namespace")&&Jj(9)){let X=o(J,!0,"namespace");L.push(X)}else if(U===109&&z("module")&&Jj(6)){let X=o(J,!0,"module");L.push(X)}else if(U===123){_j();let X=v(J,j),Y=X.includes("export type"),$=C(J);L.push({kind:"export",name:"",text:X,isExported:!0,isTypeOnly:Y,source:Uj(X),leadingComments:$,start:J,end:j})}else if(U===42){gj();let X=v(J,j),Y=C(J);L.push({kind:"export",name:"",text:X,isExported:!0,isTypeOnly:!1,source:Uj(X),leadingComments:Y,start:J,end:j})}else{I();let X=v(J,j);if(X)L.push({kind:"export",name:"",text:X,isExported:!0,start:J,end:j})}}else if(H===100&&z("declare"))j+=7,O(),Ij(J,!1);else if(H===105&&z("interface")){let U=Kj(J,!1);P.set(U.name,U)}else if(H===116&&z("type")){let U=Vj(J,!1);P.set(U.name,U),L.push(U)}else if(H===102&&z("function")){let U=d(J,!1,!1,!1);if(U)P.set(U.name,U);else I()}else if(H===97)if(z("async")){let U=j;if(j+=5,O(),z("function")){let X=d(J,!1,!0,!1);if(X)P.set(X.name,X);else j=U,I()}else j=U,I()}else if(z("abstract"))if(j+=8,O(),z("class")){let U=p(J,!1,!1);P.set(U.name,U),L.push(U)}else I();else j++,I();else if(H===99)if(z("class")){let U=p(J,!1,!1);P.set(U.name,U),L.push(U)}else if(z("const")){let U=j;if(j+=5,O(),z("enum")){j=U+5,O();let X=i(J,!1,!0);P.set(X.name,X),L.push(X)}else{j=U;let X=r(J,"const",!1);for(let Y=0;Y<X.length;Y++)P.set(X[Y].name,X[Y])}}else j++,I();else if(H===101&&z("enum")){let U=i(J,!1,!1);P.set(U.name,U),L.push(U)}else if(H===108&&z("let"))I();else if(H===118&&z("var"))I();else if(H===109&&z("module")&&Jj(6)){let U=o(J,!1,"module");L.push(U)}else if(H===110&&z("namespace")&&Jj(9)){let U=o(J,!1,"namespace");L.push(U)}else{let U=Z.charCodeAt(j);if(U===39||U===34){if(h(U),j<V&&Z.charCodeAt(j)===59)j++}else if(U===96){if(t(),j<V&&Z.charCodeAt(j)===59)j++}else if(U===64){if(j++,E(),O(),j<V&&Z.charCodeAt(j)===46)j++,E(),O();if(j<V&&Z.charCodeAt(j)===40)A(40,41)}else j++,I()}}if(P.size>0)mj(L,P);if(x.size>0){let J=new Map;for(let U of L)if(U.kind==="function")J.set(U.name,(J.get(U.name)||0)+1);let H=new Set;for(let[U,X]of J)if(X>1)H.add(U);if(H.size>0){let U=new Set;for(let X of H)for(let Y=L.length-1;Y>=0;Y--)if(L[Y].kind==="function"&&L[Y].name===X&&x.has(Y)){U.add(Y);break}if(U.size>0){let X=[...U].sort((Y,$)=>$-Y);for(let Y of X)L.splice(Y,1)}}}return L;function Ij(J,H){if(z("function")){let U=d(J,H,!1,!1);if(U)L.push(U)}else if(z("async")){if(j+=5,O(),z("function")){let U=d(J,H,!0,!1);if(U)L.push(U)}}else if(z("class")){let U=p(J,H,!1);L.push(U)}else if(z("abstract")){if(j+=8,O(),z("class")){let U=p(J,H,!0);L.push(U)}}else if(z("interface")){let U=Kj(J,H);L.push(U)}else if(z("type")){let U=Vj(J,H);L.push(U)}else if(z("enum")){let U=i(J,H,!1);L.push(U)}else if(z("const")){let U=j;if(j+=5,O(),z("enum")){j=U+5,O();let X=i(J,H,!0);L.push(X)}else if(H){j=U;let X=r(J,"const",!0);for(let Y=0;Y<X.length;Y++)L.push(X[Y])}else I()}else if(z("let")||z("var"))if(H){let U=z("let")?"let":"var",X=r(J,U,!0);for(let Y=0;Y<X.length;Y++)L.push(X[Y])}else I();else if(z("module")){let U=o(J,H,"module");L.push(U)}else if(z("namespace")){let U=o(J,H,"namespace");L.push(U)}else if(z("global")){j+=6,O();let X=`declare global ${j<V&&Z.charCodeAt(j)===123?Gj():"{}"}`,Y=C(J);L.push({kind:"module",name:"global",text:X,isExported:!1,leadingComments:Y,start:J,end:j})}else I()}}function Ej(D,Hj){let T=0,l=D.length;while(T<l){let Z=D.charCodeAt(T);if(Z>=65&&Z<=90||Z>=97&&Z<=122||Z===95||Z===36||Z>127){let c=T;T++;while(T<l){let b=D.charCodeAt(T);if(b>=65&&b<=90||b>=97&&b<=122||b>=48&&b<=57||b===95||b===36||b>127)T++;else break}Hj.add(D.substring(c,T))}else T++}}function mj(D,Hj){let T=new Set,l=new Set;for(let b of D)l.add(b.name);let Z=new Set,c=[];for(let b=0;b<D.length;b++)if(D[b].kind!=="import")c.push(D[b].text),Ej(D[b].text,Z);for(;;){let b=[];for(let[P,x]of Hj){if(T.has(P))continue;if(Z.has(P)){if(!l.has(P))b.push(x),l.add(P);T.add(P)}}if(b.length===0)break;b.sort((P,x)=>(P.start??1/0)-(x.start??1/0));let V=[],L=0;for(let P=0;P<D.length;P++){let x=D[P].start??1/0;while(L<b.length&&(b[L].start??1/0)<=x)V.push(b[L++]);V.push(D[P])}while(L<b.length)V.push(b[L++]);D.length=0;for(let P=0;P<V.length;P++)D.push(V[P]);for(let P of b)if(P.kind!=="import")c.push(P.text),Ej(P.text,Z)}}
|
|
25
25
|
export{dj as oc};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tb as K}from"./chunk-
|
|
2
|
+
import{tb as K}from"./chunk-af12rv0y.js";function L(N={}){let{buildStart:P=!0,buildEnd:Q=!1,writeBundle:T=!1,modes:y,onGenerated:U,onError:H,...W}=N,I="production",z=async()=>{try{let q=await K(W);U?.(q)}catch(q){let J=q instanceof Error?q:Error(String(q));if(H?.(J),!H)console.error("[dtsx] Generation failed:",J.message)}},F=()=>{if(!y||y.length===0)return!0;return y.includes(I)};return{name:"dtsx",apply(q){return I=q.mode,!0},async buildStart(){if(P&&F())await z()},async buildEnd(){if(Q&&F())await z()},async writeBundle(){if(T&&F())await z()}}}var Y=L,_=L;
|
|
3
3
|
export{L as ca,Y as da,_ as ea};
|