@dtsx/dtsx 0.11.48 → 0.11.50
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 +1 -1
- package/dist/{chunk-d27xpsa4.js → chunk-0rk4cvt6.js} +1 -1
- package/dist/{chunk-8qpzh9yc.js → chunk-0v6vmemf.js} +3 -3
- package/dist/{chunk-564pr6v4.js → chunk-1mg4cxd3.js} +1 -1
- package/dist/{chunk-pkdrq4sh.js → chunk-258337ef.js} +1 -1
- package/dist/{chunk-hzybfasv.js → chunk-25vpx6mq.js} +1 -1
- package/dist/{chunk-h6ngkqg7.js → chunk-2t2xwzj5.js} +1 -1
- package/dist/{chunk-c87yyjv7.js → chunk-31rb15pe.js} +1 -1
- package/dist/{chunk-qmg1535a.js → chunk-3mp0jaa7.js} +2 -2
- package/dist/{chunk-fn2xxavw.js → chunk-4p9dw996.js} +1 -1
- package/dist/{chunk-x5bspdyq.js → chunk-5rrxzd1e.js} +2 -2
- package/dist/{chunk-nf10pph8.js → chunk-5zzvxzey.js} +2 -2
- package/dist/{chunk-d0dbet9n.js → chunk-6exq13f9.js} +3 -3
- package/dist/{chunk-pp9aevcb.js → chunk-90jwk3zy.js} +2 -2
- package/dist/{chunk-rnvqc8st.js → chunk-937czex4.js} +2 -2
- package/dist/{chunk-bxjswrak.js → chunk-9xep96k0.js} +2 -2
- package/dist/{chunk-qpahzkm0.js → chunk-a5tvswq1.js} +1 -1
- package/dist/{chunk-r2h572w9.js → chunk-aj2n4x1b.js} +1 -1
- package/dist/{chunk-zesjexqf.js → chunk-av03sjse.js} +1 -1
- package/dist/{chunk-h5esm323.js → chunk-b6xcyrnx.js} +5 -5
- package/dist/{chunk-atzh1g6f.js → chunk-beg5vxdm.js} +1 -1
- package/dist/{chunk-rkdyetby.js → chunk-bkwzva5v.js} +1 -1
- package/dist/{chunk-fkngq7na.js → chunk-bsj770f8.js} +2 -2
- package/dist/{chunk-adhnnbe1.js → chunk-bvtzfznj.js} +1 -1
- package/dist/{chunk-wrvgt39b.js → chunk-c6bfdmfy.js} +1 -1
- package/dist/{chunk-gqk2s9wt.js → chunk-e29deb0h.js} +2 -2
- package/dist/{chunk-4e02xmrg.js → chunk-ef428m5g.js} +2 -2
- package/dist/{chunk-zerajrvv.js → chunk-fp40v5jx.js} +1 -1
- package/dist/{chunk-689tfwjh.js → chunk-fvr0rwgt.js} +1 -1
- package/dist/{chunk-cgz4sy6k.js → chunk-gcgtyjyj.js} +1 -1
- package/dist/{chunk-mm1cfz16.js → chunk-gyfbehkf.js} +2 -2
- package/dist/{chunk-w5m9qv5k.js → chunk-h12vphnz.js} +1 -1
- package/dist/{chunk-vhna4qch.js → chunk-h3r142dy.js} +1 -1
- package/dist/{chunk-mjaf2je8.js → chunk-j4t8d6p0.js} +1 -1
- package/dist/{chunk-475bjqea.js → chunk-ka9qyjzn.js} +3 -3
- package/dist/{chunk-kdz4gxdq.js → chunk-m7jndt3v.js} +4 -4
- package/dist/{chunk-agq858s0.js → chunk-n833rcmj.js} +1 -1
- package/dist/{chunk-8dyz1cte.js → chunk-nh71w1ta.js} +3 -3
- package/dist/{chunk-g4eb5tgt.js → chunk-ntps0jm2.js} +1 -1
- package/dist/{chunk-xs0ke3f2.js → chunk-p4dpq81g.js} +3 -3
- package/dist/chunk-qx0pxmvs.js +38 -0
- package/dist/{chunk-vwn5fx4f.js → chunk-r4dq05mh.js} +1 -1
- package/dist/{chunk-jjdjk59m.js → chunk-s6tmjqsc.js} +1 -1
- package/dist/{chunk-y3vhsctr.js → chunk-skydb7vs.js} +3 -3
- package/dist/{chunk-4kn7y9ns.js → chunk-taa77k3y.js} +1 -1
- package/dist/{chunk-8hwmssy9.js → chunk-tgfj7kre.js} +1 -1
- package/dist/{chunk-nqdc6n5d.js → chunk-txf9rw55.js} +15 -15
- package/dist/{chunk-znsgvx9t.js → chunk-vrvzmysf.js} +1 -1
- package/dist/{chunk-29m9mhwt.js → chunk-vvy85nm6.js} +2 -2
- package/dist/{chunk-0kvy1dh8.js → chunk-w60gzzxc.js} +2 -2
- package/dist/{chunk-h2007n8k.js → chunk-w9jg9761.js} +1 -1
- package/dist/{chunk-1dnqddk9.js → chunk-xawz3n8s.js} +1 -1
- package/dist/{chunk-cgrta603.js → chunk-xcfbw2r7.js} +1 -1
- package/dist/{chunk-a8djrg2n.js → chunk-xsaw8abt.js} +2 -2
- package/dist/{chunk-p458sykz.js → chunk-yapz0de1.js} +1 -1
- package/dist/chunk-zrfwvjq8.js +4 -0
- package/dist/{chunk-ex02f2vm.js → chunk-zrmg0q1q.js} +6 -6
- package/dist/src/augmentation-graph.js +1 -1
- package/dist/src/binding-patterns.js +1 -1
- package/dist/src/branded-types.js +1 -1
- package/dist/src/bundle-linker.js +1 -1
- package/dist/src/bundler.js +1 -1
- package/dist/src/cache.js +1 -1
- package/dist/src/call-signatures.js +1 -1
- package/dist/src/circular.js +1 -1
- package/dist/src/computed-keys.js +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/declaration-project.js +1 -1
- package/dist/src/declaration-publication.js +1 -1
- package/dist/src/declaration-references.d.ts +1 -1
- package/dist/src/declaration-references.js +1 -1
- package/dist/src/docs.js +1 -1
- package/dist/src/enum-declarations.js +1 -1
- package/dist/src/errors.js +1 -1
- package/dist/src/extractor/extract.js +1 -1
- package/dist/src/extractor/scanner.js +1 -1
- package/dist/src/extractor.js +1 -1
- package/dist/src/function-properties.js +1 -1
- package/dist/src/generator.js +1 -1
- package/dist/src/incremental.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/inferred-imports.js +1 -1
- package/dist/src/initializer-type-spans.js +1 -1
- package/dist/src/lexical.js +1 -1
- package/dist/src/logger.js +1 -1
- package/dist/src/lsp.js +1 -1
- package/dist/src/memory.js +1 -1
- package/dist/src/module-graph.js +1 -1
- package/dist/src/module-references.js +1 -1
- package/dist/src/native-checker.js +1 -1
- package/dist/src/native-extractor.js +1 -1
- package/dist/src/native-generation.js +1 -1
- package/dist/src/native-project.js +1 -1
- package/dist/src/optimizer.js +1 -1
- package/dist/src/parallel-processor.js +1 -1
- package/dist/src/parameters.js +1 -1
- package/dist/src/parser.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/tsdown.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/src/process-source.js +1 -1
- package/dist/src/processor/declarations.js +1 -1
- package/dist/src/processor/import-usage.js +1 -1
- package/dist/src/processor/imports.js +1 -1
- package/dist/src/processor/index.js +1 -1
- package/dist/src/processor/type-inference.js +1 -1
- package/dist/src/processor.js +1 -1
- package/dist/src/return-type-scope.js +1 -1
- package/dist/src/source-cache.js +1 -1
- package/dist/src/sourcemap.js +1 -1
- package/dist/src/transformers.js +1 -1
- package/dist/src/utils.js +1 -1
- package/dist/src/value-inference.js +1 -1
- package/dist/src/worker-thread.js +1 -1
- package/dist/src/worker.js +1 -1
- package/dist/src/workspace.js +1 -1
- package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
- package/native/darwin-x64/libzig-dtsx.dylib +0 -0
- package/native/freebsd-x64/libzig-dtsx.so +0 -0
- package/native/linux-arm64/libzig-dtsx.so +0 -0
- package/native/linux-x64/libzig-dtsx.so +0 -0
- package/native/windows-x64/zig-dtsx.dll +0 -0
- package/package.json +1 -1
- package/dist/chunk-hnw7mwcw.js +0 -3
- package/dist/chunk-hzjesnf1.js +0 -38
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mt,Ia}from"../../chunk-
|
|
2
|
+
import{mt,Ia}from"../../chunk-25vpx6mq.js";import"../../chunk-zrmg0q1q.js";import"../../chunk-s9e2a0t7.js";import"../../chunk-9kfzjkd1.js";import"../../chunk-fp40v5jx.js";import"../../chunk-h12vphnz.js";import"../../chunk-xm63aee8.js";import"../../chunk-bsj770f8.js";import"../../chunk-j4t8d6p0.js";import"../../chunk-xcfbw2r7.js";import"../../chunk-a0900w7b.js";import"../../chunk-b6xcyrnx.js";import"../../chunk-hgg4aqvf.js";import"../../chunk-p4dpq81g.js";import"../../chunk-j0y149qx.js";import"../../chunk-rwdcmcx3.js";import"../../chunk-dhzr60ge.js";import"../../chunk-aj2n4x1b.js";import"../../chunk-290jpwny.js";import"../../chunk-ka9qyjzn.js";import"../../chunk-yapz0de1.js";import"../../chunk-beg5vxdm.js";import"../../chunk-m7jndt3v.js";import"../../chunk-vvy85nm6.js";import"../../chunk-x6ddycvm.js";import"../../chunk-g9emajpc.js";import"../../chunk-02yqpwv0.js";import"../../chunk-3mp0jaa7.js";import"../../chunk-c6bfdmfy.js";import"../../chunk-gcgtyjyj.js";import"../../chunk-kcfc6zg6.js";import"../../chunk-8gksa73c.js";import"../../chunk-937czex4.js";import"../../chunk-srfpcjtn.js";import"../../chunk-v6fwy63g.js";import"../../chunk-qx0pxmvs.js";import"../../chunk-9xep96k0.js";import"../../chunk-4p9dw996.js";import"../../chunk-nh71w1ta.js";import"../../chunk-r4dq05mh.js";import"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-zrfwvjq8.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-vrvzmysf.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Ia as default,mt as dts};
|
package/dist/src/plugins/tsup.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ve,La,dr,Na}from"../../chunk-
|
|
2
|
+
import{ve,La,dr,Na}from"../../chunk-2t2xwzj5.js";import"../../chunk-zrmg0q1q.js";import"../../chunk-s9e2a0t7.js";import"../../chunk-9kfzjkd1.js";import"../../chunk-fp40v5jx.js";import"../../chunk-h12vphnz.js";import"../../chunk-xm63aee8.js";import"../../chunk-bsj770f8.js";import"../../chunk-j4t8d6p0.js";import"../../chunk-xcfbw2r7.js";import"../../chunk-a0900w7b.js";import"../../chunk-b6xcyrnx.js";import"../../chunk-hgg4aqvf.js";import"../../chunk-p4dpq81g.js";import"../../chunk-j0y149qx.js";import"../../chunk-rwdcmcx3.js";import"../../chunk-dhzr60ge.js";import"../../chunk-aj2n4x1b.js";import"../../chunk-290jpwny.js";import"../../chunk-ka9qyjzn.js";import"../../chunk-yapz0de1.js";import"../../chunk-beg5vxdm.js";import"../../chunk-m7jndt3v.js";import"../../chunk-vvy85nm6.js";import"../../chunk-x6ddycvm.js";import"../../chunk-g9emajpc.js";import"../../chunk-02yqpwv0.js";import"../../chunk-3mp0jaa7.js";import"../../chunk-c6bfdmfy.js";import"../../chunk-gcgtyjyj.js";import"../../chunk-kcfc6zg6.js";import"../../chunk-8gksa73c.js";import"../../chunk-937czex4.js";import"../../chunk-srfpcjtn.js";import"../../chunk-v6fwy63g.js";import"../../chunk-qx0pxmvs.js";import"../../chunk-9xep96k0.js";import"../../chunk-4p9dw996.js";import"../../chunk-nh71w1ta.js";import"../../chunk-r4dq05mh.js";import"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-zrfwvjq8.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-vrvzmysf.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Na as default,dr as dts,ve as dtsxPlugin,La as tsupDts};
|
package/dist/src/plugins/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ke,
|
|
2
|
+
import{Ke,Pa,Ra}from"../../chunk-ef428m5g.js";import"../../chunk-zrmg0q1q.js";import"../../chunk-s9e2a0t7.js";import"../../chunk-9kfzjkd1.js";import"../../chunk-fp40v5jx.js";import"../../chunk-h12vphnz.js";import"../../chunk-xm63aee8.js";import"../../chunk-bsj770f8.js";import"../../chunk-j4t8d6p0.js";import"../../chunk-xcfbw2r7.js";import"../../chunk-a0900w7b.js";import"../../chunk-b6xcyrnx.js";import"../../chunk-hgg4aqvf.js";import"../../chunk-p4dpq81g.js";import"../../chunk-j0y149qx.js";import"../../chunk-rwdcmcx3.js";import"../../chunk-dhzr60ge.js";import"../../chunk-aj2n4x1b.js";import"../../chunk-290jpwny.js";import"../../chunk-ka9qyjzn.js";import"../../chunk-yapz0de1.js";import"../../chunk-beg5vxdm.js";import"../../chunk-m7jndt3v.js";import"../../chunk-vvy85nm6.js";import"../../chunk-x6ddycvm.js";import"../../chunk-g9emajpc.js";import"../../chunk-02yqpwv0.js";import"../../chunk-3mp0jaa7.js";import"../../chunk-c6bfdmfy.js";import"../../chunk-gcgtyjyj.js";import"../../chunk-kcfc6zg6.js";import"../../chunk-8gksa73c.js";import"../../chunk-937czex4.js";import"../../chunk-srfpcjtn.js";import"../../chunk-v6fwy63g.js";import"../../chunk-qx0pxmvs.js";import"../../chunk-9xep96k0.js";import"../../chunk-4p9dw996.js";import"../../chunk-nh71w1ta.js";import"../../chunk-r4dq05mh.js";import"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-zrfwvjq8.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-vrvzmysf.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Ra as default,Ke as dts,Pa as viteDts};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{He,qt,ur,Ta}from"../../chunk-
|
|
2
|
+
import{He,qt,ur,Ta}from"../../chunk-bvtzfznj.js";import"../../chunk-zrmg0q1q.js";import"../../chunk-s9e2a0t7.js";import"../../chunk-9kfzjkd1.js";import"../../chunk-fp40v5jx.js";import"../../chunk-h12vphnz.js";import"../../chunk-xm63aee8.js";import"../../chunk-bsj770f8.js";import"../../chunk-j4t8d6p0.js";import"../../chunk-xcfbw2r7.js";import"../../chunk-a0900w7b.js";import"../../chunk-b6xcyrnx.js";import"../../chunk-hgg4aqvf.js";import"../../chunk-p4dpq81g.js";import"../../chunk-j0y149qx.js";import"../../chunk-rwdcmcx3.js";import"../../chunk-dhzr60ge.js";import"../../chunk-aj2n4x1b.js";import"../../chunk-290jpwny.js";import"../../chunk-ka9qyjzn.js";import"../../chunk-yapz0de1.js";import"../../chunk-beg5vxdm.js";import"../../chunk-m7jndt3v.js";import"../../chunk-vvy85nm6.js";import"../../chunk-x6ddycvm.js";import"../../chunk-g9emajpc.js";import"../../chunk-02yqpwv0.js";import"../../chunk-3mp0jaa7.js";import"../../chunk-c6bfdmfy.js";import"../../chunk-gcgtyjyj.js";import"../../chunk-kcfc6zg6.js";import"../../chunk-8gksa73c.js";import"../../chunk-937czex4.js";import"../../chunk-srfpcjtn.js";import"../../chunk-v6fwy63g.js";import"../../chunk-qx0pxmvs.js";import"../../chunk-9xep96k0.js";import"../../chunk-4p9dw996.js";import"../../chunk-nh71w1ta.js";import"../../chunk-r4dq05mh.js";import"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-zrfwvjq8.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-vrvzmysf.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{He as DtsxWebpackPlugin,Ta as default,ur as dts,qt as dtsxWebpack};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ze,$t,ai,ci,li,Fa,En}from"../chunk-
|
|
2
|
+
import{Ze,$t,ai,ci,li,Fa,En}from"../chunk-fp40v5jx.js";import"../chunk-h12vphnz.js";import"../chunk-xm63aee8.js";import"../chunk-a0900w7b.js";import"../chunk-beg5vxdm.js";import"../chunk-gcgtyjyj.js";import"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";import"../chunk-v6fwy63g.js";import"../chunk-qx0pxmvs.js";import"../chunk-9xep96k0.js";import"../chunk-4p9dw996.js";import"../chunk-nh71w1ta.js";import"../chunk-r4dq05mh.js";import"../chunk-h3r142dy.js";import"../chunk-013mp499.js";import"../chunk-zrfwvjq8.js";import"../chunk-txf9rw55.js";import"../chunk-587w6ktw.js";import"../chunk-31rb15pe.js";import"../chunk-0rk4cvt6.js";import"../chunk-vk5r6pgx.js";import"../chunk-1mg4cxd3.js";import"../chunk-w9jg9761.js";import"../chunk-vrvzmysf.js";import"../chunk-6exq13f9.js";import"../chunk-gyfbehkf.js";export{li as clearResultCache,Ze as emitNatively,$t as processSource,Fa as processSourceDirect,ai as processSourceIsolated,ci as processSourceSemantic,En as processSourceWithTypeScriptEngine};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{fe,x,de,pe,me,ge,Kn,qn,he}from"../../chunk-
|
|
2
|
+
import{fe,x,de,pe,me,ge,Kn,qn,he}from"../../chunk-nh71w1ta.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{me as processClassDeclaration,ge as processEnumDeclaration,qn as processExportDeclaration,fe as processFunctionDeclaration,Kn as processImportDeclaration,de as processInterfaceDeclaration,he as processModuleDeclaration,pe as processTypeDeclaration,x as processVariableDeclaration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Me}from"../../chunk-
|
|
2
|
+
import{Me}from"../../chunk-beg5vxdm.js";import"../../chunk-nh71w1ta.js";import"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Me as analyzeDeclarationImportUsage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fe,Yn,C,v,Wa,Ii,_a,ja}from"../../chunk-
|
|
2
|
+
import{Fe,Yn,C,v,Wa,Ii,_a,ja}from"../../chunk-h3r142dy.js";import"../../chunk-013mp499.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{_a as convertToTypeOnlyImport,C as extractAllImportedItems,Fe as getImportSourceLiteral,Ii as isTypeOnlyImportItem,ja as mergeImports,Wa as parseExportDetailed,v as parseImportDetailed,Yn as parseImportStatement};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l}from"../../chunk-
|
|
2
|
+
import{l}from"../../chunk-h12vphnz.js";import"../../chunk-xm63aee8.js";import"../../chunk-beg5vxdm.js";import{fe,x,de,pe,me,ge,Kn,qn,he}from"../../chunk-nh71w1ta.js";import{Yn,C}from"../../chunk-h3r142dy.js";import{Qn}from"../../chunk-013mp499.js";import"../../chunk-zrfwvjq8.js";import{n,Ut,Be,Q,dt,o,pt,We,U}from"../../chunk-txf9rw55.js";import{f}from"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Qn as clearProcessorCaches,C as extractAllImportedItems,U as extractSatisfiesType,o as findMatchingBracket,f as formatComments,Be as inferArrayType,pt as inferFunctionType,n as inferNarrowType,Ut as inferNarrowTypeInUnion,dt as inferObjectType,We as isGenericType,Q as parseArrayElements,Yn as parseImportStatement,me as processClassDeclaration,l as processDeclarations,ge as processEnumDeclaration,qn as processExportDeclaration,fe as processFunctionDeclaration,Kn as processImportDeclaration,de as processInterfaceDeclaration,he as processModuleDeclaration,pe as processTypeDeclaration,x as processVariableDeclaration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Vt,
|
|
2
|
+
import{Vt,zt,n,Ut,B,Sa,W,Ht,Be,Q,rr,Kt,dt,z,ye,o,pt,We,U,Va,za,Ua,Ha,Ka,qa,Ja,$a,Ya,Xa,Za}from"../../chunk-txf9rw55.js";import"../../chunk-587w6ktw.js";import"../../chunk-31rb15pe.js";import"../../chunk-0rk4cvt6.js";import{y,ee,K}from"../../chunk-vk5r6pgx.js";import"../../chunk-1mg4cxd3.js";import"../../chunk-w9jg9761.js";import"../../chunk-6exq13f9.js";import"../../chunk-gyfbehkf.js";export{Kt as classFieldDefaultDoc,ye as cleanParameterDefaults,zt as consumeCleanDefault,Vt as enableCleanDefaultCollection,Ha as extractInferTypes,U as extractSatisfiesType,o as findMatchingBracket,W as indentNestedType,Be as inferArrayType,z as inferCallType,za as inferConditionalType,B as inferFunctionBodyReturnType,pt as inferFunctionType,Ya as inferKeyofType,Va as inferMappedType,n as inferNarrowType,Ut as inferNarrowTypeInUnion,Ht as inferNewExpressionType,dt as inferObjectType,Ua as inferTemplateLiteralTypeAdvanced,Xa as inferTypeofType,ee as isBigIntLiteral,Ka as isComplexType,We as isGenericType,Za as isIndexedAccessType,y as isNumericLiteral,rr as leadingSourceComments,K as numericLiteralType,Q as parseArrayElements,$a as parseTypeParameters,Ja as parseUtilityType,Sa as primitiveMethodReturnType,qa as simplifyComplexType};
|
package/dist/src/processor.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-gyfbehkf.js";import"../chunk-6exq13f9.js";import"../chunk-w9jg9761.js";import"../chunk-zrfwvjq8.js";import"../chunk-xm63aee8.js";import{f}from"../chunk-587w6ktw.js";import"../chunk-31rb15pe.js";import"../chunk-vk5r6pgx.js";import"../chunk-0rk4cvt6.js";import"../chunk-1mg4cxd3.js";import{n,Ut,Be,Q,dt,o,pt,We,U}from"../chunk-txf9rw55.js";import{fe,x,de,pe,me,ge,Kn,qn,he}from"../chunk-nh71w1ta.js";import{Qn}from"../chunk-013mp499.js";import{Yn,C}from"../chunk-h3r142dy.js";import"../chunk-beg5vxdm.js";import{l}from"../chunk-h12vphnz.js";export{Qn as clearProcessorCaches,C as extractAllImportedItems,U as extractSatisfiesType,o as findMatchingBracket,f as formatComments,Be as inferArrayType,pt as inferFunctionType,n as inferNarrowType,Ut as inferNarrowTypeInUnion,dt as inferObjectType,We as isGenericType,Q as parseArrayElements,Yn as parseImportStatement,me as processClassDeclaration,l as processDeclarations,ge as processEnumDeclaration,qn as processExportDeclaration,fe as processFunctionDeclaration,Kn as processImportDeclaration,de as processInterfaceDeclaration,he as processModuleDeclaration,pe as processTypeDeclaration,x as processVariableDeclaration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Oi}from"../chunk-
|
|
2
|
+
import{Oi}from"../chunk-qx0pxmvs.js";import"../chunk-9xep96k0.js";import"../chunk-4p9dw996.js";import"../chunk-nh71w1ta.js";import"../chunk-r4dq05mh.js";import"../chunk-h3r142dy.js";import"../chunk-013mp499.js";import"../chunk-zrfwvjq8.js";import"../chunk-txf9rw55.js";import"../chunk-587w6ktw.js";import"../chunk-31rb15pe.js";import"../chunk-0rk4cvt6.js";import"../chunk-vk5r6pgx.js";import"../chunk-1mg4cxd3.js";import"../chunk-w9jg9761.js";import"../chunk-vrvzmysf.js";import"../chunk-6exq13f9.js";import"../chunk-gyfbehkf.js";export{Oi as createReturnTypeScope};
|
package/dist/src/source-cache.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_t,ue,_n,jn,Gn,Vn,
|
|
2
|
+
import{_t,ue,_n,jn,Gn,Vn,zn}from"../chunk-937czex4.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";export{_n as batchParseSourceFiles,jn as clearSourceFileCache,Vn as getPendingParseCount,_t as getSourceFile,ue as getSourceFileAsync,Gn as getSourceFileCacheSize,zn as shouldUseAsyncParsing};
|
package/dist/src/sourcemap.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{dn,Ct,
|
|
2
|
+
import{dn,Ct,Us,Hs,Ks,qs,qr,Js,Ys}from"../chunk-w60gzzxc.js";export{Ct as SourceMapConsumer,dn as SourceMapGenerator,Ks as appendInlineSourceMap,Hs as appendSourceMapComment,Ys as buildDeclarationMappings,Us as createSourceMap,Js as extractSourceMap,qr as readSourceMap,qs as writeSourceMap};
|
package/dist/src/transformers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Si,$i,Ln,Fo,Ei,Bo,Te,Wo,it,_o,ki,jo,Ti,Go,Vo,Uo,
|
|
2
|
+
import{Si,$i,Ln,Fo,Ei,Bo,Te,Wo,it,_o,ki,jo,Ti,Go,Vo,zo,Uo,Ai,Di,Ho,Ko,qo,Jo,Yo,Xo,Zo,Qo}from"../chunk-0v6vmemf.js";import"../chunk-290jpwny.js";export{$i as cloneDeclaration,Bo as composeTransformers,Si as createDeclaration,Go as createJSDocTransformer,Ai as createModifierTransformer,Qo as createNamespacePrefixPlugin,Uo as createParameterTransformer,ki as createPrefixTransformer,Ti as createRemoveTransformer,_o as createRenameTransformer,zo as createReturnTypeTransformer,qo as createStripTagsTransformer,jo as createSuffixTransformer,it as createTransformerPlugin,Vo as createTypeTransformer,Jo as createWrapTypeTransformer,Zo as declarePlugin,Te as filterByKind,Wo as filterByPredicate,Fo as findDeclarations,Ei as mapDeclarations,Ko as optionalTransformer,Yo as readonlyPlugin,Di as readonlyTransformer,Ho as requiredTransformer,Xo as stripPrivatePlugin,Ln as walkDeclarations};
|
package/dist/src/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tt,Mo,Y,yi,re,Tt,At,Pt
|
|
2
|
+
import{tt,Mo,Y,yi,re,Tt,At,Dt,Pt}from"../chunk-b6xcyrnx.js";import"../chunk-hgg4aqvf.js";import"../chunk-rwdcmcx3.js";import"../chunk-dhzr60ge.js";import"../chunk-m7jndt3v.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-02yqpwv0.js";import"../chunk-3mp0jaa7.js";export{Pt as addSourceMapComment,Mo as assertNever,re as checkIsolatedDeclarationsConfig,At as createDiff,Dt as generateDeclarationMap,yi as getAllTypeScriptFiles,tt as sourceMapCommentPrefix,Tt as validateDtsContent,Y as writeToFile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jn}from"../chunk-
|
|
2
|
+
import{Jn}from"../chunk-r4dq05mh.js";import"../chunk-h3r142dy.js";import"../chunk-013mp499.js";import"../chunk-zrfwvjq8.js";import"../chunk-txf9rw55.js";import"../chunk-587w6ktw.js";import"../chunk-31rb15pe.js";import"../chunk-0rk4cvt6.js";import"../chunk-vk5r6pgx.js";import"../chunk-1mg4cxd3.js";import"../chunk-w9jg9761.js";import"../chunk-6exq13f9.js";import"../chunk-gyfbehkf.js";export{Jn as inferDeclarationValueAliases};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-srfpcjtn.js";import"../chunk-8gksa73c.js";import"../chunk-kcfc6zg6.js";import"../chunk-
|
|
2
|
+
import"../chunk-srfpcjtn.js";import"../chunk-8gksa73c.js";import"../chunk-kcfc6zg6.js";import"../chunk-gyfbehkf.js";import"../chunk-6exq13f9.js";import"../chunk-v6fwy63g.js";import"../chunk-w9jg9761.js";import"../chunk-vrvzmysf.js";import"../chunk-31rb15pe.js";import"../chunk-zrfwvjq8.js";import"../chunk-4p9dw996.js";import"../chunk-vk5r6pgx.js";import"../chunk-0rk4cvt6.js";import"../chunk-1mg4cxd3.js";import"../chunk-587w6ktw.js";import"../chunk-txf9rw55.js";import"../chunk-9xep96k0.js";import"../chunk-nh71w1ta.js";import"../chunk-qx0pxmvs.js";import"../chunk-013mp499.js";import"../chunk-h3r142dy.js";import"../chunk-r4dq05mh.js";import"../chunk-gcgtyjyj.js";import"../chunk-937czex4.js";import{r}from"../chunk-c6bfdmfy.js";import"../chunk-xm63aee8.js";import"../chunk-beg5vxdm.js";import{l}from"../chunk-h12vphnz.js";import"../chunk-a0900w7b.js";import{Ze}from"../chunk-fp40v5jx.js";import*as R from"fs";import{parentPort as M}from"worker_threads";var P=typeof Bun<"u"?Bun:null,S=P?null:R,T=Promise.resolve({extractDeclarations:r,processDeclarations:l});async function N(e){let u=Date.now();try{let{extractDeclarations:m,processDeclarations:A}=await T,f=e.config?.keepComments,C=e.config?.isolatedDeclarations,v=e.config?.importOrder,B=e.config?.engine;if(e.type==="process-batch"){let{filePaths:o,outPaths:D}=e,p=o?null:e.files||[],d=o?o.length:p.length,w=e.writeOutput===!0,g=w?null:Array(d),c=null,b=e.sources;if(!b&&d>0){let t=Array(d);for(let s=0;s<d;s++){let n=p?p[s]:null,h=n?n.sourceCode:void 0,i=o?o[s]:n.filePath;if(h!=null)t[s]=Promise.resolve(h);else if(P)t[s]=P.file(i).text();else t[s]=Promise.resolve(S.readFileSync(i,"utf-8"))}b=await Promise.all(t)}let x={filePath:"",sourceCode:"",declarations:[]},O=w&&P?Array(d):null,F=!0;for(let t=0;t<d;t++){let s=p?p[t]:null,n=o?o[t]:s.filePath,h=D?D[t]:s?s.outPath:void 0;try{let i=b?b[t]:s?.sourceCode||"",a=null,y=Ze(i,n,f??!0,v??["bun"],C??!1,B);if(y===null)a=m(i,n,f,C),x.filePath=n,x.sourceCode=i,x.declarations=a,y=A(a,x,f??!0,v);if(w){if(!h)throw Error(`Missing outPath for ${n}`);if(P)O[t]=P.write(h,y);else S.writeFileSync(h,y)}else if(g)g[t]={filePath:n,success:!0,content:y,declarations:a}}catch(i){let a=i&&i.message?i.message:String(i);if(w){if(!c)c=[];c.push({filePath:n,success:!1,error:a})}else if(g)g[t]={filePath:n,success:!1,error:a};F=!1}}if(O)await Promise.all(O);let E=c?.length?`${c[0].filePath}: ${c[0].error||"Worker batch failed"}`:void 0;return{id:e.id,success:F,filePath:e.filePath,batchResults:w?c||void 0:g,error:E,duration:Date.now()-u}}if(e.type==="extract"){let o=m(e.sourceCode,e.filePath,f,C);return{id:e.id,success:!0,filePath:e.filePath,declarations:o,duration:Date.now()-u}}if(e.type==="process"){let o=m(e.sourceCode,e.filePath,f,C),D=A(o,{filePath:e.filePath,sourceCode:e.sourceCode,declarations:o},f??!0,v);return{id:e.id,success:!0,filePath:e.filePath,content:D,declarations:o,duration:Date.now()-u}}throw Error(`Unknown task type: ${e.type}`)}catch(m){return{id:e.id,success:!1,filePath:e.filePath,error:m.message,duration:Date.now()-u}}}M?.on("message",async(e)=>{let u=await N(e);M.postMessage(u)});
|
package/dist/src/worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Jt,pr,Wi,_i,ji}from"../chunk-
|
|
2
|
+
import{Jt,pr,Wi,_i,ji}from"../chunk-taa77k3y.js";import"../chunk-3mp0jaa7.js";export{Jt as WorkerPool,_i as batchFiles,ji as calculateOptimalBatchSize,pr as createWorkerPool,Wi as parallelProcess};
|
package/dist/src/workspace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ei,ti,yn,lo,ni,ri,uo}from"../chunk-
|
|
2
|
+
import{ei,ti,yn,lo,ni,ri,uo}from"../chunk-n833rcmj.js";import"../chunk-zrmg0q1q.js";import"../chunk-s9e2a0t7.js";import"../chunk-9kfzjkd1.js";import"../chunk-fp40v5jx.js";import"../chunk-h12vphnz.js";import"../chunk-xm63aee8.js";import"../chunk-bsj770f8.js";import"../chunk-j4t8d6p0.js";import"../chunk-xcfbw2r7.js";import"../chunk-a0900w7b.js";import"../chunk-b6xcyrnx.js";import"../chunk-hgg4aqvf.js";import"../chunk-p4dpq81g.js";import"../chunk-j0y149qx.js";import"../chunk-rwdcmcx3.js";import"../chunk-dhzr60ge.js";import"../chunk-aj2n4x1b.js";import"../chunk-290jpwny.js";import"../chunk-ka9qyjzn.js";import"../chunk-yapz0de1.js";import"../chunk-beg5vxdm.js";import"../chunk-m7jndt3v.js";import"../chunk-vvy85nm6.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-02yqpwv0.js";import"../chunk-3mp0jaa7.js";import"../chunk-c6bfdmfy.js";import"../chunk-gcgtyjyj.js";import"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";import"../chunk-937czex4.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-qx0pxmvs.js";import"../chunk-9xep96k0.js";import"../chunk-4p9dw996.js";import"../chunk-nh71w1ta.js";import"../chunk-r4dq05mh.js";import"../chunk-h3r142dy.js";import"../chunk-013mp499.js";import"../chunk-zrfwvjq8.js";import"../chunk-txf9rw55.js";import"../chunk-587w6ktw.js";import"../chunk-31rb15pe.js";import"../chunk-0rk4cvt6.js";import"../chunk-vk5r6pgx.js";import"../chunk-1mg4cxd3.js";import"../chunk-w9jg9761.js";import"../chunk-vrvzmysf.js";import"../chunk-6exq13f9.js";import"../chunk-gyfbehkf.js";export{ni as discoverWorkspaceFromPackageJson,ei as discoverWorkspaceProjects,uo as generateFromPackageWorkspaces,lo as generateMonorepo,yn as generateWorkspace,ri as resolveWorkspacePatterns,ti as sortProjectsByDependencies};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/dist/chunk-hnw7mwcw.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{t,m}from"./chunk-d0dbet9n.js";import{Ge}from"./chunk-h2007n8k.js";function ft(o){let f=t(o);if(f.length!==1||f[0].kind!=="word")return;let l=o.slice(f[0].start,f[0].end);return["true","false","null","undefined","this","super"].includes(l)?void 0:l}function Gt(o){let f=t(o);if(f.length===0)return!0;let l=f[f.length-1],s=o.slice(l.start,l.end);if(l.kind==="word"&&(s==="is"||s==="extends"))return!0;if(s==="|"||s==="&")return!0;let n=f[f.length-2];return s===">"&&n!==void 0&&o.slice(n.start,n.end)==="="}function V(o){return v(o,m(o))}function er(o){for(let f=1024;f<o.length;f*=8){let l=o.slice(0,f),s=S(l,t(l),f);if(s!==void 0)return s}return v(o,t(o))}function v(o,f){return S(o,f,1/0)??!1}function S(o,f,l){let s=0;for(let n=0;n<f.length;n++){let a=f[n];if(a.end>=l)return;if(a.kind==="punctuation"){let d=o.charCodeAt(a.start);if(d===123||d===40||d===91)s++;else if(d===125||d===41||d===93)s--;continue}if(s!==0||a.kind!=="word"||a.end-a.start!==6)continue;let c=o.slice(a.start,a.end);if(c==="export")return!0;if(c==="import"){let d=f[n+1];if(d===void 0?l!==1/0:d.end>=l)return;let y=d?o.slice(d.start,d.end):"";if(y!=="("&&y!==".")return!0}}return l===1/0?!1:void 0}function tr(o){if(o.isExported)return!1;if(["function","variable","interface","type","class","enum","namespace"].includes(o.kind))return!0;return o.kind==="module"&&(o.moduleForm==="namespace"||o.moduleForm==="identifier")}function nr(o,f){let l=o.text,s=t(l),n=(i)=>s[i]?l.slice(s[i].start,s[i].end):"",a=(i)=>s[i]?.kind==="word",c=new Map,d=[];for(let i=0;i<s.length;i++){let e=n(i);if(e==="("||e==="["||e==="{"||e==="<")d.push(i);else if(e===")"||e==="]"||e==="}"||e===">"&&n(i-1)!=="="){let r=d.at(-1);if(r!==void 0&&(n(r)==="("&&e===")"||n(r)==="["&&e==="]"||n(r)==="{"&&e==="}"||n(r)==="<"&&e===">"))d.pop(),c.set(r,i)}}let y=[];for(let i=0;i<s.length;i++){if(n(i)!=="(")continue;let e=c.get(i);if(e===void 0||!(n(e+1)===":"||n(e+1)==="="&&n(e+2)===">"))continue;let r=new Set,u=i+1;while(u<e){let p=u;while(p<e&&n(p)!==","){let x=c.get(p);if(x!==void 0)p=x+1;else p++}let h=u;while(h<p&&n(h)!==":"&&n(h)!=="="){let x=c.get(h);if(x!==void 0)h=x+1;else h++}let b=u;while([".","public","private","protected","readonly","override"].includes(n(b)))b++;if(n(b)==="{"||n(b)==="[")for(let x of Ge(l.slice(s[b].start,s[h-1].end)))r.add(x);else if(a(b))r.add(n(b));u=p+1}let g=e+(n(e+1)===":"?2:3);while(g<s.length){if([";",",",")","]","}"].includes(n(g))||n(g)===">"&&n(g-1)!=="=")break;let p=c.get(g);if(p!==void 0)g=p+1;else g++}y.push({start:i,end:g,names:r})}let k=(i)=>{if(!a(i))return;let e=n(i);if(!y.some((r)=>i>=r.start&&i<r.end&&r.names.has(e)))f.add(e)},w=(i,e)=>{for(let r=i;r<e;r++){if(n(r)==="<"&&c.has(r)){r=c.get(r);continue}if(!a(r)||n(r-1)==="."||n(r+1)===":")continue;if(["true","false","null","undefined","new","this","super","as","satisfies","typeof","void","keyof"].includes(n(r)))continue;k(r)}};for(let i=0;i<s.length;i++){if(n(i)==="typeof")k(i+1);if(n(i)==="export"){let e=i+1;if(n(e)==="default"){if(!["function","class","abstract"].includes(n(e+1)))w(e+1,s.length);continue}if(n(e)==="type")e++;if(n(e)==="{"){let r=c.get(e);if(r===void 0||n(r+1)==="from")continue;for(let u=e+1;u<r;){if(n(u)==="type"&&a(u+1)&&n(u+1)!=="as")u++;k(u);while(u<r&&n(u)!==",")u++;u++}}}if(n(i)==="["){let e=c.get(i);if(e!==void 0&&[":","?","("].includes(n(e+1))&&n(i+2)!==":"&&n(i+2)!=="in")w(i+1,e)}}if(o.kind==="class"){let i=-1;for(let e=0;e<s.length&&n(e)!=="{";e++)if(n(e)==="<"&&c.has(e))e=c.get(e);else if(n(e)==="extends"){i=e;break}if(i!==-1){let e=i+1;while(e<s.length&&n(e)!=="{"&&n(e)!=="implements"){let r=c.get(e);if(r!==void 0)e=r+1;else e++}w(i+1,e)}}}
|
|
3
|
-
export{ft,Gt,V,er,tr,nr};
|
package/dist/chunk-hzjesnf1.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{a,i,h,g,xe,ze}from"./chunk-mm1cfz16.js";import{t,m,d,Ue,b}from"./chunk-d0dbet9n.js";import{cr}from"./chunk-h2007n8k.js";import{Ve}from"./chunk-znsgvx9t.js";import{ir}from"./chunk-c87yyjv7.js";import{V,nr}from"./chunk-hnw7mwcw.js";import{Hn}from"./chunk-fn2xxavw.js";import{y,K}from"./chunk-vk5r6pgx.js";import{H}from"./chunk-d27xpsa4.js";import{_e,we,je}from"./chunk-564pr6v4.js";import{n,B,W,Ht,rr,Kt,U,z}from"./chunk-nqdc6n5d.js";import{zn}from"./chunk-bxjswrak.js";import{x}from"./chunk-8dyz1cte.js";import{Jn}from"./chunk-vwn5fx4f.js";function Oi(E,ne,Q,Y,ue=""){let fe=new Map,f={start:0,end:E.length,header:0,name:"",children:[],results:new Map},J=t(E),be=[],w=[],Ke=[],tt=new Map;for(let te=0;te<J.length;te++){let e=J[te];if(e.kind!=="punctuation")continue;let pe=E.slice(e.start,e.end);if(pe==="(")Ke.push(te);else if(pe===")"){let me=Ke.pop();if(me!==void 0)tt.set(te,me)}else if(pe==="{")w.push(te);else if(pe==="}"){let me=w.pop();if(me===void 0)continue;let ae=J[me].start,ie=me-1,re=ie>=0?E.slice(J[ie].start,J[ie].end):"";if(re===")"){let Te=tt.get(ie);if(Te!==void 0&&Te>0&&["if","for","while","switch","catch","with"].includes(E.slice(J[Te-1].start,J[Te-1].end)))ae=J[Te-1].start}else if(["else","try","finally","do"].includes(re))ae=J[ie].start;be.push({open:J[me].start,close:e.start,header:ae})}}let N=0,G=(te,e=new Set)=>{let pe=new Set(e),me=t(E.slice(te.start,te.end)),ae=0;for(let he=0;he+1<me.length;he++){let He=E.slice(te.start+me[he].start,te.start+me[he].end);if(He==="{")ae++;else if(He==="}")ae--;else if(!ae&&["type","interface"].includes(He))pe.add(E.slice(te.start+me[he+1].start,te.start+me[he+1].end))}let ie="",re=te.start,Te=[...te.results].map(([he,He])=>({type:he,name:He}));for(let he of te.children.sort((He,lt)=>He.header-lt.header)){let He=G(he,pe);ie+=E.slice(re,he.header)+`
|
|
3
|
-
declare namespace ${he.name} {
|
|
4
|
-
${He.text}
|
|
5
|
-
}
|
|
6
|
-
`,re=he.end+1;for(let lt of He.exports)Te.push({type:`${he.name}.${lt.name}`,name:lt.name})}ie+=`${E.slice(re,te.end)}
|
|
7
|
-
;
|
|
8
|
-
${Te.map((he)=>`export type ${he.name} = ${he.type};`).join(`
|
|
9
|
-
`)}`;let Qe=F(ie,ne,!1);for(let he of Te)pe.add(he.name);let ge=ue?Gt(ue).map((he,He)=>[he,`${ce}_capture_${He}`]):[],st=Qe.map((he)=>ue&&["type","interface"].includes(he.kind)?Wn(he,ue,ge,pe):(he.kind==="variable"?x(he,!1):he.text).replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
|
|
10
|
-
`);return{declarations:Qe,text:st,exports:Te}},ce;return{resolve(te,e){ce??=Q();let pe=f;for(let ae of be.filter((ie)=>ie.open<e&&e<ie.close).sort((ie,re)=>ie.open-re.open)){let ie=pe.children.find((re)=>re.start===ae.open+1);if(!ie)ie={start:ae.open+1,end:ae.close,header:ae.header,name:`${ce}_scope_${N++}`,children:[],results:new Map},pe.children.push(ie);pe=ie}let me=pe.results.get(te);if(!me)me=`${ce}_result_${fe.size}`,pe.results.set(te,me),fe.set(me,te);return`${ce}.${me}`},finish(te){if(!ce)return te;let e=G(f),pe=e.declarations,me=new Set(fe.keys());if(pe.every((ie)=>me.has(ie.name))){let ie=new Map(fe),re=t(te),Te="",Qe=0;for(let ge=0;ge+2<re.length;ge++){if(te.slice(re[ge].start,re[ge].end)!==ce||te.slice(re[ge+1].start,re[ge+1].end)!==".")continue;let st=ie.get(te.slice(re[ge+2].start,re[ge+2].end));if(!st)continue;Te+=te.slice(Qe,re[ge].start)+`(${st})`,Qe=re[ge+2].end,ge+=2}return Te+te.slice(Qe)}if(ue){let ie=Gt(ue).join(", "),re=t(te),Te="",Qe=0;for(let ge=0;ge+2<re.length;ge++){if(te.slice(re[ge].start,re[ge].end)!==ce||te.slice(re[ge+1].start,re[ge+1].end)!=="."||!me.has(te.slice(re[ge+2].start,re[ge+2].end)))continue;Te+=`${te.slice(Qe,re[ge+2].end)}<${ie}>`,Qe=re[ge+2].end,ge+=2}te=Te+te.slice(Qe)}let ae=e.text;return Y({kind:"module",name:ce,text:`declare namespace ${ce} {
|
|
11
|
-
${ae}
|
|
12
|
-
}`,moduleForm:"namespace",isExported:!1}),te}}}function Gt(E){let ne=t(E),Q=[],Y=0,ue=0,fe=!1;for(let f of ne){let J=E.slice(f.start,f.end);if(J==="<"){if(Y++,Y===1)fe=!0}else if(J===">"&&E[f.start-1]!=="=")Y--;else if(["(","[","{"].includes(J))ue++;else if([")","]","}"].includes(J))ue--;else if(J===","&&Y===1&&!ue)fe=!0;else if(fe&&f.kind==="word"&&!["const","in","out"].includes(J))Q.push(J),fe=!1}return Q}function Wn(E,ne,Q,Y){let ue=new Set(Gt(E.generics||"")),fe=(G,ce,te)=>{let e=t(G),pe="",me=0;for(let ae=0;ae<e.length;ae++){let ie=e[ae],re=G.slice(ie.start,ie.end),Te=e[ae+1]&&G.slice(e[ae+1].start,e[ae+1].end),Qe=e[ae+2]&&G.slice(e[ae+2].start,e[ae+2].end),ge=e[ae-1]&&G.slice(e[ae-1].start,e[ae-1].end);if(ie.kind!=="word"||Te===":"||Te==="?"&&Qe===":")continue;let st=!te.has(re)&&ge!=="."&&Q.find(([he])=>he===re)?.[1];if(st)pe+=G.slice(me,ie.start)+st,me=ie.end;else if(ce&&Y.has(re)&&!te.has(re)){let he=Q.map(([,He])=>He).join(", ");pe+=`${G.slice(me,ie.end)}<${he}${Te==="<"?", ":">"}`,me=Te==="<"?e[++ae].end:ie.end}}return pe+G.slice(me)},f=t(E.text),J=f.findIndex((G)=>["type","interface"].includes(E.text.slice(G.start,G.end))),be=f[J+1],w=E.generics||"",Ke=w?E.text.indexOf(w,be.end)+w.length:be.end,tt=fe(Bn(ne),!1,new Set),N=w?`, ${fe(w.slice(1,-1),!0,ue)}`:"";return`${E.text.slice(0,be.end)}<${tt}${N}>${fe(E.text.slice(Ke),!0,ue)}`.replace(/^export\s+/,"").replace(/^declare\s+/,"")}function Bn(E){let ne=E.slice(1,-1),Q=t(ne),Y=0,ue=0,fe=!1,f="";for(let J=0;J<Q.length;J++){let be=Q[J],w=ne.slice(be.start,be.end);if(["(","[","{","<"].includes(w))Y++;else if([")","]","}"].includes(w)||w===">"&&ne[be.start-1]!=="=")Y--;else if(!Y&&w==="const")f+=ne.slice(ue,be.start),ue=be.end;else if(!Y&&w==="="&&ne.slice(Q[J+1]?.start,Q[J+1]?.end)!==">")f+=ne.slice(ue,be.start),fe=!0;else if(!Y&&w===","&&fe)ue=be.start,fe=!1}return f+(fe?"":ne.slice(ue))}var Fe=32,Ge=9,ye=10,Ee=13,X=47,ke=42,Ae=39,$e=34,We=96,Ye=92,L=123,ee=125,le=40,Ce=41,De=91,Me=93,Se=60,Ie=62,oe=59,et=58,Oe=61,nt=44,Ct=46,It=63,pn=35,Ln=64,Nn=36;function Ne(E){return E===Fe||E===Ge||E===ye||E===Ee}function qn(E){let ne=!0;for(let Q=0;Q<E.length;Q++){let Y=E.charCodeAt(Q);if(Y===Ct){if(ne)return!1;ne=!0}else if(ne){if(!a(Y))return!1;ne=!1}else if(!i(Y))return!1}return E.length>0&&!ne}function $t(E,ne,Q){let Y=ne+1;while(Y<E.length){let ue=E.charCodeAt(Y);if(ue===Ye){Y+=2;continue}if(Y++,ue===Q)break}return Y}function jn(E){if(E==="any"||E==="object"||E==="unknown")return!0;if(E.startsWith("Record<")||E.startsWith("Array<"))return!0;return E.charCodeAt(0)===L&&E.includes("[")&&E.includes("]:")}var Ut=["public","protected","private","readonly","override"];function Ba(E,ne,Q=!0,Y=!1){return Y?R(E,ne,Q):F(E,ne,Q)}function R(E,ne,Q=!0){return Vt(E,ne,Q,!0)}function F(E,ne,Q=!0,Y){return Vt(E,ne,Q,!1,!1,Y)}function jt(E,ne,Q=!0){return Vt(E,ne,Q,!0,!0)}function Vt(E,ne,Q,Y,ue=!1,fe){let f=E,J=Q,be=Y,w=f.length,Ke=ze(f),tt=V(f),N=[],G=new Map,ce=new Map,te=new Set,e=0,pe,me=0,ae=[],ie=[],re=[],Te=[],Qe;function ge(s){let o=`__dtsx_constructor_field_${Te.length}__`;Qe??=new Set(m(f).filter((r)=>r.kind==="word").map((r)=>f.slice(r.start,r.end)).filter((r)=>r.startsWith("__dtsx_constructor_field_")));while(Qe.has(o))o+="_";return Te.push({marker:o,initializer:s,classes:ae.map((r)=>r.name),namespaces:[...re]}),o}function st(s){let o=/^this\.([\w$]+)$/.exec(s);if(o){let p=ae.at(-1);return p?.fields.get(`${p.isStatic?"static:":""}${o[1]}`)}let r=/^([\w$]+)\s*\(/.exec(s);if(!r||!s.endsWith(")"))return;let c=t(s),l=0;for(let p=1;p<c.length;p++){let S=s.slice(c[p].start,c[p].end);if(S==="(")l++;else if(S===")"&&--l===0&&p!==c.length-1)return}let u=[...N,...G.values()].filter((p)=>p.kind==="function"&&p.name===r[1]);if(u.length!==1||u[0].generics||Ve(f,r[1])!==1)return;return u[0].returnType}function he(s){let o=s.trim(),r=st(o);if(r)return r;if(!o.startsWith("class"))return;let c=t(o);if(c[0]?.kind!=="word"||o.slice(c[0].start,c[0].end)!=="class")return;let l;do l=`__dtsx_class_${me++}`;while(f.includes(l));let u=c[1],p=u?o.slice(u.start,u.end):"",S=u?.kind==="word"&&!["extends","implements"].includes(p),A=S?p:`${l}_value`,C=S?`export ${o}`:`export class ${A} ${o.slice(5)}`,v=F(C,ne,J),O=v.find((k)=>k.kind==="class");if(!O)throw Error("Cannot extract the class expression declaration");if(t(C.slice(O.end??C.length)).some((k)=>C.slice((O.end??0)+k.start,(O.end??0)+k.end)!==";"))return;let M=v.map((k)=>k.text.replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
|
|
13
|
-
`);return G.set(l,{kind:"module",name:l,text:`declare namespace ${l} {
|
|
14
|
-
${M}
|
|
15
|
-
}`,moduleForm:"namespace",isExported:!1,start:e,end:e}),`typeof ${l}.${A}`}function He(s,o){let r=/^this\.([\w$]+)$/.exec(s);if(r)return ae.at(-1)?.fields.get(`${o?"static:":""}${r[1]}`);return he(s)}function lt(s){let o=ce.get(s.name);if(o)o.push(s);else ce.set(s.name,[s]);G.set(s.name,s)}if(e<w&&f.charCodeAt(e)===65279)e++;function ve(s,o){if(s<o){let r=f.charCodeAt(s),c=f.charCodeAt(o-1);if(r!==Fe&&r!==Ge&&r!==ye&&r!==Ee&&c!==Fe&&c!==Ge&&c!==ye&&c!==Ee)return f.slice(s,o)}while(s<o&&Ne(f.charCodeAt(s)))s++;while(o>s&&Ne(f.charCodeAt(o-1)))o--;return f.slice(s,o)}let Qt=/[\r\n]/g;function ft(s){return Qt.lastIndex=s,Qt.exec(f)?.index??w}function D(){if(e>=w)return;let s=f.charCodeAt(e);if(s!==Fe&&s!==Ge&&s!==ye&&s!==Ee&&s!==X)return;while(e<w){let o=f.charCodeAt(e);if(o===Fe||o===Ge||o===ye||o===Ee){e++;continue}if(o===X&&e+1<w){let r=f.charCodeAt(e+1);if(r===X){e=ft(e+2);continue}if(r===ke){let c=f.indexOf("*/",e+2);e=c===-1?w:c+2;continue}}break}}function Cn(s){if(s.indexOf("//")===-1&&s.indexOf("/*")===-1)return s;let o=0,r=0;while(r<s.length){let c=s.charCodeAt(r);if(c===Ae||c===$e||c===We){r=$t(s,r,c),o=r;continue}if(c===Ye){r+=2,o=Math.min(r,s.length);continue}if(c===X&&s.charCodeAt(r+1)===X){while(r<s.length&&s.charCodeAt(r)!==ye&&s.charCodeAt(r)!==Ee)r++;continue}if(c===X&&s.charCodeAt(r+1)===ke){let l=s.indexOf("*/",r+2);r=l===-1?s.length:l+2;continue}if(r++,c>32)o=r}return o<s.length?s.slice(0,o).trimEnd():s}function An(s){let o=s.length,r=0,c=o;for(let l=0;l<o;l++){let u=s.charCodeAt(l);if(r){if(u===Ye){l++;continue}if(u===r)r=0;continue}if(u===Ae||u===$e||u===We){r=u;continue}if(u===X&&l+1<o){let p=s.charCodeAt(l+1);if(p===X){c=l;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge))c--;return s.slice(0,c)}if(p===ke){let S=s.indexOf("*/",l+2);if(S!==-1){s=`${s.slice(0,l)} ${s.slice(S+2)}`,l--;continue}}}}c=o;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge||s.charCodeAt(c-1)===Ee))c--;return c<o?s.slice(0,c):s}function it(s){e++;let o=s===Ae?"'":'"';while(e<w){let r=f.indexOf(o,e);if(r===-1){e=w;return}let c=0,l=r-1;while(l>=0&&f.charCodeAt(l)===Ye)c++,l--;if(c%2===0){e=r+1;return}e=r+1}}function At(){e++;let s=[];while(e<w){let o=f.charCodeAt(e);if(s.length===0){if(o===Ye){e+=2;continue}if(o===We){e++;return}if(o===Nn&&e+1<w&&f.charCodeAt(e+1)===L){e+=2,s.push(0);continue}e++;continue}if(o===Ae||o===$e){it(o);continue}if(o===We){At();continue}if(o===X&&e+1<w){let r=f.charCodeAt(e+1);if(r===X){e=ft(e+2);continue}if(r===ke){let c=f.indexOf("*/",e+2);e=c===-1?w:c+2;continue}if(Jt()){Zt();continue}e++;continue}if(o===L){s[s.length-1]++,e++;continue}if(o===ee){let r=s[s.length-1];if(r===0){s.pop(),e++;continue}s[s.length-1]=r-1,e++;continue}e++}}let Ot=!1;function qe(){Ot=!1;let s=f.charCodeAt(e);if(s===Ae||s===$e)return it(s),!0;if(s===We)return At(),!0;if(s===X&&e+1<w){let o=f.charCodeAt(e+1);if(o===X)return e=ft(e+2),!0;if(o===ke){let r=f.indexOf("*/",e+2);return Ot=ft(e+2)<(r===-1?w:r),e=r===-1?w:r+2,!0}if(Jt())return Zt(),!0}return!1}function Jt(){return h(f,e)}function Zt(){e=g(f,e)}function Re(){let s=e;while(e<w&&i(f.charCodeAt(e)))e++;return f.slice(s,e)}function _(s){if(e+s.length>w)return!1;for(let o=0;o<s.length;o++)if(f.charCodeAt(e+o)!==s.charCodeAt(o))return!1;if(e+s.length<w&&i(f.charCodeAt(e+s.length)))return!1;return!0}function xt(s){let o=e+s;while(o<w){let r=f.charCodeAt(o);if(r===Fe||r===Ge||r===ye||r===Ee){o++;continue}return r!==Ct&&r!==Oe}return!1}function Xt(){if(!Ot)return!1;let s=e;D();let o=e>=w||Et()||f.charCodeAt(e)===ee;return e=s,o}function Et(){if(e>=w)return!1;switch(f.charCodeAt(e)){case 101:return _("export")||_("enum");case 105:return _("import")||_("interface");case 102:return _("function");case 99:return _("class")||_("const");case 116:return _("type");case 108:return _("let");case 118:return _("var");case 100:return _("declare")||_("default");case 109:return _("module");case 110:return _("namespace");case 97:return _("abstract")||_("async");default:return!1}}function ht(){let s=f.charCodeAt(e);if(s!==ye&&s!==Ee)return!1;let o=e;if(e++,s===Ee&&e<w&&f.charCodeAt(e)===ye)e++;while(e<w){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Ee||c===ye){e++;continue}if(c===X&&e+1<w){let l=f.charCodeAt(e+1);if(l===X){e=ft(e+2);continue}if(l===ke){let u=f.indexOf("*/",e+2);e=u===-1?w:u+2;continue}}break}let r=e>=w||Et()||f.charCodeAt(e)===ee;return e=o,r}function bn(s){let o=s-1;while(o>=0){let A=f.charCodeAt(o);if(A===Fe||A===Ge||A===Ee||A===ye){o--;continue}break}if(o<0)return!0;let r=f[o];if("+-*/%=<>&|^!~?:,.([{".includes(r))return!0;let c=o;while(c>0&&f.charCodeAt(c-1)!==ye)c--;let l=f.slice(c,o+1),u=l.lastIndexOf("<");if(u!==-1&&/^<[A-Za-z]/.test(l.slice(u))&&!l.slice(u).includes(">"))return!0;let p=o;while(p>=0&&/[a-z]/i.test(f[p]))p--;let S=f.slice(p+1,o+1);return["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(S)}function wn(s,o){let r=f.charCodeAt(e);if(r!==ye&&r!==Ee&&!(r===X&&(f[e+1]==="/"||f[e+1]==="*")))return!1;let c=m(f),l=0,u=c.length;while(l<u){let v=l+u>>>1;if(c[v].start<e)l=v+1;else u=v}let p=c[l-1],S=c[l];if(!p||p.start<s||!/[\r\n]/.test(f.slice(e,S?.start??w)))return!1;let A=f.slice(p.start,p.end);if(p.end!==o&&p.kind==="punctuation"&&"+-*/%=<>&|^!~?:,.([{".includes(A))return!1;if(p.kind==="word"&&["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(A))return!1;if(!S)return!0;let C=f.slice(S.start,S.end);return!(".?:)]},+-*/%<>=&|^`([".includes(C)||S.kind==="literal"&&f.charCodeAt(S.start)===We||["as","satisfies","instanceof","in"].includes(C))}function Yt(){let s=f.charCodeAt(e);if(s!==ye&&s!==Ee)return!1;if(bn(e))return!1;let o=e;e++;while(e<w){let l=f.charCodeAt(e);if(l===Fe||l===Ge||l===Ee||l===ye){e++;continue}if(l===X&&e+1<w){let u=f.charCodeAt(e+1);if(u===X){e=ft(e+2);continue}if(u===ke){let p=f.indexOf("*/",e+2);e=p===-1?w:p+2;continue}}break}let r=e<w?f[e]:"",c=r==="|"||r==="&"||r==="["||r==="."||r==="?"||r===":"||r===">"||r===")"||r===","||_("extends");return e=o,!c}function bt(){let s=f.charCodeAt(e);if(s!==ye&&s!==Ee)return!1;let o=e;if(e++,s===Ee&&e<w&&f.charCodeAt(e)===ye)e++;while(e<w){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Ee||c===ye){e++;continue}if(c===X&&e+1<w&&f.charCodeAt(e+1)===X){e=ft(e+2);continue}break}if(e>=w)return e=o,!0;let r=f.charCodeAt(e);if(r===124||r===38||r===Ct||r===It||r===et)return e=o,!1;if(_("extends")||_("keyof")||_("typeof")||_("infer")||_("is")||_("as")||_("in"))return e=o,!1;return e=o,!0}let kn=/[{}'"`\/]/g,$n=/[()'"`\/]/g,xn=/[[\]'"`\/]/g,yn=/[<>'"`\/]/g;function Be(s,o){let r=1;e++;let c=s===L?kn:s===le?$n:s===De?xn:yn;c.lastIndex=e;let l;while((l=c.exec(f))!==null){let u=l.index,p=f.charCodeAt(u);if(p===Ae||p===$e){e=u,it(p),c.lastIndex=e;continue}if(p===We){e=u,At(),c.lastIndex=e;continue}if(p===X){if(e=u,qe()){c.lastIndex=e;continue}c.lastIndex=u+1;continue}if(p===s)r++;else if(p===o){if(o===Ie&&u>0&&f.charCodeAt(u-1)===Oe){c.lastIndex=u+1;continue}if(r--,r===0)return e=u+1,e}c.lastIndex=u+1}return e=w,e}function Xe(){return e>0&&f.charCodeAt(e-1)===Oe}function Rt(){return e+1<w&&f.charCodeAt(e+1)===Ie}let Je=/[<{};'"`\/\n\r()[\]]/g;function Le(s=!1){let o=0,r=0,c=0,l=0,u=f.charCodeAt(e)===L;Je.lastIndex=e;let p;while((p=Je.exec(f))!==null){let S=p.index,A=f.charCodeAt(S);if(A===Ae||A===$e){e=S,it(A),Je.lastIndex=e;continue}if(A===We){e=S,At(),Je.lastIndex=e;continue}if(A===X){if(S>0&&f.charCodeAt(S-1)===Se){Je.lastIndex=S+1;continue}if(e=S,qe()){if(o===0&&r===0&&c===0&&l===0&&Xt())return;Je.lastIndex=e;continue}Je.lastIndex=S+1;continue}if(A===Se){let C=Ke(S)?.delta??null;if(C!==null)l=Math.max(0,l+C);Je.lastIndex=S+1;continue}if(A===le){r++,Je.lastIndex=S+1;continue}if(A===Ce){r--,Je.lastIndex=S+1;continue}if(A===De){c++,Je.lastIndex=S+1;continue}if(A===Me){c--,Je.lastIndex=S+1;continue}if(A===L){o++,Je.lastIndex=S+1;continue}if(A===ee){let C=o>0;if(!C&&s&&r===0&&c===0&&l===0){e=S;return}if(C)o--;if((!C||u)&&o===0&&r===0&&c===0&&l===0){e=S+1;return}if(C&&o===0&&r===0&&c===0&&l===0){e=S+1;let v=e;D();let O=Et();if(e=v,O)return}Je.lastIndex=S+1;continue}if(A===oe&&o===0&&r===0&&c===0&&l===0){e=S+1;return}if((A===ye||A===Ee)&&o===0&&r===0&&c===0&&l===0){if(e=S,ht())return}Je.lastIndex=S+1}e=w}function vn(){e++;while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;let s=f.indexOf(`
|
|
16
|
-
`,e),o=s===-1?w:s,r=f.indexOf(";",e);if(r!==-1&&r<o){let c=r-1;while(c>=e&&(f.charCodeAt(c)===Fe||f.charCodeAt(c)===Ge))c--;let l=f.charCodeAt(e),u=f.charCodeAt(c);if(l===L&&u===ee||l===De&&u===Me||l===Ae&&u===Ae||l===$e&&u===$e||l===We&&u===We){e=r+1;return}}Le()}function en(){Be(L,ee);while(e<w&&Ne(f.charCodeAt(e)))e++;if(_("from")){e+=4;while(e<w&&Ne(f.charCodeAt(e)))e++;if(e<w){let s=f.charCodeAt(e);if(s===Ae||s===$e)it(s)}}while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++}function tn(){e++;while(e<w&&Ne(f.charCodeAt(e)))e++;if(_("as")){e+=2;while(e<w&&Ne(f.charCodeAt(e)))e++;Re();while(e<w&&Ne(f.charCodeAt(e)))e++}if(_("from")){e+=4;while(e<w&&Ne(f.charCodeAt(e)))e++;if(e<w){let s=f.charCodeAt(e);if(s===Ae||s===$e)it(s)}}while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++}function yt(s){let o=s.indexOf("from ");if(o===-1)return;let r=o+5;while(r<s.length&&(s.charCodeAt(r)===32||s.charCodeAt(r)===9))r++;if(r>=s.length)return;let c=s.charCodeAt(r);if(c!==39&&c!==34)return;let l=s.indexOf(s[r],r+1);if(l===-1)return;return s.slice(r+1,l)}function Ze(s){if(!J)return;let o=s-1;while(o>=0&&Ne(f.charCodeAt(o)))o--;if(o<0)return;let r=[],c=!1;while(o>=0){if(o>=1&&f.charCodeAt(o)===X&&f.charCodeAt(o-1)===ke){let p=f.lastIndexOf("/*",o-2);if(p>=0){r.push(f.slice(p,o+1)),c=!0,o=p-1;while(o>=0&&Ne(f.charCodeAt(o)))o--;continue}break}let l=o;while(l>0&&f.charCodeAt(l-1)!==ye)l--;let u=ve(l,o+1);if(u.startsWith("//")){if(c)break;let p=[u];o=l-1;while(o>=0&&(f.charCodeAt(o)===ye||f.charCodeAt(o)===Ee))o--;while(o>=0){let S=o;while(S>0&&f.charCodeAt(S-1)!==ye)S--;let A=ve(S,o+1);if(A.startsWith("//")){p.push(A),o=S-1;while(o>=0&&(f.charCodeAt(o)===ye||f.charCodeAt(o)===Ee))o--}else if(A===""){o=S-1;while(o>=0&&(f.charCodeAt(o)===ye||f.charCodeAt(o)===Ee))o--}else break}p.reverse(),r.push(p.join(`
|
|
17
|
-
`));continue}break}if(r.length===0)return;return r.reverse(),r}function Sn(s){let o=s,r=!1,c=0,l;while(e<w){let I=f.charCodeAt(e);if(I===X&&(f.charCodeAt(e+1)===X||f.charCodeAt(e+1)===ke)){D();continue}if(I===oe){e++;break}if(I===L)c++;else if(I===ee&&c>0)c--;if(I===Ae||I===$e){if(it(I),c>0)continue;r=!0;let M=e;if(D(),f.charCodeAt(e)===Ce){let k=e+1;l=Ue(f.slice(o,k)),e=l?k:M}else e=M;while(e<w&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<w&&f.charCodeAt(e)===oe)e++;break}if(I===ye&&r)break;e++}let u=ve(o,e),p=b(u).find((I)=>I.category==="static-import"),S=t(u),A=l?.isTypeOnly??p?.isTypeOnly??!1,C=S[1]?.kind==="quoted",v=l?.source??p?.specifier??"",O=Ze(o);return{kind:"import",name:"",text:u,isExported:!1,isTypeOnly:A,isSideEffect:C,source:v,leadingComments:O,start:o,end:e}}function Mt(){let s=e;return Be(L,ee),f.slice(s,e)}function nn(s){let o=s.indexOf("(");if(o===-1)return s;let r=s.slice(o);if(r.indexOf("=")===-1)return s;let c=!1;for(let A=0;A<r.length;A++)if(r.charCodeAt(A)===61){let v=A>0?r.charCodeAt(A-1):0,O=A+1<r.length?r.charCodeAt(A+1):0;if(v!==61&&v!==33&&v!==60&&v!==62&&O!==61&&O!==62){c=!0;break}}if(!c)return s;let l=0,u=-1;for(let A=o;A<s.length;A++){let C=s.charCodeAt(A);if(C===40)l++;else if(C===41){if(l--,l===0){u=A;break}}}if(u===-1)return s;let p=s.slice(o,u+1),S=pt(p);return s.slice(0,o)+S+s.slice(u+1)}function sn(s){let o=s.indexOf("//")!==-1||s.indexOf("/*")!==-1,r=s.split(`
|
|
18
|
-
`),c=[],l=[],u=[],p=!1,S=1/0;for(let v=0;v<r.length;v++){let O=r[v];if(o){if(p){if(O.includes("*/"))p=!1;continue}let I=O.trim();if(I.length===0)continue;let M=I.charCodeAt(0);if(M===X){let Z=I.charCodeAt(1);if(Z===X)continue;if(Z===ke){if(!I.includes("*/"))p=!0;continue}}if(M===ke)continue;let k=An(O);if(k.charCodeAt(k.length-1)===oe)k=k.slice(0,-1);k=nn(k);let T=k.trim();if(!T)continue;c.push(k),l.push(T);let j=0;while(j<k.length&&Ne(k.charCodeAt(j)))j++;if(T!=="{"&&T!=="}"){if(j<S)S=j}u.push(j)}else{let I=O.length;while(I>0&&(O.charCodeAt(I-1)===Fe||O.charCodeAt(I-1)===Ge||O.charCodeAt(I-1)===Ee))I--;if(I===0)continue;let M=I<O.length?O.slice(0,I):O;if(M.charCodeAt(M.length-1)===oe)M=M.slice(0,-1);M=nn(M);let k=M.trim();if(!k)continue;c.push(M),l.push(k);let T=0;while(T<M.length&&Ne(M.charCodeAt(T)))T++;if(k!=="{"&&k!=="}"){if(T<S)S=T}u.push(T)}}if(c.length===0)return"{}";if(S===1/0||S<=2)return c.join(`
|
|
19
|
-
`);let A=S-2,C=Array(c.length);for(let v=0;v<c.length;v++){let O=l[v];if(O==="{"){C[v]=O;continue}let I=u[v];if(I>S)C[v]=c[v];else if(I===S&&(O.charCodeAt(0)===ee||O.charCodeAt(0)===Me||O.charCodeAt(0)===Ce))C[v]=c[v];else{let M=Math.max(0,I-A);C[v]=" ".repeat(M)+O}}return C.join(`
|
|
20
|
-
`)}function rt(){if(e>=w||f.charCodeAt(e)!==Se)return"";let s=e;Be(Se,Ie);let o=f.slice(s,e);if(o.includes(`
|
|
21
|
-
`)){let r="",c=!1;for(let l=0;l<o.length;l++){let u=o.charCodeAt(l);if(u===32||u===9||u===10||u===13){if(!c&&r.length>0)r+=" ",c=!0}else r+=o[l],c=!1}if(r.charCodeAt(1)===32)r=`<${r.slice(2)}`;if(r.charCodeAt(r.length-2)===32)r=`${r.slice(0,-2)}>`;return r}return o}function ot(){if(e>=w||f.charCodeAt(e)!==le)return"()";let s=e;return Be(le,Ce),f.slice(s,e)}function vt(s){if(s.indexOf("/")===-1)return s;let o="",r=!1,c=0;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(r){if(o+=s[l],u===Ye&&l+1<s.length){o+=s[++l];continue}if(u===c)r=!1;continue}if(u===Ae||u===$e||u===We){r=!0,c=u,o+=s[l];continue}if(u===X&&l+1<s.length){let p=s.charCodeAt(l+1);if(p===ke){let S=s.indexOf("*/",l+2);l=S===-1?s.length:S+1,o+=" ";continue}if(p===X){let S=s.indexOf(`
|
|
22
|
-
`,l+2);l=S===-1?s.length:S-1;continue}if(h(s,l)){let S=g(s,l);o+=s.slice(l,S),l=S-1;continue}}o+=s[l]}return o.trim()}function pt(s){let o=s.slice(1,-1).trim();if(!o)return"()";if(s.indexOf(`
|
|
23
|
-
`)===-1&&o.indexOf(":")!==-1&&o.indexOf("{")===-1&&o.indexOf("[")===-1&&o.indexOf("=")===-1&&o.indexOf("@")===-1&&o.indexOf("...")===-1){let A=0,C=0,v=0;for(let O=0;O<o.length;O++){let I=o.charCodeAt(O);if(I===le||I===Se||I===L)v++;else if(I===Ce||I===Ie||I===ee)v--;else if(v===0){if(I===et)A++;else if(I===nt)C++}}if(A>=C+1){let O=!1;for(let I=0;I<Ut.length;I++){let M=Ut[I],k=o.indexOf(M);if(k!==-1){let T=k+M.length;if((k===0||!i(o.charCodeAt(k-1)))&&(T>=o.length||!i(o.charCodeAt(T)))){O=!0;break}}}if(!O)return s}}let r=[],c=0,l=0,u=!1,p=0;for(let A=0;A<=o.length;A++){if(A===o.length){r.push(vt(o.slice(c).trim()));break}let C=o.charCodeAt(A);if(u){if(C===Ye){A++;continue}if(C===p)u=!1;continue}if(C===X&&A+1<o.length){let v=o.charCodeAt(A+1);if(v===ke){A+=2;while(A+1<o.length&&!(o.charCodeAt(A)===ke&&o.charCodeAt(A+1)===X))A++;A++;continue}if(v===X){while(A<o.length&&o.charCodeAt(A)!==10)A++;continue}if(h(o,A)){A=g(o,A)-1;continue}}if(C===Ae||C===$e||C===We){u=!0,p=C;continue}if(C===le||C===L||C===De||C===Se)l++;else if(C===Ce||C===ee||C===Me||C===Ie&&!(A>0&&o.charCodeAt(A-1)===Oe))l--;else if(C===nt&&l===0)r.push(vt(o.slice(c,A).trim())),c=A+1}let S=[];for(let A of r){if(!A)continue;let C=A.trim();if(C.startsWith("//")||C.startsWith("/*"))continue;let v=A;{let O=!1,I=0,M=0,k=0;for(let T=0;T<v.length-1;T++){let j=v.charCodeAt(T);if(j===ye){k=T+1;continue}if(O){if(j===Ye){T++;continue}if(j===I)O=!1;continue}if(j===Ae||j===$e||j===We){O=!0,I=j;continue}if(j===L||j===De||j===le||j===Se){M++;continue}if(j===ee||j===Me||j===Ce||j===Ie){if(M>0)M--;continue}if(j===X&&h(v,T)){T=g(v,T)-1;continue}if(j===X&&v.charCodeAt(T+1)===X){if(M===0){v=v.slice(0,T).trimEnd();break}let Z=v.indexOf(`
|
|
24
|
-
`,T);if(Z===-1){v=v.slice(0,k).trimEnd();break}let q=v.slice(0,k),P=v.slice(Z+1);v=`${q}${P}`,T=k-1}}}if(!v.trim())continue;S.push(rn(v))}return _e(`(${S.join(", ")})`)}function _n(s){if(!s.startsWith("{")&&!s.startsWith("["))return s;let o="",r=0,c=0,l=!1,u=0;while(r<s.length){let p=s.charCodeAt(r);if(l){if(p===Ye&&r+1<s.length){o+=s[r]+s[r+1],r+=2;continue}if(p===u)l=!1;o+=s[r],r++;continue}if(p===X&&r+1<s.length){let S=s.charCodeAt(r+1);if(S===ke){let A=r;r+=2;while(r+1<s.length&&!(s.charCodeAt(r)===ke&&s.charCodeAt(r+1)===X))r++;r=Math.min(r+2,s.length),o+=s.slice(A,r);continue}if(S===X){let A=r;while(r<s.length&&s.charCodeAt(r)!==10)r++;o+=s.slice(A,r);continue}}if(p===Ae||p===$e||p===We){l=!0,u=p,o+=s[r],r++;continue}if(p===L||p===De||p===le)c++;else if(p===ee||p===Me||p===Ce)c--;if(c>=1&&p===Oe&&(r+1>=s.length||s.charCodeAt(r+1)!==Oe&&s.charCodeAt(r+1)!==Ie)){while(o.length>0&&(o[o.length-1]===" "||o[o.length-1]==="\t"||o[o.length-1]===`
|
|
25
|
-
`))o=o.slice(0,-1);r++;let S=0;while(r<s.length){let A=s.charCodeAt(r);if(A===X){if(s.charCodeAt(r+1)===X){let C=s.indexOf(`
|
|
26
|
-
`,r+2);r=C===-1?s.length:C+1;continue}if(s.charCodeAt(r+1)===ke){let C=s.indexOf("*/",r+2);r=C===-1?s.length:C+2;continue}if(h(s,r)){r=g(s,r);continue}}if(A===Ae||A===$e||A===We){let C=A;r++;while(r<s.length){if(s.charCodeAt(r)===Ye){r+=2;continue}if(s.charCodeAt(r)===C){r++;break}r++}continue}if(A===L||A===De||A===le)S++;else if(A===ee||A===Me||A===Ce){if(S===0)break;S--}else if(A===nt&&S===0)break;r++}continue}o+=s[r],r++}return o}function rn(s){let o=s.trim(),r=o.startsWith("...");if(r)o=o.slice(3).trim();while(o.startsWith("@")){let k=1;while(k<o.length&&i(o.charCodeAt(k)))k++;if(k<o.length&&o.charCodeAt(k)===le){let T=1;k++;while(k<o.length&&T>0){if(o.charCodeAt(k)===le)T++;else if(o.charCodeAt(k)===Ce)T--;k++}}o=o.slice(k).trim()}let c=!0;while(c){c=!1;for(let k of Ut)if(o.startsWith(k)&&o.length>k.length&&!i(o.charCodeAt(k.length))){let T=o.slice(k.length).trim();if(T.charCodeAt(0)===et||T.charCodeAt(0)===It&&T.length>1&&T.charCodeAt(1)===et)break;o=T,c=!0;break}}let l=-1,u=-1,p=0,S=!1,A=0;for(let k=0;k<o.length;k++){let T=o.charCodeAt(k);if(S){if(T===Ye){k++;continue}if(T===A)S=!1;continue}if(T===X&&k+1<o.length){let j=o.charCodeAt(k+1);if(j===ke){k+=2;while(k+1<o.length&&!(o.charCodeAt(k)===ke&&o.charCodeAt(k+1)===X))k++;k++;continue}if(j===X){while(k<o.length&&o.charCodeAt(k)!==10)k++;continue}if(h(o,k)){k=g(o,k)-1;continue}}if(T===Ae||T===$e||T===We){S=!0,A=T;continue}if(T===le||T===L||T===De||T===Se)p++;else if(T===Ce||T===ee||T===Me||T===Ie&&!(k>0&&o.charCodeAt(k-1)===Oe))p--;else if(p===0){if(T===et&&l===-1)l=k;else if(T===Oe&&u===-1&&(k===0||o.charCodeAt(k-1)!==Oe)&&(k+1>=o.length||o.charCodeAt(k+1)!==Oe&&o.charCodeAt(k+1)!==Ie))u=k}}let C,v,O=u!==-1;if(l!==-1&&(u===-1||l<u))if(C=o.slice(0,l).trim(),u!==-1)v=o.slice(l+1,u).trim();else v=o.slice(l+1).trim();else if(u!==-1){C=o.slice(0,u).trim();let k=r?null:we(C,o.slice(u+1));if(k)return je(k,wt);v=wt(o.slice(u+1).trim())}else C=o,v="unknown";if(C=_n(C),(C.startsWith("{")||C.startsWith("["))&&C.includes(`
|
|
27
|
-
`)){let k=C.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(k.length<=40)C=k;else C=C.split(`
|
|
28
|
-
`).map((j)=>{let Z=j.trim();if(!Z)return"";if(Z==="{"||Z==="}"||Z==="["||Z==="]"||Z.startsWith("}")||Z.startsWith("]"))return Z;return` ${Z}`}).join(`
|
|
29
|
-
`)}let I=C.endsWith("?")||O;if(C.endsWith("?"))C=C.slice(0,-1).trim();let M=I&&!r?"?":"";if(r)return`...${C}: ${v}`;return`${C}${M}: ${v}`}function wt(s){let o=s.trim(),r=st(o);if(r)return r;if(o==="true"||o==="false")return"boolean";if(y(o))return"number";if(o.startsWith("'")&&o.endsWith("'")||o.startsWith('"')&&o.endsWith('"'))return"string";if(o.startsWith("["))return"unknown[]";if(o.startsWith("{"))return"Record<string, unknown>";return U(o)??"unknown"}function Pt(s){let o=s.trim();if(o.endsWith("as const"))o=o.slice(0,-8).trim();if(o==="true"||o==="false")return o;if(y(o))return K(o);let r=Tn(o);if(r!==null)return r;return U(o)??"unknown"}function Tn(s){if(s==="")return null;if(s.charCodeAt(0)===Ae||s.charCodeAt(0)===$e){if($t(s,0,s.charCodeAt(0))===s.length)return s}let o=Dn(s,"+");if(o.length>1){let r=!1,c=!0,l=[];for(let u of o){let p=u.trim(),S=p.charCodeAt(0);if((S===Ae||S===$e)&&$t(p,0,S)===p.length)r=!0,l.push(In(p));else c=!1}if(c)return On(l.join(""));if(r)return"string";return null}if(/^[\d\s()+*/%.\-]+$/.test(s)&&/\d/.test(s)&&/[+*/%\-\s]/.test(s))return"number";return null}function Dn(s,o){let r=[],c=0,l="",u=0;while(u<s.length){let p=s.charCodeAt(u);if(p===Ae||p===$e||p===We){let S=$t(s,u,p);l+=s.slice(u,S),u=S;continue}if(p===X&&(s.charCodeAt(u+1)===X||s.charCodeAt(u+1)===42)){if(s.charCodeAt(u+1)===X){let C=s.indexOf(`
|
|
30
|
-
`,u+2),v=C===-1?s.length:C;l+=s.slice(u,v),u=v;continue}let S=s.indexOf("*/",u+2),A=S===-1?s.length:S+2;l+=s.slice(u,A),u=A;continue}if(p===le||p===De||p===L)c++;else if(p===Ce||p===Me||p===ee)c--;if(s[u]===o&&c===0){r.push(l),l="",u++;continue}l+=s[u],u++}return r.push(l),r}function In(s){return s.slice(1,-1).replace(/\\(.)/g,(r,c)=>{if(c==="n")return`
|
|
31
|
-
`;if(c==="t")return"\t";if(c==="r")return"\r";if(c==="0")return"\x00";return c})}function On(s){return`'${s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function St(s){if(s.endsWith("as const"))return null;let o=0,r=-1;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(u===Ae||u===$e||u===We)l=$t(s,l,u)-1;else if(u===123||u===91||u===40)o++;else if(u===125||u===93||u===41)o--;else if(o===0&&u===32&&l+4<=s.length&&s.substring(l,l+4)===" as ")r=l}if(r===-1)return null;return s.slice(r+4).trim()||null}function kt(){if(D(),e<w&&f.charCodeAt(e)===et){let c=function(){let l=ve(s,r),u=(p)=>{let S=l.length-p.length;return S>=0&&l.endsWith(p)&&(S===0||!i(l.charCodeAt(S-1)))};return l.length===0||l.endsWith("=>")||l.endsWith("|")||l.endsWith("&")||u("is")||u("extends")};e++,D();let s=e,o=0,r=s;while(e<w){let l=e;if(qe()){if(f.charCodeAt(l)!==X)r=e;continue}let u=f.charCodeAt(e);if(u===le||u===De||u===Se)o++;else if(u===Ce||u===Me||u===Ie&&!Xe())o--;else if(u===L)if(o>0)o++;else if(c())o++;else break;else if(u===ee){if(o===0)break;o--}else if(o===0&&u===oe)break;if(o===0&&bt()&&!c())break;if(!Ne(u))r=e+1;e++}return ve(s,e)}return""}function ct(s,o,r,c){e+=8,D();let l=e<w&&f.charCodeAt(e)===ke;if(l)e++,D();let u=Re();if(!u&&!c)return null;D();let p=rt();D();let S=ot();D();let A=kt(),C=A.length>0;if(!A)if(r&&l)A="AsyncGenerator<unknown, void, unknown>";else if(l)A="Generator<unknown, void, unknown>";else if(r)A="Promise<void>";else A="void";D();let v=!1;if(e<w&&f.charCodeAt(e)===L){v=!0;let Z=e+1;if(Be(L,ee),!C&&!l){let q=f.slice(Z,e-1),P=Oi(q,ne??"stdin.ts",()=>{let de;do de=`__dtsx_return_${me++}`;while(f.includes(de));return de},(de)=>G.set(de.name,{...de,start:e,end:e}),p);A=P.finish(B(q,r,S,he,P.resolve))}}else if(e<w&&f.charCodeAt(e)===oe)e++;let O=pt(S),k=`${o?c?"export default function ":"export declare function ":"declare function "}${u||(c?"":"default")}${p}${O}: ${A};`,T=Ze(s),j={kind:"function",name:u||"default",text:k,isExported:o,isDefault:c,isAsync:r,isGenerator:l,returnType:A,generics:p||void 0,leadingComments:T,start:s,end:e};if(v)te.add(j);return j}let Wt,En=0;function on(){Wt??=new Set(t(f).filter((s)=>s.kind==="word").map((s)=>f.slice(s.start,s.end)));for(;;){let s=`__dtsx_binding_${En++}`;if(Wt.has(s))continue;return Wt.add(s),s}}function dt(s,o,r){e+=o.length,D();let c=[];do{if(D(),e>=w)break;let l=f.charCodeAt(e),u,p=e;if(l===L||l===De)Be(l,l===L?ee:Me),u=f.slice(p,e);let S=u?on():Re();if(!S)return Le(),c;D();let A,C,v,O=!1;if(e<w&&f.charCodeAt(e)===et){e++,D();let Z=e,q=0;while(e<w){if(qe()){if(q===0&&Xt())break;continue}let P=f.charCodeAt(e);if(P===le||P===L||P===De||P===Se)q++;else if(P===Ce||P===ee||P===Me||P===Ie&&!Xe())q--;else if(q===0&&(P===oe||P===nt))break;else if(q===0&&P===Oe&&!Rt())break;if(q===0&&(ht()||Yt()))break;e++}A=ve(Z,e)}if(e<w&&f.charCodeAt(e)===Oe)if(be&&A&&(!J||!jn(A)))vn();else{e++,D();let Z=e;v=Z;let q=0,P=0,de;while(e<w){if(q===0&&P===0&&wn(Z,de))break;if(qe())continue;let se=f.charCodeAt(e);if(se===le||se===L||se===De)q++;else if(se===Ce||se===ee||se===Me)q--;else if(se===Se){pe??=H(f);let Pe=q===0&&P===0?pe(e,Z,de):void 0;if(Pe?.parameters||Pe?.completeOperand||Pe&&ne!==void 0&&!/\.[jt]sx$/.test(ne)){e=Pe.end,de=Pe.completeOperand?Pe.end:void 0;continue}let ut=P>0||f[e+1]!=="/"&&xe(f,e)?Ke(e):null;if(ut){if(P=Math.max(0,P+ut.delta),e=ut.end+1,P===0)de=e;continue}else if(P===0){if(Pe){e=Pe.end,de=Pe.completeOperand?Pe.end:void 0;continue}}}else if(q===0&&P===0&&(se===oe||se===nt))break;e++}if(C=Cn(ve(Z,e)),C.endsWith(" as const")||C==="const"){if(O=!0,!A){let se=C.endsWith(" as const")?C.slice(0,-9).trim():C,Pe=Pt(se);A=Pe!=="unknown"?Pe:void 0}}else if(!A){let se=z(C)??St(C)??he(C);if(se)A=se}}let I=c.length===0?Ze(s):void 0,M=u?"const":o,k=u?!1:r,T=`${k?"export ":""}declare ${M} ${S}: ${A||"unknown"};`,j={kind:"variable",name:S,text:T,isExported:k,typeAnnotation:A,value:C,initializerStart:v,modifiers:O?[M,"const assertion"]:[M],leadingComments:u?void 0:I,start:s,end:e};if(u)c.push(...cr({pattern:u,patternOffset:p,root:j,kind:o,exported:r,comments:I,allocateName:on}));else c.push(j);if(f.charCodeAt(e)===nt){e++;continue}if(f.charCodeAt(e)===oe)e++;break}while(e<w);return c}function Bt(s,o){e+=9,D();let r=Re();D();let c=rt();D();let l="";if(_("extends")){e+=7,D();let C=e,v=0;while(e<w){if(qe())continue;let O=f.charCodeAt(e);if(O===Se)v++;else if(O===Ie&&!Xe())v--;else if(O===L&&v===0)break;e++}l=ve(C,e)}D();let u=e<w&&f.charCodeAt(e)===L?Mt():"{}",p=sn(u),S=`${o?"export ":""}declare interface ${r}${c}${l?` extends ${l}`:""} ${p}`,A=Ze(s);return{kind:"interface",name:r,text:S,isExported:o,extends:l||void 0,generics:c||void 0,leadingComments:A,start:s,end:e}}function Lt(s,o){e+=4,D();let r=Re();D();let c=rt();if(D(),e<w&&f.charCodeAt(e)===Oe)e++;D();let l=e,u=0;while(e<w){if(qe())continue;let C=f.charCodeAt(e);if(C===le||C===L||C===De||C===Se)u++;else if(C===Ce||C===ee||C===Me||C===Ie&&!Xe())u--;else if(u===0&&C===oe)break;if(u===0&&(ht()||Yt()))break;e++}let p=ve(l,e);if(e<w&&f.charCodeAt(e)===oe)e++;let S=`${o?"export ":""}type ${r}${c} = ${p}`,A=Ze(s);return{kind:"type",name:r,text:S,isExported:o,generics:c||void 0,leadingComments:A,start:s,end:e}}function mt(s,o,r){e+=4,D();let c=Re();D();let l=e;if(e<w&&f.charCodeAt(e)===L)Be(L,ee);let u=ve(s,e),p=Ze(s);return{kind:"enum",name:c,text:u,isExported:o,modifiers:r?["const"]:void 0,leadingComments:p,start:s,end:e}}function at(s,o,r,c=!1){e+=5,D();let l=Re()||"AnonymousClass";D();let u=rt();D();let p="";if(_("extends")){e+=7,D();let I=e,M=0;while(e<w){if(qe())continue;let k=f.charCodeAt(e);if(k===Se)M++;else if(k===Ie&&!Xe())M--;else if(M===0&&(k===L||_("implements")))break;e++}p=ve(I,e)}let S;if(_("implements")){e+=10,D();let I=e,M=0;while(e<w){if(qe())continue;let T=f.charCodeAt(e);if(T===Se)M++;else if(T===Ie&&!Xe())M--;else if(M===0&&T===L)break;e++}let k=ve(I,e);if(k)S=k.split(",").map((T)=>T.trim())}D();let A=zt(l),v=`${o?c?"export default ":"export declare ":"declare "}${r?"abstract ":""}class ${l}${u}${p?` extends ${p}`:""}${S&&S.length>0?` implements ${S.join(", ")}`:""} ${A}`,O=Ze(s);return{kind:"class",name:l,text:v,isExported:o,isDefault:c,extends:p||void 0,implements:S,generics:u||void 0,modifiers:r?["abstract"]:void 0,leadingComments:O,start:s,end:e}}let Nt;function zt(s){if(e>=w||f.charCodeAt(e)!==L)return"{}";e++;let o={name:s,fields:new Map,pending:[],isStatic:!1};ae.push(o);let r=[],c=new Set;while(e<w){if(D(),e>=w)break;if(f.charCodeAt(e)===ee){e++;break}if(f.charCodeAt(e)===oe){e++;continue}if(Nt=Ze(e),_("static")&&Tt("static")===L){e+=6,D(),Be(L,ee);continue}let l=!1,u=!1,p=!1,S=!1,A=!1,C=!1,v=!1,O=!1,I=!0;while(I){D();let q=e,P=Re();if(e=q,P){let de=Tt(P);if(de===le||de===Se||de===It||de===33||de===et||de===Oe||de===oe||de===ee)break}if(_("private")){l=!0,e+=7;continue}if(_("protected")){u=!0,e+=9;continue}if(_("public")){e+=6;continue}if(_("static")){p=!0,e+=6;continue}if(_("abstract")){S=!0,e+=8;continue}if(_("readonly")){A=!0,e+=8;continue}if(_("override")){C=!0,e+=8;continue}if(_("accessor")){v=!0,e+=8;continue}if(_("async")){O=!0,e+=5;continue}if(_("declare")){e+=7;continue}break}if(D(),e>=w||f.charCodeAt(e)===ee)break;let M=e;if(o.isStatic=p,(_("get")||_("set"))&&qt(Tt(f.slice(e,e+3))))e+=3,D();if(f.charCodeAt(e)===ke)e++,D();let k=_t();e=M;let T=k.startsWith("#");if(T)l=!0;if(l&&k&&k!=="constructor"){let q=T?p?" static #private_static;":" #private;":` private ${p?"static ":""}${k};`,de=k[0]==="'"||k[0]==='"'?d(k)??k:k,se=T?`${p?"static":"instance"}#`:`${p?"static:":"instance:"}${de}`;if(!c.has(se))c.add(se),r.push(q)}let j=l?[]:r,Z=" ";if(u)Z+="protected ";if(p)Z+="static ";if(S)Z+="abstract ";if(A)Z+="readonly ";if(_("constructor")){e+=11,D();let q=ot();if(D(),Mn(q,r),e<w&&f.charCodeAt(e)===L)Be(L,ee);else if(e<w&&f.charCodeAt(e)===oe)e++;let P=pt(q);r.push(l?" private constructor();":` ${u?"protected ":""}constructor${P};`)}else if(_("get"))if(e+=3,D(),e<w&&qt(f.charCodeAt(e))){let q=_t();if(q.startsWith("#")){if(D(),e<w&&f.charCodeAt(e)===le)ot();if(D(),kt(),D(),e<w&&f.charCodeAt(e)===L)Be(L,ee);else if(e<w&&f.charCodeAt(e)===oe)e++;continue}D(),ot(),D();let P=kt(),de;if(D(),e<w&&f.charCodeAt(e)===L){let Pe=e+1;if(Be(L,ee),!P&&!be)de=f.slice(Pe,e-1),P=B(de,!1,"()",(ut)=>He(ut,p))}else if(e<w&&f.charCodeAt(e)===oe)e++;let se=j.length;if(j.push(`${Z}get ${q}(): ${de?W(P):P||"unknown"};`),de)o.pending.push(()=>{let Pe=B(de,!1,"()",(ut)=>He(ut,p));j[se]=`${Z}get ${q}(): ${W(Pe)};`})}else an("get",Z,p,A,O,j);else if(_("set"))if(e+=3,D(),e<w&&qt(f.charCodeAt(e))){let q=_t();if(q.startsWith("#")){if(D(),e<w&&f.charCodeAt(e)===le)ot();if(D(),e<w&&f.charCodeAt(e)===L)Be(L,ee);else if(e<w&&f.charCodeAt(e)===oe)e++;continue}D();let P=ot();if(D(),e<w&&f.charCodeAt(e)===L)Be(L,ee);else if(e<w&&f.charCodeAt(e)===oe)e++;let de=pt(P);j.push(`${Z}set ${q}${de};`)}else an("set",Z,p,A,O,j);else{let q=f.charCodeAt(e)===ke;if(q)e++,D();let P=_t();if(!P){cn();continue}ln(P,Z,p,A,q,S,O,j)}}for(let l of o.pending)l();return ae.pop(),`{
|
|
32
|
-
${r.join(`
|
|
33
|
-
`)}
|
|
34
|
-
}`}function qt(s){return a(s)||s===De||s===pn||s===Ae||s===$e}function _t(){if(e>=w)return"";let s=f.charCodeAt(e);if(s===De){let o=e;return Be(De,Me),f.slice(o,e)}if(s===pn)return e++,`#${Re()}`;if(s===Ae||s===$e){let o=e;return it(s),f.slice(o,e)}return Re()}function Tt(s){let o=e;e+=s.length,D();let r=e<w?f.charCodeAt(e):0;return e=o,r}function cn(){let s=0;while(e<w){if(qe())continue;let o=f.charCodeAt(e);if(o===L||o===le)s++;else if(o===ee||o===Ce){if(s===0)return;s--}else if(o===oe&&s===0){e++;return}if(s===0&&bt())return;e++}}function an(s,o,r,c,l,u){ln(s,o,r,c,!1,!1,l,u)}function ln(s,o,r,c,l,u,p,S){let A=Nt;if(Nt=void 0,D(),e>=w)return;let C=f.charCodeAt(e),v=!1;if(C===It)v=!0,e++,D();if(e<w&&f.charCodeAt(e)===33)e++,D();let O=e<w?f.charCodeAt(e):0;if(O===le||O===Se){let I=O===Se?rt():"";D();let M=ot();D();let k=kt(),T,j=k.length>0;if(!k)if(p&&l)k="AsyncGenerator<unknown, void, unknown>";else if(l)k="Generator<unknown, void, unknown>";else if(p)k="Promise<void>";else k="void";if(D(),e<w&&f.charCodeAt(e)===L){let de=e+1;if(Be(L,ee),!j&&!l)T=f.slice(de,e-1),k=B(T,p,M,(se)=>He(se,r))}else if(e<w&&f.charCodeAt(e)===oe)e++;let Z=pt(M),q=v?"?":"",P=S.length;if(S.push(`${o}${s}${q}${I}${Z}: ${T?W(k):k};`),T)ae.at(-1)?.pending.push(()=>{let de=B(T,p,M,(se)=>He(se,r));S[P]=`${o}${s}${q}${I}${Z}: ${W(de)};`})}else if(O===et||O===Oe||O===oe||O===ee||O===ye||O===Ee){let I="";if(O===et){e++,D();let Z=e,q=0;while(e<w){if(qe())continue;let P=f.charCodeAt(e);if(P===le||P===L||P===De||P===Se)q++;else if(P===Ce||P===ee||P===Me||P===Ie&&!Xe()){if(q===0)break;q--}else if(q===0&&(P===oe||P===nt))break;else if(q===0&&P===Oe&&!Rt())break;if(q===0&&bt())break;e++}I=ve(Z,e)}let M="";if(e<w&&f.charCodeAt(e)===Oe)if(be&&I){e++;let Z=0;while(e<w){if(qe())continue;let q=f.charCodeAt(e);if(q===le||q===L||q===De)Z++;else if(q===Ce||q===ee||q===Me){if(Z===0&&q===ee)break;Z--}else if(Z===0&&q===oe)break;if(Z===0&&bt())break;e++}}else{e++,D();let Z=e,q=0;while(e<w){if(qe())continue;let P=f.charCodeAt(e);if(P===le||P===L||P===De)q++;else if(P===Ce||P===ee||P===Me){if(q===0&&P===ee)break;q--}else if(q===0&&P===oe)break;if(q===0&&bt())break;e++}M=ve(Z,e)}if(e<w&&f.charCodeAt(e)===oe)e++;let k=I.length>0;if(!I)if(M){let Z=St(M);if(Z)I=Z;else if(M.startsWith("new "))I=ge(M);else I=M.endsWith("as const")||r&&c?Pt(M):wt(M)}else I="unknown";let T=v?"?":"";ae.at(-1)?.fields.set(`${r?"static:":""}${s}`,v?`(${I}) | undefined`:I);let j=J&&!k&&M?Kt(A,M,I):"";S.push(`${j}${o}${s}${T}: ${I};`)}else cn()}function Rn(s){let o=0;for(let r=0;r<s.length;r++){let c=s.charCodeAt(r);if(c===le||c===L||c===De||c===Se)o++;else if(c===Ce||c===ee||c===Me||c===Ie&&s.charCodeAt(r-1)!==Oe)o--;else if(c===Oe&&o===0&&s.charCodeAt(r+1)!==Ie&&s.charCodeAt(r+1)!==Oe)return!0}return!1}function Mn(s,o){let r=s.slice(1,-1).trim();if(!r)return;let c=[],l=0,u=0,p=!1,S=0,A=[];for(let C=0;C<=r.length;C++){if(C===r.length){A.push(r.slice(l)),c.push(vt(r.slice(l).trim()));break}let v=r.charCodeAt(C);if(p){if(v===Ye){C++;continue}if(v===S)p=!1;continue}if(v===X&&C+1<r.length){let O=r.charCodeAt(C+1);if(O===ke){C+=2;while(C+1<r.length&&!(r.charCodeAt(C)===ke&&r.charCodeAt(C+1)===X))C++;C++;continue}if(O===X){while(C<r.length&&r.charCodeAt(C)!==10)C++;continue}}if(v===Ae||v===$e||v===We){p=!0,S=v;continue}if(v===le||v===L||v===De||v===Se)u++;else if(v===Ce||v===ee||v===Me||v===Ie&&!(C>0&&r.charCodeAt(C-1)===Oe))u--;else if(v===nt&&u===0)A.push(r.slice(l,C)),c.push(vt(r.slice(l,C).trim())),l=C+1}for(let[C,v]of c.entries()){let O=v.startsWith("public ")||v.startsWith("public\t"),I=v.startsWith("protected ")||v.startsWith("protected\t"),M=v.startsWith("private ")||v.startsWith("private\t"),k=v.includes("readonly ");if(!O&&!I&&!M&&!k)continue;let T=v,j=[];if(M){let se=7;while(se<T.length&&Ne(T.charCodeAt(se)))se++;T=T.slice(se),j.push("private")}if(O){let se=6;while(se<T.length&&Ne(T.charCodeAt(se)))se++;T=T.slice(se),j.push("public")}if(I){let se=9;while(se<T.length&&Ne(T.charCodeAt(se)))se++;T=T.slice(se),j.push("protected")}if(k){let se=T.indexOf("readonly ");if(se!==-1){let Pe=se+8;while(Pe<T.length&&Ne(T.charCodeAt(Pe)))Pe++;T=T.slice(0,se)+T.slice(Pe)}j.push("readonly")}let Z=j.length>0?`${j.join(" ")} `:"",q=rn(T),P=T.search(/[?:=]/);if(P!==-1&&T.charCodeAt(P)!==63&&Rn(T))q=q.replace(/^([\w$]+)\?:/,"$1:");let de="";if(J&&!M&&P!==-1&&T.charCodeAt(P)===Oe){let se=T.slice(P+1);de=Kt(rr(A[C]),se,wt(se))}o.push(M?` private ${q.split(/[?:]/,1)[0]};`:`${de} ${Z}${q};`)}}function Ft(s=" ",o="",r=!1){if(e>=w||f.charCodeAt(e)!==L)return"{}";e++;let c=re.at(-1)?.path,l={path:c?`${c}.${o}`:o,bindings:new Map,exports:new Set,ambient:r||re.at(-1)?.ambient===!0};ie.push(l),re.push(l);let u=[];while(e<w){if(D(),e>=w)break;if(f.charCodeAt(e)===ee){e++;break}if(f.charCodeAt(e)===oe){e++;continue}let p=!1;if(_("export"))p=!0,e+=6,D();let S=!1;if(_("declare"))S=!0,e+=7,D();let A=p?"export ":"";if(_("function")||_("async")&&Pn("async","function")){let C=!1;if(_("async"))C=!0,e+=5,D();if(e+=8,D(),e<w&&f.charCodeAt(e)===ke)e++,D();let O=Re();D();let I=rt();D();let M=ot();D();let k=kt();if(!k)k=C?"Promise<void>":"void";if(D(),e<w&&f.charCodeAt(e)===L)Be(L,ee);else if(e<w&&f.charCodeAt(e)===oe)e++;let T=pt(M);u.push(`${s}${A}function ${O}${I}${T}: ${k};`)}else if(_("const")||_("let")||_("var")){let C=_("const")?"const":_("let")?"let":"var";e+=C.length,D();let v=Re();if(l.bindings.set(v,"value"),p||l.ambient)l.exports.add(v);if(!v){Le(!0);continue}D();let O="";if(e<w&&f.charCodeAt(e)===et){e++,D();let M=e,k=0;while(e<w){if(qe())continue;let T=f.charCodeAt(e);if(T===le||T===L||T===De||T===Se)k++;else if(T===ee&&k===0)break;else if(T===Ce||T===ee||T===Me||T===Ie&&!Xe())k--;else if(k===0&&(T===oe||T===nt))break;else if(k===0&&T===Oe&&!Rt())break;if(k===0&&ht())break;e++}O=ve(M,e)}let I="";if(e<w&&f.charCodeAt(e)===Oe){e++,D();let M=e,k=0;while(e<w){if(qe())continue;let T=f.charCodeAt(e);if(T===le||T===L||T===De||T===Se)k++;else if(T===ee&&k===0)break;else if(T===Ce||T===ee||T===Me||T===Ie&&!Xe())k--;else if(k===0&&(T===oe||T===nt))break;if(k===0&&ht())break;e++}I=ve(M,e)}if(e<w&&f.charCodeAt(e)===oe)e++;if(!O&&I){let M=St(I);if(M)O=M;else if(C==="const")O=Pt(I);else O=wt(I)}if(!O)O="unknown";u.push(`${s}${A}${C} ${v}: ${O};`)}else if(_("interface")){e+=9,D();let C=Re();D();let v=rt();D();let O="";if(_("extends")){e+=7,D();let M=e,k=0;while(e<w){if(qe())continue;let T=f.charCodeAt(e);if(T===Se)k++;else if(T===Ie&&!Xe())k--;else if(T===L&&k===0)break;e++}O=ve(M,e)}let I=sn(Mt());u.push(`${s}${A}interface ${C}${v}${O?` extends ${O}`:""} ${I}`)}else if(_("type")){e+=4,D();let C=Re();D();let v=rt();if(D(),e<w&&f.charCodeAt(e)===Oe){e++,D();let O=e,I=0;while(e<w){if(qe())continue;let k=f.charCodeAt(e);if(k===le||k===L||k===De||k===Se)I++;else if(k===ee&&I===0)break;else if(k===Ce||k===ee||k===Me||k===Ie&&!Xe())I--;else if(I===0&&k===oe)break;if(I===0&&ht())break;e++}let M=ve(O,e);if(e<w&&f.charCodeAt(e)===oe)e++;u.push(`${s}${A}type ${C}${v} = ${M}`)}}else if(_("class")){e+=5,D();let C=Re();D();let v=rt();D();let O=e,I=0;while(e<w){if(qe())continue;let j=f.charCodeAt(e);if(j===Se)I++;else if(j===Ie&&!Xe())I--;else if(j===L&&I===0)break;e++}let M=ve(O,e),k=M?` ${M}`:"";if(l.bindings.set(C,"class"),p||l.ambient)l.exports.add(C);let T=zt(C);u.push(`${s}${A}class ${C}${v}${k} ${T}`)}else if(_("enum")){e+=4,D();let C=Re();D();let v=Mt();u.push(`${s}${A}enum ${C} ${v}`)}else if(_("namespace")||_("module")){let C=_("namespace")?"namespace":"module";e+=C.length,D();let v=Re();if(!l.bindings.has(v))l.bindings.set(v,"namespace");if(p||l.ambient)l.exports.add(v);D();let O=Ft(s,v,S);u.push(`${s}${A}${C} ${v} ${O}`)}else if(_("abstract"))if(e+=8,D(),_("class")){e+=5,D();let C=Re();D();let v=rt();D();let O=e,I=0;while(e<w){if(qe())continue;let j=f.charCodeAt(e);if(j===Se)I++;else if(j===Ie&&!Xe())I--;else if(j===L&&I===0)break;e++}let M=ve(O,e),k=M?` ${M}`:"";if(l.bindings.set(C,"class"),p||l.ambient)l.exports.add(C);let T=zt(C);u.push(`${s}${A}abstract class ${C}${v}${k} ${T}`)}else Le(!0);else if(p&&_("default")){e+=7,D();let C=e;Le(!0);let v=ve(C,e);if(v.charCodeAt(v.length-1)===oe)v=v.slice(0,-1);if(v)u.push(`${s}export default ${v};`)}else if(!p&&(f.charCodeAt(e)===Ae||f.charCodeAt(e)===$e||f.charCodeAt(e)===We))Le(!0);else Le(!0)}if(re.pop(),u.length===0)return"{}";return`{
|
|
35
|
-
${u.join(`
|
|
36
|
-
`)}
|
|
37
|
-
}`}function Pn(s,o){let r=e+s.length;while(r<w&&Ne(f.charCodeAt(r)))r++;for(let c=0;c<o.length;c++)if(r+c>=w||f.charCodeAt(r+c)!==o.charCodeAt(c))return!1;return r+o.length>=w||!i(f.charCodeAt(r+o.length))}function gt(s,o,r){e+=r.length,D();let c="",l=f.charCodeAt(e);if(l===Ae||l===$e){let I=e;it(l),c=f.slice(I,e)}else{c=Re();while(e<w&&f.charCodeAt(e)===Ct)e++,c+=`.${Re()}`}D();let u=t(f.slice(s,e)),p=u.findIndex((I)=>I.kind==="word"&&["namespace","module"].includes(f.slice(s+I.start,s+I.end))),S=u.slice(0,p).some((I)=>I.kind==="word"&&f.slice(s+I.start,s+I.end)==="declare"),A=e<w&&f.charCodeAt(e)===L?Ft(" ",c,S):"{}",C=`${o?"export ":""}declare ${r} ${c} ${A}`,v=Ze(s),O=c.startsWith("'")||c.startsWith('"');return{kind:"module",name:c,text:C,isExported:o,moduleForm:O?"quoted":r==="namespace"?"namespace":"identifier",source:O?c.slice(1,-1):void 0,leadingComments:v,start:s,end:e}}function fn(s,o){Le();let r=ve(o,e);if(r.charCodeAt(r.length-1)===oe)r=r.slice(0,-1).trimEnd();if(!r)return;let c=a(r.charCodeAt(0));for(let v=1;c&&v<r.length;v++)c=i(r.charCodeAt(v));let l=Ze(s);if(c){N.push({kind:"export",name:"default",text:`export default ${r};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e});return}let u="__dtsx_default_export__",p=1;while(f.includes(u))u=`__dtsx_default_export_${p++}__`;let A=St(r)||he(r)||n(r,!1),C=A==="unknown"&&qn(r)?`typeof ${r}`:A;N.push({kind:"variable",name:u,text:`declare const ${u}: ${C};`,isExported:!1,typeAnnotation:C,modifiers:["const"],start:s,end:e}),N.push({kind:"export",name:"default",text:`export default ${u};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e})}function dn(){if(f.charCodeAt(e)===L)return Be(L,ee),!0;let s=_("if"),o=_("do"),r=_("try"),c=_("for");if(!s&&!o&&!r&&!c&&!_("while")&&!_("switch")&&!_("with"))return!1;if(Re(),D(),c&&_("await"))e+=5,D();if(!o&&!r&&f.charCodeAt(e)===le)Be(le,Ce);if(Dt(),D(),s&&_("else"))e+=4,Dt();else if(o&&_("while")){if(e+=5,D(),f.charCodeAt(e)===le)Be(le,Ce);if(D(),f.charCodeAt(e)===oe)e++}else if(r){if(_("catch")){if(e+=5,D(),f.charCodeAt(e)===le)Be(le,Ce);Dt(),D()}if(_("finally"))e+=7,Dt()}return!0}function Dt(){if(D(),!dn())Le()}while(e<w){if(D(),e>=w)break;if(dn())continue;let s=e,o=f.charCodeAt(e);if(o===105&&_("import"))N.push(Sn(s));else if(o===101&&_("export")){e+=6,D();let r=f.charCodeAt(e);if(r===100&&_("default")){e+=7,D();let c=e,l=f.charCodeAt(e);if(l===102&&_("function")){let u=ct(s,!0,!1,!0);if(u)N.push(u)}else if(l===97&&_("async")&&Tt("async")!==oe)if(e+=5,D(),_("function")){let u=ct(s,!0,!0,!0);if(u)N.push(u)}else fn(s,c);else if(l===99&&_("class")){let u=at(s,!0,!1,!0);N.push(u)}else if(l===97&&_("abstract")){if(e+=8,D(),_("class")){let u=at(s,!0,!0,!0);N.push(u)}}else fn(s,c)}else if(r===116&&_("type")){let c=e;if(e+=4,D(),e<w&&f.charCodeAt(e)===L){en();let l=ve(s,e),u=Ze(s);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:yt(l),leadingComments:u,start:s,end:e})}else if(e<w&&f.charCodeAt(e)===ke){tn();let l=ve(s,e);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:yt(l),start:s,end:e})}else{e=c;let l=Lt(s,!0);N.push(l)}}else if(r===105&&_("interface")){let c=Bt(s,!0);N.push(c)}else if(r===102&&_("function")){let c=ct(s,!0,!1,!1);if(c)N.push(c)}else if(r===97&&_("async"))if(e+=5,D(),_("function")){let c=ct(s,!0,!0,!1);if(c)N.push(c)}else Le();else if(r===99)if(_("class")){let c=at(s,!0,!1);N.push(c)}else if(_("const")){let c=e;if(e+=5,D(),_("enum")){e=c+5,D();let l=mt(s,!0,!0);N.push(l)}else{e=c;let l=dt(s,"const",!0);for(let u=0;u<l.length;u++)N.push(l[u])}}else Le();else if(r===97&&_("abstract")){if(e+=8,D(),_("class")){let c=at(s,!0,!0);N.push(c)}}else if(r===108&&_("let")){let c=dt(s,"let",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(r===118&&_("var")){let c=dt(s,"var",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(r===101&&_("enum")){let c=mt(s,!0,!1);N.push(c)}else if(r===100&&_("declare"))e+=7,D(),hn(s,!0);else if(r===110&&_("namespace")&&xt(9)){let c=gt(s,!0,"namespace");N.push(c)}else if(r===109&&_("module")&&xt(6)){let c=gt(s,!0,"module");N.push(c)}else if(r===L){en();let c=ve(s,e),l=c.includes("export type"),u=Ze(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:l,source:yt(c),leadingComments:u,start:s,end:e})}else if(r===ke){tn();let c=ve(s,e),l=Ze(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:!1,source:yt(c),leadingComments:l,start:s,end:e})}else{Le();let c=ve(s,e);if(c)N.push({kind:"export",name:"",text:c,isExported:!0,start:s,end:e})}}else if(o===100&&_("declare"))e+=7,D(),hn(s,!1);else if(o===105&&_("interface")){let r=Bt(s,!1);G.set(r.name,r)}else if(o===116&&_("type")){let r=Lt(s,!1);G.set(r.name,r),N.push(r)}else if(o===102&&_("function")){let r=ct(s,!1,!1,!1);if(r)lt(r);else Le()}else if(o===97)if(_("async")){let r=e;if(e+=5,D(),_("function")){let c=ct(s,!1,!0,!1);if(c)lt(c);else e=r,Le()}else e=r,Le()}else if(_("abstract"))if(e+=8,D(),_("class")){let r=at(s,!1,!1);G.set(r.name,r),N.push(r)}else Le();else e++,Le();else if(o===99)if(_("class")){let r=at(s,!1,!1);G.set(r.name,r),N.push(r)}else if(_("const")){let r=e;if(e+=5,D(),_("enum")){e=r+5,D();let c=mt(s,!1,!0);G.set(c.name,c),N.push(c)}else{e=r;let c=dt(s,"const",!1);for(let l=0;l<c.length;l++)G.set(c[l].name,c[l])}}else e++,Le();else if(o===101&&_("enum")){let r=mt(s,!1,!1);G.set(r.name,r),N.push(r)}else if(o===108&&_("let")||o===118&&_("var")){let r=_("let")?"let":"var",c=dt(s,r,!1);for(let l=0;l<c.length;l++)G.set(c[l].name,c[l])}else if(o===109&&_("module")&&xt(6)){let r=gt(s,!1,"module");N.push(r)}else if(o===110&&_("namespace")&&xt(9)){let r=gt(s,!1,"namespace");N.push(r)}else{let r=f.charCodeAt(e);if(r===oe)e++;else if(r===Ae||r===$e){if(it(r),e<w&&f.charCodeAt(e)===oe)e++}else if(r===We){if(At(),e<w&&f.charCodeAt(e)===oe)e++}else if(r===Ln){if(e++,Re(),D(),e<w&&f.charCodeAt(e)===Ct)e++,Re(),D();if(e<w&&f.charCodeAt(e)===le)Be(le,Ce)}else e++,Le()}}if(Te.length){let s=new Set([...N,...G.values()]),o=new Set([...s].filter((u)=>u.kind==="class").map((u)=>u.name)),r=new Map;for(let u of ie)for(let[p,S]of u.bindings){let A=u.path?`${u.path}.${p}`:p;if(u.exports.has(p)&&(S!=="namespace"||!r.has(A)))r.set(A,S)}let c=new Map;for(let u of Te)c.set(u.marker,Ht(u.initializer,(p)=>{if(u.classes.includes(p))return!0;for(let S=u.namespaces.length-1;S>=0;S--){let A=u.namespaces[S],C=A.path?`${A.path}.${p}`:p,v=p.split(".")[0],O=A.bindings.get(v);if(O){if(p===v&&O!=="namespace")return O==="class";return r.get(C)==="class"}let I=A.path?`${A.path}.${v}`:v;if(r.has(I))return r.get(C)==="class"}return r.has(p)?r.get(p)==="class":o.has(p)}));let l=(u)=>{if(!u.includes("__dtsx_constructor_field_"))return u;let p="",S=0;for(let A of t(u)){if(A.kind!=="word")continue;let C=c.get(u.slice(A.start,A.end));if(!C)continue;p+=u.slice(S,A.start)+C,S=A.end}return p+u.slice(S)};for(let u of s){u.text=l(u.text);for(let p of["typeAnnotation","inferredType","returnType"])if(u[p])u[p]=l(u[p])}}if(te.size>0){un(N);for(let s of ce.values())un(s)}if(zn(f,N,G,ce),Hn(N,G),ir(N,G),!be)Jn(f,N,G,fe);if(ue){let s=new Set(N);for(let o of[...G.values(),...[...ce.values()].flat()])if(!s.has(o))N.push(o),s.add(o);return N.sort((o,r)=>(o.start??0)-(r.start??0))}if(G.size>0)Fn(N,G,ce,tt);return N;function un(s){let o=new Map;for(let c of s)if(c.kind==="function")o.set(c.name,(o.get(c.name)||0)+1);let r=new Set;for(let[c,l]of o)if(l>1)r.add(c);if(r.size>0){let c=new Set;for(let l of r)for(let u=s.length-1;u>=0;u--)if(s[u].kind==="function"&&s[u].name===l&&te.has(s[u])){c.add(u);break}if(c.size>0){let l=[...c].sort((u,p)=>p-u);for(let u of l)s.splice(u,1)}}}function hn(s,o){if(_("function")){let r=ct(s,o,!1,!1);if(r)N.push(r)}else if(_("async")){if(e+=5,D(),_("function")){let r=ct(s,o,!0,!1);if(r)N.push(r)}}else if(_("class")){let r=at(s,o,!1);N.push(r)}else if(_("abstract")){if(e+=8,D(),_("class")){let r=at(s,o,!0);N.push(r)}}else if(_("interface")){let r=Bt(s,o);N.push(r)}else if(_("type")){let r=Lt(s,o);N.push(r)}else if(_("enum")){let r=mt(s,o,!1);N.push(r)}else if(_("const")){let r=e;if(e+=5,D(),_("enum")){e=r+5,D();let c=mt(s,o,!0);N.push(c)}else{e=r;let c=dt(s,"const",o);for(let l=0;l<c.length;l++)if(o||!tt)N.push(c[l]);else G.set(c[l].name,c[l])}}else if(_("let")||_("var")){let r=_("let")?"let":"var",c=dt(s,r,o);for(let l=0;l<c.length;l++)if(o||!tt)N.push(c[l]);else G.set(c[l].name,c[l])}else if(_("module")){let r=gt(s,o,"module");N.push(r)}else if(_("namespace")){let r=gt(s,o,"namespace");N.push(r)}else if(_("global")){e+=6,D();let c=`declare global ${e<w&&f.charCodeAt(e)===L?Ft(" ","",!0):"{}"}`,l=Ze(s);N.push({kind:"module",name:"global",text:c,isExported:!1,moduleForm:"global",leadingComments:l,start:s,end:e})}else Le()}}class gn{names;lengths=new Uint8Array(65);firstUnits=new Uint8Array(65536);size;constructor(E){this.names=E;for(let ne of E.keys()){if(!ne)continue;this.lengths[Math.min(ne.length,64)]=1,this.firstUnits[ne.charCodeAt(0)]=1}this.size=E.size}scan(E,ne){if(this.size===0)return!1;let Q=!1,Y=0,ue=E.length;while(Y<ue){let fe=E.charCodeAt(Y);if(fe>=65&&fe<=90||fe>=97&&fe<=122||fe===95||fe===36||fe>127){let f=Y;Y++;while(Y<ue){let J=E.charCodeAt(Y);if(J>=65&&J<=90||J>=97&&J<=122||J>=48&&J<=57||J===95||J===36||J>127)Y++;else break}if(this.firstUnits[fe]===1&&this.lengths[Math.min(Y-f,64)]===1){let J=E.substring(f,Y),be=this.names.get(J);if(be!==void 0){if(ne.add(J),be.kind==="function"||be.kind==="variable")Q=!0}}}else Y++}return Q}}function mn(E,ne){let Q=0;while(Q<E.length){let Y=E.charCodeAt(Q);if(Y===Ae||Y===$e||Y===We){let Ke=Y;Q++;while(Q<E.length)if(E.charCodeAt(Q)===Ye)Q+=2;else if(E.charCodeAt(Q++)===Ke)break;continue}if(Y===X&&E.charCodeAt(Q+1)===X){Q+=2;while(Q<E.length&&E.charCodeAt(Q)!==ye&&E.charCodeAt(Q)!==Ee)Q++;continue}if(Y===X&&E.charCodeAt(Q+1)===ke){let Ke=E.indexOf("*/",Q+2);Q=Ke===-1?E.length:Ke+2;continue}if(!a(Y)){Q++;continue}let ue=Q++;while(Q<E.length&&i(E.charCodeAt(Q)))Q++;let fe=ue-1,f=Q;while(fe>=0&&Ne(E.charCodeAt(fe)))fe--;while(f<E.length&&Ne(E.charCodeAt(f)))f++;let J=fe>=0?E.charCodeAt(fe):0,be=f<E.length?E.charCodeAt(f):0,w=ue>=3&&E.slice(ue-3,ue)==="...";if(be===et||J===Ct&&!w)continue;if(be===le&&(J===L||J===nt))continue;ne.add(E.slice(ue,Q))}}function Fn(E,ne,Q,Y){let ue=new Map;if(Y){let G=0;for(let ce of E)if(ce.kind==="class"&&!ce.isExported){if(ue.set(ce.name,ce),!ne.has(ce.name))ne.set(ce.name,ce)}else E[G++]=ce;E.length=G}let fe=new Set(E),f=new Set,J=new Set;for(let G of E)J.add(G.name);let be=new gn(ne),w=new Set,Ke=new Set,tt=(G)=>{if(be.scan(G.text,w))nr(G,Ke)},N=new Set;for(let G=0;G<E.length;G++){let ce=E[G];if(ce.kind!=="import"){if(tt(ce),typeof ce.value==="string")mn(ce.value,N)}}for(;;){let G=[];for(let[e,pe]of ne){if(f.has(e))continue;if((pe.kind==="function"||pe.kind==="variable"?Ke:w).has(e)||pe.kind!=="function"&&N.has(e)){let ae=ue.get(e);if(ae){for(let ie of[ae,pe])if(!fe.has(ie))G.push(ie),fe.add(ie);J.add(e)}else if(!J.has(e)){let ie=pe.kind==="function"?Q.get(e):void 0;if(ie)for(let re of ie)G.push(re);else G.push(pe);J.add(e)}f.add(e)}}if(G.length===0)break;G.sort((e,pe)=>(e.start??1/0)-(pe.start??1/0));let ce=[],te=0;for(let e=0;e<E.length;e++){let pe=E[e].start??1/0;while(te<G.length&&(G[te].start??1/0)<=pe)ce.push(G[te++]);ce.push(E[e])}while(te<G.length)ce.push(G[te++]);E.length=0;for(let e=0;e<ce.length;e++)E.push(ce[e]);for(let e of G)if(e.kind!=="import"){if(tt(e),typeof e.value==="string")mn(e.value,N)}}}
|
|
38
|
-
export{Oi,Ba,R,F,jt};
|