@stacksjs/dtsx 0.9.12 → 0.9.13
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 +6 -6
- package/dist/{chunk-7vj8vtzh.js → chunk-0f9tt1yd.js} +1 -1
- package/dist/{chunk-jddkdjap.js → chunk-188ep5ns.js} +1 -1
- package/dist/{chunk-v96rjx7x.js → chunk-1t76q5wk.js} +1 -1
- package/dist/chunk-2vw7w2j4.js +23 -0
- package/dist/{chunk-f18nyrrb.js → chunk-365avtde.js} +1 -1
- package/dist/chunk-446n992h.js +2 -0
- package/dist/{chunk-efkpkyz9.js → chunk-49b3ran6.js} +1 -1
- package/dist/{chunk-gpxdn99a.js → chunk-50hbgzrj.js} +1 -1
- package/dist/{chunk-qn0xktfx.js → chunk-6jpqpjkc.js} +1 -1
- package/dist/{chunk-p1d09y82.js → chunk-94h87sgb.js} +1 -1
- package/dist/{chunk-3j7r0fxz.js → chunk-a592hfkt.js} +1 -1
- package/dist/chunk-at36dtgx.js +2 -0
- package/dist/{chunk-2w3g3g00.js → chunk-b0bkjk0p.js} +1 -1
- package/dist/chunk-chbk4344.js +2 -0
- package/dist/{chunk-7cpp6v8f.js → chunk-ck86m3vf.js} +1 -1
- package/dist/{chunk-kge8a5vc.js → chunk-e0gx49tv.js} +1 -1
- package/dist/{chunk-8j312sjx.js → chunk-e38jw5aa.js} +1 -1
- package/dist/{chunk-20kdv9bh.js → chunk-emwe4zbk.js} +1 -1
- package/dist/chunk-ez568rby.js +2 -0
- package/dist/{chunk-fjjs2r77.js → chunk-f0mvmcmj.js} +1 -1
- package/dist/{chunk-91gpfz27.js → chunk-hbd2nj9p.js} +1 -1
- package/dist/{chunk-r1m3q3dj.js → chunk-hwm87z68.js} +1 -1
- package/dist/{chunk-8dx98fd5.js → chunk-jfk0hw36.js} +1 -1
- package/dist/{chunk-jm5ywn4e.js → chunk-mrk48ejm.js} +1 -1
- package/dist/chunk-myvmq7hz.js +2 -0
- package/dist/{chunk-6s7n1gt0.js → chunk-nd0xbpbz.js} +1 -1
- package/dist/{chunk-5fveksya.js → chunk-nfeqwqca.js} +1 -1
- package/dist/{chunk-d9my0n30.js → chunk-nr1gxnen.js} +1 -1
- package/dist/chunk-ns3hznyf.js +3 -0
- package/dist/{chunk-xe1z54pq.js → chunk-pdt5pc9f.js} +1 -1
- package/dist/{chunk-97pgeywh.js → chunk-pdvve1gm.js} +1 -1
- package/dist/chunk-sv136qag.js +17 -0
- package/dist/{chunk-r1ywapeb.js → chunk-te9r0j9z.js} +1 -1
- package/dist/chunk-trftkghj.js +2 -0
- package/dist/{chunk-p09jmjq8.js → chunk-tzrvp0n2.js} +1 -1
- package/dist/{chunk-3g2v2ns2.js → chunk-vf7ywnxz.js} +1 -1
- package/dist/chunk-xqymptjk.js +2 -0
- 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/dist/transformers.d.ts +12 -0
- package/dist/type-mappings.d.ts +32 -16
- package/package.json +1 -1
- package/dist/chunk-0fhq2wva.js +0 -17
- package/dist/chunk-1e5c83wa.js +0 -2
- package/dist/chunk-1vc477cq.js +0 -2
- package/dist/chunk-7p1sfeeg.js +0 -2
- package/dist/chunk-bzsvvb81.js +0 -2
- package/dist/chunk-j40mkvfg.js +0 -2
- package/dist/chunk-kpp6ajgg.js +0 -2
- package/dist/chunk-me2ae6f0.js +0 -23
- package/dist/chunk-rw6j20e2.js +0 -3
- package/dist/chunk-zsznaama.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{a,b,c}from"./chunk-49b3ran6.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-sv136qag.js";import"./chunk-ns3hznyf.js";export{b as optimizeFile,a as optimizeDeclarations,c as minifyDts};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tb as z}from"./chunk-
|
|
2
|
+
import{tb as z}from"./chunk-jfk0hw36.js";function C(F={}){let{preBuild:H=!1,postBuild:I=!0,onGenerated:J,onError:w,...q}=F,y=async()=>{try{let j=await z(q);J?.(j)}catch(j){let k=j instanceof Error?j:Error(String(j));if(w?.(k),!w)console.error("[dtsx] Generation failed:",k.message)}};return{name:"dtsx",async setup(j){let k=j.config;if(!q.entrypoints&&k.entrypoints)q.entrypoints=k.entrypoints;if(!q.outdir&&k.outdir)q.outdir=k.outdir;if(!q.root&&k.root)q.root=k.root;if(H)j.onStart(async()=>{await y()});if(I){let v=!1;j.onLoad({filter:/.*/},async(K)=>{if(!v)queueMicrotask(async()=>{if(!v)v=!0,await y()});return})}}}}var M=C,P=C;
|
|
3
3
|
export{C as fa,M as ga,P as ha};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h}from"./chunk-d0p3jzwb.js";import"./chunk-
|
|
2
|
+
import{I as a,J as b,K as c,L as d,M as e,N as f,O as g,P as h}from"./chunk-d0p3jzwb.js";import"./chunk-ns3hznyf.js";export{b as toZod,e as toYup,c as toValibot,a as toJsonSchema,d as toIoTs,f as toArkType,h as getFormatExtension,g as convertToFormat};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{tb as b,ub as c,vb as d}from"./chunk-jfk0hw36.js";import"./chunk-b0bkjk0p.js";import"./chunk-94h87sgb.js";import{ic as a}from"./chunk-6jpqpjkc.js";import"./chunk-50hbgzrj.js";import"./chunk-2vw7w2j4.js";import"./chunk-pdvve1gm.js";import"./chunk-sv136qag.js";import"./chunk-365avtde.js";import"./chunk-57agx6g8.js";import"./chunk-ns3hznyf.js";export{d as watch,a as processSource,c as processFile,b as generate};
|
package/dist/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as b9,b as P9,c as x9}from"../chunk-
|
|
2
|
+
import{a as b9,b as P9,c as x9}from"../chunk-49b3ran6.js";import{d as O8,e as A8,f as G8,g as B8,h as z8,i as N8,j as j8,k as R8}from"../chunk-emwe4zbk.js";import{l as m9,m as p9,n as d9,o as c9,p as l9,q as o9,r as s9}from"../chunk-nfeqwqca.js";import{s as w9,t as I9,u as T9,v as S9,w as k9,x as C9,y as v9}from"../chunk-188ep5ns.js";import{A as I6,B as T6,C as S6,D as k6,E as C6,F as v6,G as b6,H as P6,z as w6}from"../chunk-mrk48ejm.js";import{I as f8,J as u8,K as m8,L as p8,M as d8,N as c8,O as l8,P as o8}from"../chunk-d0p3jzwb.js";import{Q as x6,R as y6,S as h6,T as g6,U as f6,V as u6,W as m6,X as p6,Y as d6}from"../chunk-te9r0j9z.js";import{$ as g9,Z as y9,_ as h9,aa as f9,ba as u9}from"../chunk-6qv7p9sg.js";import{$a as h8,Aa as M6,Ba as c6,Ca as l6,Da as o6,Ea as QX,Fa as s6,Ga as a6,Ha as i6,Ia as n6,Ja as r6,Ka as t6,La as F8,Ma as D8,Na as E8,Oa as L8,Pa as M8,Qa as w8,Ra as I8,Sa as T8,Ta as S8,Ua as k8,Va as C8,Wa as v8,Xa as b8,Ya as P8,Za as x8,_a as y8,ab as g8,bb as s8,cb as a8,db as i8,eb as n8,fb as r8,gb as t8,hb as mX,ib as e8,jb as X9,kb as Z9,lb as A9,mb as G9,nb as B9,ob as z9,pb as N9,qb as j9,rb as R9,sb as F9,tb as E9,ua as j6,ub as L9,va as R6,vb as M9,wa as F6,xa as D6,ya as E6,za as L6}from"../chunk-jfk0hw36.js";import{$b as _6,Ab as v4,Bb as gZ,Cb as fZ,Db as p4,Eb as d4,Fb as c4,Gb as l4,Hb as o4,Ib as s4,Jb as a4,Kb as i4,Lb as n4,Mb as r4,Nb as t4,Ob as e4,Pb as X6,Qb as Z6,Rb as $6,Sb as J6,Tb as Q6,Ub as q6,Vb as Y6,Wb as V6,Xb as W6,Yb as K6,Zb as H6,_b as U6,ac as O6,bc as A6,cc as G6,dc as B6,ec as EX,fc as z6,gc as N6,wb as T4,xb as S4,yb as k4,zb as C4}from"../chunk-b0bkjk0p.js";import{hc as SZ}from"../chunk-94h87sgb.js";import{ic as D9}from"../chunk-6jpqpjkc.js";import"../chunk-50hbgzrj.js";import"../chunk-2vw7w2j4.js";import{Ac as O9,Bc as LX,oc as uZ,pc as $9,qc as J9,rc as Q9,sc as q9,tc as Y9,uc as V9,vc as W9,wc as K9,xc as H9,yc as U9,zc as _9}from"../chunk-pdvve1gm.js";import{Ec as b4,Fc as P4,Gc as x4,Hc as y4,Ic as h4,Jc as hZ,Kc as g4,Lc as f4,Mc as u4,Nc as m4}from"../chunk-sv136qag.js";import{Oc as V8,Pc as W8,Qc as K8,Rc as H8,Sc as U8,Tc as _8}from"../chunk-365avtde.js";import{$c as Y8,Uc as e6,Vc as X8,Wc as Z8,Xc as $8,Yc as J8,Zc as Q8,_c as q8}from"../chunk-57agx6g8.js";import{ad as TZ,cd as v}from"../chunk-ns3hznyf.js";function C0(X){if(!X||typeof X!=="string")throw Error("Invalid file path: must be a non-empty string");return X}function v0(X){if(!X||typeof X!=="string")throw Error("Invalid directory path: must be a non-empty string");return X}function b0(X){if(!X||typeof X!=="string")throw Error("Invalid glob pattern: must be a non-empty string");return X}function P0(X){if(typeof X!=="string")throw TypeError("Invalid source code: must be a string");return X}function x0(X){if(typeof X!=="string")throw TypeError("Invalid DTS content: must be a string");return X}function y0(X){if(!X||typeof X!=="string")throw Error("Invalid module specifier: must be a non-empty string");return X}function h0(X){if(!X||typeof X!=="string")throw Error("Invalid type name: must be a non-empty string");if(!["string","number","boolean","symbol","bigint","undefined","null","void","never","any","unknown","object"].includes(X)&&!/^[A-Z_$]/.test(X));return X}function g0(X){if(!X||typeof X!=="string")throw Error("Invalid declaration name: must be a non-empty string");return X}function f0(X){if(!X||typeof X!=="string")throw Error("Invalid absolute path: must be a non-empty string");if(!X.startsWith("/")&&!/^[A-Z]:/i.test(X))throw Error("Invalid absolute path: must start with / or drive letter");return X}function u0(X){if(!X||typeof X!=="string")throw Error("Invalid relative path: must be a non-empty string");if(X.startsWith("/")||/^[A-Z]:/i.test(X))throw Error("Invalid relative path: must not be absolute");return X}function m0(X){if(typeof X!=="string")throw TypeError("Invalid JSON string: must be a string");try{JSON.parse(X)}catch{throw Error("Invalid JSON string: must be valid JSON")}return X}function p0(X,Z){return typeof X==="string"||typeof X==="number"}function d0(X){return X}var c0={join(X,...Z){let{join:$}=v("path");return $(X,...Z)},dirname(X){let{dirname:Z}=v("path");return Z(X)},basename(X){let{basename:Z}=v("path");return Z(X)},resolve(...X){let{resolve:Z}=v("path");return Z(...X)},isAbsolute(X){let{isAbsolute:Z}=v("path");return Z(X)},relative(X,Z){let{relative:$}=v("path");return $(X,Z)}};function nX(X,Z){let $=X.length,J=Z.length,Q=Array.from({length:$+1},()=>Array(J+1).fill(0));for(let q=1;q<=$;q++)for(let Y=1;Y<=J;Y++)if(X[q-1]===Z[Y-1])Q[q][Y]=Q[q-1][Y-1]+1;else Q[q][Y]=Math.max(Q[q-1][Y],Q[q][Y-1]);return Q}function rX(X,Z,$,J,Q){let q=[];while(J>0||Q>0)if(J>0&&Q>0&&Z[J-1]===$[Q-1])q.unshift({op:"equal",oldIdx:J-1,newIdx:Q-1,line:Z[J-1]}),J--,Q--;else if(Q>0&&(J===0||X[J][Q-1]>=X[J-1][Q]))q.unshift({op:"add",newIdx:Q-1,line:$[Q-1]}),Q--;else if(J>0)q.unshift({op:"remove",oldIdx:J-1,line:Z[J-1]}),J--;return q}function JX(X,Z){let $=X;if(Z.ignoreWhitespace)$=$.replace(/\s+/g," ").trim();return $}function d(X,Z,$,J={}){let{context:Q=3,ignoreWhitespace:q=!1,ignoreBlankLines:Y=!1}=J,V=X.split(`
|
|
3
3
|
`),W=Z.split(`
|
|
4
4
|
`);if(V[V.length-1]==="")V.pop();if(W[W.length-1]==="")W.pop();let K=V.map((F)=>JX(F,{ignoreWhitespace:q})),U=W.map((F)=>JX(F,{ignoreWhitespace:q})),O=K,H=U,A=V.map((F,w)=>w),_=W.map((F,w)=>w);if(Y)O=[],H=[],A=[],_=[],K.forEach((F,w)=>{if(F.trim())O.push(F),A.push(w)}),U.forEach((F,w)=>{if(F.trim())H.push(F),_.push(w)});let G=nX(O,H),B=rX(G,O,H,O.length,H.length),z=B.every((F)=>F.op==="equal"),j=0,N=0,R=0;for(let F of B)if(F.op==="add")j++;else if(F.op==="remove")N++;else R++;let k=tX(B,V,W,A,_,Q);return{filePath:$,identical:z,hunks:k,stats:{additions:j,deletions:N,unchanged:R},oldContent:X,newContent:Z}}function tX(X,Z,$,J,Q,q){let Y=[],V=[];if(X.forEach((U,O)=>{if(U.op!=="equal")V.push(O)}),V.length===0)return Y;let W=[],K=[V[0]];for(let U=1;U<V.length;U++)if(V[U]-V[U-1]<=q*2+1)K.push(V[U]);else W.push(K),K=[V[U]];W.push(K);for(let U of W){let O=Math.max(0,U[0]-q),H=Math.min(X.length-1,U[U.length-1]+q),A=X.slice(O,H+1),_=[],G=1,B=1,z=0,j=0;for(let N=0;N<O;N++){let R=X[N];if(R.op==="equal"||R.op==="remove")G++;if(R.op==="equal"||R.op==="add")B++}for(let N of A)if(N.op==="equal")_.push(` ${N.line}`),z++,j++;else if(N.op==="remove")_.push(`-${N.line}`),z++;else if(N.op==="add")_.push(`+${N.line}`),j++;Y.push({operation:"equal",lines:_,oldStart:G,oldCount:z,newStart:B,newCount:j})}return Y}function s0(X){if(X.identical)return"";let Z=[];Z.push(`--- a/${X.filePath}`),Z.push(`+++ b/${X.filePath}`);for(let $ of X.hunks)Z.push(`@@ -${$.oldStart},${$.oldCount} +${$.newStart},${$.newCount} @@`),Z.push(...$.lines);return Z.join(`
|
|
5
5
|
`)}function eX(X){if(X.identical)return`\x1B[32m\u2713 ${X.filePath} (unchanged)\x1B[0m`;let Z=[],$=`+${X.stats.additions} -${X.stats.deletions}`;Z.push(`\x1B[1m${X.filePath}\x1B[0m \x1B[90m(${$})\x1B[0m`),Z.push("");for(let J of X.hunks){Z.push(`\x1B[36m@@ -${J.oldStart},${J.oldCount} +${J.newStart},${J.newCount} @@\x1B[0m`);for(let Q of J.lines)if(Q.startsWith("+"))Z.push(`\x1B[32m${Q}\x1B[0m`);else if(Q.startsWith("-"))Z.push(`\x1B[31m${Q}\x1B[0m`);else Z.push(`\x1B[90m${Q}\x1B[0m`);Z.push("")}return Z.join(`
|
package/dist/src/plugins/bun.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fa as a,ga as b,ha as c}from"../../chunk-
|
|
2
|
+
import{fa as a,ga as b,ha as c}from"../../chunk-tzrvp0n2.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{a as dts,c as default,b as bunDts};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ia as a,ja as b,ka as c,la as d}from"../../chunk-
|
|
2
|
+
import{ia as a,ja as b,ka as c,la as d}from"../../chunk-f0mvmcmj.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{b as esbuildDts,a as dtsx,c as dts,d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ca as s}from"../../chunk-
|
|
2
|
+
import{ca as s}from"../../chunk-pdt5pc9f.js";import{fa as t}from"../../chunk-tzrvp0n2.js";import{ia as i,ka as p}from"../../chunk-f0mvmcmj.js";import{ma as e,oa as u}from"../../chunk-hbd2nj9p.js";import{qa as l,ra as a,sa as n}from"../../chunk-0f9tt1yd.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{n as webpackPlugin,a as webpackDts,s as viteDts,s as vite,u as tsupPlugin,e as tsupDts,e as tsup,p as esbuildPlugin,i as esbuildDts,i as esbuild,t as bunDts,t as bun,l as DtsxWebpackPlugin};
|
package/dist/src/plugins/tsup.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ma as a,na as b,oa as c,pa as d}from"../../chunk-
|
|
2
|
+
import{ma as a,na as b,oa as c,pa as d}from"../../chunk-hbd2nj9p.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{b as tsupDts,a as dtsxPlugin,c as dts,d as default};
|
package/dist/src/plugins/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ca as a,da as b,ea as c}from"../../chunk-
|
|
2
|
+
import{ca as a,da as b,ea as c}from"../../chunk-pdt5pc9f.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{b as viteDts,a as dts,c as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{qa as a,ra as b,sa as c,ta as d}from"../../chunk-
|
|
2
|
+
import{qa as a,ra as b,sa as c,ta as d}from"../../chunk-0f9tt1yd.js";import"../../chunk-jfk0hw36.js";import"../../chunk-b0bkjk0p.js";import"../../chunk-94h87sgb.js";import"../../chunk-6jpqpjkc.js";import"../../chunk-50hbgzrj.js";import"../../chunk-2vw7w2j4.js";import"../../chunk-pdvve1gm.js";import"../../chunk-sv136qag.js";import"../../chunk-365avtde.js";import"../../chunk-57agx6g8.js";import"../../chunk-ns3hznyf.js";export{b as dtsxWebpack,c as dts,d as default,a as DtsxWebpackPlugin};
|
package/dist/transformers.d.ts
CHANGED
|
@@ -97,6 +97,18 @@ export declare function createWrapTypeTransformer(utilityType: string, filter?:
|
|
|
97
97
|
* Plugin that prefixes all exported types with a namespace
|
|
98
98
|
*/
|
|
99
99
|
export declare function createNamespacePrefixPlugin(namespace: string): Plugin;
|
|
100
|
+
/**
|
|
101
|
+
* Make all declarations readonly (for interfaces/types)
|
|
102
|
+
*/
|
|
103
|
+
export declare const readonlyTransformer: Transformer;
|
|
104
|
+
/**
|
|
105
|
+
* Make all optional properties required
|
|
106
|
+
*/
|
|
107
|
+
export declare const requiredTransformer: Transformer;
|
|
108
|
+
/**
|
|
109
|
+
* Make all required properties optional
|
|
110
|
+
*/
|
|
111
|
+
export declare const optionalTransformer: Transformer;
|
|
100
112
|
/**
|
|
101
113
|
* Plugin that makes all interface properties readonly
|
|
102
114
|
*/
|
package/dist/type-mappings.d.ts
CHANGED
|
@@ -10,6 +10,22 @@ export declare function createTypeMapper(config?: TypeMappingConfig): TypeMapper
|
|
|
10
10
|
* Apply type mappings to declaration text
|
|
11
11
|
*/
|
|
12
12
|
export declare function applyTypeMappings(declarationText: string, mapper: TypeMapper, context?: Partial<TypeMappingContext>): string;
|
|
13
|
+
/**
|
|
14
|
+
* Default type mappings for common patterns
|
|
15
|
+
*/
|
|
16
|
+
export declare const defaultTypeMappings: TypeMappingRule[];
|
|
17
|
+
/**
|
|
18
|
+
* Strict mode mappings - converts unsafe types
|
|
19
|
+
*/
|
|
20
|
+
export declare const strictTypeMappings: TypeMappingRule[];
|
|
21
|
+
/**
|
|
22
|
+
* Readonly mappings - adds immutability
|
|
23
|
+
*/
|
|
24
|
+
export declare const readonlyTypeMappings: TypeMappingRule[];
|
|
25
|
+
/**
|
|
26
|
+
* Simplified mappings - reduces complexity
|
|
27
|
+
*/
|
|
28
|
+
export declare const simplifiedTypeMappings: TypeMappingRule[];
|
|
13
29
|
/**
|
|
14
30
|
* Default type mapper instance
|
|
15
31
|
*/
|
|
@@ -23,14 +39,14 @@ export declare const strictTypeMapper: TypeMapper;
|
|
|
23
39
|
* @defaultValue
|
|
24
40
|
* ```ts
|
|
25
41
|
* {
|
|
26
|
-
* makeReadonly: (type: string) =>
|
|
27
|
-
* makeNullable: (type: string) =>
|
|
28
|
-
* makeOptional: (type: string) =>
|
|
29
|
-
* makeRequired: (type: string) =>
|
|
30
|
-
* promisify: (type: string) =>
|
|
31
|
-
* unpromisify: (type: string) =>
|
|
32
|
-
* arrayify: (type: string) =>
|
|
33
|
-
* unarrayify: (type: string) =>
|
|
42
|
+
* makeReadonly: (type: string) => unknown,
|
|
43
|
+
* makeNullable: (type: string) => unknown,
|
|
44
|
+
* makeOptional: (type: string) => unknown,
|
|
45
|
+
* makeRequired: (type: string) => unknown,
|
|
46
|
+
* promisify: (type: string) => unknown,
|
|
47
|
+
* unpromisify: (type: string) => unknown,
|
|
48
|
+
* arrayify: (type: string) => unknown,
|
|
49
|
+
* unarrayify: (type: string) => unknown
|
|
34
50
|
* }
|
|
35
51
|
* ```
|
|
36
52
|
*/
|
|
@@ -38,35 +54,35 @@ export declare const TypeTransformers: {
|
|
|
38
54
|
/**
|
|
39
55
|
* Make all types readonly
|
|
40
56
|
*/
|
|
41
|
-
makeReadonly: (type: string) =>
|
|
57
|
+
makeReadonly: (type: string) => unknown;
|
|
42
58
|
/**
|
|
43
59
|
* Make type nullable
|
|
44
60
|
*/
|
|
45
|
-
makeNullable: (type: string) =>
|
|
61
|
+
makeNullable: (type: string) => unknown;
|
|
46
62
|
/**
|
|
47
63
|
* Make type optional (add undefined)
|
|
48
64
|
*/
|
|
49
|
-
makeOptional: (type: string) =>
|
|
65
|
+
makeOptional: (type: string) => unknown;
|
|
50
66
|
/**
|
|
51
67
|
* Remove null/undefined from type
|
|
52
68
|
*/
|
|
53
|
-
makeRequired: (type: string) =>
|
|
69
|
+
makeRequired: (type: string) => unknown;
|
|
54
70
|
/**
|
|
55
71
|
* Wrap in Promise
|
|
56
72
|
*/
|
|
57
|
-
promisify: (type: string) =>
|
|
73
|
+
promisify: (type: string) => unknown;
|
|
58
74
|
/**
|
|
59
75
|
* Unwrap Promise
|
|
60
76
|
*/
|
|
61
|
-
unpromisify: (type: string) =>
|
|
77
|
+
unpromisify: (type: string) => unknown;
|
|
62
78
|
/**
|
|
63
79
|
* Convert to array type
|
|
64
80
|
*/
|
|
65
|
-
arrayify: (type: string) =>
|
|
81
|
+
arrayify: (type: string) => unknown;
|
|
66
82
|
/**
|
|
67
83
|
* Unwrap array type
|
|
68
84
|
*/
|
|
69
|
-
unarrayify: (type: string) =>
|
|
85
|
+
unarrayify: (type: string) => unknown
|
|
70
86
|
};
|
|
71
87
|
/**
|
|
72
88
|
* Custom type mappings for DTS generation
|
package/package.json
CHANGED
package/dist/chunk-0fhq2wva.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var k=!1,M=null;function p(J){let Y="",X=0;while(X<J.length)if(J.charCodeAt(X)===47&&X+1<J.length&&J.charCodeAt(X+1)===42){X+=2;while(X<J.length-1){if(J.charCodeAt(X)===42&&J.charCodeAt(X+1)===47){X+=2;break}X++}}else Y+=J.charAt(X),X++;return Y.trim()}function t(){k=!0,M=null}function e(){k=!1;let J=M;return M=null,J}function g(J){let Y=J.length;if(Y===0)return!1;let X=0;if(J.charCodeAt(X)===45)X++;if(X>=Y)return!1;let $=X;while(X<Y&&J.charCodeAt(X)>=48&&J.charCodeAt(X)<=57)X++;if(X===$)return!1;if(X<Y&&J.charCodeAt(X)===46){X++;let z=X;while(X<Y&&J.charCodeAt(X)>=48&&J.charCodeAt(X)<=57)X++;if(X===z)return!1}return X===Y}function l(J){for(let Y=0,X=J.length-1;Y<X;Y++){let $=J.charCodeAt(Y);if($<48||$>57)return!1}return!0}function E(J,Y){let X=0,$=0;while(($=J.indexOf(Y,$))!==-1)X++,$+=Y.length;return X}function P(J){let Y=J.length,X=!1;for(let Z=1;Z<Y;Z++)if(J.charCodeAt(Z)<=32&&J.charCodeAt(Z-1)<=32){X=!0;break}if(!X)for(let Z=0;Z<Y;Z++){let H=J.charCodeAt(Z);if(H===10||H===13||H===9){X=!0;break}}if(!X)return J;let $=[],z=-1,B=!1;for(let Z=0;Z<Y;Z++)if(J.charCodeAt(Z)<=32){if(!B){if(z>=0)$.push(J.substring(z,Z));$.push(" "),B=!0,z=-1}}else{if(B||z<0)z=Z;B=!1}if(z>=0)$.push(J.substring(z));return $.join("")}function V(J,Y=!1,X=!1,$=0){if(!J||typeof J!=="string")return"unknown";if($>=20)return"unknown";let z=J.trim();if(z.startsWith("BigInt("))return"bigint";if(z.startsWith("Symbol.for("))return"symbol";if(z.includes(".raw`")||z.includes("String.raw`"))return"string";if(z.startsWith('"')&&z.endsWith('"')||z.startsWith("'")&&z.endsWith("'")||z.startsWith("`")&&z.endsWith("`")){if(!z.includes("${")){if(!Y)return"string";return z}if(Y)return z;return"string"}if(g(z)){if(!Y)return"number";return z}if(z==="true"||z==="false"){if(!Y)return"boolean";return z}if(z==="null")return"null";if(z==="undefined")return"undefined";if(z.startsWith("[")&&z.endsWith("]"))return D(z,Y,$+1);if(z.startsWith("{")&&z.endsWith("}"))return i(z,Y,$+1);if(z.startsWith("new "))return d(z);if(z.includes("=>")||z.startsWith("function")||z.startsWith("async"))return u(z,X,$,Y);if(z.endsWith("as const")){let B=z.slice(0,-8).trim();if(B.startsWith("[")&&B.endsWith("]")){let Z=B.slice(1,-1).trim();if(!Z)return"readonly []";return`readonly [${U(Z).map((j)=>V(j.trim(),!0,!1,$+1)).join(", ")}]`}return V(B,!0,X,$+1)}if(z.startsWith("`")&&z.endsWith("`"))return c(z,Y);if(z.startsWith("Promise."))return y(z,Y,$);if(z.startsWith("await "))return"unknown";if(z.charCodeAt(z.length-1)===110&&z.length>1&&l(z)){if(Y)return z;return"bigint"}if(z.startsWith("Symbol(")||z==="Symbol.for")return"symbol";return"unknown"}function m(J,Y=!1,X=0){return V(J,Y,!0,X)}function c(J,Y){if(J.includes(".raw`")||J.includes("String.raw`"))return"string";if(!Y)return"string";if(!J.includes("${"))return J;return"string"}function d(J){let Y=4;while(Y<J.length&&J.charCodeAt(Y)<=32)Y++;let X=Y,$=J.charCodeAt(Y);if($<65||$>90)return"unknown";while(Y<J.length&&T(J.charCodeAt(Y)))Y++;if(Y===X)return"unknown";let z=J.slice(X,Y);{let B=J.slice(Y);if(B.startsWith("<")){let Z=0,H=-1;for(let Q=0;Q<B.length;Q++)if(B[Q]==="<")Z++;else if(B[Q]===">"){if(Z--,Z===0){H=Q;break}}if(H!==-1){let Q=B.slice(0,H+1);return`${z}${Q}`}}switch(z){case"Date":return"Date";case"Map":return"Map<any, any>";case"Set":return"Set<any>";case"WeakMap":return"WeakMap<any, any>";case"WeakSet":return"WeakSet<any>";case"RegExp":return"RegExp";case"Error":return"Error";case"Array":return"any[]";case"Object":return"object";case"Function":return"Function";case"Promise":return"Promise<any>";default:return z}}return"unknown"}function y(J,Y,X=0){if(J.startsWith("Promise.resolve(")){let z=J.indexOf(")",16);if(z!==-1){let B=J.slice(16,z).trim();if(B)return`Promise<${V(B,Y,!1,X+1)}>`}return"Promise<unknown>"}if(J.startsWith("Promise.reject("))return"Promise<never>";if(J.startsWith("Promise.all(")){let $=J.indexOf("[",12),z=J.lastIndexOf("]");if($!==-1&&z>$){let B=J.slice($+1,z).trim();return`Promise<[${U(B).map((Q)=>{let j=Q.trim();if(j.startsWith("Promise.resolve(")){let O=y(j,Y,X+1),G=O.indexOf("<"),K=O.lastIndexOf(">");return G!==-1&&K>G?O.slice(G+1,K):"unknown"}return V(j,Y,!1,X+1)}).join(", ")}]>`}return"Promise<unknown[]>"}return"Promise<unknown>"}function D(J,Y,X=0){let $=J.slice(1,-1).trim();if(!$)return"never[]";if(X>=20)return"unknown[]";let z=U($),B=!1;for(let G=0;G<z.length;G++){let K=z[G],F=K.length;while(F>0&&K.charCodeAt(F-1)<=32)F--;if(F>=8&&K.slice(F-8,F)==="as const"){B=!0;break}}if(B)return`readonly [
|
|
3
|
-
${z.map((K)=>{let F=K.trim();if(F.endsWith("as const")){let L=F.slice(0,-8).trim();if(L.startsWith("[")&&L.endsWith("]")){let W=L.slice(1,-1).trim();return`readonly [${U(W).map((A)=>V(A.trim(),!0,!1,X+1)).join(", ")}]`}return V(L,!0,!1,X+1)}if(F.startsWith("[")&&F.endsWith("]"))return D(F,!0,X+1);return V(F,!0,!1,X+1)}).join(` |
|
|
4
|
-
`)}
|
|
5
|
-
]`;let Z=k&&!Y,H=[],Q=[];for(let G of z){let K=G.trim(),F=M;if(M=null,K.startsWith("[")&&K.endsWith("]"))H.push(D(K,Y,X+1));else H.push(m(K,Y,X+1));if(Z)Q.push(M);M=F}if(Z)if(_(J))M=P(J);else{let G=[];for(let K=0;K<z.length;K++){let F=z[K].trim();if(F.endsWith("as const"))continue;if(w(F)||F==="null"||F==="undefined")G.push(F);else if(F.startsWith("[")&&_(F))G.push(P(F));else if(F.startsWith("{")){if(Q[K])G.push(Q[K])}else{let L=V(F,!1,!1,0);if(L!=="unknown")G.push(L)}}if(G.length>0)M=`[${G.join(", ")}]`}if(Y)return`readonly [${H.join(", ")}]`;let j=[],O=!0;for(let G of H){let K=!1;for(let F of j)if(G===F){K=!0;break}if(!K)j.push(G);if(O){if(!(g(G)||G==="true"||G==="false"||G.charCodeAt(0)===34&&G.charCodeAt(G.length-1)===34||G.charCodeAt(0)===39&&G.charCodeAt(G.length-1)===39))O=!1}}if(O&&H.length<=10)return`readonly [${H.join(", ")}]`;if(j.length===1)return`${j[0]}[]`;return`(${j.join(" | ")})[]`}function U(J){let Y=[],X=0,$=0,z=!1,B=0;for(let H=0;H<J.length;H++){let Q=J.charCodeAt(H);if(!z&&(Q===34||Q===39||Q===96))z=!0,B=Q;else if(z&&Q===B&&(H===0||J.charCodeAt(H-1)!==92))z=!1;if(!z){if(Q===91||Q===123||Q===40)$++;else if(Q===93||Q===125||Q===41)$--;else if(Q===44&&$===0){let j=J.substring(X,H).trim();if(j)Y.push(j);X=H+1;continue}}}let Z=J.substring(X).trim();if(Z)Y.push(Z);return Y}function w(J){if(g(J))return!0;if(J==="true"||J==="false")return!0;if(J.startsWith('"')&&J.endsWith('"')||J.startsWith("'")&&J.endsWith("'"))return!0;return!1}function s(J){return J==="number"||J==="string"||J==="boolean"}function _(J){let Y=!1,X=0,$=J.length;for(let z=0;z<$;z++){let B=J.charCodeAt(z);if(Y){if(B===92){z++;continue}if(B===X)Y=!1;continue}if(B===34||B===39||B===96){Y=!0,X=B;continue}if(B===61&&z+1<$&&J.charCodeAt(z+1)===62)return!1;if(B>=97&&B<=122){let Z=z;while(z<$&&(J.charCodeAt(z)>=97&&J.charCodeAt(z)<=122||J.charCodeAt(z)>=65&&J.charCodeAt(z)<=90||J.charCodeAt(z)>=48&&J.charCodeAt(z)<=57||J.charCodeAt(z)===95||J.charCodeAt(z)===36))z++;let H=J.slice(Z,z);if(H==="new"||H==="async"||H==="await"||H==="function"||H==="yield"||H==="console"||H==="process")return!1;let Q=z;while(Q<$&&J.charCodeAt(Q)<=32)Q++;if(Q<$&&J.charCodeAt(Q)===40)return!1;z--}}return!0}function i(J,Y,X=0){let $=J.slice(1,-1).trim();if(!$)return"{}";if(X>=20)return"Record<string, unknown>";let z=a($),B=[],Z=k&&!Y,H=[];for(let[Q,j]of z){let O=M;M=null;let G=V(j,Y,!1,X+1),K=M;if(M=O,G.includes("=>")||G.includes("function")||G.includes("async"))G=I(G);let F=j.trim();if(!Y&&s(G)&&w(F))B.push(`/** @defaultValue ${F} */
|
|
6
|
-
${Q}: ${G}`);else B.push(`${Q}: ${G}`);if(Z){let L=p(Q);if(F.endsWith("as const"));else if(w(F))H.push(`${L}: ${F}`);else if(F.startsWith("[")&&_(F))H.push(`${L}: ${P(F)}`);else if(F.startsWith("{")){if(K)H.push(`${L}: ${K}`)}else if(!F.startsWith("[")&&(F.includes("=>")||F.startsWith("function")||F.startsWith("async"))){let W=u(F,!1,0,!0);H.push(`${L}: ${W}`)}}}if(Z&&H.length>0){let Q=X>0?(X-1)/2:0,j=`{ ${H.join(", ")} }`;if(j.length<=80)M=j;else{let O=" ".repeat((Q+1)*2),G=" ".repeat(Q*2);M=`{
|
|
7
|
-
${O}${H.join(`,
|
|
8
|
-
${O}`)}
|
|
9
|
-
${G}}`}}return`{
|
|
10
|
-
${B.join(`;
|
|
11
|
-
`)}
|
|
12
|
-
}`}function I(J){let X=J.split(`
|
|
13
|
-
`).map((O)=>h(O)).join(`
|
|
14
|
-
`),$=X.indexOf("async");if($!==-1){let O=$>0?X.charCodeAt($-1):32,G=$+5<X.length?X.charCodeAt($+5):32;if(!T(O)&&!T(G))X=(X.slice(0,$)+X.slice($+5)).trim()}let z=X.indexOf("(");if(z!==-1){let O=x(X,z,"(",")");if(O!==-1){let G=X.slice(z,O+1),K=b(G);X=X.slice(0,z)+K+X.slice(O+1)}}let B=X.length,Z="",H=[],Q=!1,j=!1;for(let O=0;O<B;O++){let G=X.charCodeAt(O);if(G===123||G===40)H.push(G);else if(G===125||G===41)H.pop();if(G<=32){if(Q=!0,G===10||G===13)j=!0;continue}if(Q&&Z.length>0){let F=(H.length>0?H[H.length-1]:0)===123;if(j&&F){let L=Z.charCodeAt(Z.length-1),W=L===59||L===44||L===123||G===125,q=Z.length>=2&&Z.charCodeAt(Z.length-1)===47&&Z.charCodeAt(Z.length-2)===42;if(!W&&!q)Z+="; ";else Z+=" "}else Z+=" "}Q=!1,j=!1,Z+=X[O]}return Z.trim()}function T(J){return J>=97&&J<=122||J>=65&&J<=90||J>=48&&J<=57||J===95||J===36}function b(J){let Y=J.trim(),X,$=!1;if(Y.startsWith("(")&&Y.endsWith(")"))X=Y.slice(1,-1),$=!0;else X=Y;let z=X.trim();if(!z)return $?"()":"";let B=!1;{let L=0;for(let W=0;W<z.length;W++){let q=z.charCodeAt(W);if(q===40||q===60||q===91||q===123)L++;else if(q===41||q===62||q===93||q===125)L--;else if(L===0&&q===61){let N=W>0?z.charCodeAt(W-1):0,A=W+1<z.length?z.charCodeAt(W+1):0;if(N!==61&&N!==33&&N!==60&&N!==62&&A!==61&&A!==62){B=!0;break}}}}if(!B)return Y;let Z=[],H=[],Q=0,j=0,O=!1,G=0;for(let L=0;L<=z.length;L++){if(L===z.length){Z.push(z.slice(Q));break}let W=z.charCodeAt(L);if(O){if(W===92){L++;continue}if(W===G)O=!1;continue}if(W===39||W===34||W===96){O=!0,G=W;continue}if(W===40||W===60||W===91||W===123)j++;else if(W===41||W===62||W===93||W===125)j--;else if(W===44&&j===0){Z.push(z.slice(Q,L));let q=",",N=L+1;while(N<z.length&&z.charCodeAt(N)<=32)q+=z[N],N++;H.push(q),Q=N}}let K=[];for(let L of Z){let W=L.trim();if(!W){K.push(L);continue}if(W.startsWith("//"))continue;let q=h(W),N=L.slice(0,L.length-L.trimStart().length);K.push(N+n(q))}let F=K[0]||"";for(let L=1;L<K.length;L++)F+=(H[L-1]||", ")+K[L];return $?`(${F})`:F}function h(J){let Y=!1,X=0;for(let $=0;$<J.length-1;$++){let z=J.charCodeAt($);if(Y){if(z===92){$++;continue}if(z===X)Y=!1;continue}if(z===39||z===34||z===96){Y=!0,X=z;continue}if(z===47&&J.charCodeAt($+1)===47)return J.slice(0,$).trimEnd()}return J}function n(J){if(J.startsWith("..."))return J;let Y=-1,X=-1,$=0,z=!1,B=0;for(let H=0;H<J.length;H++){let Q=J.charCodeAt(H);if(z){if(Q===92){H++;continue}if(Q===B)z=!1;continue}if(Q===39||Q===34||Q===96){z=!0,B=Q;continue}if(Q===40||Q===60||Q===91||Q===123)$++;else if(Q===41||Q===62||Q===93||Q===125)$--;else if($===0){if(Q===58&&Y===-1)Y=H;else if(Q===61&&X===-1&&(H===0||J.charCodeAt(H-1)!==61)&&(H+1>=J.length||J.charCodeAt(H+1)!==61&&J.charCodeAt(H+1)!==62))X=H}}let Z=X!==-1;if(Y!==-1&&(X===-1||Y<X)){let H=J.slice(0,Y).trim(),Q=X!==-1?J.slice(Y+1,X).trim():J.slice(Y+1).trim(),j=Z&&!H.endsWith("?")?"?":"";return`${H}${j}: ${Q}`}else if(X!==-1){let H=J.slice(0,X).trim(),Q=!H.endsWith("?")?"?":"",j=J.slice(X+1).trim(),O="unknown";if(j==="true"||j==="false")O="boolean";else if(/^-?\d+(\.\d+)?$/.test(j))O="number";else if(j.startsWith("'")&&j.endsWith("'")||j.startsWith('"')&&j.endsWith('"'))O="string";else if(j.startsWith("["))O="unknown[]";else if(j.startsWith("{"))O="Record<string, unknown>";return`${H}${Q}: ${O}`}return J}function a(J){let Y=[],X="",$="",z=0,B=!1,Z="",H=!0,Q=!1,j=0;for(let O=0;O<J.length;O++){let G=J[O],K=O>0?J[O-1]:"",F=O<J.length-1?J[O+1]:"";if(!B&&!Q&&G==="/"&&F==="/"){O+=2;while(O<J.length&&J[O]!==`
|
|
15
|
-
`)O++;continue}if(!B&&!Q&&G==="/"&&F==="*"){Q=!0,j=1,X+="/*",O++;continue}else if(Q&&G==="*"&&F==="/"){if(j--,X+="*/",O++,j===0)Q=!1;continue}else if(Q&&G==="/"&&F==="*"){j++,X+="/*",O++;continue}if(!B&&(G==='"'||G==="'"||G==="`"))B=!0,Z=G,X+=G;else if(B&&G===Z&&K!=="\\")B=!1,X+=G;else if(!B&&!Q)if(G==="("&&z===0&&H){if($=X.trim(),$.startsWith("async "))$=$.slice(6).trim();X=G,H=!1,z=1}else if(G==="{"||G==="["||G==="(")z++,X+=G;else if(G==="}"||G==="]"||G===")")z--,X+=G;else if(G===":"&&z===0&&H)$=X.trim(),X="",H=!1;else if(G===","&&z===0){if($&&X.trim()){let L=X.trim();if(L.startsWith("("))L=C($,L);else if(L.includes("=>")||L.includes("function")||L.includes("async"))L=I(L);Y.push([$,L])}X="",$="",H=!0}else X+=G;else X+=G}if($&&X.trim()){let O=X.trim();if(O.startsWith("("))O=C($,O);else if(O.includes("=>")||O.includes("function")||O.includes("async"))O=I(O);Y.push([$,O])}return Y}function C(J,Y){let X=Y,$=0;while($<X.length&&X.charCodeAt($)<=32)$++;if(X.startsWith("async",$)&&$+5<X.length&&X.charCodeAt($+5)<=32)X=X.slice($+5).trimStart();let z="";if(X.charCodeAt(0)===60){let G=0,K=-1;for(let F=0;F<X.length;F++)if(X.charCodeAt(F)===60)G++;else if(X.charCodeAt(F)===62){if(G--,G===0){K=F;break}}if(K!==-1)z=X.slice(0,K+1),X=X.slice(K+1).trimStart()}let B=X.indexOf("("),Z=x(X,B,"(",")");if(B===-1||Z===-1)return"() => unknown";let H=X.slice(B,Z+1),Q="unknown",j=X.slice(Z+1).trimStart();if(j.charCodeAt(0)===58){let G=j.indexOf("{");if(G!==-1)Q=j.slice(1,G).trim();else Q=j.slice(1).trim()}let O=b(H);return`${z}${O} => ${Q}`}function x(J,Y,X,$){let z=0;for(let B=Y;B<J.length;B++)if(J[B]===X)z++;else if(J[B]===$){if(z--,z===0)return B}return-1}function r(J){let Y=0,X=0,$=!1,z="";for(let B=0;B<J.length-1;B++){let Z=J[B],H=J[B+1],Q=B>0?J[B-1]:"";if(!$&&(Z==='"'||Z==="'"||Z==="`"))$=!0,z=Z;else if($&&Z===z&&Q!=="\\")$=!1;if(!$){if(Z==="(")Y++;else if(Z===")")Y--;else if(Z==="[")X++;else if(Z==="]")X--;if(Z==="="&&H===">"&&Y===0&&X===0)return B}}return-1}function u(J,Y=!1,X=0,$=!0){let z=J.trim();if(z.length>200&&E(z,"=>")>2&&E(z,"<")>5&&!z.startsWith("function"))return Y?"((...args: any[]) => any)":"(...args: any[]) => any";if(z.startsWith("async ")&&z.includes("=>")){let Z=z.slice(5).trim(),H=Z.indexOf("=>"),Q=Z.substring(0,H).trim(),j=Z.substring(H+2).trim();if(Q=b(Q),Q==="()"||Q==="")Q="()";else if(!Q.startsWith("("))Q=`(${Q})`;let O="unknown";if(j.startsWith("{"))O="unknown";else O=V(j,$,!1,X+1);let G=`${Q} => Promise<${O}>`;return Y?`(${G})`:G}if(z.includes("=>")){let Z="",H=z;if(z.startsWith("<")){let W=x(z,0,"<",">");if(W!==-1)Z=z.substring(0,W+1),H=z.substring(W+1).trim()}let Q=r(H);if(Q===-1)return Y?"(() => unknown)":"() => unknown";let j=H.substring(0,Q).trim(),O=H.substring(Q+2).trim(),G="",K=j.lastIndexOf("):");if(K!==-1){let W=j.substring(K+2).trim();if(W&&!W.includes("=>")&&!W.includes("="))G=W,j=j.substring(0,K+1)}if(j=b(j),j==="()"||j==="")j="()";else if(!j.startsWith("("))j=`(${j})`;let F="unknown";if(G)F=G;else if(O.startsWith("{"))F="unknown";else if(O.includes("=>")){let W=O.trimStart(),q=W.indexOf("("),N=q!==-1?W.indexOf(")",q):-1,A=N!==-1?W.indexOf("=>",N):-1;if(q===0&&N!==-1&&A!==-1){let R=W.substring(q+1,N).trim();if(Z.includes("T")&&R.includes("T"))F=`(${R}) => T`;else F=`(${R}) => any`}else F="any"}else if(Y)F="unknown";else F=V(O,$,!1,X+1);let L=`${Z}${j} => ${F}`;return Y?`(${L})`:L}if(z.startsWith("function")){let Z=8,H=z.length;while(Z<H&&z.charCodeAt(Z)<=32)Z++;let Q=!1;if(Z<H&&z.charCodeAt(Z)===42){Q=!0,Z++;while(Z<H&&z.charCodeAt(Z)<=32)Z++}let j="";if(Z<H&&z.charCodeAt(Z)===60){let K=Z,F=1;Z++;while(Z<H&&F>0){let L=z.charCodeAt(Z);if(L===60)F++;else if(L===62)F--;Z++}j=z.substring(K,Z);while(Z<H&&z.charCodeAt(Z)<=32)Z++}let O=z.indexOf("(",Z);if(O!==-1){let K=1,F=O+1;while(F<H&&K>0){let N=z.charCodeAt(F);if(N===40)K++;else if(N===41)K--;F++}let L=z.substring(O+1,F-1).trim(),W=L?`(${L})`:"()";if(Q){let N=z.substring(F).trim(),A=N.indexOf("Generator<");if(A!==-1){let S=A+10,f=N.indexOf(">",S);if(f!==-1){let o=N.substring(S,f),v=`${j}${W} => Generator<${o}>`;return Y?`(${v})`:v}}let R=`${j}${W} => Generator<any, any, any>`;return Y?`(${R})`:R}let q=`${j}${W} => unknown`;return Y?`(${q})`:q}let G="(...args: any[]) => unknown";return Y?`(${G})`:G}if(z.includes("=>")&&z.includes("(")&&z.includes(")")){if(z.length>100||E(z,"=>")>2){let Z="";if(z.charCodeAt(0)===60){let G=z.indexOf(">");if(G!==-1)Z=z.substring(0,G+1)}let H=z.indexOf("("),Q=H!==-1?z.indexOf(")",H):-1,j=H!==-1&&Q!==-1?z.substring(H,Q+1):"(...args: any[])",O=`${Z}${j} => any`;return Y?`(${O})`:O}return Y?`(${z})`:z}let B="() => unknown";return Y?`(${B})`:B}function zz(J){let Y=J.trim();if(Y==="any"||Y==="object"||Y==="unknown")return!0;if(Y.startsWith("Record<")&&Y.endsWith(">"))return!0;if(Y.startsWith("Array<")&&Y.endsWith(">"))return!0;if(/^\{\s*\[[^\]]*\]:\s*(any|string|number|unknown)\s*\}$/.test(Y))return!0;return!1}function Jz(J){let Y=J.lastIndexOf(" satisfies ");if(Y===-1)return null;let X=J.slice(Y+11).trim();if(X.endsWith(";"))X=X.slice(0,-1).trim();return X||null}function Yz(J){let Y=[],X=0;for(let $=0;$<=J.length;$++)if($===J.length||J[$]===`
|
|
16
|
-
`){let z=X,B=$;while(z<B&&(J[z]===" "||J[z]==="\t"||J[z]==="\r"))z++;while(B>z&&(J[B-1]===" "||J[B-1]==="\t"||J[B-1]==="\r"))B--;let Z=J.slice(z,B);if(X=$+1,Z.startsWith("///")){if(Z.match(/^\/\/\/\s*<reference\s+(path|types|lib|no-default-lib)\s*=\s*["'][^"']+["']\s*\/>/))Y.push(Z);else if(Z.match(/^\/\/\/\s*<amd-module\s+name\s*=\s*["'][^"']+["']\s*\/>/))Y.push(Z);else if(Z.match(/^\/\/\/\s*<amd-dependency\s+path\s*=\s*["'][^"']+["']/))Y.push(Z)}else if(Z===""||Z.startsWith("//"))continue;else break}return Y}
|
|
17
|
-
export{t as Cc,e as Dc,V as Ec,m as Fc,D as Gc,U as Hc,i as Ic,x as Jc,u as Kc,zz as Lc,Jz as Mc,Yz as Nc};
|
package/dist/chunk-1e5c83wa.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{a,b,c}from"./chunk-efkpkyz9.js";import"./chunk-2w3g3g00.js";import"./chunk-p1d09y82.js";import"./chunk-gpxdn99a.js";import"./chunk-me2ae6f0.js";import"./chunk-0fhq2wva.js";import"./chunk-rw6j20e2.js";export{b as optimizeFile,a as optimizeDeclarations,c as minifyDts};
|
package/dist/chunk-1vc477cq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{s as a,t as b,u as c,v as d,w as e,x as f,y as g}from"./chunk-jddkdjap.js";import"./chunk-2w3g3g00.js";import"./chunk-p1d09y82.js";import"./chunk-gpxdn99a.js";import"./chunk-me2ae6f0.js";import"./chunk-97pgeywh.js";import"./chunk-0fhq2wva.js";import"./chunk-rw6j20e2.js";export{f as startLSPServer,g as createFileWatcher,b as SymbolKind,a as LspDiagnosticSeverity,e as DtsxLanguageServer,d as DocumentHighlightKind,c as CompletionItemKind};
|
package/dist/chunk-7p1sfeeg.js
DELETED
package/dist/chunk-bzsvvb81.js
DELETED
package/dist/chunk-j40mkvfg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d as a,e as b,f as c,g as d,h as e,i as f,j as g,k as h}from"./chunk-20kdv9bh.js";import"./chunk-2w3g3g00.js";import"./chunk-p1d09y82.js";import"./chunk-gpxdn99a.js";import"./chunk-me2ae6f0.js";import"./chunk-0fhq2wva.js";import"./chunk-57agx6g8.js";import"./chunk-rw6j20e2.js";export{a as parseJSDoc,f as generateTypeDocJSON,c as generateMarkdown,e as generateJSON,d as generateHTML,g as generateDocs,b as extractDocumentation,h as createDocsGenerator};
|
package/dist/chunk-kpp6ajgg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tb as b,ub as c,vb as d}from"./chunk-8dx98fd5.js";import"./chunk-2w3g3g00.js";import"./chunk-p1d09y82.js";import{ic as a}from"./chunk-qn0xktfx.js";import"./chunk-gpxdn99a.js";import"./chunk-me2ae6f0.js";import"./chunk-97pgeywh.js";import"./chunk-0fhq2wva.js";import"./chunk-f18nyrrb.js";import"./chunk-57agx6g8.js";import"./chunk-rw6j20e2.js";export{d as watch,a as processSource,c as processFile,b as generate};
|
package/dist/chunk-me2ae6f0.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function y(g){return g===32||g===9||g===10||g===13}function Oj(g){return g>=65&&g<=90||g>=97&&g<=122||g===95||g===36||g>127}function S(g){return Oj(g)||g>=48&&g<=57}function Wj(g){if(g.charCodeAt(0)===82&&g.startsWith("Record<"))return!0;if(g.charCodeAt(0)===65&&g.startsWith("Array<"))return!0;if(g.charCodeAt(0)===123&&g.includes("[")&&g.includes("]:"))return!0;if(g==="any"||g==="object"||g==="unknown")return!0;return!1}var Fj=["public","protected","private","readonly","override"];function xj(g,e,A=!0,h=!1){let Y=g,a=A,P=h,V=Y.length,L=[],b=new Map,u=new Set,j=0;if(j<V&&Y.charCodeAt(j)===65279)j++;function w(J,H){if(J<H){let X=Y.charCodeAt(J),U=Y.charCodeAt(H-1);if(X!==32&&X!==9&&X!==10&&X!==13&&U!==32&&U!==9&&U!==10&&U!==13)return Y.slice(J,H)}while(J<H&&y(Y.charCodeAt(J)))J++;while(H>J&&y(Y.charCodeAt(H-1)))H--;return Y.slice(J,H)}function O(){if(j>=V)return;let J=Y.charCodeAt(j);if(J!==32&&J!==9&&J!==10&&J!==13&&J!==47)return;while(j<V){let H=Y.charCodeAt(j);if(H===32||H===9||H===10||H===13){j++;continue}if(H===47&&j+1<V){let X=Y.charCodeAt(j+1);if(X===47){let U=Y.indexOf(`
|
|
3
|
-
`,j+2);j=U===-1?V:U+1;continue}if(X===42){let U=Y.indexOf("*/",j+2);j=U===-1?V:U+2;continue}}break}}function bj(J){let H=J.length,X=0,U=H;for(let Z=0;Z<H;Z++){let Q=J.charCodeAt(Z);if(X){if(Q===92){Z++;continue}if(Q===X)X=0;continue}if(Q===39||Q===34||Q===96){X=Q;continue}if(Q===47&&Z+1<H){let F=J.charCodeAt(Z+1);if(F===47){U=Z;while(U>0&&(J.charCodeAt(U-1)===32||J.charCodeAt(U-1)===9))U--;return J.slice(0,U)}if(F===42){let G=J.indexOf("*/",Z+2);if(G!==-1){J=`${J.slice(0,Z)} ${J.slice(G+2)}`,Z--;continue}}}}U=H;while(U>0&&(J.charCodeAt(U-1)===32||J.charCodeAt(U-1)===9||J.charCodeAt(U-1)===13))U--;return U<H?J.slice(0,U):J}function l(J){j++;let H=J===39?"'":'"';while(j<V){let X=Y.indexOf(H,j);if(X===-1){j=V;return}let U=0,Z=X-1;while(Z>=0&&Y.charCodeAt(Z)===92)U++,Z--;if(U%2===0){j=X+1;return}j=X+1}}function jj(){j++;let J=0;while(j<V){let H=Y.charCodeAt(j);if(H===92){j+=2;continue}if(H===96&&J===0){j++;return}if(H===36&&j+1<V&&Y.charCodeAt(j+1)===123){j+=2,J++;continue}if(H===125&&J>0){J--,j++;continue}j++}}function f(){let J=Y.charCodeAt(j);if(J===39||J===34)return l(J),!0;if(J===96)return jj(),!0;if(J===47&&j+1<V){let H=Y.charCodeAt(j+1);if(H===47){let X=Y.indexOf(`
|
|
4
|
-
`,j+2);return j=X===-1?V:X+1,!0}if(H===42){let X=Y.indexOf("*/",j+2);return j=X===-1?V:X+2,!0}if(wj())return vj(),!0}return!1}function wj(){let J=j-1;while(J>=0&&(Y.charCodeAt(J)===32||Y.charCodeAt(J)===9||Y.charCodeAt(J)===10||Y.charCodeAt(J)===13))J--;if(J<0)return!0;let H=Y.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(S(H)){let X=J;while(X>=0&&S(Y.charCodeAt(X)))X--;let U=Y.slice(X+1,J+1);if(U==="return"||U==="typeof"||U==="void"||U==="delete"||U==="throw"||U==="new"||U==="in"||U==="of"||U==="case"||U==="instanceof"||U==="yield"||U==="await")return!0}return!1}function vj(){j++;let J=!1;while(j<V){let H=Y.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&&S(Y.charCodeAt(j)))j++}function E(){let J=j;while(j<V&&S(Y.charCodeAt(j)))j++;return Y.slice(J,j)}function z(J){if(j+J.length>V)return!1;for(let H=0;H<J.length;H++)if(Y.charCodeAt(j+H)!==J.charCodeAt(H))return!1;if(j+J.length<V&&S(Y.charCodeAt(j+J.length)))return!1;return!0}function Ij(){if(j>=V)return!1;switch(Y.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 p(){let J=Y.charCodeAt(j);if(J!==10&&J!==13)return!1;let H=j;if(j++,J===13&&j<V&&Y.charCodeAt(j)===10)j++;while(j<V){let U=Y.charCodeAt(j);if(U===32||U===9||U===13||U===10){j++;continue}if(U===47&&j+1<V){let Z=Y.charCodeAt(j+1);if(Z===47){let Q=Y.indexOf(`
|
|
5
|
-
`,j+2);j=Q===-1?V:Q+1;continue}if(Z===42){let Q=Y.indexOf("*/",j+2);j=Q===-1?V:Q+2;continue}}break}let X=j>=V||Ij()||Y.charCodeAt(j)===125;return j=H,X}function o(){let J=Y.charCodeAt(j);if(J!==10&&J!==13)return!1;let H=j;if(j++,J===13&&j<V&&Y.charCodeAt(j)===10)j++;while(j<V){let U=Y.charCodeAt(j);if(U===32||U===9||U===13||U===10){j++;continue}if(U===47&&j+1<V&&Y.charCodeAt(j+1)===47){let Z=Y.indexOf(`
|
|
6
|
-
`,j+2);j=Z===-1?V:Z+1;continue}break}if(j>=V)return j=H,!0;let X=Y.charCodeAt(j);if(X===124||X===38||X===46||X===63)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 Ej=/[{}'"`\/]/g,fj=/[()'"`\/]/g,yj=/[[\]'"`\/]/g,Tj=/[<>'"`\/]/g;function T(J,H){let X=1;j++;let U=J===123?Ej:J===40?fj:J===91?yj:Tj;U.lastIndex=j;let Z;while((Z=U.exec(Y))!==null){let Q=Z.index,F=Y.charCodeAt(Q);if(F===39||F===34){j=Q,l(F),U.lastIndex=j;continue}if(F===96){j=Q,jj(),U.lastIndex=j;continue}if(F===47){if(j=Q,f()){U.lastIndex=j;continue}U.lastIndex=Q+1;continue}if(F===J)X++;else if(F===H){if(H===62&&Q>0&&Y.charCodeAt(Q-1)===61){U.lastIndex=Q+1;continue}if(X--,X===0)return j=Q+1,j}U.lastIndex=Q+1}return j=V,j}function C(){return j>0&&Y.charCodeAt(j-1)===61}let x=/[{};'"`\/\n\r]/g;function I(){let J=0;x.lastIndex=j;let H;while((H=x.exec(Y))!==null){let X=H.index,U=Y.charCodeAt(X);if(U===39||U===34){j=X,l(U),x.lastIndex=j;continue}if(U===96){j=X,jj(),x.lastIndex=j;continue}if(U===47){if(j=X,f()){x.lastIndex=j;continue}x.lastIndex=X+1;continue}if(U===123){J++,x.lastIndex=X+1;continue}if(U===125){if(J--,J<=0){j=X+1;return}x.lastIndex=X+1;continue}if(U===59&&J===0){j=X+1;return}if((U===10||U===13)&&J===0){if(j=X,p())return}x.lastIndex=X+1}j=V}function Bj(){T(123,125);while(j<V&&y(Y.charCodeAt(j)))j++;if(z("from")){j+=4;while(j<V&&y(Y.charCodeAt(j)))j++;if(j<V){let J=Y.charCodeAt(j);if(J===39||J===34)l(J)}}while(j<V&&(Y.charCodeAt(j)===32||Y.charCodeAt(j)===9))j++;if(j<V&&Y.charCodeAt(j)===59)j++}function Gj(){j++;while(j<V&&y(Y.charCodeAt(j)))j++;if(z("as")){j+=2;while(j<V&&y(Y.charCodeAt(j)))j++;E();while(j<V&&y(Y.charCodeAt(j)))j++}if(z("from")){j+=4;while(j<V&&y(Y.charCodeAt(j)))j++;if(j<V){let J=Y.charCodeAt(j);if(J===39||J===34)l(J)}}while(j<V&&(Y.charCodeAt(j)===32||Y.charCodeAt(j)===9))j++;if(j<V&&Y.charCodeAt(j)===59)j++}function k(J){if(!a)return;let H=J-1;while(H>=0&&y(Y.charCodeAt(H)))H--;if(H<0)return;let X=[],U=!1;while(H>=0){if(H>=1&&Y.charCodeAt(H)===47&&Y.charCodeAt(H-1)===42){let F=Y.lastIndexOf("/*",H-2);if(F>=0){X.push(Y.slice(F,H+1)),U=!0,H=F-1;while(H>=0&&y(Y.charCodeAt(H)))H--;continue}break}let Z=H;while(Z>0&&Y.charCodeAt(Z-1)!==10)Z--;let Q=w(Z,H+1);if(Q.startsWith("//")){if(U)break;let F=[Q];H=Z-1;while(H>=0&&(Y.charCodeAt(H)===10||Y.charCodeAt(H)===13))H--;while(H>=0){let G=H;while(G>0&&Y.charCodeAt(G-1)!==10)G--;let K=w(G,H+1);if(K.startsWith("//")){F.push(K),H=G-1;while(H>=0&&(Y.charCodeAt(H)===10||Y.charCodeAt(H)===13))H--}else if(K===""){H=G-1;while(H>=0&&(Y.charCodeAt(H)===10||Y.charCodeAt(H)===13))H--}else break}F.reverse(),X.push(F.join(`
|
|
7
|
-
`));continue}break}if(X.length===0)return;return X.reverse(),X}function Aj(J){let H=J,X=!1;while(j<V){let K=Y.charCodeAt(j);if(K===59){j++;break}if(K===39||K===34){l(K),X=!0;while(j<V&&(Y.charCodeAt(j)===32||Y.charCodeAt(j)===9))j++;if(j<V&&Y.charCodeAt(j)===59)j++;break}if(K===10&&X)break;j++}let U=w(H,j),Z=U.charCodeAt(7)===116&&(U.startsWith("import type ")||U.startsWith("import type{")),Q=!1;{let K=6;while(K<U.length&&(U.charCodeAt(K)===32||U.charCodeAt(K)===9))K++;if(K<U.length&&U.charCodeAt(K)===116&&U.startsWith("type",K)){K+=4;while(K<U.length&&(U.charCodeAt(K)===32||U.charCodeAt(K)===9))K++}if(K<U.length){let $=U.charCodeAt(K);Q=$===39||$===34}}let F="";{let K=U.indexOf("from ");if(K!==-1){let $=K+5;while($<U.length&&(U.charCodeAt($)===32||U.charCodeAt($)===9))$++;if($<U.length){let B=U.charCodeAt($);if(B===39||B===34){let N=U.indexOf(String.fromCharCode(B),$+1);if(N!==-1)F=U.slice($+1,N)}}}else if(Q){let $=6;while($<U.length&&U.charCodeAt($)!==39&&U.charCodeAt($)!==34)$++;if($<U.length){let B=U.charCodeAt($),N=U.indexOf(String.fromCharCode(B),$+1);if(N!==-1)F=U.slice($+1,N)}}}let G=k(H);return{kind:"import",name:"",text:U,isExported:!1,isTypeOnly:Z,isSideEffect:Q,source:F,leadingComments:G,start:H,end:j}}function Jj(){let J=j;return T(123,125),Y.slice(J,j)}function qj(J){let H=J.indexOf("(");if(H===-1)return J;let X=J.slice(H);if(X.indexOf("=")===-1)return J;let U=!1;for(let K=0;K<X.length;K++)if(X.charCodeAt(K)===61){let B=K>0?X.charCodeAt(K-1):0,N=K+1<X.length?X.charCodeAt(K+1):0;if(B!==61&&B!==33&&B!==60&&B!==62&&N!==61&&N!==62){U=!0;break}}if(!U)return J;let Z=0,Q=-1;for(let K=H;K<J.length;K++){let $=J.charCodeAt(K);if($===40)Z++;else if($===41){if(Z--,Z===0){Q=K;break}}}if(Q===-1)return J;let F=J.slice(H,Q+1),G=c(F);return J.slice(0,H)+G+J.slice(Q+1)}function Rj(J){let H=J.indexOf("//")!==-1||J.indexOf("/*")!==-1,X=J.split(`
|
|
8
|
-
`),U=[],Z=[],Q=[],F=!1,G=1/0;for(let B=0;B<X.length;B++){let N=X[B];if(H){if(F){if(N.includes("*/"))F=!1;continue}let D=N.trim();if(D.length===0)continue;let q=D.charCodeAt(0);if(q===47){let v=D.charCodeAt(1);if(v===47)continue;if(v===42){if(!D.includes("*/"))F=!0;continue}}if(q===42)continue;let R=bj(N);if(R.charCodeAt(R.length-1)===59)R=R.slice(0,-1);R=qj(R);let _=R.trim();if(!_)continue;U.push(R),Z.push(_);let M=0;while(M<R.length&&y(R.charCodeAt(M)))M++;if(_!=="{"&&_!=="}"){if(M<G)G=M}Q.push(M)}else{let D=N.length;while(D>0&&(N.charCodeAt(D-1)===32||N.charCodeAt(D-1)===9||N.charCodeAt(D-1)===13))D--;if(D===0)continue;let q=D<N.length?N.slice(0,D):N;if(q.charCodeAt(q.length-1)===59)q=q.slice(0,-1);q=qj(q);let R=q.trim();if(!R)continue;U.push(q),Z.push(R);let _=0;while(_<q.length&&y(q.charCodeAt(_)))_++;if(R!=="{"&&R!=="}"){if(_<G)G=_}Q.push(_)}}if(U.length===0)return"{}";if(G===1/0||G<=2)return U.join(`
|
|
9
|
-
`);let K=G-2,$=Array(U.length);for(let B=0;B<U.length;B++){let N=Z[B];if(N==="{"){$[B]=N;continue}let D=Q[B];if(D>G)$[B]=U[B];else if(D===G&&(N.charCodeAt(0)===125||N.charCodeAt(0)===93||N.charCodeAt(0)===41))$[B]=U[B];else{let q=Math.max(0,D-K);$[B]=" ".repeat(q)+N}}return $.join(`
|
|
10
|
-
`)}function W(){if(j>=V||Y.charCodeAt(j)!==60)return"";let J=j;T(60,62);let H=Y.slice(J,j);if(H.includes(`
|
|
11
|
-
`)){let X="",U=!1;for(let Z=0;Z<H.length;Z++){let Q=H.charCodeAt(Z);if(Q===32||Q===9||Q===10||Q===13){if(!U&&X.length>0)X+=" ",U=!0}else X+=H[Z],U=!1}if(X.charCodeAt(1)===32)X=`<${X.slice(2)}`;if(X.charCodeAt(X.length-2)===32)X=`${X.slice(0,-2)}>`;return X}return H}function m(){if(j>=V||Y.charCodeAt(j)!==40)return"()";let J=j;return T(40,41),Y.slice(J,j)}function c(J){let H=J.slice(1,-1).trim();if(!H)return"()";if(J.indexOf(`
|
|
12
|
-
`)===-1&&H.indexOf(":")!==-1&&H.indexOf("{")===-1&&H.indexOf("[")===-1&&H.indexOf("=")===-1&&H.indexOf("@")===-1&&H.indexOf("...")===-1){let K=0,$=0,B=0;for(let N=0;N<H.length;N++){let D=H.charCodeAt(N);if(D===40||D===60||D===123)B++;else if(D===41||D===62||D===125)B--;else if(B===0){if(D===58)K++;else if(D===44)$++}}if(K>=$+1){let N=!1;for(let D=0;D<Fj.length;D++){let q=Fj[D],R=H.indexOf(q);if(R!==-1){let _=R+q.length;if((R===0||!S(H.charCodeAt(R-1)))&&(_>=H.length||!S(H.charCodeAt(_)))){N=!0;break}}}if(!N)return J}}let X=[],U=0,Z=0,Q=!1,F=0;for(let K=0;K<=H.length;K++){if(K===H.length){X.push(H.slice(U).trim());break}let $=H.charCodeAt(K);if(Q){if($===92){K++;continue}if($===F)Q=!1;continue}if($===39||$===34||$===96){Q=!0,F=$;continue}if($===40||$===123||$===91||$===60)Z++;else if($===41||$===125||$===93||$===62&&!(K>0&&H.charCodeAt(K-1)===61))Z--;else if($===44&&Z===0)X.push(H.slice(U,K).trim()),U=K+1}let G=[];for(let K of X){if(!K)continue;let $=K.trim();if($.startsWith("//")||$.startsWith("/*"))continue;let B=K;{let N=!1,D=0;for(let q=0;q<B.length-1;q++){let R=B.charCodeAt(q);if(N){if(R===92){q++;continue}if(R===D)N=!1;continue}if(R===39||R===34||R===96){N=!0,D=R;continue}if(R===47&&B.charCodeAt(q+1)===47){B=B.slice(0,q).trimEnd();break}}}if(!B.trim())continue;G.push(Nj(B))}return`(${G.join(", ")})`}function kj(J){if(!J.startsWith("{")&&!J.startsWith("["))return J;let H="",X=0,U=0,Z=!1,Q=0;while(X<J.length){let F=J.charCodeAt(X);if(Z){if(F===92&&X+1<J.length){H+=J[X]+J[X+1],X+=2;continue}if(F===Q)Z=!1;H+=J[X],X++;continue}if(F===39||F===34||F===96){Z=!0,Q=F,H+=J[X],X++;continue}if(F===123||F===91||F===40)U++;else if(F===125||F===93||F===41)U--;if(U>=1&&F===61&&(X+1>=J.length||J.charCodeAt(X+1)!==61&&J.charCodeAt(X+1)!==62)){while(H.length>0&&(H[H.length-1]===" "||H[H.length-1]==="\t"||H[H.length-1]===`
|
|
13
|
-
`))H=H.slice(0,-1);X++;let G=0;while(X<J.length){let K=J.charCodeAt(X);if(K===39||K===34||K===96){let $=K;X++;while(X<J.length){if(J.charCodeAt(X)===92){X+=2;continue}if(J.charCodeAt(X)===$){X++;break}X++}continue}if(K===123||K===91||K===40)G++;else if(K===125||K===93||K===41){if(G===0)break;G--}else if(K===44&&G===0)break;X++}continue}if(U===1&&F===46&&X+2<J.length&&J.charCodeAt(X+1)===46&&J.charCodeAt(X+2)===46){X+=3;continue}H+=J[X],X++}return H}function Nj(J){let H=J.trim(),X=H.startsWith("...");if(X)H=H.slice(3).trim();while(H.startsWith("@")){let R=1;while(R<H.length&&S(H.charCodeAt(R)))R++;if(R<H.length&&H.charCodeAt(R)===40){let _=1;R++;while(R<H.length&&_>0){if(H.charCodeAt(R)===40)_++;else if(H.charCodeAt(R)===41)_--;R++}}H=H.slice(R).trim()}let U=!0;while(U){U=!1;for(let R of Fj)if(H.startsWith(R)&&H.length>R.length&&!S(H.charCodeAt(R.length))){H=H.slice(R.length).trim(),U=!0;break}}let Z=-1,Q=-1,F=0,G=!1,K=0;for(let R=0;R<H.length;R++){let _=H.charCodeAt(R);if(G){if(_===92){R++;continue}if(_===K)G=!1;continue}if(_===39||_===34||_===96){G=!0,K=_;continue}if(_===40||_===123||_===91||_===60)F++;else if(_===41||_===125||_===93||_===62&&!(R>0&&H.charCodeAt(R-1)===61))F--;else if(F===0){if(_===58&&Z===-1)Z=R;else if(_===61&&Q===-1&&(R===0||H.charCodeAt(R-1)!==61)&&(R+1>=H.length||H.charCodeAt(R+1)!==61&&H.charCodeAt(R+1)!==62))Q=R}}let $,B,N=Q!==-1;if(Z!==-1&&(Q===-1||Z<Q))if($=H.slice(0,Z).trim(),Q!==-1)B=H.slice(Z+1,Q).trim();else B=H.slice(Z+1).trim();else if(Q!==-1)$=H.slice(0,Q).trim(),B=Uj(H.slice(Q+1).trim());else $=H,B="unknown";if($=kj($),($.startsWith("{")||$.startsWith("["))&&$.includes(`
|
|
14
|
-
`)){let R=$.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(R.length<=40)$=R;else $=$.split(`
|
|
15
|
-
`).map((M)=>{let v=M.trim();if(!v)return"";if(v==="{"||v==="}"||v==="["||v==="]"||v.startsWith("}")||v.startsWith("]"))return v;return` ${v}`}).join(`
|
|
16
|
-
`)}let D=$.endsWith("?")||N;if($.endsWith("?"))$=$.slice(0,-1).trim();let q=D&&!X?"?":"";if(X)return`...${$}: ${B}`;return`${$}${q}: ${B}`}function Dj(J){let H=0;if(H<J.length&&J.charCodeAt(H)===45)H++;if(H>=J.length)return!1;let X=J.charCodeAt(H);if(X<48||X>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 Uj(J){let H=J.trim();if(H==="true"||H==="false")return"boolean";if(Dj(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 Xj(J){let H=J.trim();if(H==="true"||H==="false")return H;if(Dj(H))return H;if(H.startsWith("'")&&H.endsWith("'")||H.startsWith('"')&&H.endsWith('"'))return H;return"unknown"}function Yj(J){if(J.endsWith("as const"))return null;let H=0,X=-1;for(let Z=0;Z<J.length;Z++){let Q=J.charCodeAt(Z);if(Q===123||Q===91||Q===40)H++;else if(Q===125||Q===93||Q===41)H--;else if(H===0&&Q===32&&Z+4<=J.length&&J.substring(Z,Z+4)===" as ")X=Z}if(X===-1)return null;return J.slice(X+4).trim()||null}function s(){if(O(),j<V&&Y.charCodeAt(j)===58){j++,O();let J=j,H=0;while(j<V){if(f())continue;let X=Y.charCodeAt(j);if(X===40||X===91||X===60)H++;else if(X===41||X===93||X===62&&!C())H--;else if(X===123)if(H>0)H++;else{let U=w(J,j),Z=(Q)=>{let F=U.length-Q.length;return F>=0&&U.endsWith(Q)&&(F===0||!S(U.charCodeAt(F-1)))};if(U.length===0||U.endsWith("|")||U.endsWith("&")||Z("is")||Z("extends"))H++;else break}else if(X===125){if(H===0)break;H--}else if(H===0&&X===59)break;if(H===0&&o())break;j++}return w(J,j)}return""}function n(J,H,X,U){j+=8,O();let Z=j<V&&Y.charCodeAt(j)===42;if(Z)j++,O();let Q=E();if(!Q&&!U)return null;O();let F=W();O();let G=m();O();let K=s();if(!K)if(X&&Z)K="AsyncGenerator<unknown, void, unknown>";else if(Z)K="Generator<unknown, void, unknown>";else if(X)K="Promise<void>";else K="void";O();let $=!1;if(j<V&&Y.charCodeAt(j)===123)$=!0,T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;let B=c(G),N=`${H?"export ":""}declare function ${Q||"default"}${F}${B}: ${K};`,D=k(J);if($)u.add(L.length);return{kind:"function",name:Q||"default",text:N,isExported:H,isDefault:U,isAsync:X,isGenerator:Z,returnType:K,generics:F||void 0,leadingComments:D,start:J,end:j}}function t(J,H,X){j+=H.length,O();let U=[];do{if(O(),j>=V)break;let Z=Y.charCodeAt(j);if(Z===123||Z===91)return I(),U;let Q=E();if(!Q)return I(),U;O();let F,G,K=!1;if(j<V&&Y.charCodeAt(j)===58){j++,O();let N=j,D=0;while(j<V){if(f())continue;let q=Y.charCodeAt(j);if(q===40||q===123||q===91||q===60)D++;else if(q===41||q===125||q===93||q===62&&!C())D--;else if(D===0&&(q===61||q===59||q===44))break;if(D===0&&p())break;j++}F=w(N,j)}if(j<V&&Y.charCodeAt(j)===61)if(P&&F&&!Wj(F))I();else{j++,O();let N=j,D=0;while(j<V){if(f())continue;let q=Y.charCodeAt(j);if(q===40||q===123||q===91||q===60)D++;else if(q===41||q===125||q===93||q===62&&!C())D--;else if(D===0&&(q===59||q===44))break;if(D===0&&p())break;j++}if(G=w(N,j),G.endsWith(" as const")||G==="const"){if(K=!0,!F){let q=G.endsWith(" as const")?G.slice(0,-9).trim():G,R=Xj(q);F=R!=="unknown"?R:void 0}}else if(!F){let q=Yj(G);if(q)F=q}}if(j<V){let N=Y.charCodeAt(j);if(N===44){j++;continue}if(N===59)j++}let $=k(J),B=`export declare ${H} ${Q}: ${F||"unknown"};`;U.push({kind:"variable",name:Q,text:B,isExported:!0,typeAnnotation:F,value:G,modifiers:K?[H,"const assertion"]:[H],leadingComments:$,start:J,end:j});break}while(j<V);return U}function Zj(J,H){j+=9,O();let X=E();O();let U=W();O();let Z="";if(z("extends")){j+=7,O();let $=j,B=0;while(j<V){if(f())continue;let N=Y.charCodeAt(j);if(N===60)B++;else if(N===62&&!C())B--;else if(N===123&&B===0)break;j++}Z=w($,j)}O();let Q=j<V&&Y.charCodeAt(j)===123?Jj():"{}",F=Rj(Q),G=`${H?"export ":""}declare interface ${X}${U}${Z?` extends ${Z}`:""} ${F}`,K=k(J);return{kind:"interface",name:X,text:G,isExported:H,extends:Z||void 0,generics:U||void 0,leadingComments:K,start:J,end:j}}function $j(J,H){j+=4,O();let X=E();O();let U=W();if(O(),j<V&&Y.charCodeAt(j)===61)j++;O();let Z=j,Q=0;while(j<V){if(f())continue;let $=Y.charCodeAt(j);if($===40||$===123||$===91||$===60)Q++;else if($===41||$===125||$===93||$===62&&!C())Q--;else if(Q===0&&$===59)break;if(Q===0&&p())break;j++}let F=w(Z,j);if(j<V&&Y.charCodeAt(j)===59)j++;let G=`${H?"export ":""}type ${X}${U} = ${F}`,K=k(J);return{kind:"type",name:X,text:G,isExported:H,generics:U||void 0,leadingComments:K,start:J,end:j}}function r(J,H,X){j+=4,O();let U=E();O();let Z=j;if(j<V&&Y.charCodeAt(j)===123)T(123,125);let Q=w(J,j),F=k(J);return{kind:"enum",name:U,text:Q,isExported:H,modifiers:X?["const"]:void 0,leadingComments:F,start:J,end:j}}function d(J,H,X){j+=5,O();let U=E()||"AnonymousClass";O();let Z=W();O();let Q="";if(z("extends")){j+=7,O();let B=j,N=0;while(j<V){if(f())continue;let D=Y.charCodeAt(j);if(D===60)N++;else if(D===62&&!C())N--;else if(N===0&&(D===123||z("implements")))break;j++}Q=w(B,j)}let F;if(z("implements")){j+=10,O();let B=j,N=0;while(j<V){if(f())continue;let q=Y.charCodeAt(j);if(q===60)N++;else if(q===62&&!C())N--;else if(N===0&&q===123)break;j++}let D=w(B,j);if(D)F=D.split(",").map((q)=>q.trim())}O();let G=Qj(),K=`${H?"export ":""}declare ${X?"abstract ":""}class ${U}${Z}${Q?` extends ${Q}`:""}${F&&F.length>0?` implements ${F.join(", ")}`:""} ${G}`,$=k(J);return{kind:"class",name:U,text:K,isExported:H,extends:Q||void 0,implements:F,generics:Z||void 0,modifiers:X?["abstract"]:void 0,leadingComments:$,start:J,end:j}}function Qj(){if(j>=V||Y.charCodeAt(j)!==123)return"{}";j++;let J=[];while(j<V){if(O(),j>=V)break;if(Y.charCodeAt(j)===125){j++;break}if(Y.charCodeAt(j)===59){j++;continue}if(z("static")&&_j("static")===123){j+=6,O(),T(123,125);continue}let H=!1,X=!1,U=!1,Z=!1,Q=!1,F=!1,G=!1,K=!1,$=!0;while($){if(O(),z("private")){H=!0,j+=7;continue}if(z("protected")){X=!0,j+=9;continue}if(z("public")){j+=6;continue}if(z("static")){U=!0,j+=6;continue}if(z("abstract")){Z=!0,j+=8;continue}if(z("readonly")){Q=!0,j+=8;continue}if(z("override")){F=!0,j+=8;continue}if(z("accessor")){G=!0,j+=8;continue}if(z("async")){K=!0,j+=5;continue}if(z("declare")){j+=7;continue}break}if(O(),j>=V||Y.charCodeAt(j)===125)break;if(Y.charCodeAt(j)===35)H=!0;if(H){Vj();continue}let B=" ";if(X)B+="protected ";if(U)B+="static ";if(Z)B+="abstract ";if(Q)B+="readonly ";if(z("constructor")){j+=11,O();let N=m();if(O(),Cj(N,J),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;let D=c(N);J.push(` constructor${D};`)}else if(z("get"))if(j+=3,O(),j<V&&(Oj(Y.charCodeAt(j))||Y.charCodeAt(j)===91||Y.charCodeAt(j)===35)){let N=Kj();if(N.startsWith("#")){if(O(),j<V&&Y.charCodeAt(j)===40)m();if(O(),s(),O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;continue}O(),m(),O();let D=s()||"unknown";if(O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;J.push(`${B}get ${N}(): ${D};`)}else Lj("get",B,U,Q,K,J);else if(z("set"))if(j+=3,O(),j<V&&(Oj(Y.charCodeAt(j))||Y.charCodeAt(j)===91||Y.charCodeAt(j)===35)){let N=Kj();if(N.startsWith("#")){if(O(),j<V&&Y.charCodeAt(j)===40)m();if(O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;continue}O();let D=m();if(O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;let q=c(D);J.push(`${B}set ${N}${q};`)}else Lj("set",B,U,Q,K,J);else{let N=Y.charCodeAt(j)===42;if(N)j++,O();let D=Kj();if(!D){Vj();continue}gj(D,B,U,Q,N,Z,K,J)}}return`{
|
|
17
|
-
${J.join(`
|
|
18
|
-
`)}
|
|
19
|
-
}`}function Kj(){if(j>=V)return"";let J=Y.charCodeAt(j);if(J===91){let H=j;return T(91,93),Y.slice(H,j)}if(J===35)return j++,`#${E()}`;return E()}function _j(J){let H=j+J.length;while(H<V&&y(Y.charCodeAt(H)))H++;return H<V?Y.charCodeAt(H):0}function Vj(){let J=0;while(j<V){if(f())continue;let H=Y.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&&o())return;j++}}function Lj(J,H,X,U,Z,Q){gj(J,H,X,U,!1,!1,Z,Q)}function gj(J,H,X,U,Z,Q,F,G){if(O(),j>=V)return;let K=Y.charCodeAt(j),$=!1;if(K===63)$=!0,j++,O();if(j<V&&Y.charCodeAt(j)===33)j++,O();let B=j<V?Y.charCodeAt(j):0;if(B===40||B===60){let N=B===60?W():"";O();let D=m();O();let q=s();if(!q)if(F&&Z)q="AsyncGenerator<unknown, void, unknown>";else if(Z)q="Generator<unknown, void, unknown>";else if(F)q="Promise<void>";else q="void";if(O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;let R=c(D),_=$?"?":"",M=Z?"*":"";G.push(`${H}${M}${J}${_}${N}${R}: ${q};`)}else if(B===58||B===61||B===59||B===125||B===10||B===13){let N="";if(B===58){j++,O();let R=j,_=0;while(j<V){if(f())continue;let M=Y.charCodeAt(j);if(M===40||M===123||M===91||M===60)_++;else if(M===41||M===125||M===93||M===62&&!C()){if(_===0)break;_--}else if(_===0&&(M===59||M===61||M===44))break;if(_===0&&o())break;j++}N=w(R,j)}let D="";if(j<V&&Y.charCodeAt(j)===61)if(P&&N){j++;let R=0;while(j<V){if(f())continue;let _=Y.charCodeAt(j);if(_===40||_===123||_===91)R++;else if(_===41||_===125||_===93){if(R===0&&_===125)break;R--}else if(R===0&&_===59)break;if(R===0&&o())break;j++}}else{j++,O();let R=j,_=0;while(j<V){if(f())continue;let M=Y.charCodeAt(j);if(M===40||M===123||M===91)_++;else if(M===41||M===125||M===93){if(_===0&&M===125)break;_--}else if(_===0&&M===59)break;if(_===0&&o())break;j++}D=w(R,j)}if(j<V&&Y.charCodeAt(j)===59)j++;if(!N)if(D){let R=Yj(D);if(R)N=R;else N=X&&U?Xj(D):Uj(D)}else N="unknown";let q=$?"?":"";G.push(`${H}${J}${q}: ${N};`)}else Vj()}function Cj(J,H){let X=J.slice(1,-1).trim();if(!X)return;let U=[],Z=0,Q=0,F=!1,G=0;for(let K=0;K<=X.length;K++){if(K===X.length){U.push(X.slice(Z).trim());break}let $=X.charCodeAt(K);if(F){if($===92){K++;continue}if($===G)F=!1;continue}if($===39||$===34||$===96){F=!0,G=$;continue}if($===40||$===123||$===91||$===60)Q++;else if($===41||$===125||$===93||$===62&&!(K>0&&X.charCodeAt(K-1)===61))Q--;else if($===44&&Q===0)U.push(X.slice(Z,K).trim()),Z=K+1}for(let K of U){let $=K.startsWith("public ")||K.startsWith("public\t"),B=K.startsWith("protected ")||K.startsWith("protected\t"),N=K.startsWith("private ")||K.startsWith("private\t"),D=K.includes("readonly ");if(!$&&!B&&!N&&!D)continue;if(N)continue;let q=K,R=[];if($){let v=6;while(v<q.length&&y(q.charCodeAt(v)))v++;q=q.slice(v),R.push("public")}if(B){let v=9;while(v<q.length&&y(q.charCodeAt(v)))v++;q=q.slice(v),R.push("protected")}if(D){let v=q.indexOf("readonly ");if(v!==-1){let Hj=v+8;while(Hj<q.length&&y(q.charCodeAt(Hj)))Hj++;q=q.slice(0,v)+q.slice(Hj)}R.push("readonly")}let _=R.length>0?`${R.join(" ")} `:"",M=Nj(q);H.push(` ${_}${M};`)}}function zj(J=" "){if(j>=V||Y.charCodeAt(j)!==123)return"{}";j++;let H=[];while(j<V){if(O(),j>=V)break;if(Y.charCodeAt(j)===125){j++;break}if(Y.charCodeAt(j)===59){j++;continue}let X=!1;if(z("export"))X=!0,j+=6,O();if(z("declare"))j+=7,O();let U=X?"export ":"";if(z("function")||z("async")&&Sj("async","function")){let Z=!1;if(z("async"))Z=!0,j+=5,O();if(j+=8,O(),j<V&&Y.charCodeAt(j)===42)j++,O();let F=E();O();let G=W();O();let K=m();O();let $=s();if(!$)$=Z?"Promise<void>":"void";if(O(),j<V&&Y.charCodeAt(j)===123)T(123,125);else if(j<V&&Y.charCodeAt(j)===59)j++;let B=c(K);H.push(`${J}${U}function ${F}${G}${B}: ${$};`)}else if(z("const")||z("let")||z("var")){let Z=z("const")?"const":z("let")?"let":"var";j+=Z.length,O();let Q=E();if(!Q){I();continue}O();let F="";if(j<V&&Y.charCodeAt(j)===58){j++,O();let K=j,$=0;while(j<V){if(f())continue;let B=Y.charCodeAt(j);if(B===40||B===123||B===91||B===60)$++;else if(B===41||B===125||B===93||B===62&&!C())$--;else if($===0&&(B===61||B===59||B===44))break;if($===0&&p())break;j++}F=w(K,j)}let G="";if(j<V&&Y.charCodeAt(j)===61){j++,O();let K=j,$=0;while(j<V){if(f())continue;let B=Y.charCodeAt(j);if(B===40||B===123||B===91||B===60)$++;else if(B===41||B===125||B===93||B===62&&!C())$--;else if($===0&&(B===59||B===44))break;if($===0&&p())break;j++}G=w(K,j)}if(j<V&&Y.charCodeAt(j)===59)j++;if(!F&&G){let K=Yj(G);if(K)F=K;else if(Z==="const")F=Xj(G);else F=Uj(G)}if(!F)F="unknown";H.push(`${J}${U}${Z} ${Q}: ${F};`)}else if(z("interface")){j+=9,O();let Z=E();O();let Q=W();O();let F="";if(z("extends")){let K=j;while(j<V&&Y.charCodeAt(j)!==123){if(f())continue;j++}F=Y.slice(K,j)}let G=Rj(Jj());H.push(`${J}${U}interface ${Z}${Q}${F} ${G}`)}else if(z("type")){j+=4,O();let Z=E();O();let Q=W();if(O(),j<V&&Y.charCodeAt(j)===61){j++,O();let F=j,G=0;while(j<V){if(f())continue;let $=Y.charCodeAt(j);if($===40||$===123||$===91||$===60)G++;else if($===41||$===125||$===93||$===62&&!C())G--;else if(G===0&&$===59)break;if(G===0&&p())break;j++}let K=w(F,j);if(j<V&&Y.charCodeAt(j)===59)j++;H.push(`${J}${U}type ${Z}${Q} = ${K}`)}}else if(z("class")){j+=5,O();let Z=E();O();let Q=W();O();let F=j;while(j<V&&Y.charCodeAt(j)!==123){if(f())continue;j++}let G=w(F,j),K=G?` ${G}`:"",$=Qj();H.push(`${J}${U}class ${Z}${Q}${K} ${$}`)}else if(z("enum")){j+=4,O();let Z=E();O();let Q=Jj();H.push(`${J}${U}enum ${Z} ${Q}`)}else if(z("namespace")||z("module")){let Z=z("namespace")?"namespace":"module";j+=Z.length,O();let Q=E();O();let F=zj(J);H.push(`${J}${U}${Z} ${Q} ${F}`)}else if(z("abstract"))if(j+=8,O(),z("class")){j+=5,O();let Z=E();O();let Q=W();O();let F=j;while(j<V&&Y.charCodeAt(j)!==123){if(f())continue;j++}let G=w(F,j),K=G?` ${G}`:"",$=Qj();H.push(`${J}${U}abstract class ${Z}${Q}${K} ${$}`)}else I();else if(X&&z("default")){j+=7,O();let Z=j;I();let Q=w(Z,j);if(Q.charCodeAt(Q.length-1)===59)Q=Q.slice(0,-1);if(Q)H.push(`${J}export default ${Q};`)}else if(!X&&(Y.charCodeAt(j)===39||Y.charCodeAt(j)===34||Y.charCodeAt(j)===96))I();else I()}if(H.length===0)return"{}";return`{
|
|
20
|
-
${H.join(`
|
|
21
|
-
`)}
|
|
22
|
-
}`}function Sj(J,H){let X=j+J.length;while(X<V&&y(Y.charCodeAt(X)))X++;for(let U=0;U<H.length;U++)if(X+U>=V||Y.charCodeAt(X+U)!==H.charCodeAt(U))return!1;return X+H.length>=V||!S(Y.charCodeAt(X+H.length))}function i(J,H,X){j+=X.length,O();let U="",Z=Y.charCodeAt(j);if(Z===39||Z===34){let $=j;l(Z),U=Y.slice($,j)}else{U=E();while(j<V&&Y.charCodeAt(j)===46)j++,U+=`.${E()}`}O();let Q=j<V&&Y.charCodeAt(j)===123?zj():"{}",F=`${H?"export ":""}declare ${X} ${U} ${Q}`,G=k(J),K=U.startsWith("'")||U.startsWith('"');return{kind:"module",name:U,text:F,isExported:H,source:K?U.slice(1,-1):void 0,leadingComments:G,start:J,end:j}}while(j<V){if(O(),j>=V)break;let J=j,H=Y.charCodeAt(j);if(H===105&&z("import"))L.push(Aj(J));else if(H===101&&z("export")){j+=6,O();let X=Y.charCodeAt(j);if(X===100&&z("default")){j+=7,O();let U=Y.charCodeAt(j);if(U===102&&z("function")){let Z=n(J,!0,!1,!0);if(Z)L.push(Z)}else if(U===97&&z("async")&&_j("async")!==59)if(j+=5,O(),z("function")){let Z=n(J,!0,!0,!0);if(Z)L.push(Z)}else{I();let Z=w(J,j);L.push({kind:"export",name:"default",text:Z,isExported:!0,isTypeOnly:!1,start:J,end:j})}else if(U===99&&z("class")){let Z=d(J,!0,!1);L.push(Z)}else if(U===97&&z("abstract")){if(j+=8,O(),z("class")){let Z=d(J,!0,!0);L.push(Z)}}else{I();let Z=w(J,j),Q=k(J);L.push({kind:"export",name:"default",text:Z,isExported:!0,isTypeOnly:!1,leadingComments:Q,start:J,end:j})}}else if(X===116&&z("type")){let U=j;if(j+=4,O(),j<V&&Y.charCodeAt(j)===123){Bj();let Z=w(J,j),Q=k(J);L.push({kind:"export",name:"",text:Z,isExported:!0,isTypeOnly:!0,leadingComments:Q,start:J,end:j})}else if(j<V&&Y.charCodeAt(j)===42){Gj();let Z=w(J,j);L.push({kind:"export",name:"",text:Z,isExported:!0,isTypeOnly:!0,start:J,end:j})}else{j=U;let Z=$j(J,!0);L.push(Z)}}else if(X===105&&z("interface")){let U=Zj(J,!0);L.push(U)}else if(X===102&&z("function")){let U=n(J,!0,!1,!1);if(U)L.push(U)}else if(X===97&&z("async"))if(j+=5,O(),z("function")){let U=n(J,!0,!0,!1);if(U)L.push(U)}else I();else if(X===99)if(z("class")){let U=d(J,!0,!1);L.push(U)}else if(z("const")){let U=j;if(j+=5,O(),z("enum")){j=U+5,O();let Z=r(J,!0,!0);L.push(Z)}else{j=U;let Z=t(J,"const",!0);for(let Q=0;Q<Z.length;Q++)L.push(Z[Q])}}else I();else if(X===97&&z("abstract")){if(j+=8,O(),z("class")){let U=d(J,!0,!0);L.push(U)}}else if(X===108&&z("let")){let U=t(J,"let",!0);for(let Z=0;Z<U.length;Z++)L.push(U[Z])}else if(X===118&&z("var")){let U=t(J,"var",!0);for(let Z=0;Z<U.length;Z++)L.push(U[Z])}else if(X===101&&z("enum")){let U=r(J,!0,!1);L.push(U)}else if(X===100&&z("declare"))j+=7,O(),Mj(J,!0);else if(X===110&&z("namespace")){let U=i(J,!0,"namespace");L.push(U)}else if(X===109&&z("module")){let U=i(J,!0,"module");L.push(U)}else if(X===123){Bj();let U=w(J,j),Z=U.includes("export type"),Q=k(J);L.push({kind:"export",name:"",text:U,isExported:!0,isTypeOnly:Z,leadingComments:Q,start:J,end:j})}else if(X===42){Gj();let U=w(J,j),Z=k(J),Q,F=U.indexOf("from ");if(F!==-1){let G=F+5;while(G<U.length&&(U.charCodeAt(G)===32||U.charCodeAt(G)===9))G++;if(G<U.length){let K=U.charCodeAt(G);if(K===39||K===34){let $=U.indexOf(U[G],G+1);if($!==-1)Q=U.slice(G+1,$)}}}L.push({kind:"export",name:"",text:U,isExported:!0,isTypeOnly:!1,source:Q,leadingComments:Z,start:J,end:j})}else{I();let U=w(J,j);if(U)L.push({kind:"export",name:"",text:U,isExported:!0,start:J,end:j})}}else if(H===100&&z("declare"))j+=7,O(),Mj(J,!1);else if(H===105&&z("interface")){let X=Zj(J,!1);b.set(X.name,X)}else if(H===116&&z("type")){let X=$j(J,!1);b.set(X.name,X),L.push(X)}else if(H===102&&z("function"))I();else if(H===97)if(z("async"))I();else if(z("abstract"))if(j+=8,O(),z("class")){let X=d(J,!1,!1);b.set(X.name,X),L.push(X)}else I();else j++,I();else if(H===99)if(z("class")){let X=d(J,!1,!1);b.set(X.name,X),L.push(X)}else if(z("const")){let X=j;if(j+=5,O(),z("enum")){j=X+5,O();let U=r(J,!1,!0);b.set(U.name,U),L.push(U)}else j=X,I()}else j++,I();else if(H===101&&z("enum")){let X=r(J,!1,!1);b.set(X.name,X),L.push(X)}else if(H===108&&z("let"))I();else if(H===118&&z("var"))I();else if(H===109&&z("module")){let X=i(J,!1,"module");L.push(X)}else if(H===110&&z("namespace")){let X=i(J,!1,"namespace");L.push(X)}else{let X=Y.charCodeAt(j);if(X===39||X===34){if(l(X),j<V&&Y.charCodeAt(j)===59)j++}else if(X===96){if(jj(),j<V&&Y.charCodeAt(j)===59)j++}else if(X===64){if(j++,E(),O(),j<V&&Y.charCodeAt(j)===46)j++,E(),O();if(j<V&&Y.charCodeAt(j)===40)T(40,41)}else j++,I()}}if(b.size>0)uj(L,b);if(u.size>0){let J=new Map;for(let X of L)if(X.kind==="function")J.set(X.name,(J.get(X.name)||0)+1);let H=new Set;for(let[X,U]of J)if(U>1)H.add(X);if(H.size>0){let X=new Set;for(let U of H)for(let Z=L.length-1;Z>=0;Z--)if(L[Z].kind==="function"&&L[Z].name===U&&u.has(Z)){X.add(Z);break}if(X.size>0){let U=[...X].sort((Z,Q)=>Q-Z);for(let Z of U)L.splice(Z,1)}}}return L;function Mj(J,H){if(z("function")){let X=n(J,H,!1,!1);if(X)L.push(X)}else if(z("async")){if(j+=5,O(),z("function")){let X=n(J,H,!0,!1);if(X)L.push(X)}}else if(z("class")){let X=d(J,H,!1);L.push(X)}else if(z("abstract")){if(j+=8,O(),z("class")){let X=d(J,H,!0);L.push(X)}}else if(z("interface")){let X=Zj(J,H);L.push(X)}else if(z("type")){let X=$j(J,H);L.push(X)}else if(z("enum")){let X=r(J,H,!1);L.push(X)}else if(z("const")){let X=j;if(j+=5,O(),z("enum")){j=X+5,O();let U=r(J,H,!0);L.push(U)}else if(H){j=X;let U=t(J,"const",!0);for(let Z=0;Z<U.length;Z++)L.push(U[Z])}else I()}else if(z("let")||z("var"))if(H){let X=z("let")?"let":"var",U=t(J,X,!0);for(let Z=0;Z<U.length;Z++)L.push(U[Z])}else I();else if(z("module")){let X=i(J,H,"module");L.push(X)}else if(z("namespace")){let X=i(J,H,"namespace");L.push(X)}else if(z("global")){j+=6,O();let U=`declare global ${j<V&&Y.charCodeAt(j)===123?zj():"{}"}`,Z=k(J);L.push({kind:"module",name:"global",text:U,isExported:!1,leadingComments:Z,start:J,end:j})}else I()}}function Pj(g,e){let A=0,h=g.length;while(A<h){let Y=g.charCodeAt(A);if(Y>=65&&Y<=90||Y>=97&&Y<=122||Y===95||Y===36||Y>127){let a=A;A++;while(A<h){let P=g.charCodeAt(A);if(P>=65&&P<=90||P>=97&&P<=122||P>=48&&P<=57||P===95||P===36||P>127)A++;else break}e.add(g.substring(a,A))}else A++}}function uj(g,e){let A=new Set,h=new Set;for(let P of g)h.add(P.name);let Y=new Set,a=[];for(let P=0;P<g.length;P++)if(g[P].kind!=="import")a.push(g[P].text),Pj(g[P].text,Y);for(;;){let P=[];for(let[b,u]of e){if(A.has(b))continue;if(Y.has(b)){if(!h.has(b))P.push(u),h.add(b);A.add(b)}}if(P.length===0)break;P.sort((b,u)=>(b.start??1/0)-(u.start??1/0));let V=[],L=0;for(let b=0;b<g.length;b++){let u=g[b].start??1/0;while(L<P.length&&(P[L].start??1/0)<=u)V.push(P[L++]);V.push(g[b])}while(L<P.length)V.push(P[L++]);g.length=0;for(let b=0;b<V.length;b++)g.push(V[b]);for(let b of P)if(b.kind!=="import")a.push(b.text),Pj(b.text,Y)}}
|
|
23
|
-
export{xj as nc};
|
package/dist/chunk-rw6j20e2.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var g=Object.create;var{getPrototypeOf:h,defineProperty:f,getOwnPropertyNames:i}=Object;var j=Object.prototype.hasOwnProperty;var k=(a,b,c)=>{c=a!=null?g(h(a)):{};let d=b||!a||!a.__esModule?f(c,"default",{value:a,enumerable:!0}):c;for(let e of i(a))if(!j.call(d,e))f(d,e,{get:()=>a[e],enumerable:!0});return d};var l=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var m=import.meta.require;
|
|
3
|
-
export{k as ad,l as bd,m as cd};
|
package/dist/chunk-zsznaama.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{l as a,m as b,n as c,o as d,p as e,q as f,r as g}from"./chunk-5fveksya.js";import"./chunk-8dx98fd5.js";import"./chunk-2w3g3g00.js";import"./chunk-p1d09y82.js";import"./chunk-qn0xktfx.js";import"./chunk-gpxdn99a.js";import"./chunk-me2ae6f0.js";import"./chunk-97pgeywh.js";import"./chunk-0fhq2wva.js";import"./chunk-f18nyrrb.js";import"./chunk-57agx6g8.js";import"./chunk-rw6j20e2.js";export{b as sortProjectsByDependencies,f as resolveWorkspacePatterns,c as generateWorkspace,d as generateMonorepo,g as generateFromPackageWorkspaces,a as discoverWorkspaceProjects,e as discoverWorkspaceFromPackageJson};
|