@aussieljk/forkbook 0.0.1-2 → 0.0.1-20
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/LICENSE +1 -1
- package/README.md +35 -53
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +2 -2
- package/assets/browser/favicon-wrapper.svg +4 -4
- package/assets/browser/favicon.svg +1 -1
- package/assets/browser/inter-LICENSE.txt +92 -0
- package/assets/browser/inter-variable-italic.woff2 +0 -0
- package/assets/browser/inter-variable.woff2 +0 -0
- package/assets/browser/mirror-ball.png +0 -0
- package/assets/builder-vite/iframe.html +8 -24
- package/assets/create/rendererAssets/common/Configure.mdx +100 -100
- package/assets/create/rendererAssets/common/button.css +7 -7
- package/assets/create/rendererAssets/common/header.css +6 -6
- package/assets/create/rendererAssets/common/page.css +12 -12
- package/assets/create/templates/react-native/index.expo.js +4 -4
- package/assets/create/templates/react-native/index.js +5 -5
- package/assets/server/base-preview-body.html +32 -32
- package/assets/server/base-preview-head.html +86 -86
- package/assets/server/template.ejs +31 -26
- package/dist/_browser-chunks/{Color-PCLE2J36.js → Color-KALNKPOV.js} +8 -8
- package/dist/_browser-chunks/{DocsRenderer-JXND3PVQ.js → DocsRenderer-DKXSW2OY.js} +2 -2
- package/dist/_browser-chunks/WithTooltip-66AWY4VQ.js +199 -0
- package/dist/_browser-chunks/{chunk-RBCHTR7C.js → chunk-2ELGJRFZ.js} +1 -1
- package/dist/_browser-chunks/{chunk-PFRNG3UC.js → chunk-2WZWS7GJ.js} +5 -5
- package/dist/_browser-chunks/{chunk-52CW7FF7.js → chunk-3QNZOMD7.js} +8 -3
- package/dist/_browser-chunks/{chunk-LV5PIKV4.js → chunk-3QPZOXB7.js} +6 -8
- package/dist/_browser-chunks/{chunk-ODVJ3XZJ.js → chunk-4BOJAE7P.js} +14 -10
- package/dist/_browser-chunks/{chunk-2MEPHP35.js → chunk-4KIQBRD2.js} +1 -1
- package/dist/_browser-chunks/chunk-4ZGQ4YQ2.js +20 -0
- package/dist/_browser-chunks/chunk-6AKCRYVX.js +6 -0
- package/dist/_browser-chunks/{chunk-W5M6NPS3.js → chunk-6SL45YM3.js} +15 -18
- package/dist/_browser-chunks/{chunk-2SCZVUKW.js → chunk-AN2LJG5I.js} +1 -1
- package/dist/_browser-chunks/{chunk-P6PK47TQ.js → chunk-BLCZ3C5M.js} +48 -83
- package/dist/_browser-chunks/{chunk-RSPAQWVJ.js → chunk-BNP234B4.js} +1 -1
- package/dist/_browser-chunks/{chunk-JYVGARBG.js → chunk-CX37N6FG.js} +770 -720
- package/dist/_browser-chunks/{chunk-JSBKXXXF.js → chunk-DHTLVXAL.js} +38 -45
- package/dist/_browser-chunks/{chunk-GNZY6LOW.js → chunk-DISGPOF4.js} +54 -51
- package/dist/_browser-chunks/chunk-DNJ3OSLB.js +6021 -0
- package/dist/_browser-chunks/{chunk-6SXYJQST.js → chunk-E6QKKKLO.js} +21 -6
- package/dist/_browser-chunks/{chunk-FJGWSWL5.js → chunk-EBSOKHFG.js} +10 -4
- package/dist/_browser-chunks/{chunk-CFAOWGL7.js → chunk-ECMVTOVD.js} +1 -1
- package/dist/_browser-chunks/{chunk-CFWWCCZV.js → chunk-ENHFQXYS.js} +9 -7
- package/dist/_browser-chunks/{chunk-YTIT5NA5.js → chunk-EW2M3URL.js} +91 -84
- package/dist/_browser-chunks/{chunk-MFMDGWP6.js → chunk-FCULT3AE.js} +3 -3
- package/dist/_browser-chunks/{chunk-46Z7NGAS.js → chunk-HX443LKV.js} +1 -1
- package/dist/_browser-chunks/chunk-HZFHNYRC.js +53 -0
- package/dist/_browser-chunks/chunk-IFADVEQE.js +669 -0
- package/dist/_browser-chunks/{chunk-OQWFVDIN.js → chunk-KQJ4T6JL.js} +31 -25
- package/dist/_browser-chunks/{chunk-RNTIV5CE.js → chunk-LYYXDWR2.js} +9 -9
- package/dist/_browser-chunks/{chunk-V5M7Q4HT.js → chunk-MJIDTL3X.js} +4 -14
- package/dist/_browser-chunks/{chunk-V2G23FV7.js → chunk-N5WQGLI7.js} +1 -1
- package/dist/_browser-chunks/{chunk-EIYAKDGP.js → chunk-NA4ITZTK.js} +127 -105
- package/dist/_browser-chunks/{chunk-RMYQ3QN3.js → chunk-NK5SGJNG.js} +22 -17
- package/dist/_browser-chunks/chunk-NPNIBOPF.js +18 -0
- package/dist/_browser-chunks/{chunk-YEKO6BHJ.js → chunk-ONTSNQON.js} +1 -1
- package/dist/_browser-chunks/chunk-OOETBSA7.js +502 -0
- package/dist/_browser-chunks/{chunk-KQ7CRO2B.js → chunk-OWWV6YG7.js} +12 -12
- package/dist/_browser-chunks/chunk-PFYL47RM.js +45 -0
- package/dist/_browser-chunks/{chunk-OD6IBQCC.js → chunk-PQRPDA4U.js} +5 -5
- package/dist/_browser-chunks/{chunk-2JDQ35OA.js → chunk-PU7D2WDP.js} +0 -11
- package/dist/_browser-chunks/chunk-PZQRXPVR.js +21 -0
- package/dist/_browser-chunks/{chunk-5WMXI5GW.js → chunk-QFO2B4X2.js} +31 -28
- package/dist/_browser-chunks/{chunk-2JT76G3E.js → chunk-SBOQ4QPY.js} +15 -15
- package/dist/_browser-chunks/{chunk-C3D4HEFY.js → chunk-TRXLBGLS.js} +344 -166
- package/dist/_browser-chunks/{chunk-ZTQ5MEJ5.js → chunk-UMGDO2ZM.js} +3 -37
- package/dist/_browser-chunks/{chunk-5I7E4GMO.js → chunk-WY2LUGOH.js} +1 -1
- package/dist/_browser-chunks/chunk-XKTORVEQ.js +255 -0
- package/dist/_browser-chunks/chunk-XSVERCGB.js +91 -0
- package/dist/_browser-chunks/{chunk-FVSEPWWX.js → chunk-XTQCLWVH.js} +325 -1635
- package/dist/_browser-chunks/{chunk-MDOL7KML.js → chunk-YJO5BK52.js} +7 -3
- package/dist/_browser-chunks/{chunk-66OCZ54D.js → chunk-ZF37BMDS.js} +6 -2
- package/dist/_browser-chunks/{matchers-YLBYSYAF.js → matchers-2HVLNCVO.js} +4 -4
- package/dist/_browser-chunks/{react-dom-client-4OHE3QDV.js → react-dom-client-SLBUX3U3.js} +1 -1
- package/dist/_node-chunks/{attached-runtime-I2G4WLJI.js → attached-runtime-YD6HKC4B.js} +33 -31
- package/dist/_node-chunks/builder-manager-UNJGYVTD.js +1176 -0
- package/dist/_node-chunks/chunk-25A7444H.js +47 -0
- package/dist/_node-chunks/{chunk-U5W53R2J.js → chunk-2CNN3CRI.js} +506 -494
- package/dist/_node-chunks/{chunk-VLOXOXXE.js → chunk-2GA4VQCS.js} +9 -9
- package/dist/_node-chunks/{chunk-YZFWBA5L.js → chunk-2VJHCGAK.js} +368 -321
- package/dist/_node-chunks/{chunk-FK7KGTV7.js → chunk-33I6AQU7.js} +7 -7
- package/dist/_node-chunks/{chunk-6YKBRP72.js → chunk-3CQI3JH5.js} +6 -6
- package/dist/_node-chunks/{chunk-IK4FGZLR.js → chunk-3ZOSFS7G.js} +6 -6
- package/dist/_node-chunks/{chunk-DUR55DJJ.js → chunk-4BE3LRIQ.js} +86 -67
- package/dist/_node-chunks/{chunk-Q7QNUM5H.js → chunk-5LFJQCYN.js} +6 -6
- package/dist/_node-chunks/{chunk-3Y6AAY5H.js → chunk-65X3MXFT.js} +8 -8
- package/dist/_node-chunks/chunk-6FWJWEAG.js +52 -0
- package/dist/_node-chunks/{chunk-UVINFLGY.js → chunk-6NLQCV6A.js} +7 -7
- package/dist/_node-chunks/{chunk-KISMCCP5.js → chunk-6OQKMJJA.js} +474 -479
- package/dist/_node-chunks/{chunk-XLP2ZKXV.js → chunk-6RYD6ENB.js} +7 -7
- package/dist/_node-chunks/{chunk-V2DY426G.js → chunk-75TTPKEA.js} +283 -306
- package/dist/_node-chunks/{chunk-3W7F2B7P.js → chunk-7CWDZLIZ.js} +6 -6
- package/dist/_node-chunks/{chunk-FPZB5OI7.js → chunk-7M3TOE4F.js} +6 -6
- package/dist/_node-chunks/{chunk-DC7DKR5K.js → chunk-AGLGQNTY.js} +6 -6
- package/dist/_node-chunks/{chunk-NIBT7XDZ.js → chunk-AOYLA323.js} +9 -6
- package/dist/_node-chunks/{chunk-RRN2V55B.js → chunk-AP4HJ3I3.js} +7 -7
- package/dist/_node-chunks/chunk-AVHJZUTH.js +2613 -0
- package/dist/_node-chunks/{chunk-H32DYT6P.js → chunk-B2EEX2SZ.js} +6 -6
- package/dist/_node-chunks/chunk-CGVVOUBC.js +18 -0
- package/dist/_node-chunks/{chunk-B5J7Q7J4.js → chunk-CJDYU653.js} +6 -6
- package/dist/_node-chunks/{chunk-XHL2LVBM.js → chunk-CPDP5SQS.js} +14 -16
- package/dist/_node-chunks/{chunk-LO56I6E2.js → chunk-DAYTIH6Z.js} +10 -10
- package/dist/_node-chunks/{chunk-FW2HQUBQ.js → chunk-DO3CPQAZ.js} +6 -6
- package/dist/_node-chunks/chunk-DQEUNKLX.js +347 -0
- package/dist/_node-chunks/{chunk-BS2WMZMR.js → chunk-EFCBUWOB.js} +7 -7
- package/dist/_node-chunks/{chunk-OWNFOGTA.js → chunk-EG2WLN5V.js} +7 -7
- package/dist/_node-chunks/{chunk-LCK4ZQKG.js → chunk-EKYNX5NX.js} +9 -9
- package/dist/_node-chunks/{chunk-TNJIXE37.js → chunk-F762PHMI.js} +6 -6
- package/dist/_node-chunks/{chunk-ET7PWEO7.js → chunk-FC3V4KZO.js} +14 -13
- package/dist/_node-chunks/chunk-FXW52X4U.js +281 -0
- package/dist/_node-chunks/{chunk-TD5PLLQG.js → chunk-GEJBTN76.js} +62 -7
- package/dist/_node-chunks/chunk-GFEH7IBP.js +620 -0
- package/dist/_node-chunks/{chunk-TWI4GVH7.js → chunk-GWT4HQZU.js} +6 -6
- package/dist/_node-chunks/{chunk-4FEANXWU.js → chunk-HHM5X5RQ.js} +140 -118
- package/dist/_node-chunks/{chunk-MA24JW6C.js → chunk-IBLUURAJ.js} +25 -8
- package/dist/_node-chunks/{chunk-2BUPBPFB.js → chunk-IENHXJVB.js} +7 -7
- package/dist/_node-chunks/{chunk-EWOX7HPJ.js → chunk-IIGBIVK3.js} +6 -6
- package/dist/_node-chunks/{chunk-XGIUVY52.js → chunk-J6FGP2VM.js} +7 -7
- package/dist/_node-chunks/chunk-JOX7OETB.js +534 -0
- package/dist/_node-chunks/{chunk-RXNJDRGO.js → chunk-JR7ZCQ77.js} +21 -25
- package/dist/_node-chunks/{chunk-OISX4AGQ.js → chunk-JXZONVHW.js} +37 -31
- package/dist/_node-chunks/{chunk-34EO2PUT.js → chunk-KAALBGRE.js} +6 -6
- package/dist/_node-chunks/{chunk-SLWQNBGO.js → chunk-L52VGA36.js} +34 -949
- package/dist/_node-chunks/chunk-LAJIVWUF.js +497 -0
- package/dist/_node-chunks/{chunk-JGGFYIG5.js → chunk-LCNF6BLP.js} +7 -7
- package/dist/_node-chunks/chunk-LGHTKFSF.js +405 -0
- package/dist/_node-chunks/{chunk-WCULS5TP.js → chunk-LNGSV5UI.js} +7 -7
- package/dist/_node-chunks/{chunk-HMP2G23X.js → chunk-MC4BFUVH.js} +6 -6
- package/dist/_node-chunks/{chunk-SWO5CDYU.js → chunk-MWKSSYPG.js} +8 -8
- package/dist/_node-chunks/{chunk-2DSIDINN.js → chunk-N25CZ3RC.js} +650 -9
- package/dist/_node-chunks/{chunk-WZJF2OUH.js → chunk-N4LNGTYL.js} +7 -7
- package/dist/_node-chunks/{chunk-XI6B6P47.js → chunk-N5WU4BEY.js} +6 -6
- package/dist/_node-chunks/{chunk-TINO74G5.js → chunk-NRXCMSAI.js} +6 -6
- package/dist/_node-chunks/{chunk-E6YESGLX.js → chunk-NZWK62R5.js} +542 -1049
- package/dist/_node-chunks/{chunk-DHJFTB4K.js → chunk-OBPVOYJA.js} +7 -7
- package/dist/_node-chunks/{chunk-6KEHV53S.js → chunk-OMMQME7G.js} +33 -41
- package/dist/_node-chunks/chunk-PJRPETSU.js +62 -0
- package/dist/_node-chunks/{chunk-7GUDZVRQ.js → chunk-QDVIQG3B.js} +6 -6
- package/dist/_node-chunks/{chunk-OUW6R7C3.js → chunk-QEYWG5C7.js} +6 -6
- package/dist/_node-chunks/{chunk-GRBLDJCR.js → chunk-QQNRWEHL.js} +132 -149
- package/dist/_node-chunks/{chunk-EHUNOMDD.js → chunk-RAIWLNFA.js} +29849 -51588
- package/dist/_node-chunks/{chunk-JZOO7GGC.js → chunk-S7RGKBGT.js} +6 -6
- package/dist/_node-chunks/{chunk-GEFQN7K3.js → chunk-SFXFL4TP.js} +8 -8
- package/dist/_node-chunks/{chunk-JDXXX6LB.js → chunk-SPAHK37C.js} +6 -6
- package/dist/_node-chunks/chunk-SUQ4OM7Y.js +49 -0
- package/dist/_node-chunks/chunk-U54Q3F7E.js +20 -0
- package/dist/_node-chunks/{chunk-RWFIFGO5.js → chunk-UZH2V3WY.js} +8 -8
- package/dist/_node-chunks/{chunk-SVTBJ7Q3.js → chunk-VIMGLCNZ.js} +6 -6
- package/dist/_node-chunks/{chunk-BSKFCWQD.js → chunk-VNZF62KE.js} +7 -7
- package/dist/_node-chunks/{chunk-CCOTJ4FC.js → chunk-VPFU5CEP.js} +10 -10
- package/dist/_node-chunks/{chunk-RZMQ7S3L.js → chunk-VYCVBW5Q.js} +8 -8
- package/dist/_node-chunks/{chunk-ICPBH3E7.js → chunk-WDANLGYN.js} +7 -7
- package/dist/_node-chunks/{chunk-UMUBKI6E.js → chunk-WMZJ2WK4.js} +96 -177
- package/dist/_node-chunks/{chunk-LXBD4UL4.js → chunk-WTPHQ2NG.js} +8 -8
- package/dist/_node-chunks/chunk-WYCITRIE.js +11 -0
- package/dist/_node-chunks/chunk-WYRBOMQF.js +137 -0
- package/dist/_node-chunks/{chunk-ZWBCQ4MJ.js → chunk-WZBMPROH.js} +9 -17
- package/dist/_node-chunks/{chunk-CXRU72ET.js → chunk-X2GGQZIN.js} +6 -6
- package/dist/_node-chunks/chunk-X6OGIC2G.js +28 -0
- package/dist/_node-chunks/{chunk-42UWAGPW.js → chunk-XF7H5GZM.js} +52 -22
- package/dist/_node-chunks/{chunk-WNZ2UMFM.js → chunk-XUZB4FIX.js} +15 -9
- package/dist/_node-chunks/{chunk-3SDUYDXH.js → chunk-XVSUIOZA.js} +7 -7
- package/dist/_node-chunks/{chunk-TFEWM4E3.js → chunk-Z665R6AF.js} +75 -75
- package/dist/_node-chunks/{chunk-H4PPVMP5.js → chunk-ZEYZWDOS.js} +6 -6
- package/dist/_node-chunks/{chunk-UBOGWBEA.js → chunk-ZHRCL7PG.js} +10 -10
- package/dist/_node-chunks/chunk-ZLC4JSBV.js +25 -0
- package/dist/_node-chunks/{chunk-F3ZFKBHY.js → chunk-ZN6YOIB2.js} +8 -8
- package/dist/_node-chunks/{chunk-YCMRA6RX.js → chunk-ZX32M4O7.js} +7 -7
- package/dist/_node-chunks/{chunk-NDWKJ4CL.js → chunk-ZZ5XMIGW.js} +97 -111
- package/dist/_node-chunks/dist-HBFOS25E.js +16 -0
- package/dist/_node-chunks/dist-Q2XNFC24.js +27 -0
- package/dist/_node-chunks/{local-runtime-NTKIN2QT.js → local-runtime-4ETW6QTI.js} +19 -20
- package/dist/_node-chunks/{mdx-plugin-MWISDWDQ.js → mdx-plugin-OOYTYMVU.js} +2263 -130
- package/dist/_node-chunks/{monorepo-LIRFMQXE.js → monorepo-3AWUYNFD.js} +12 -12
- package/dist/_node-chunks/{monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js → monorepo-optimized-tests-relaxed-limits-no-story-deletion-ORY3BAP5.js} +12 -12
- package/dist/_node-chunks/optimized-tests-DOKSUJAM.js +22 -0
- package/dist/_node-chunks/{pattern-copy-play-EKHIUAU2.js → pattern-copy-play-AY4DE7ME.js} +12 -12
- package/dist/_node-chunks/postinstallAddon-L46G75CD.js +20 -0
- package/dist/_node-chunks/{rehype-external-links-BUN3HUCO.js → rehype-external-links-FGVC633L.js} +9 -9
- package/dist/_node-chunks/{rehype-slug-PLADX223.js → rehype-slug-2AZLMC5G.js} +9 -9
- package/dist/_node-chunks/{relaxed-limits-GBHW6KIQ.js → relaxed-limits-QI3YR6CU.js} +12 -12
- package/dist/_node-chunks/{run-NL66VTNR.js → run-QJJ4FOF3.js} +281 -19
- package/dist/_node-chunks/{run-KDTIZNSY.js → run-WFJZYNZN.js} +18 -18
- package/dist/_node-chunks/{setup-MGC7BQO6.js → setup-V5CRAJMV.js} +9 -9
- package/dist/_node-chunks/{vitest.config.4.template-JH2THZFG.js → vitest.config.4.template-LECBBF3L.js} +9 -9
- package/dist/actions/decorator.js +18 -22
- package/dist/actions/index.d.ts +4 -4
- package/dist/actions/index.js +3 -2
- package/dist/addon-a11y/index.d.ts +3 -3
- package/dist/addon-a11y/index.js +3 -2
- package/dist/addon-a11y/manager.js +41 -38
- package/dist/addon-a11y/preset.js +7 -7
- package/dist/addon-a11y/preview.d.ts +8 -2
- package/dist/addon-a11y/preview.js +3 -2
- package/dist/addon-comments/manager.js +353 -0
- package/dist/addon-comments/preset.js +52 -0
- package/dist/addon-comments/preview.js +101 -0
- package/dist/addon-docs/blocks.d.ts +123 -85
- package/dist/addon-docs/blocks.js +159 -85
- package/dist/addon-docs/index.d.ts +21 -21
- package/dist/addon-docs/index.js +3 -3
- package/dist/addon-docs/manager.js +6 -6
- package/dist/addon-docs/preset.js +12 -12
- package/dist/addon-docs/preview.d.ts +3 -1
- package/dist/addon-docs/preview.js +1 -1
- package/dist/addon-links/index.d.ts +2 -1
- package/dist/addon-links/index.js +5 -2
- package/dist/addon-links/preview.d.ts +1 -1
- package/dist/addon-links/preview.js +5 -2
- package/dist/addon-links/react/index.js +4 -1
- package/dist/addon-mcp/preset.js +176 -57
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +70 -70
- package/dist/addon-ondevice-actions/index.js +5 -1
- package/dist/addon-ondevice-actions/register.js +5 -1
- package/dist/addon-ondevice-controls/index.js +1 -1
- package/dist/addon-ondevice-controls/register.js +1 -1
- package/dist/addon-pseudo-states/index.d.ts +1 -1
- package/dist/addon-pseudo-states/index.js +1 -1
- package/dist/addon-pseudo-states/manager.js +2 -2
- package/dist/addon-pseudo-states/preview.d.ts +1 -1
- package/dist/addon-pseudo-states/preview.js +1 -1
- package/dist/addon-themes/index.d.ts +7 -6
- package/dist/addon-themes/index.js +2 -2
- package/dist/addon-themes/manager.js +4 -4
- package/dist/addon-themes/postinstall.js +7 -7
- package/dist/addon-themes/preview.js +2 -2
- package/dist/addon-vitest/constants.js +8 -8
- package/dist/addon-vitest/manager.js +32 -23
- package/dist/addon-vitest/node/coverage-reporter.js +11 -11
- package/dist/addon-vitest/node/vitest.js +35 -35
- package/dist/addon-vitest/postinstall.js +10 -10
- package/dist/addon-vitest/preset.js +22 -22
- package/dist/addon-vitest/vitest-plugin/global-setup.js +22 -22
- package/dist/addon-vitest/vitest-plugin/index.js +78 -68
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +3 -3
- package/dist/addon-vitest/vitest-plugin/setup-file.js +1 -1
- package/dist/babel/index.d.ts +241 -995
- package/dist/babel/index.js +13 -19
- package/dist/backgrounds/index.d.ts +1 -1
- package/dist/bin/core.js +118 -95
- package/dist/bin/dispatcher.js +18 -16
- package/dist/bin/loader.js +17 -16
- package/dist/builder-next/index.d.ts +59 -0
- package/dist/builder-next/index.js +201 -0
- package/dist/builder-vite/index.d.ts +8 -3
- package/dist/builder-vite/index.js +80 -25
- package/dist/builder-vite/preset.js +13 -13
- package/dist/channels/index.d.ts +3 -2
- package/dist/channels/index.js +97 -24
- package/dist/{chunk-Dr3R0DXk.d.ts → chunk-B-NVyPqN.d.ts} +2 -2
- package/dist/{chunk-DoIGKY33.d.ts → chunk-BLZXEm1K.d.ts} +6 -8
- package/dist/chunk-BcYKnZln.d.ts +10 -0
- package/dist/{chunk-DEVFdzxR.d.ts → chunk-BsO65uOb.d.ts} +4 -4
- package/dist/{chunk-BCoJQE-f.d.ts → chunk-BtKww7r1.d.ts} +6 -4
- package/dist/{chunk-Bpi2tz-6.d.ts → chunk-Bubi-WAs.d.ts} +20 -17
- package/dist/chunk-CDMZhRke.d.ts +30 -0
- package/dist/chunk-CFhJCPSB.d.ts +48 -0
- package/dist/{chunk-DtHByo32.d.ts → chunk-CFk6djyM.d.ts} +5 -5
- package/dist/{chunk-CMeX4WRe.d.ts → chunk-CT2iXaHz.d.ts} +1 -1
- package/dist/{chunk-pcFXCimE.d.ts → chunk-CmV7WZzR.d.ts} +124 -2
- package/dist/{chunk-B2t1tGRh.d.ts → chunk-D2CQlXaR.d.ts} +13 -15
- package/dist/{chunk-BGkgZp-H.d.ts → chunk-D3uSIa6H.d.ts} +9 -1
- package/dist/{chunk-DzuY9DXg.d.ts → chunk-DDd8BhTY.d.ts} +2 -2
- package/dist/{chunk-Dw1z1Pki.d.ts → chunk-DNCU78oW.d.ts} +160 -323
- package/dist/chunk-DVIvUVkS.d.ts +195 -0
- package/dist/{chunk-gCX81nOr.d.ts → chunk-DgzPaTw9.d.ts} +3 -3
- package/dist/{chunk-Kt1tW-D1.d.ts → chunk-Dm-iHJ-s.d.ts} +3 -3
- package/dist/{chunk-C-bavsOH.d.ts → chunk-Dw_4ad2Y.d.ts} +6 -6
- package/dist/{chunk-CwQKNaYL.d.ts → chunk-OksNJcvJ.d.ts} +2 -2
- package/dist/chunk-Susgfkap.d.ts +20 -0
- package/dist/{chunk-C2p5r3Vt.d.ts → chunk-ge-rSPy0.d.ts} +818 -701
- package/dist/{chunk-BXLImeLy.d.ts → chunk-r-Vjut9o.d.ts} +52 -11
- package/dist/cli/index.d.ts +14 -867
- package/dist/cli/index.js +47 -4962
- package/dist/cli/skills/content/index.d.ts +2 -2
- package/dist/cli/skills/content/index.js +2 -2
- package/dist/cli/tools/sdk/child-host.d.ts +1 -1
- package/dist/cli/tools/sdk/child-host.js +17 -17
- package/dist/cli/tools/sdk/index.d.ts +3 -3
- package/dist/cli/tools/sdk/index.js +18 -18
- package/dist/cli-commands/bin/index.js +7 -7
- package/dist/client-logger/index.d.ts +20 -21
- package/dist/client-logger/index.js +5 -2
- package/dist/common/index.d.ts +27 -39
- package/dist/common/index.js +35 -42
- package/dist/components/index.d.ts +86 -272
- package/dist/components/index.js +2759 -8547
- package/dist/core-events/index.d.ts +6 -4
- package/dist/core-events/index.js +5 -1
- package/dist/core-server/index.d.ts +58 -17
- package/dist/core-server/index.js +1500 -382
- package/dist/core-server/presets/common-manager.js +836 -1334
- package/dist/core-server/presets/common-override-preset.js +12 -10
- package/dist/core-server/presets/common-preset.js +100 -282
- package/dist/create/bin/index.js +7 -7
- package/dist/create/index.js +15 -15
- package/dist/csf/csf-utils.d.ts +1 -1
- package/dist/csf/index.d.ts +6 -6
- package/dist/csf/index.js +86 -154
- package/dist/csf-tools/index.d.ts +66 -54
- package/dist/csf-tools/index.js +18 -16
- package/dist/docs-tools/index.d.ts +332 -16
- package/dist/docs-tools/index.js +3 -3
- package/dist/highlight/index.d.ts +1 -1
- package/dist/instrumenter/index.d.ts +5 -5
- package/dist/instrumenter/index.js +31 -19
- package/dist/manager/_manager-chunks/{globals-runtime-BvM-NY2g.js → globals-runtime-B4NRbNSS.js} +638 -1731
- package/dist/{preview/_chunks/runtime-CqHxptiK.js → manager/_manager-chunks/globals-runtime-BC43T1rL.js} +3413 -173
- package/dist/manager/_manager-chunks/{globals-runtime-sGpNlIJ1.js → globals-runtime-BDkYPr00.js} +715 -620
- package/dist/manager/_manager-chunks/{globals-runtime-eLPTIfX-.js → globals-runtime-BnQ7i5wq.js} +232 -370
- package/dist/manager/_manager-chunks/{globals-runtime-Rp_zjGnh.js → globals-runtime-BnWjPJUH.js} +2 -2
- package/dist/manager/_manager-chunks/globals-runtime-BtduS2C2.js +10601 -0
- package/dist/manager/_manager-chunks/{globals-runtime-C02fvgcd.js → globals-runtime-Bv2PBsx6.js} +411 -379
- package/dist/manager/_manager-chunks/globals-runtime-BzuYs3dZ.js +1971 -0
- package/dist/manager/_manager-chunks/globals-runtime-CBviMKtt.js +446 -0
- package/dist/manager/_manager-chunks/globals-runtime-CS41oTca.js +1808 -0
- package/dist/manager/_manager-chunks/globals-runtime-CoTrrHG3.js +1163 -0
- package/dist/manager/_manager-chunks/{globals-runtime-qKvCZHFY.js → globals-runtime-D6tkG2NO.js} +1033 -621
- package/dist/manager/_manager-chunks/{globals-runtime-BmphMP6z.js → globals-runtime-D9zzVzSP.js} +11 -11
- package/dist/manager/_manager-chunks/{globals-runtime-FC201B7s.js → globals-runtime-DCmvKMN5.js} +2 -1
- package/dist/manager/_manager-chunks/{globals-runtime-DpNYC-qi.js → globals-runtime-DafcXCKU.js} +1013 -778
- package/dist/manager/_manager-chunks/globals-runtime-DgO0hT2p.js +32 -0
- package/dist/manager/_manager-chunks/globals-runtime-Me9Bl-sx.js +156 -0
- package/dist/manager/_manager-chunks/globals-runtime-nQMRiA0J.js +19 -0
- package/dist/manager/_manager-chunks/globals-runtime-oRjPg2jY.js +8935 -0
- package/dist/manager/_manager-chunks/{runtime-EITvVbkG.js → runtime-BdGkqNEt.js} +1 -2
- package/dist/manager/_manager-chunks/runtime-BhfRBP4G.js +294 -0
- package/dist/manager/_manager-chunks/runtime-BuPcYKCO.js +737 -0
- package/dist/manager/_manager-chunks/{runtime-eDVAYF7N.js → runtime-CGaGp83p.js} +57 -76
- package/dist/manager/_manager-chunks/{runtime-BhkT2CXl.js → runtime-CXROgt6G.js} +220 -406
- package/dist/manager/_manager-chunks/{runtime-i-PDAHLR.js → runtime-Cn5PJT3-.js} +741 -698
- package/dist/manager/_manager-chunks/{runtime-cp5pazY2.js → runtime-DJlTd1qE.js} +1717 -1536
- package/dist/manager/_manager-chunks/{runtime-D0UOWx0U.js → runtime-DTUm5K9J.js} +232 -158
- package/dist/manager/_manager-chunks/{runtime-D94Vq3oR.js → runtime-Dc6lf19c.js} +8 -534
- package/dist/manager/_manager-chunks/runtime-DmpQacrn.js +553 -0
- package/dist/manager/_manager-chunks/runtime-P663lpsR.js +528 -0
- package/dist/manager/_manager-chunks/runtime-mjv_40eH.js +201 -0
- package/dist/manager/globals-runtime.js +1 -1
- package/dist/manager/globals.d.ts +12 -12
- package/dist/manager/globals.js +12 -12
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +537 -527
- package/dist/manager-errors.d.ts +1 -1
- package/dist/manager-errors.js +2 -2
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +9 -9
- package/dist/mocking-utils/index.d.ts +7 -5
- package/dist/mocking-utils/index.js +34 -34
- package/dist/mocking-utils/mocker-runtime.js +2 -2
- package/dist/next/index.d.ts +231 -0
- package/dist/next/index.js +398 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +3 -1
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +4 -1
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +9 -1
- package/dist/nextjs-vite/export-mocks/router/index.js +13 -7
- package/dist/nextjs-vite/index.d.ts +4 -4
- package/dist/nextjs-vite/index.js +10 -5
- package/dist/nextjs-vite/node/index.d.ts +2 -2
- package/dist/nextjs-vite/node/index.js +7 -7
- package/dist/nextjs-vite/node-stand-ins/index.d.ts +68 -0
- package/dist/nextjs-vite/node-stand-ins/index.js +145 -0
- package/dist/nextjs-vite/preset.js +117 -15
- package/dist/nextjs-vite/preview.d.ts +2 -1
- package/dist/nextjs-vite/preview.js +1 -1
- package/dist/nextjs-vite/vite-plugin/index.d.ts +2 -2
- package/dist/nextjs-vite/vite-plugin/index.js +9 -9
- package/dist/nextjs-vite-plugin/index.d.ts +2 -3
- package/dist/nextjs-vite-plugin/index.js +24 -49
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +8 -8
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +2 -2
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +10 -6
- package/dist/node-logger/index.d.ts +83 -90
- package/dist/node-logger/index.js +11 -12
- package/dist/oxc-parser/index.js +15 -14
- package/dist/oxc-parser/worker.js +10 -10
- package/dist/{manager/_manager-chunks/globals-runtime-8HkdnU2F.js → preview/_chunks/runtime-BYRCSYBN.js} +4440 -179
- package/dist/preview/_chunks/{runtime-CsV4HZPV.js → runtime-BiYuZt-X.js} +392 -173
- package/dist/preview/_chunks/{runtime-BZSnICCg.js → runtime-Bvh_rfnQ.js} +29 -64
- package/dist/preview/_chunks/{runtime-iXdo8CR8.js → runtime-C88AzFBv.js} +772 -418
- package/dist/preview/_chunks/{runtime-DrTjJkPY.js → runtime-Cpzxe5eK.js} +447 -151
- package/dist/preview/_chunks/{runtime-q3wt0e_N.js → runtime-D2MPrqbU.js} +2 -2
- package/dist/preview/_chunks/{runtime-BIzIdDbb.js → runtime-DS0s7U3c.js} +482 -334
- package/dist/preview/_chunks/{runtime-CxZK_Ln3.js → runtime-MYVHRAoo.js} +3 -3
- package/dist/preview/globals.d.ts +10 -10
- package/dist/preview/globals.js +10 -10
- package/dist/preview/runtime.js +1 -1
- package/dist/preview-api/index.d.ts +3 -3
- package/dist/preview-api/index.js +12 -10
- package/dist/preview-errors.d.ts +1 -1
- package/dist/preview-errors.js +2 -2
- package/dist/react/docgen/docgen-worker.js +11 -12
- package/dist/react/entry-preview-argtypes.js +1 -1
- package/dist/react/entry-preview-docs.js +1 -1
- package/dist/react/entry-preview.js +2 -1
- package/dist/react/index.d.ts +9 -11
- package/dist/react/index.js +8 -6
- package/dist/react/preset.js +13 -14
- package/dist/react/preview.d.ts +1 -1
- package/dist/react/preview.js +5 -4
- package/dist/react-native/bin/get-stories.js +12 -12
- package/dist/react-native/index.d.ts +48 -47
- package/dist/react-native/index.js +64 -249
- package/dist/react-native/metro/node.d.ts +3 -3
- package/dist/react-native/metro/node.js +10 -9
- package/dist/react-native/metro/{withStorybook.d.ts → withForkbook.d.ts} +18 -18
- package/dist/react-native/metro/{withStorybook.js → withForkbook.js} +27 -26
- package/dist/react-native/preview.js +4 -1
- package/dist/react-native/scripts/generate.d.ts +1 -1
- package/dist/react-native/scripts/generate.js +8 -8
- package/dist/react-native/stub.js +1 -1
- package/dist/react-native-theming/index.d.ts +2 -58
- package/dist/react-native-theming/index.js +63 -2338
- package/dist/react-native-ui/index.d.ts +14 -14
- package/dist/react-native-ui/index.js +8 -15
- package/dist/react-native-ui-common/index.d.ts +32 -12
- package/dist/react-native-ui-common/index.js +26 -31
- package/dist/react-vite/index.d.ts +2 -2
- package/dist/react-vite/node/index.d.ts +3 -3
- package/dist/react-vite/node/index.js +7 -7
- package/dist/react-vite/preset.d.ts +3 -1
- package/dist/react-vite/preset.js +16 -9
- package/dist/router/index.d.ts +80 -3
- package/dist/router/index.js +66 -12
- package/dist/server-errors.d.ts +1 -1
- package/dist/server-errors.js +9 -9
- package/dist/shared/open-service/index.d.ts +3 -3
- package/dist/shared/open-service/index.js +2 -2
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +9 -9
- package/dist/shared/open-service/toolsets/docs/public.d.ts +28 -28
- package/dist/telemetry/index.d.ts +38 -274
- package/dist/telemetry/index.js +11 -68
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +765 -511
- package/dist/theming/create.d.ts +1 -1
- package/dist/theming/create.js +2 -1
- package/dist/theming/index.d.ts +6 -6
- package/dist/theming/index.js +41 -16
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +5 -5
- package/dist/viewport/index.d.ts +1 -1
- package/package.json +69 -69
- package/skills/setup/SKILL.md +14 -0
- package/skills/stories/SKILL.md +21 -0
- package/skills/write-story/SKILL.md +14 -0
- package/template/nextjs-vite/cli/js/Button.jsx +2 -2
- package/template/nextjs-vite/cli/js/Button.stories.js +6 -6
- package/template/nextjs-vite/cli/js/Configure.mdx +100 -100
- package/template/nextjs-vite/cli/js/Header.jsx +1 -1
- package/template/nextjs-vite/cli/js/Header.stories.js +2 -2
- package/template/nextjs-vite/cli/js/Page.jsx +3 -3
- package/template/nextjs-vite/cli/js/Page.stories.js +2 -2
- package/template/nextjs-vite/cli/ts/Button.stories.ts +6 -6
- package/template/nextjs-vite/cli/ts/Button.tsx +2 -2
- package/template/nextjs-vite/cli/ts/Configure.mdx +84 -84
- package/template/nextjs-vite/cli/ts/Header.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Header.tsx +1 -1
- package/template/nextjs-vite/cli/ts/Page.stories.ts +2 -2
- package/template/nextjs-vite/cli/ts/Page.tsx +3 -3
- package/template/react/cli/js/Button.jsx +2 -2
- package/template/react/cli/js/Button.stories.js +6 -6
- package/template/react/cli/js/Header.jsx +1 -1
- package/template/react/cli/js/Header.stories.js +2 -2
- package/template/react/cli/js/Page.jsx +3 -3
- package/template/react/cli/js/Page.stories.js +2 -2
- package/template/react/cli/ts/Button.stories.ts +6 -6
- package/template/react/cli/ts/Button.tsx +2 -2
- package/template/react/cli/ts/Header.stories.ts +2 -2
- package/template/react/cli/ts/Header.tsx +1 -1
- package/template/react/cli/ts/Page.stories.ts +2 -2
- package/template/react/cli/ts/Page.tsx +3 -3
- package/template/react-vite/cli/js/Button.jsx +2 -2
- package/template/react-vite/cli/js/Button.stories.js +6 -6
- package/template/react-vite/cli/js/Header.jsx +1 -1
- package/template/react-vite/cli/js/Header.stories.js +2 -2
- package/template/react-vite/cli/js/Page.jsx +3 -3
- package/template/react-vite/cli/js/Page.stories.js +2 -2
- package/template/react-vite/cli/ts/Button.stories.ts +6 -6
- package/template/react-vite/cli/ts/Button.tsx +2 -2
- package/template/react-vite/cli/ts/Header.stories.ts +2 -2
- package/template/react-vite/cli/ts/Header.tsx +1 -1
- package/template/react-vite/cli/ts/Page.stories.ts +2 -2
- package/template/react-vite/cli/ts/Page.tsx +3 -3
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +0 -1619
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +0 -20
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +0 -108
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +0 -1661
- package/dist/_node-chunks/chunk-2RU7BKEW.js +0 -23
- package/dist/_node-chunks/chunk-3BKIBF5S.js +0 -3008
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +0 -662
- package/dist/_node-chunks/chunk-5DQFEZEA.js +0 -40
- package/dist/_node-chunks/chunk-6LMWA44H.js +0 -3837
- package/dist/_node-chunks/chunk-BXVYT7SB.js +0 -36
- package/dist/_node-chunks/chunk-CQKMLL5J.js +0 -33
- package/dist/_node-chunks/chunk-FY6UXW6G.js +0 -11
- package/dist/_node-chunks/chunk-IDEL2J23.js +0 -23
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +0 -29
- package/dist/_node-chunks/chunk-MK2KYAI6.js +0 -5414
- package/dist/_node-chunks/chunk-NPO45IMH.js +0 -33
- package/dist/_node-chunks/chunk-QEQLR22M.js +0 -1877
- package/dist/_node-chunks/chunk-SIEXZVCR.js +0 -51
- package/dist/_node-chunks/chunk-TEQGGSP7.js +0 -33
- package/dist/_node-chunks/chunk-TFCEV2XX.js +0 -155
- package/dist/_node-chunks/chunk-W4OMYLSP.js +0 -1297
- package/dist/_node-chunks/chunk-WAXVSN3O.js +0 -18
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +0 -4731
- package/dist/_node-chunks/dist-VTSTZKUB.js +0 -16
- package/dist/_node-chunks/globby-OEMHPBFY.js +0 -2884
- package/dist/_node-chunks/jiti-NFX6UU74.js +0 -3848
- package/dist/_node-chunks/lib-MDVARD7W.js +0 -366
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +0 -22
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +0 -20
- package/dist/_node-chunks/session-id-KIIVOQLR.js +0 -23
- package/dist/chunk-BTVrWliM.d.ts +0 -115
- package/dist/chunk-BfBzpgct.d.ts +0 -916
- package/dist/chunk-BxWufQms.d.ts +0 -142
- package/dist/chunk-DaVb55-_.d.ts +0 -124
- package/dist/core-server/presets/common-manager.css +0 -170
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +0 -3389
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +0 -9766
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +0 -5357
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +0 -10463
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +0 -452
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +0 -22
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +0 -998
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +0 -77
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +0 -1102
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +0 -63
- package/dist/preview/_chunks/runtime-DZToXfvO.js +0 -9767
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +0 -387
package/dist/babel/index.d.ts
CHANGED
|
@@ -1,299 +1,8 @@
|
|
|
1
|
-
import { $ as DeclareModuleExports, $i as TSTypeAnnotation, $n as NumberLiteralTypeAnnotation, $r as TSAsExpression, $t as Identifier, A as ClassBody, Aa as TypeParameterInstantiation, Ai as TSModuleBlock, An as JSXSpreadAttribute, Ar as QualifiedTypeIdentifier, At as ExportSpecifier, B as CompletionStatement, Ba as VariableDeclarator, Bi as TSParameterProperty, Bn as Method, Br as SpreadProperty$1, Bt as For, C as BooleanLiteralTypeAnnotation, Ca as TupleExpression, Ci as TSInterfaceBody, Cn as JSXExpressionContainer, Cr as PipelineTopicExpression, Ct as ExistsTypeAnnotation, D as CatchClause, Da as TypeCastExpression, Di as TSLiteralType, Dn as JSXNamespacedName, Dr as Program, Dt as ExportDefaultSpecifier, E as CallExpression, Ea as TypeAnnotation, Ei as TSIntrinsicKeyword, En as JSXMemberExpression, Er as PrivateName, Et as ExportDefaultDeclaration, F as ClassPrivateMethod, Fa as UnionTypeAnnotation, Fi as TSNonNullExpression, Fn as Literal, Fr as RestProperty$1, Ft as Flow, G as DecimalLiteral, Ga as WhileStatement, Gi as TSSatisfiesExpression, Gn as ModuleSpecifier, Gr as StringLiteralTypeAnnotation, Gt as Function, H as ConditionalExpression, Ha as VoidPattern, Hi as TSPropertySignature, Hn as MixedTypeAnnotation, Hr as Statement, Ht as ForOfStatement, I as ClassPrivateProperty, Ia as UpdateExpression, Ii as TSNullKeyword, In as LogicalExpression, Ir as ReturnStatement, It as FlowBaseAnnotation, J as DeclareExportAllDeclaration, Ja as index_d_exports
|
|
1
|
+
import { $ as DeclareModuleExports, $i as TSTypeAnnotation, $n as NumberLiteralTypeAnnotation, $r as TSAsExpression, $t as Identifier, A as ClassBody, Aa as TypeParameterInstantiation, Ai as TSModuleBlock, An as JSXSpreadAttribute, Ar as QualifiedTypeIdentifier, At as ExportSpecifier, B as CompletionStatement, Ba as VariableDeclarator, Bi as TSParameterProperty, Bn as Method, Br as SpreadProperty$1, Bt as For, C as BooleanLiteralTypeAnnotation, Ca as TupleExpression, Ci as TSInterfaceBody, Cn as JSXExpressionContainer, Cr as PipelineTopicExpression, Ct as ExistsTypeAnnotation, D as CatchClause, Da as TypeCastExpression, Di as TSLiteralType, Dn as JSXNamespacedName, Dr as Program, Dt as ExportDefaultSpecifier, E as CallExpression, Ea as TypeAnnotation, Ei as TSIntrinsicKeyword, En as JSXMemberExpression, Er as PrivateName, Et as ExportDefaultDeclaration, F as ClassPrivateMethod, Fa as UnionTypeAnnotation, Fi as TSNonNullExpression, Fn as Literal, Fr as RestProperty$1, Ft as Flow, G as DecimalLiteral, Ga as WhileStatement, Gi as TSSatisfiesExpression, Gn as ModuleSpecifier, Gr as StringLiteralTypeAnnotation, Gt as Function, H as ConditionalExpression, Ha as VoidPattern, Hi as TSPropertySignature, Hn as MixedTypeAnnotation, Hr as Statement, Ht as ForOfStatement, I as ClassPrivateProperty, Ia as UpdateExpression, Ii as TSNullKeyword, In as LogicalExpression, Ir as ReturnStatement, It as FlowBaseAnnotation, J as DeclareExportAllDeclaration, Ja as index_d_exports, Ji as TSTemplateLiteralType, Jn as Noop, Jr as SwitchCase, Jt as FunctionParameter, K as Declaration, Ka as WithStatement, Ki as TSStringKeyword, Kn as NewExpression, Kr as StringTypeAnnotation, Kt as FunctionDeclaration, L as ClassProperty, La as UserWhitespacable, Li as TSNumberKeyword, Ln as Loop, Lr as Scopable, Lt as FlowDeclaration, M as ClassExpression, Ma as TypeofTypeAnnotation, Mi as TSNamedTupleMember, Mn as JSXText, Mr as RegExpLiteral, Mt as ExpressionStatement, N as ClassImplements, Na as UnaryExpression, Ni as TSNamespaceExportDeclaration, Nn as LVal, Nr as RegexLiteral$1, Nt as ExpressionWrapper, O as Class, Oa as TypeParameter, Oi as TSMappedType, On as JSXOpeningElement, Or as Property, Ot as ExportNamedDeclaration, P as ClassMethod, Pa as UnaryLike, Pi as TSNeverKeyword, Pn as LabeledStatement, Pr as RestElement, Pt as File, Q as DeclareModule, Qi as TSTypeAliasDeclaration, Qn as NumberLiteral$1, Qr as TSArrayType, Qt as GenericTypeAnnotation, R as Comment, Ra as V8IntrinsicIdentifier, Ri as TSObjectKeyword, Rn as MemberExpression, Rr as SequenceExpression, Rt as FlowPredicate, S as BooleanLiteral, Sa as TryStatement, Si as TSInstantiationExpression, Sn as JSXEmptyExpression, Sr as PipelinePrimaryTopicReference, St as EnumSymbolBody, T as BreakStatement, Ta as TypeAlias, Ti as TSIntersectionType, Tn as JSXIdentifier, Tr as Private, Tt as ExportDeclaration, U as ContinueStatement, Ua as VoidTypeAnnotation, Ui as TSQualifiedName, Un as ModuleDeclaration, Ur as StaticBlock, Ut as ForStatement, V as Conditional, Va as Variance, Vi as TSParenthesizedType, Vn as Miscellaneous, Vr as Standardized, Vt as ForInStatement, W as DebuggerStatement, Wa as While, Wi as TSRestType, Wn as ModuleExpression, Wr as StringLiteral, Wt as ForXStatement, X as DeclareFunction, Xi as TSTupleType, Xn as NullLiteralTypeAnnotation, Xr as SymbolTypeAnnotation, Xt as FunctionTypeAnnotation, Y as DeclareExportDeclaration, Yi as TSThisType, Yn as NullLiteral, Yr as SwitchStatement, Yt as FunctionParent, Z as DeclareInterface, Zi as TSType, Zn as NullableTypeAnnotation, Zr as TSAnyKeyword, Zt as FunctionTypeParam, _ as BinaryExpression, _a as Terminatorless, _i as TSImportEqualsDeclaration, _n as JSX, _r as Options$1, _t as EnumMember, a as Aliases, aa as TSTypeParameterDeclaration, ai as TSConstructSignatureDeclaration, an as ImportDefaultSpecifier, ar as ObjectPattern, at as DeprecatedAliases, b as BlockParent, ba as ThrowStatement, bi as TSIndexedAccessType, bn as JSXClosingFragment, br as PatternLike, bt as EnumStringBody, c as ArrayExpression, ca as TSTypeQuery, ci as TSDeclareMethod, cn as ImportOrExportDeclaration, cr as ObjectTypeCallProperty, ct as DoExpression, d as ArrowFunctionExpression, da as TSUnionType, di as TSEnumDeclaration, dn as InferredPredicate, dr as ObjectTypeProperty, dt as EmptyTypeAnnotation, ea as TSTypeAssertion, ei as TSBaseType, en as IfStatement, er as NumberTypeAnnotation, et as DeclareOpaqueType, f as AssignmentExpression, fa as TSUnknownKeyword, fi as TSEnumMember, fn as InterfaceDeclaration, fr as ObjectTypeSpreadProperty, ft as EnumBody, g as Binary, ga as TemplateLiteral, gi as TSFunctionType, gn as IntersectionTypeAnnotation, gr as OptionalMemberExpression, gt as EnumDefaultedMember, h as BigIntLiteral, ha as TemplateElement, hi as TSExternalModuleReference, hn as InterpreterDirective, hr as OptionalIndexedAccessType, ht as EnumDeclaration, i as Accessor, ia as TSTypeParameter, ii as TSConditionalType, in as ImportDeclaration, ir as ObjectMethod, it as Decorator, j as ClassDeclaration, ja as TypeScript, ji as TSModuleDeclaration, jn as JSXSpreadChild, jr as RecordExpression, jt as Expression, k as ClassAccessorProperty, ka as TypeParameterDeclaration, ki as TSMethodSignature, kn as JSXOpeningFragment, kr as Pureish, kt as ExportNamespaceSpecifier, l as ArrayPattern, la as TSTypeReference, li as TSEntityName, ln as ImportSpecifier, lr as ObjectTypeIndexer, lt as DoWhileStatement, m as AwaitExpression, ma as TaggedTemplateExpression, mi as TSExpressionWithTypeArguments, mn as InterfaceTypeAnnotation, mr as OptionalCallExpression, mt as EnumBooleanMember, na as TSTypeLiteral, ni as TSBooleanKeyword, nn as Import, nr as ObjectExpression, nt as DeclareVariable, o as AnyTypeAnnotation, oa as TSTypeParameterInstantiation, oi as TSConstructorType, on as ImportExpression, or as ObjectProperty, ot as Directive, p as AssignmentPattern, pa as TSVoidKeyword, pi as TSExportAssignment, pn as InterfaceExtends, pr as OpaqueType, pt as EnumBooleanBody, q as DeclareClass, qa as YieldExpression, qi as TSSymbolKeyword, qn as Node, qr as Super, qt as FunctionExpression, r as generate$1, ra as TSTypeOperator, ri as TSCallSignatureDeclaration, rn as ImportAttribute, rr as ObjectMember, rt as DeclaredPredicate, s as ArgumentPlaceholder, sa as TSTypePredicate, si as TSDeclareFunction, sn as ImportNamespaceSpecifier, sr as ObjectTypeAnnotation, st as DirectiveLiteral, t as GeneratorOptions, ta as TSTypeElement, ti as TSBigIntKeyword, tn as Immutable, tr as NumericLiteral, tt as DeclareTypeAlias, u as ArrayTypeAnnotation, ua as TSUndefinedKeyword, ui as TSEnumBody, un as IndexedAccessType, ur as ObjectTypeInternalSlot, ut as EmptyStatement, v as BindExpression, va as ThisExpression, vi as TSImportType, vn as JSXAttribute, vr as ParenthesizedExpression, vt as EnumNumberBody, w as BooleanTypeAnnotation, wa as TupleTypeAnnotation, wi as TSInterfaceDeclaration, wn as JSXFragment, wr as Placeholder, wt as ExportAllDeclaration, x as BlockStatement, xa as TopicReference, xi as TSInferType, xn as JSXElement, xr as PipelineBareFunction, xt as EnumStringMember, y as Block, ya as ThisTypeAnnotation, yi as TSIndexSignature, yn as JSXClosingElement, yr as Pattern, yt as EnumNumberMember, z as CommentTypeShorthand, za as VariableDeclaration, zi as TSOptionalType, zn as MetaProperty, zr as SpreadElement, zt as FlowType } from "../chunk-D7DwV41f.js";
|
|
2
2
|
import * as recast from "recast";
|
|
3
3
|
import { Options as RecastOptions } from "recast";
|
|
4
4
|
|
|
5
|
-
//#region ../../node_modules/@babel/parser/typings/babel-parser.d.ts
|
|
6
|
-
declare namespace babel_parser_d_exports {
|
|
7
|
-
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult$1 as ParseResult, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse$1 as parse, parseExpression, tokTypes };
|
|
8
|
-
}
|
|
9
|
-
declare class Position {
|
|
10
|
-
line: number;
|
|
11
|
-
column: number;
|
|
12
|
-
index: number;
|
|
13
|
-
constructor(line: number, col: number, index: number);
|
|
14
|
-
}
|
|
15
|
-
type SyntaxPlugin = "flow" | "typescript" | "jsx" | "functionBind" | "pipelineOperator" | "placeholders";
|
|
16
|
-
type ParseErrorCode = "BABEL_PARSER_SYNTAX_ERROR" | "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
|
|
17
|
-
interface ParseErrorSpecification<ErrorDetails> {
|
|
18
|
-
code: ParseErrorCode;
|
|
19
|
-
reasonCode: string;
|
|
20
|
-
syntaxPlugin?: SyntaxPlugin;
|
|
21
|
-
missingPlugin?: string | string[];
|
|
22
|
-
loc: Position;
|
|
23
|
-
details: ErrorDetails;
|
|
24
|
-
pos: number;
|
|
25
|
-
}
|
|
26
|
-
type ParseError$1<ErrorDetails> = SyntaxError & ParseErrorSpecification<ErrorDetails>;
|
|
27
|
-
type BABEL_8_BREAKING = false;
|
|
28
|
-
type IF_BABEL_7<V> = false extends BABEL_8_BREAKING ? V : never;
|
|
29
|
-
type Plugin$1 = "asyncDoExpressions" | IF_BABEL_7<"asyncGenerators"> | IF_BABEL_7<"bigInt"> | IF_BABEL_7<"classPrivateMethods"> | IF_BABEL_7<"classPrivateProperties"> | IF_BABEL_7<"classProperties"> | IF_BABEL_7<"classStaticBlock"> | IF_BABEL_7<"decimal"> | "decorators-legacy" | "deferredImportEvaluation" | "decoratorAutoAccessors" | "destructuringPrivate" | IF_BABEL_7<"deprecatedImportAssert"> | "doExpressions" | IF_BABEL_7<"dynamicImport"> | IF_BABEL_7<"explicitResourceManagement"> | "exportDefaultFrom" | IF_BABEL_7<"exportNamespaceFrom"> | "flow" | "flowComments" | "functionBind" | "functionSent" | "importMeta" | "jsx" | IF_BABEL_7<"jsonStrings"> | IF_BABEL_7<"logicalAssignment"> | IF_BABEL_7<"importAssertions"> | IF_BABEL_7<"importReflection"> | "moduleBlocks" | IF_BABEL_7<"moduleStringNames"> | IF_BABEL_7<"nullishCoalescingOperator"> | IF_BABEL_7<"numericSeparator"> | IF_BABEL_7<"objectRestSpread"> | IF_BABEL_7<"optionalCatchBinding"> | IF_BABEL_7<"optionalChaining"> | "partialApplication" | "placeholders" | IF_BABEL_7<"privateIn"> | IF_BABEL_7<"regexpUnicodeSets"> | "sourcePhaseImports" | "throwExpressions" | IF_BABEL_7<"topLevelAwait"> | "v8intrinsic" | ParserPluginWithOptions[0];
|
|
30
|
-
type ParserPluginWithOptions = ["decorators", DecoratorsPluginOptions] | ["discardBinding", {
|
|
31
|
-
syntaxType: "void";
|
|
32
|
-
}] | ["estree", {
|
|
33
|
-
classFeatures?: boolean;
|
|
34
|
-
}] | IF_BABEL_7<["importAttributes", {
|
|
35
|
-
deprecatedAssertSyntax: boolean;
|
|
36
|
-
}]> | IF_BABEL_7<["moduleAttributes", {
|
|
37
|
-
version: "may-2020";
|
|
38
|
-
}]> | ["optionalChainingAssign", {
|
|
39
|
-
version: "2023-07";
|
|
40
|
-
}] | ["pipelineOperator", PipelineOperatorPluginOptions] | ["recordAndTuple", RecordAndTuplePluginOptions] | ["flow", FlowPluginOptions] | ["typescript", TypeScriptPluginOptions];
|
|
41
|
-
type PluginConfig = Plugin$1 | ParserPluginWithOptions;
|
|
42
|
-
interface DecoratorsPluginOptions {
|
|
43
|
-
decoratorsBeforeExport?: boolean;
|
|
44
|
-
allowCallParenthesized?: boolean;
|
|
45
|
-
}
|
|
46
|
-
interface PipelineOperatorPluginOptions {
|
|
47
|
-
proposal: BABEL_8_BREAKING extends false ? "minimal" | "fsharp" | "hack" | "smart" : "fsharp" | "hack";
|
|
48
|
-
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
|
49
|
-
}
|
|
50
|
-
interface RecordAndTuplePluginOptions {
|
|
51
|
-
syntaxType: "bar" | "hash";
|
|
52
|
-
}
|
|
53
|
-
type FlowPluginOptions = BABEL_8_BREAKING extends true ? {
|
|
54
|
-
all?: boolean;
|
|
55
|
-
enums?: boolean;
|
|
56
|
-
} : {
|
|
57
|
-
all?: boolean;
|
|
58
|
-
};
|
|
59
|
-
interface TypeScriptPluginOptions {
|
|
60
|
-
dts?: boolean;
|
|
61
|
-
disallowAmbiguousJSXLike?: boolean;
|
|
62
|
-
}
|
|
63
|
-
type Plugin = PluginConfig;
|
|
64
|
-
type SourceType = "script" | "commonjs" | "module" | "unambiguous";
|
|
65
|
-
interface Options {
|
|
66
|
-
/**
|
|
67
|
-
* By default, import and export declarations can only appear at a program's top level.
|
|
68
|
-
* Setting this option to true allows them anywhere where a statement is allowed.
|
|
69
|
-
*/
|
|
70
|
-
allowImportExportEverywhere?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* By default, await use is not allowed outside of an async function.
|
|
73
|
-
* Set this to true to accept such code.
|
|
74
|
-
*/
|
|
75
|
-
allowAwaitOutsideFunction?: boolean;
|
|
76
|
-
/**
|
|
77
|
-
* By default, a return statement at the top level raises an error.
|
|
78
|
-
* Set this to true to accept such code.
|
|
79
|
-
*/
|
|
80
|
-
allowReturnOutsideFunction?: boolean;
|
|
81
|
-
/**
|
|
82
|
-
* By default, new.target use is not allowed outside of a function or class.
|
|
83
|
-
* Set this to true to accept such code.
|
|
84
|
-
*/
|
|
85
|
-
allowNewTargetOutsideFunction?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* By default, super calls are not allowed outside of a method.
|
|
88
|
-
* Set this to true to accept such code.
|
|
89
|
-
*/
|
|
90
|
-
allowSuperOutsideMethod?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* By default, exported identifiers must refer to a declared variable.
|
|
93
|
-
* Set this to true to allow export statements to reference undeclared variables.
|
|
94
|
-
*/
|
|
95
|
-
allowUndeclaredExports?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* By default, yield use is not allowed outside of a generator function.
|
|
98
|
-
* Set this to true to accept such code.
|
|
99
|
-
*/
|
|
100
|
-
allowYieldOutsideFunction?: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* By default, Babel parser JavaScript code according to Annex B syntax.
|
|
103
|
-
* Set this to `false` to disable such behavior.
|
|
104
|
-
*/
|
|
105
|
-
annexB?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* By default, Babel attaches comments to adjacent AST nodes.
|
|
108
|
-
* When this option is set to false, comments are not attached.
|
|
109
|
-
* It can provide up to 30% performance improvement when the input code has many comments.
|
|
110
|
-
* @babel/eslint-parser will set it for you.
|
|
111
|
-
* It is not recommended to use attachComment: false with Babel transform,
|
|
112
|
-
* as doing so removes all the comments in output code, and renders annotations such as
|
|
113
|
-
* /* istanbul ignore next *\/ nonfunctional.
|
|
114
|
-
*/
|
|
115
|
-
attachComment?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* By default, Babel always throws an error when it finds some invalid code.
|
|
118
|
-
* When this option is set to true, it will store the parsing error and
|
|
119
|
-
* try to continue parsing the invalid input file.
|
|
120
|
-
*/
|
|
121
|
-
errorRecovery?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* Indicate the mode the code should be parsed in.
|
|
124
|
-
* Can be one of "script", "commonjs", "module", or "unambiguous". Defaults to "script".
|
|
125
|
-
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
|
126
|
-
* of ES6 import or export statements.
|
|
127
|
-
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
|
128
|
-
*
|
|
129
|
-
* Use "commonjs" to parse code that is intended to be run in a CommonJS environment such as Node.js.
|
|
130
|
-
*/
|
|
131
|
-
sourceType?: SourceType;
|
|
132
|
-
/**
|
|
133
|
-
* Correlate output AST nodes with their source filename.
|
|
134
|
-
* Useful when generating code and source maps from the ASTs of multiple input files.
|
|
135
|
-
*/
|
|
136
|
-
sourceFilename?: string;
|
|
137
|
-
/**
|
|
138
|
-
* By default, all source indexes start from 0.
|
|
139
|
-
* You can provide a start index to alternatively start with.
|
|
140
|
-
* Useful for integration with other source tools.
|
|
141
|
-
*/
|
|
142
|
-
startIndex?: number;
|
|
143
|
-
/**
|
|
144
|
-
* By default, the first line of code parsed is treated as line 1.
|
|
145
|
-
* You can provide a line number to alternatively start with.
|
|
146
|
-
* Useful for integration with other source tools.
|
|
147
|
-
*/
|
|
148
|
-
startLine?: number;
|
|
149
|
-
/**
|
|
150
|
-
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
|
151
|
-
* You can provide a column number to alternatively start with.
|
|
152
|
-
* Useful for integration with other source tools.
|
|
153
|
-
*/
|
|
154
|
-
startColumn?: number;
|
|
155
|
-
/**
|
|
156
|
-
* Array containing the plugins that you want to enable.
|
|
157
|
-
*/
|
|
158
|
-
plugins?: Plugin[];
|
|
159
|
-
/**
|
|
160
|
-
* Should the parser work in strict mode.
|
|
161
|
-
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
|
162
|
-
*/
|
|
163
|
-
strictMode?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Adds a ranges property to each node: [node.start, node.end]
|
|
166
|
-
*/
|
|
167
|
-
ranges?: boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Adds all parsed tokens to a tokens property on the File node.
|
|
170
|
-
*/
|
|
171
|
-
tokens?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* By default, the parser adds information about parentheses by setting
|
|
174
|
-
* `extra.parenthesized` to `true` as needed.
|
|
175
|
-
* When this option is `true` the parser creates `ParenthesizedExpression`
|
|
176
|
-
* AST nodes instead of using the `extra` property.
|
|
177
|
-
*/
|
|
178
|
-
createParenthesizedExpressions?: boolean;
|
|
179
|
-
/**
|
|
180
|
-
* The default is false in Babel 7 and true in Babel 8
|
|
181
|
-
* Set this to true to parse it as an `ImportExpression` node.
|
|
182
|
-
* Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
|
|
183
|
-
*/
|
|
184
|
-
createImportExpressions?: boolean;
|
|
185
|
-
}
|
|
186
|
-
type ParserOptions = Partial<Options>;
|
|
187
|
-
type ParseError = ParseError$1<object>;
|
|
188
|
-
type ParseResult$1<Result extends File | Expression = File> = Result & {
|
|
189
|
-
comments: File["comments"];
|
|
190
|
-
errors: null | ParseError[];
|
|
191
|
-
tokens?: File["tokens"];
|
|
192
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Parse the provided code as an entire ECMAScript program.
|
|
195
|
-
*/
|
|
196
|
-
declare function parse$1(input: string, options?: ParserOptions): ParseResult$1<File>;
|
|
197
|
-
declare function parseExpression(input: string, options?: ParserOptions): ParseResult$1<Expression>;
|
|
198
|
-
declare const tokTypes: {
|
|
199
|
-
// todo(flow->ts) real token type
|
|
200
|
-
[name: string]: any;
|
|
201
|
-
};
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region ../../node_modules/@types/babel__template/index.d.ts
|
|
204
|
-
interface TemplateBuilderOptions extends ParserOptions {
|
|
205
|
-
/**
|
|
206
|
-
* A set of placeholder names to automatically accept.
|
|
207
|
-
* Items in this list do not need to match `placeholderPattern`.
|
|
208
|
-
*
|
|
209
|
-
* This option cannot be used when using `%%foo%%` style placeholders.
|
|
210
|
-
*/
|
|
211
|
-
placeholderWhitelist?: Set<string> | null | undefined;
|
|
212
|
-
/**
|
|
213
|
-
* A pattern to search for when looking for `Identifier` and `StringLiteral`
|
|
214
|
-
* nodes that should be considered as placeholders.
|
|
215
|
-
*
|
|
216
|
-
* `false` will disable placeholder searching placeholders, leaving only
|
|
217
|
-
* the `placeholderWhitelist` value to find replacements.
|
|
218
|
-
*
|
|
219
|
-
* This option cannot be used when using `%%foo%%` style placeholders.
|
|
220
|
-
*
|
|
221
|
-
* @default /^[_$A-Z0-9]+$/
|
|
222
|
-
*/
|
|
223
|
-
placeholderPattern?: RegExp | false | null | undefined;
|
|
224
|
-
/**
|
|
225
|
-
* Set this to `true` to preserve comments from the template string
|
|
226
|
-
* into the resulting AST, or `false` to automatically discard comments.
|
|
227
|
-
*
|
|
228
|
-
* @default false
|
|
229
|
-
*/
|
|
230
|
-
preserveComments?: boolean | null | undefined;
|
|
231
|
-
/**
|
|
232
|
-
* Set to `true` to use `%%foo%%` style placeholders, `false` to use legacy placeholders
|
|
233
|
-
* described by `placeholderPattern` or `placeholderWhitelist`.
|
|
234
|
-
*
|
|
235
|
-
* When it is not set, it behaves as `true` if there are syntactic placeholders, otherwise as `false`.
|
|
236
|
-
*
|
|
237
|
-
* @since 7.4.0
|
|
238
|
-
*/
|
|
239
|
-
syntacticPlaceholders?: boolean | null | undefined;
|
|
240
|
-
}
|
|
241
|
-
interface TemplateBuilder<T> {
|
|
242
|
-
/**
|
|
243
|
-
* Build a new builder, merging the given options with the previous ones.
|
|
244
|
-
*/
|
|
245
|
-
(opts: TemplateBuilderOptions): TemplateBuilder<T>;
|
|
246
|
-
/**
|
|
247
|
-
* Building from a string produces an AST builder function by default.
|
|
248
|
-
*/
|
|
249
|
-
(code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T;
|
|
250
|
-
/**
|
|
251
|
-
* Building from a template literal produces an AST builder function by default.
|
|
252
|
-
*/
|
|
253
|
-
(tpl: TemplateStringsArray, ...args: unknown[]): (arg?: PublicReplacements) => T;
|
|
254
|
-
/**
|
|
255
|
-
* Allow users to explicitly create templates that produce ASTs,
|
|
256
|
-
* skipping the need for an intermediate function.
|
|
257
|
-
*
|
|
258
|
-
* Does not allow `%%foo%%` style placeholders.
|
|
259
|
-
*/
|
|
260
|
-
ast: {
|
|
261
|
-
(tpl: string, opts?: TemplateBuilderOptions): T;
|
|
262
|
-
(tpl: TemplateStringsArray, ...args: unknown[]): T;
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
type PublicReplacements = {
|
|
266
|
-
[index: string]: unknown;
|
|
267
|
-
} | unknown[];
|
|
268
|
-
declare const smart: TemplateBuilder<Statement | Statement[]>;
|
|
269
|
-
declare const statement: TemplateBuilder<Statement>;
|
|
270
|
-
declare const statements: TemplateBuilder<Statement[]>;
|
|
271
|
-
declare const expression: TemplateBuilder<Expression>;
|
|
272
|
-
declare const program: TemplateBuilder<Program>;
|
|
273
|
-
type DefaultTemplateBuilder = typeof smart & {
|
|
274
|
-
smart: typeof smart;
|
|
275
|
-
statement: typeof statement;
|
|
276
|
-
statements: typeof statements;
|
|
277
|
-
expression: typeof expression;
|
|
278
|
-
program: typeof program;
|
|
279
|
-
ast: typeof smart.ast;
|
|
280
|
-
};
|
|
281
|
-
declare const templateBuilder: DefaultTemplateBuilder;
|
|
282
|
-
//#endregion
|
|
283
5
|
//#region ../../node_modules/@types/babel__traverse/index.d.ts
|
|
284
|
-
declare const traverse$1: {
|
|
285
|
-
<S>(parent: Node$1, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath): void;
|
|
286
|
-
(parent: Node$1, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
|
|
287
|
-
visitors: typeof visitors;
|
|
288
|
-
verify: typeof visitors.verify;
|
|
289
|
-
explode: typeof visitors.explode;
|
|
290
|
-
cheap: (node: Node$1, enter: (node: Node$1) => void) => void;
|
|
291
|
-
node: (node: Node$1, opts: TraverseOptions, scope?: Scope, state?: any, path?: NodePath, skipKeys?: Record<string, boolean>) => void;
|
|
292
|
-
clearNode: (node: Node$1, opts?: Options$1) => void;
|
|
293
|
-
removeProperties: (tree: Node$1, opts?: Options$1) => Node$1;
|
|
294
|
-
hasType: (tree: Node$1, type: Node$1["type"], denylistTypes?: string[]) => boolean;
|
|
295
|
-
cache: typeof cache;
|
|
296
|
-
};
|
|
297
6
|
declare namespace visitors {
|
|
298
7
|
/**
|
|
299
8
|
* `explode()` will take a `Visitor` object with all of the various shorthands
|
|
@@ -309,21 +18,21 @@ declare namespace visitors {
|
|
|
309
18
|
* - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
|
|
310
19
|
* - `enter` and `exit` functions are wrapped in arrays, to ease merging of visitors
|
|
311
20
|
*/
|
|
312
|
-
function explode<S = unknown>(visitor: Visitor<S>): { [Type in Exclude<Node
|
|
21
|
+
function explode<S = unknown>(visitor: Visitor<S>): { [Type in Exclude<Node, DeprecatedAliases>["type"]]?: VisitNodeObject<S, Extract<Node, {
|
|
313
22
|
type: Type;
|
|
314
23
|
}>> };
|
|
315
24
|
function verify(visitor: Visitor): void;
|
|
316
25
|
function merge<State>(visitors: Array<Visitor<State>>): Visitor<State>;
|
|
317
|
-
function merge(visitors: Visitor[], states?: any[], wrapper?: (stateKey: any, visitorKey: keyof Visitor, func: VisitNodeFunction<unknown, Node
|
|
26
|
+
function merge(visitors: Visitor[], states?: any[], wrapper?: (stateKey: any, visitorKey: keyof Visitor, func: VisitNodeFunction<unknown, Node>) => VisitNodeFunction<unknown, Node> | null): Visitor;
|
|
318
27
|
}
|
|
319
28
|
declare namespace cache {
|
|
320
|
-
let path: WeakMap<Node
|
|
321
|
-
let scope: WeakMap<Node
|
|
29
|
+
let path: WeakMap<Node, Map<Node, NodePath>>;
|
|
30
|
+
let scope: WeakMap<Node, Scope>;
|
|
322
31
|
function clear(): void;
|
|
323
32
|
function clearPath(): void;
|
|
324
33
|
function clearScope(): void;
|
|
325
34
|
}
|
|
326
|
-
type TraverseOptions<S = Node
|
|
35
|
+
type TraverseOptions<S = Node> = {
|
|
327
36
|
scope?: Scope;
|
|
328
37
|
noScope?: boolean;
|
|
329
38
|
denylist?: NodeType[]; /** @deprecated will be removed in Babel 8 */
|
|
@@ -338,9 +47,9 @@ declare class Scope {
|
|
|
338
47
|
constructor(path: NodePath, parentScope?: Scope);
|
|
339
48
|
uid: number;
|
|
340
49
|
path: NodePath;
|
|
341
|
-
block: Node
|
|
50
|
+
block: Node;
|
|
342
51
|
labels: Map<string, NodePath<LabeledStatement>>;
|
|
343
|
-
parentBlock: Node
|
|
52
|
+
parentBlock: Node;
|
|
344
53
|
parent: Scope;
|
|
345
54
|
hub: HubInterface;
|
|
346
55
|
bindings: {
|
|
@@ -361,8 +70,8 @@ declare class Scope {
|
|
|
361
70
|
/** Variables available in current context. */
|
|
362
71
|
static contextVariables: string[];
|
|
363
72
|
/** Traverse node with current scope and path. */
|
|
364
|
-
traverse<S>(node: Node
|
|
365
|
-
traverse(node: Node
|
|
73
|
+
traverse<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
|
|
74
|
+
traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void;
|
|
366
75
|
/** Generate a unique identifier and add it to the current scope. */
|
|
367
76
|
generateDeclaredUidIdentifier(name?: string): Identifier;
|
|
368
77
|
/** Generate a unique identifier. */
|
|
@@ -370,7 +79,7 @@ declare class Scope {
|
|
|
370
79
|
/** Generate a unique `_id1` binding. */
|
|
371
80
|
generateUid(name?: string): string;
|
|
372
81
|
/** Generate a unique identifier based on a node. */
|
|
373
|
-
generateUidIdentifierBasedOnNode(parent: Node
|
|
82
|
+
generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): Identifier;
|
|
374
83
|
/**
|
|
375
84
|
* Determine whether evaluating the specific input `node` is a consequenceless reference. ie.
|
|
376
85
|
* evaluating it wont result in potentially arbitrary code from being ran. The following are
|
|
@@ -380,13 +89,13 @@ declare class Scope {
|
|
|
380
89
|
* - `super` expressions
|
|
381
90
|
* - Bound identifiers
|
|
382
91
|
*/
|
|
383
|
-
isStatic(node: Node
|
|
92
|
+
isStatic(node: Node): boolean;
|
|
384
93
|
/** Possibly generate a memoised identifier if it is not static and has consequences. */
|
|
385
|
-
maybeGenerateMemoised(node: Node
|
|
94
|
+
maybeGenerateMemoised(node: Node, dontPush?: boolean): Identifier;
|
|
386
95
|
checkBlockScopedCollisions(local: Binding, kind: BindingKind, name: string, id: object): void;
|
|
387
|
-
rename(oldName: string, newName?: string, block?: Node
|
|
96
|
+
rename(oldName: string, newName?: string, block?: Node): void;
|
|
388
97
|
dump(): void;
|
|
389
|
-
toArray(node: Node
|
|
98
|
+
toArray(node: Node, i?: number | boolean, arrayLikeIsIterable?: boolean): ArrayExpression | CallExpression | Identifier;
|
|
390
99
|
hasLabel(name: string): boolean;
|
|
391
100
|
getLabel(name: string): NodePath<LabeledStatement> | undefined;
|
|
392
101
|
registerLabel(path: NodePath<LabeledStatement>): void;
|
|
@@ -398,7 +107,7 @@ declare class Scope {
|
|
|
398
107
|
hasUid(name: string): boolean;
|
|
399
108
|
hasGlobal(name: string): boolean;
|
|
400
109
|
hasReference(name: string): boolean;
|
|
401
|
-
isPure(node: Node
|
|
110
|
+
isPure(node: Node, constantsOnly?: boolean): boolean;
|
|
402
111
|
/**
|
|
403
112
|
* Set some arbitrary data on the current scope.
|
|
404
113
|
*/
|
|
@@ -439,7 +148,7 @@ declare class Scope {
|
|
|
439
148
|
getAllBindings(): Record<string, Binding>;
|
|
440
149
|
/** Walks the scope tree and gathers all declarations of `kind`. */
|
|
441
150
|
getAllBindingsOfKind(...kinds: string[]): Record<string, Binding>;
|
|
442
|
-
bindingIdentifierEquals(name: string, node: Node
|
|
151
|
+
bindingIdentifierEquals(name: string, node: Node): boolean;
|
|
443
152
|
getBinding(name: string): Binding | undefined;
|
|
444
153
|
getOwnBinding(name: string): Binding | undefined;
|
|
445
154
|
getBindingIdentifier(name: string): Identifier;
|
|
@@ -498,28 +207,28 @@ declare class Binding {
|
|
|
498
207
|
/** Decrement the amount of references to this binding. */
|
|
499
208
|
dereference(): void;
|
|
500
209
|
}
|
|
501
|
-
type Visitor<S = unknown> = VisitNodeObject<S, Node
|
|
210
|
+
type Visitor<S = unknown> = VisitNodeObject<S, Node> & { [N in Node as N["type"]]?: VisitNode<S, N extends {
|
|
502
211
|
type: N["type"];
|
|
503
212
|
} ? N : never> } & { [K in keyof Aliases]?: VisitNode<S, Aliases[K]> } & { [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]> } & {
|
|
504
213
|
// Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
|
|
505
214
|
// too complex for TS. So we type it as a general visitor only if the key contains `|`
|
|
506
215
|
// this is good enough for non-visitor traverse options e.g. `noScope`
|
|
507
|
-
[k: `${string}|${string}`]: VisitNode<S, Node
|
|
216
|
+
[k: `${string}|${string}`]: VisitNode<S, Node>;
|
|
508
217
|
};
|
|
509
|
-
type VisitNode<S, P extends Node
|
|
510
|
-
type VisitNodeFunction<S, P extends Node
|
|
511
|
-
type NodeType = Node
|
|
512
|
-
interface VisitNodeObject<S, P extends Node
|
|
218
|
+
type VisitNode<S, P extends Node> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
|
219
|
+
type VisitNodeFunction<S, P extends Node> = (this: S, path: NodePath<P>, state: S) => void;
|
|
220
|
+
type NodeType = Node["type"] | keyof Aliases;
|
|
221
|
+
interface VisitNodeObject<S, P extends Node> {
|
|
513
222
|
enter?: VisitNodeFunction<S, P>;
|
|
514
223
|
exit?: VisitNodeFunction<S, P>;
|
|
515
224
|
}
|
|
516
|
-
type NodeKeyOfArrays<T extends Node
|
|
517
|
-
type NodePaths<T extends Node
|
|
518
|
-
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node
|
|
519
|
-
type NodesInsertionParam<T extends Node
|
|
520
|
-
declare class NodePath<T = Node
|
|
521
|
-
constructor(hub: HubInterface, parent: Node
|
|
522
|
-
parent: Node
|
|
225
|
+
type NodeKeyOfArrays<T extends Node> = { [P in keyof T]-?: T[P] extends Array<Node | null | undefined> ? P : never }[keyof T];
|
|
226
|
+
type NodePaths<T extends Node | readonly Node[]> = T extends readonly Node[] ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node>> } : T extends Node ? [NodePath<T>] : never;
|
|
227
|
+
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node ? P : never) : never;
|
|
228
|
+
type NodesInsertionParam<T extends Node> = T | readonly T[] | [T, ...T[]];
|
|
229
|
+
declare class NodePath<T = Node> {
|
|
230
|
+
constructor(hub: HubInterface, parent: Node);
|
|
231
|
+
parent: Node;
|
|
523
232
|
hub: Hub;
|
|
524
233
|
data: Record<string | symbol, unknown>;
|
|
525
234
|
context: TraversalContext;
|
|
@@ -529,32 +238,32 @@ declare class NodePath<T = Node$1> {
|
|
|
529
238
|
opts: any; // exploded TraverseOptions
|
|
530
239
|
skipKeys: Record<string, boolean> | null;
|
|
531
240
|
parentPath: T extends Program ? null : NodePath;
|
|
532
|
-
container: Node
|
|
241
|
+
container: Node | Node[] | null;
|
|
533
242
|
listKey: string | null;
|
|
534
243
|
key: string | number | null;
|
|
535
244
|
node: T;
|
|
536
|
-
type: T extends Node
|
|
245
|
+
type: T extends Node ? T["type"] : T extends null | undefined ? undefined : Node["type"] | undefined;
|
|
537
246
|
shouldSkip: boolean;
|
|
538
247
|
shouldStop: boolean;
|
|
539
248
|
removed: boolean;
|
|
540
249
|
inList: boolean;
|
|
541
250
|
parentKey: string;
|
|
542
251
|
typeAnnotation: object;
|
|
543
|
-
static get<C extends Node
|
|
252
|
+
static get<C extends Node, K extends keyof C>(opts: {
|
|
544
253
|
hub?: HubInterface;
|
|
545
254
|
parentPath: NodePath | null;
|
|
546
|
-
parent: Node
|
|
255
|
+
parent: Node;
|
|
547
256
|
container: C;
|
|
548
257
|
key: K;
|
|
549
258
|
}): NodePath<C[K]>;
|
|
550
|
-
static get<C extends Node
|
|
259
|
+
static get<C extends Node, L extends NodeKeyOfArrays<C>>(opts: {
|
|
551
260
|
hub?: HubInterface;
|
|
552
261
|
parentPath: NodePath | null;
|
|
553
|
-
parent: Node
|
|
262
|
+
parent: Node;
|
|
554
263
|
container: C;
|
|
555
264
|
listKey: L;
|
|
556
265
|
key: number;
|
|
557
|
-
}): C[L] extends Array<Node
|
|
266
|
+
}): C[L] extends Array<Node | null | undefined> ? NodePath<C[L][number]> : never;
|
|
558
267
|
getScope(scope: Scope): Scope;
|
|
559
268
|
setData(key: string | symbol, val: any): any;
|
|
560
269
|
getData(key: string | symbol, def?: any): any;
|
|
@@ -591,7 +300,7 @@ declare class NodePath<T = Node$1> {
|
|
|
591
300
|
*/
|
|
592
301
|
getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath;
|
|
593
302
|
/** Get the earliest path in the tree where the provided `paths` intersect. */
|
|
594
|
-
getDeepestCommonAncestorFrom(paths: NodePath[], filter?: (deepest: Node
|
|
303
|
+
getDeepestCommonAncestorFrom(paths: NodePath[], filter?: (deepest: Node, i: number, ancestries: NodePath[][]) => NodePath): NodePath;
|
|
595
304
|
/**
|
|
596
305
|
* Build an array of node paths containing the entire ancestry of the current node path.
|
|
597
306
|
*
|
|
@@ -622,7 +331,7 @@ declare class NodePath<T = Node$1> {
|
|
|
622
331
|
* - Insert the provided nodes after the current node.
|
|
623
332
|
* - Remove the current node.
|
|
624
333
|
*/
|
|
625
|
-
replaceWithMultiple<Nodes extends Node
|
|
334
|
+
replaceWithMultiple<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
626
335
|
/**
|
|
627
336
|
* Parse a string as an expression and replace the current node with the result.
|
|
628
337
|
*
|
|
@@ -632,7 +341,7 @@ declare class NodePath<T = Node$1> {
|
|
|
632
341
|
*/
|
|
633
342
|
replaceWithSourceString(replacement: string): [NodePath];
|
|
634
343
|
/** Replace the current node with another. */
|
|
635
|
-
replaceWith<R extends Node
|
|
344
|
+
replaceWith<R extends Node>(replacementPath: R | NodePath<R>): [NodePath<R>];
|
|
636
345
|
replaceWith<R extends NodePath>(replacementPath: R): [R];
|
|
637
346
|
/**
|
|
638
347
|
* This method takes an array of statements nodes and then explodes it
|
|
@@ -640,7 +349,7 @@ declare class NodePath<T = Node$1> {
|
|
|
640
349
|
* extremely important to retain original semantics.
|
|
641
350
|
*/
|
|
642
351
|
replaceExpressionWithStatements(nodes: Statement[]): NodePaths<Expression | Statement>;
|
|
643
|
-
replaceInline<Nodes extends Node
|
|
352
|
+
replaceInline<Nodes extends Node | readonly Node[] | [Node, ...Node[]]>(nodes: Nodes): NodePaths<Nodes>; // #endregion
|
|
644
353
|
// #region ------------------------- evaluation -------------------------
|
|
645
354
|
/**
|
|
646
355
|
* Walk the input `node` and statically evaluate if it's truthy.
|
|
@@ -712,7 +421,7 @@ declare class NodePath<T = Node$1> {
|
|
|
712
421
|
* This is because arrow functions may implicitly return an expression, which
|
|
713
422
|
* is the same as containing a block statement.
|
|
714
423
|
*/
|
|
715
|
-
canSwapBetweenExpressionAndStatement(replacement: Node
|
|
424
|
+
canSwapBetweenExpressionAndStatement(replacement: Node): boolean;
|
|
716
425
|
/** Check whether the current path references a completion record */
|
|
717
426
|
isCompletionRecord(allowInsideFunction?: boolean): boolean;
|
|
718
427
|
/**
|
|
@@ -781,12 +490,12 @@ declare class NodePath<T = Node$1> {
|
|
|
781
490
|
}>; // #endregion
|
|
782
491
|
// #region ------------------------- modification -------------------------
|
|
783
492
|
/** Insert the provided nodes before the current one. */
|
|
784
|
-
insertBefore<Nodes extends NodesInsertionParam<Node
|
|
493
|
+
insertBefore<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
785
494
|
/**
|
|
786
495
|
* Insert the provided nodes after the current one. When inserting nodes after an
|
|
787
496
|
* expression, ensure that the completion record is correct by pushing the current node.
|
|
788
497
|
*/
|
|
789
|
-
insertAfter<Nodes extends NodesInsertionParam<Node
|
|
498
|
+
insertAfter<Nodes extends NodesInsertionParam<Node>>(nodes: Nodes): NodePaths<Nodes>;
|
|
790
499
|
/** Update all sibling node paths after `fromIndex` by `incrementBy`. */
|
|
791
500
|
updateSiblingKeys(fromIndex: number, incrementBy: number): void;
|
|
792
501
|
/**
|
|
@@ -794,13 +503,13 @@ declare class NodePath<T = Node$1> {
|
|
|
794
503
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
795
504
|
* @param nodes - the nodes to insert.
|
|
796
505
|
*/
|
|
797
|
-
unshiftContainer<T extends Node
|
|
506
|
+
unshiftContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
798
507
|
/**
|
|
799
508
|
* Insert child nodes at the end of the current node.
|
|
800
509
|
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
801
510
|
* @param nodes - the nodes to insert.
|
|
802
511
|
*/
|
|
803
|
-
pushContainer<T extends Node
|
|
512
|
+
pushContainer<T extends Node, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
804
513
|
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
|
805
514
|
hoist(scope: Scope): void; // #endregion
|
|
806
515
|
// #region ------------------------- family -------------------------
|
|
@@ -1478,14 +1187,14 @@ interface HubInterface {
|
|
|
1478
1187
|
getCode(): string | undefined;
|
|
1479
1188
|
getScope(): Scope | undefined;
|
|
1480
1189
|
addHelper(name: string): any;
|
|
1481
|
-
buildError(node: Node
|
|
1190
|
+
buildError(node: Node, msg: string, Error: ErrorConstructor): Error;
|
|
1482
1191
|
}
|
|
1483
1192
|
declare class Hub implements HubInterface {
|
|
1484
1193
|
constructor();
|
|
1485
1194
|
getCode(): string | undefined;
|
|
1486
1195
|
getScope(): Scope | undefined;
|
|
1487
1196
|
addHelper(name: string): any;
|
|
1488
|
-
buildError(node: Node
|
|
1197
|
+
buildError(node: Node, msg: string, Error?: ErrorConstructor): Error;
|
|
1489
1198
|
}
|
|
1490
1199
|
interface TraversalContext<S = unknown> {
|
|
1491
1200
|
parentPath: NodePath;
|
|
@@ -1498,719 +1207,221 @@ interface TraversalContext<S = unknown> {
|
|
|
1498
1207
|
type ImplGetOfArray<T extends readonly unknown[], K extends string> = K extends `${infer N extends number}` ? T[N] : K extends keyof T ? T[K] : never; // dprint-ignore
|
|
1499
1208
|
type ImplGetByKey<T, K extends string> = T extends readonly unknown[] ? ImplGetOfArray<T, K> : K extends keyof T ? T[K] : K extends `${infer N extends number}` ? N extends keyof T ? T[N] : never : never; // dprint-ignore
|
|
1500
1209
|
type ImplGetRecursive<T, K extends string> = K extends `${infer L}.${infer R}` ? ImplGetRecursive<ImplGetByKey<T, L>, R> : ImplGetByKey<T, K>;
|
|
1501
|
-
type NodePathResult<T> = (Extract<T, Node
|
|
1210
|
+
type NodePathResult<T> = (Extract<T, Node | null | undefined> extends never ? never : NodePath<Extract<T, Node | null | undefined>>) | (T extends Array<Node | null | undefined> ? Array<NodePath<T[number]>> : never);
|
|
1502
1211
|
interface VirtualTypeAliases {
|
|
1503
1212
|
BindingIdentifier: Identifier;
|
|
1504
|
-
BlockScoped: Node
|
|
1213
|
+
BlockScoped: Node;
|
|
1505
1214
|
ExistentialTypeParam: ExistsTypeAnnotation;
|
|
1506
1215
|
Flow: Flow | ImportDeclaration | ExportDeclaration | ImportSpecifier;
|
|
1507
1216
|
ForAwaitStatement: ForOfStatement;
|
|
1508
|
-
Generated: Node
|
|
1217
|
+
Generated: Node;
|
|
1509
1218
|
NumericLiteralTypeAnnotation: NumberLiteralTypeAnnotation;
|
|
1510
|
-
Pure: Node
|
|
1511
|
-
Referenced: Node
|
|
1219
|
+
Pure: Node;
|
|
1220
|
+
Referenced: Node;
|
|
1512
1221
|
ReferencedIdentifier: Identifier | JSXIdentifier;
|
|
1513
1222
|
ReferencedMemberExpression: MemberExpression;
|
|
1514
1223
|
RestProperty: RestElement;
|
|
1515
1224
|
Scope: Scopable | Pattern;
|
|
1516
1225
|
SpreadProperty: RestElement;
|
|
1517
|
-
User: Node
|
|
1226
|
+
User: Node;
|
|
1518
1227
|
Var: VariableDeclaration;
|
|
1519
1228
|
}
|
|
1520
|
-
declare namespace
|
|
1521
|
-
export {
|
|
1229
|
+
declare namespace babel_parser_d_exports {
|
|
1230
|
+
export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParseResult, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes };
|
|
1522
1231
|
}
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
* Source map standard format as to revision 3
|
|
1529
|
-
* @see {@link https://sourcemaps.info/spec.html}
|
|
1530
|
-
* @see {@link https://github.com/mozilla/source-map/blob/HEAD/source-map.d.ts}
|
|
1531
|
-
*/
|
|
1532
|
-
interface InputSourceMap {
|
|
1533
|
-
version: number;
|
|
1534
|
-
sources: string[];
|
|
1535
|
-
names: string[];
|
|
1536
|
-
sourceRoot?: string | undefined;
|
|
1537
|
-
sourcesContent?: string[] | undefined;
|
|
1538
|
-
mappings: string;
|
|
1539
|
-
file: string;
|
|
1232
|
+
declare class Position {
|
|
1233
|
+
line: number;
|
|
1234
|
+
column: number;
|
|
1235
|
+
index: number;
|
|
1236
|
+
constructor(line: number, col: number, index: number);
|
|
1540
1237
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
*
|
|
1593
|
-
* Default: `true`
|
|
1594
|
-
*/
|
|
1595
|
-
babelrc?: boolean | null | undefined;
|
|
1596
|
-
/**
|
|
1597
|
-
* Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search
|
|
1598
|
-
* inside of. Defaults to only searching the "root" package.
|
|
1599
|
-
*
|
|
1600
|
-
* Default: `(root)`
|
|
1601
|
-
*/
|
|
1602
|
-
babelrcRoots?: boolean | MatchPattern | MatchPattern[] | null | undefined;
|
|
1603
|
-
/**
|
|
1604
|
-
* Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json.
|
|
1605
|
-
* This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
|
1606
|
-
*
|
|
1607
|
-
* If a string is specified, it must represent the path of a browserslist configuration file. Relative paths are resolved relative to the configuration file which specifies
|
|
1608
|
-
* this option, or to `cwd` when it's passed as part of the programmatic options.
|
|
1609
|
-
*
|
|
1610
|
-
* Default: `true`
|
|
1611
|
-
*/
|
|
1612
|
-
browserslistConfigFile?: boolean | null | undefined;
|
|
1613
|
-
/**
|
|
1614
|
-
* The Browserslist environment to use.
|
|
1615
|
-
*
|
|
1616
|
-
* Default: `undefined`
|
|
1617
|
-
*/
|
|
1618
|
-
browserslistEnv?: string | null | undefined;
|
|
1619
|
-
/**
|
|
1620
|
-
* By default `babel.transformFromAst` will clone the input AST to avoid mutations.
|
|
1621
|
-
* Specifying `cloneInputAst: false` can improve parsing performance if the input AST is not used elsewhere.
|
|
1622
|
-
*
|
|
1623
|
-
* Default: `true`
|
|
1624
|
-
*/
|
|
1625
|
-
cloneInputAst?: boolean | null | undefined;
|
|
1626
|
-
/**
|
|
1627
|
-
* Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"`
|
|
1628
|
-
*
|
|
1629
|
-
* Default: env vars
|
|
1630
|
-
*/
|
|
1631
|
-
envName?: string | undefined;
|
|
1632
|
-
/**
|
|
1633
|
-
* If any of patterns match, the current configuration object is considered inactive and is ignored during config processing.
|
|
1634
|
-
*/
|
|
1635
|
-
exclude?: MatchPattern | MatchPattern[] | undefined;
|
|
1636
|
-
/**
|
|
1637
|
-
* Enable code generation
|
|
1638
|
-
*
|
|
1639
|
-
* Default: `true`
|
|
1640
|
-
*/
|
|
1641
|
-
code?: boolean | null | undefined;
|
|
1642
|
-
/**
|
|
1643
|
-
* Output comments in generated output
|
|
1644
|
-
*
|
|
1645
|
-
* Default: `true`
|
|
1646
|
-
*/
|
|
1647
|
-
comments?: boolean | null | undefined;
|
|
1648
|
-
/**
|
|
1649
|
-
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB
|
|
1650
|
-
*
|
|
1651
|
-
* Default: `"auto"`
|
|
1652
|
-
*/
|
|
1653
|
-
compact?: boolean | "auto" | null | undefined;
|
|
1654
|
-
/**
|
|
1655
|
-
* The working directory that Babel's programmatic options are loaded relative to.
|
|
1656
|
-
*
|
|
1657
|
-
* Default: `"."`
|
|
1658
|
-
*/
|
|
1659
|
-
cwd?: string | null | undefined;
|
|
1660
|
-
/**
|
|
1661
|
-
* Utilities may pass a caller object to identify themselves to Babel and
|
|
1662
|
-
* pass capability-related flags for use by configs, presets and plugins.
|
|
1663
|
-
*
|
|
1664
|
-
* @see https://babeljs.io/docs/en/next/options#caller
|
|
1665
|
-
*/
|
|
1666
|
-
caller?: TransformCaller | undefined;
|
|
1667
|
-
/**
|
|
1668
|
-
* This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }`
|
|
1669
|
-
* which will use those options when the `envName` is `production`
|
|
1670
|
-
*
|
|
1671
|
-
* Default: `{}`
|
|
1672
|
-
*/
|
|
1673
|
-
env?: {
|
|
1674
|
-
[index: string]: TransformOptions | null | undefined;
|
|
1675
|
-
} | null | undefined;
|
|
1676
|
-
/**
|
|
1677
|
-
* A path to a `.babelrc` file to extend
|
|
1678
|
-
*
|
|
1679
|
-
* Default: `null`
|
|
1680
|
-
*/
|
|
1681
|
-
extends?: string | null | undefined;
|
|
1682
|
-
/**
|
|
1683
|
-
* Filename for use in errors etc
|
|
1684
|
-
*
|
|
1685
|
-
* Default: `"unknown"`
|
|
1686
|
-
*/
|
|
1687
|
-
filename?: string | null | undefined;
|
|
1688
|
-
/**
|
|
1689
|
-
* Filename relative to `sourceRoot`
|
|
1690
|
-
*
|
|
1691
|
-
* Default: `(filename)`
|
|
1692
|
-
*/
|
|
1693
|
-
filenameRelative?: string | null | undefined;
|
|
1694
|
-
/**
|
|
1695
|
-
* An object containing the options to be passed down to the babel code generator, @babel/generator
|
|
1696
|
-
*
|
|
1697
|
-
* Default: `{}`
|
|
1698
|
-
*/
|
|
1699
|
-
generatorOpts?: GeneratorOptions | null | undefined;
|
|
1700
|
-
/**
|
|
1701
|
-
* Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. If falsy value is returned then the generated module id is used
|
|
1702
|
-
*
|
|
1703
|
-
* Default: `null`
|
|
1704
|
-
*/
|
|
1705
|
-
getModuleId?: ((moduleName: string) => string | null | undefined) | null | undefined;
|
|
1706
|
-
/**
|
|
1707
|
-
* ANSI highlight syntax error code frames
|
|
1708
|
-
*
|
|
1709
|
-
* Default: `true`
|
|
1710
|
-
*/
|
|
1711
|
-
highlightCode?: boolean | null | undefined;
|
|
1712
|
-
/**
|
|
1713
|
-
* Opposite to the `only` option. `ignore` is disregarded if `only` is specified
|
|
1714
|
-
*
|
|
1715
|
-
* Default: `null`
|
|
1716
|
-
*/
|
|
1717
|
-
ignore?: MatchPattern[] | null | undefined;
|
|
1718
|
-
/**
|
|
1719
|
-
* This option is a synonym for "test"
|
|
1720
|
-
*/
|
|
1721
|
-
include?: MatchPattern | MatchPattern[] | undefined;
|
|
1722
|
-
/**
|
|
1723
|
-
* A source map object that the output source map will be based on
|
|
1724
|
-
*
|
|
1725
|
-
* Default: `null`
|
|
1726
|
-
*/
|
|
1727
|
-
inputSourceMap?: InputSourceMap | null | undefined;
|
|
1728
|
-
/**
|
|
1729
|
-
* Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe)
|
|
1730
|
-
*
|
|
1731
|
-
* Default: `false`
|
|
1732
|
-
*/
|
|
1733
|
-
minified?: boolean | null | undefined;
|
|
1734
|
-
/**
|
|
1735
|
-
* Specify a custom name for module ids
|
|
1736
|
-
*
|
|
1737
|
-
* Default: `null`
|
|
1738
|
-
*/
|
|
1739
|
-
moduleId?: string | null | undefined;
|
|
1740
|
-
/**
|
|
1741
|
-
* If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
|
|
1742
|
-
*
|
|
1743
|
-
* Default: `false`
|
|
1744
|
-
*/
|
|
1745
|
-
moduleIds?: boolean | null | undefined;
|
|
1746
|
-
/**
|
|
1747
|
-
* Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
|
|
1748
|
-
*
|
|
1749
|
-
* Default: `(sourceRoot)`
|
|
1750
|
-
*/
|
|
1751
|
-
moduleRoot?: string | null | undefined;
|
|
1752
|
-
/**
|
|
1753
|
-
* A glob, regex, or mixed array of both, matching paths to **only** compile. Can also be an array of arrays containing paths to explicitly match. When attempting to compile
|
|
1754
|
-
* a non-matching file it's returned verbatim
|
|
1755
|
-
*
|
|
1756
|
-
* Default: `null`
|
|
1757
|
-
*/
|
|
1758
|
-
only?: MatchPattern[] | null | undefined;
|
|
1759
|
-
/**
|
|
1760
|
-
* Allows users to provide an array of options that will be merged into the current configuration one at a time.
|
|
1761
|
-
* This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply
|
|
1762
|
-
*/
|
|
1763
|
-
overrides?: TransformOptions[] | undefined;
|
|
1238
|
+
type SyntaxPlugin = "flow" | "typescript" | "jsx" | "functionBind" | "pipelineOperator" | "placeholders";
|
|
1239
|
+
type ParseErrorCode = "BABEL_PARSER_SYNTAX_ERROR" | "BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED";
|
|
1240
|
+
interface ParseErrorSpecification<ErrorDetails> {
|
|
1241
|
+
code: ParseErrorCode;
|
|
1242
|
+
reasonCode: string;
|
|
1243
|
+
syntaxPlugin?: SyntaxPlugin;
|
|
1244
|
+
missingPlugin?: string | string[];
|
|
1245
|
+
loc: Position;
|
|
1246
|
+
details: ErrorDetails;
|
|
1247
|
+
pos: number;
|
|
1248
|
+
}
|
|
1249
|
+
type ParseError$1<ErrorDetails> = SyntaxError & ParseErrorSpecification<ErrorDetails>;
|
|
1250
|
+
type BABEL_8_BREAKING = false;
|
|
1251
|
+
type IF_BABEL_7<V> = false extends BABEL_8_BREAKING ? V : never;
|
|
1252
|
+
type Plugin$1 = "asyncDoExpressions" | IF_BABEL_7<"asyncGenerators"> | IF_BABEL_7<"bigInt"> | IF_BABEL_7<"classPrivateMethods"> | IF_BABEL_7<"classPrivateProperties"> | IF_BABEL_7<"classProperties"> | IF_BABEL_7<"classStaticBlock"> | IF_BABEL_7<"decimal"> | "decorators-legacy" | "deferredImportEvaluation" | "decoratorAutoAccessors" | "destructuringPrivate" | IF_BABEL_7<"deprecatedImportAssert"> | "doExpressions" | IF_BABEL_7<"dynamicImport"> | IF_BABEL_7<"explicitResourceManagement"> | "exportDefaultFrom" | IF_BABEL_7<"exportNamespaceFrom"> | "flow" | "flowComments" | "functionBind" | "functionSent" | "importMeta" | "jsx" | IF_BABEL_7<"jsonStrings"> | IF_BABEL_7<"logicalAssignment"> | IF_BABEL_7<"importAssertions"> | IF_BABEL_7<"importReflection"> | "moduleBlocks" | IF_BABEL_7<"moduleStringNames"> | IF_BABEL_7<"nullishCoalescingOperator"> | IF_BABEL_7<"numericSeparator"> | IF_BABEL_7<"objectRestSpread"> | IF_BABEL_7<"optionalCatchBinding"> | IF_BABEL_7<"optionalChaining"> | "partialApplication" | "placeholders" | IF_BABEL_7<"privateIn"> | IF_BABEL_7<"regexpUnicodeSets"> | "sourcePhaseImports" | "throwExpressions" | IF_BABEL_7<"topLevelAwait"> | "v8intrinsic" | ParserPluginWithOptions[0];
|
|
1253
|
+
type ParserPluginWithOptions = ["decorators", DecoratorsPluginOptions] | ["discardBinding", {
|
|
1254
|
+
syntaxType: "void";
|
|
1255
|
+
}] | ["estree", {
|
|
1256
|
+
classFeatures?: boolean;
|
|
1257
|
+
}] | IF_BABEL_7<["importAttributes", {
|
|
1258
|
+
deprecatedAssertSyntax: boolean;
|
|
1259
|
+
}]> | IF_BABEL_7<["moduleAttributes", {
|
|
1260
|
+
version: "may-2020";
|
|
1261
|
+
}]> | ["optionalChainingAssign", {
|
|
1262
|
+
version: "2023-07";
|
|
1263
|
+
}] | ["pipelineOperator", PipelineOperatorPluginOptions] | ["recordAndTuple", RecordAndTuplePluginOptions] | ["flow", FlowPluginOptions] | ["typescript", TypeScriptPluginOptions];
|
|
1264
|
+
type PluginConfig = Plugin$1 | ParserPluginWithOptions;
|
|
1265
|
+
interface DecoratorsPluginOptions {
|
|
1266
|
+
decoratorsBeforeExport?: boolean;
|
|
1267
|
+
allowCallParenthesized?: boolean;
|
|
1268
|
+
}
|
|
1269
|
+
interface PipelineOperatorPluginOptions {
|
|
1270
|
+
proposal: BABEL_8_BREAKING extends false ? "minimal" | "fsharp" | "hack" | "smart" : "fsharp" | "hack";
|
|
1271
|
+
topicToken?: "%" | "#" | "@@" | "^^" | "^";
|
|
1272
|
+
}
|
|
1273
|
+
interface RecordAndTuplePluginOptions {
|
|
1274
|
+
syntaxType: "bar" | "hash";
|
|
1275
|
+
}
|
|
1276
|
+
type FlowPluginOptions = BABEL_8_BREAKING extends true ? {
|
|
1277
|
+
all?: boolean;
|
|
1278
|
+
enums?: boolean;
|
|
1279
|
+
} : {
|
|
1280
|
+
all?: boolean;
|
|
1281
|
+
};
|
|
1282
|
+
interface TypeScriptPluginOptions {
|
|
1283
|
+
dts?: boolean;
|
|
1284
|
+
disallowAmbiguousJSXLike?: boolean;
|
|
1285
|
+
}
|
|
1286
|
+
type Plugin = PluginConfig;
|
|
1287
|
+
type SourceType = "script" | "commonjs" | "module" | "unambiguous";
|
|
1288
|
+
interface Options {
|
|
1764
1289
|
/**
|
|
1765
|
-
*
|
|
1766
|
-
*
|
|
1767
|
-
* Default: `{}`
|
|
1290
|
+
* By default, import and export declarations can only appear at a program's top level.
|
|
1291
|
+
* Setting this option to true allows them anywhere where a statement is allowed.
|
|
1768
1292
|
*/
|
|
1769
|
-
|
|
1293
|
+
allowImportExportEverywhere?: boolean;
|
|
1770
1294
|
/**
|
|
1771
|
-
*
|
|
1772
|
-
*
|
|
1773
|
-
* Default: `[]`
|
|
1295
|
+
* By default, await use is not allowed outside of an async function.
|
|
1296
|
+
* Set this to true to accept such code.
|
|
1774
1297
|
*/
|
|
1775
|
-
|
|
1298
|
+
allowAwaitOutsideFunction?: boolean;
|
|
1776
1299
|
/**
|
|
1777
|
-
*
|
|
1778
|
-
*
|
|
1779
|
-
* Default: `[]`
|
|
1300
|
+
* By default, a return statement at the top level raises an error.
|
|
1301
|
+
* Set this to true to accept such code.
|
|
1780
1302
|
*/
|
|
1781
|
-
|
|
1303
|
+
allowReturnOutsideFunction?: boolean;
|
|
1782
1304
|
/**
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1785
|
-
* Default: `false`
|
|
1305
|
+
* By default, new.target use is not allowed outside of a function or class.
|
|
1306
|
+
* Set this to true to accept such code.
|
|
1786
1307
|
*/
|
|
1787
|
-
|
|
1308
|
+
allowNewTargetOutsideFunction?: boolean;
|
|
1788
1309
|
/**
|
|
1789
|
-
*
|
|
1790
|
-
*
|
|
1791
|
-
* Default: `null`
|
|
1310
|
+
* By default, super calls are not allowed outside of a method.
|
|
1311
|
+
* Set this to true to accept such code.
|
|
1792
1312
|
*/
|
|
1793
|
-
|
|
1313
|
+
allowSuperOutsideMethod?: boolean;
|
|
1794
1314
|
/**
|
|
1795
|
-
*
|
|
1796
|
-
*
|
|
1797
|
-
* Default: `(filenameRelative)`
|
|
1315
|
+
* By default, exported identifiers must refer to a declared variable.
|
|
1316
|
+
* Set this to true to allow export statements to reference undeclared variables.
|
|
1798
1317
|
*/
|
|
1799
|
-
|
|
1318
|
+
allowUndeclaredExports?: boolean;
|
|
1800
1319
|
/**
|
|
1801
|
-
*
|
|
1802
|
-
*
|
|
1803
|
-
*
|
|
1804
|
-
* Default: `false`
|
|
1320
|
+
* By default, yield use is not allowed outside of a generator function.
|
|
1321
|
+
* Set this to true to accept such code.
|
|
1805
1322
|
*/
|
|
1806
|
-
|
|
1323
|
+
allowYieldOutsideFunction?: boolean;
|
|
1807
1324
|
/**
|
|
1808
|
-
*
|
|
1809
|
-
*
|
|
1810
|
-
* Default: `(moduleRoot)`
|
|
1325
|
+
* By default, Babel parser JavaScript code according to Annex B syntax.
|
|
1326
|
+
* Set this to `false` to disable such behavior.
|
|
1811
1327
|
*/
|
|
1812
|
-
|
|
1328
|
+
annexB?: boolean;
|
|
1813
1329
|
/**
|
|
1814
|
-
*
|
|
1815
|
-
*
|
|
1816
|
-
*
|
|
1817
|
-
*
|
|
1330
|
+
* By default, Babel attaches comments to adjacent AST nodes.
|
|
1331
|
+
* When this option is set to false, comments are not attached.
|
|
1332
|
+
* It can provide up to 30% performance improvement when the input code has many comments.
|
|
1333
|
+
* @babel/eslint-parser will set it for you.
|
|
1334
|
+
* It is not recommended to use attachComment: false with Babel transform,
|
|
1335
|
+
* as doing so removes all the comments in output code, and renders annotations such as
|
|
1336
|
+
* /* istanbul ignore next *\/ nonfunctional.
|
|
1818
1337
|
*/
|
|
1819
|
-
|
|
1338
|
+
attachComment?: boolean;
|
|
1820
1339
|
/**
|
|
1821
|
-
*
|
|
1340
|
+
* By default, Babel always throws an error when it finds some invalid code.
|
|
1341
|
+
* When this option is set to true, it will store the parsing error and
|
|
1342
|
+
* try to continue parsing the invalid input file.
|
|
1822
1343
|
*/
|
|
1823
|
-
|
|
1344
|
+
errorRecovery?: boolean;
|
|
1824
1345
|
/**
|
|
1825
|
-
*
|
|
1826
|
-
*
|
|
1346
|
+
* Indicate the mode the code should be parsed in.
|
|
1347
|
+
* Can be one of "script", "commonjs", "module", or "unambiguous". Defaults to "script".
|
|
1348
|
+
* "unambiguous" will make @babel/parser attempt to guess, based on the presence
|
|
1349
|
+
* of ES6 import or export statements.
|
|
1350
|
+
* Files with ES6 imports and exports are considered "module" and are otherwise "script".
|
|
1827
1351
|
*
|
|
1828
|
-
*
|
|
1829
|
-
*/
|
|
1830
|
-
targets?: string | string[] | {
|
|
1831
|
-
esmodules?: boolean;
|
|
1832
|
-
node?: Omit<string, "current"> | "current" | true;
|
|
1833
|
-
safari?: Omit<string, "tp"> | "tp";
|
|
1834
|
-
browsers?: string | string[];
|
|
1835
|
-
android?: string;
|
|
1836
|
-
chrome?: string;
|
|
1837
|
-
deno?: string;
|
|
1838
|
-
edge?: string;
|
|
1839
|
-
electron?: string;
|
|
1840
|
-
firefox?: string;
|
|
1841
|
-
ie?: string;
|
|
1842
|
-
ios?: string;
|
|
1843
|
-
opera?: string;
|
|
1844
|
-
rhino?: string;
|
|
1845
|
-
samsung?: string;
|
|
1846
|
-
};
|
|
1847
|
-
/**
|
|
1848
|
-
* An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
|
|
1849
|
-
* `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
|
|
1850
|
-
*/
|
|
1851
|
-
wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null | undefined;
|
|
1852
|
-
}
|
|
1853
|
-
interface TransformCaller {
|
|
1854
|
-
// the only required property
|
|
1855
|
-
name: string; // e.g. set to true by `babel-loader` and false by `babel-jest`
|
|
1856
|
-
supportsStaticESM?: boolean | undefined;
|
|
1857
|
-
supportsDynamicImport?: boolean | undefined;
|
|
1858
|
-
supportsExportNamespaceFrom?: boolean | undefined;
|
|
1859
|
-
supportsTopLevelAwait?: boolean | undefined; // augment this with a "declare module '@babel/core' { ... }" if you need more keys
|
|
1860
|
-
}
|
|
1861
|
-
type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
|
|
1862
|
-
interface MatchPatternContext {
|
|
1863
|
-
envName: string;
|
|
1864
|
-
dirname: string;
|
|
1865
|
-
caller: TransformCaller | undefined;
|
|
1866
|
-
}
|
|
1867
|
-
type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean);
|
|
1868
|
-
/**
|
|
1869
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1870
|
-
*/
|
|
1871
|
-
declare function transform(code: string, callback: FileResultCallback): void;
|
|
1872
|
-
/**
|
|
1873
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1874
|
-
*/
|
|
1875
|
-
declare function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1876
|
-
/**
|
|
1877
|
-
* Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API.
|
|
1878
|
-
*/
|
|
1879
|
-
declare function transform(code: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1880
|
-
/**
|
|
1881
|
-
* Transforms the passed in code. Returning an object with the generated code, source map, and AST.
|
|
1882
|
-
*/
|
|
1883
|
-
declare function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1884
|
-
/**
|
|
1885
|
-
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
|
|
1886
|
-
*/
|
|
1887
|
-
declare function transformAsync(code: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1888
|
-
/**
|
|
1889
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1890
|
-
*/
|
|
1891
|
-
declare function transformFile(filename: string, callback: FileResultCallback): void;
|
|
1892
|
-
/**
|
|
1893
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1894
|
-
*/
|
|
1895
|
-
declare function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1896
|
-
/**
|
|
1897
|
-
* Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`.
|
|
1898
|
-
*/
|
|
1899
|
-
declare function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1900
|
-
/**
|
|
1901
|
-
* Asynchronously transforms the entire contents of a file.
|
|
1902
|
-
*/
|
|
1903
|
-
declare function transformFileAsync(filename: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1904
|
-
/**
|
|
1905
|
-
* Given an AST, transform it.
|
|
1906
|
-
*/
|
|
1907
|
-
declare function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void;
|
|
1908
|
-
/**
|
|
1909
|
-
* Given an AST, transform it.
|
|
1910
|
-
*/
|
|
1911
|
-
declare function transformFromAst(ast: Node, code: string | undefined, opts: TransformOptions | undefined, callback: FileResultCallback): void;
|
|
1912
|
-
/**
|
|
1913
|
-
* Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API.
|
|
1914
|
-
*/
|
|
1915
|
-
declare function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null;
|
|
1916
|
-
/**
|
|
1917
|
-
* Given an AST, transform it.
|
|
1918
|
-
*/
|
|
1919
|
-
declare function transformFromAstAsync(ast: Node, code?: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
|
|
1920
|
-
// A babel plugin is a simple function which must return an object matching
|
|
1921
|
-
// the following interface. Babel will throw if it finds unknown properties.
|
|
1922
|
-
// The list of allowed plugin keys is here:
|
|
1923
|
-
// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71
|
|
1924
|
-
interface PluginObj<S = PluginPass> {
|
|
1925
|
-
name?: string | undefined;
|
|
1926
|
-
manipulateOptions?(opts: any, parserOpts: any): void;
|
|
1927
|
-
pre?(this: S, file: BabelFile): void;
|
|
1928
|
-
visitor: Visitor<S>;
|
|
1929
|
-
post?(this: S, file: BabelFile): void;
|
|
1930
|
-
inherits?: any;
|
|
1931
|
-
}
|
|
1932
|
-
interface BabelFile {
|
|
1933
|
-
ast: File;
|
|
1934
|
-
opts: TransformOptions;
|
|
1935
|
-
hub: Hub;
|
|
1936
|
-
metadata: object;
|
|
1937
|
-
path: NodePath<Program>;
|
|
1938
|
-
scope: Scope;
|
|
1939
|
-
inputMap: object | null;
|
|
1940
|
-
code: string;
|
|
1941
|
-
}
|
|
1942
|
-
interface PluginPass {
|
|
1943
|
-
file: BabelFile;
|
|
1944
|
-
key: string;
|
|
1945
|
-
opts: object;
|
|
1946
|
-
cwd: string;
|
|
1947
|
-
filename: string | undefined;
|
|
1948
|
-
get(key: unknown): any;
|
|
1949
|
-
set(key: unknown, value: unknown): void;
|
|
1950
|
-
[key: string]: unknown;
|
|
1951
|
-
}
|
|
1952
|
-
interface BabelFileResult {
|
|
1953
|
-
ast?: File | null | undefined;
|
|
1954
|
-
code?: string | null | undefined;
|
|
1955
|
-
ignored?: boolean | undefined;
|
|
1956
|
-
map?: {
|
|
1957
|
-
version: number;
|
|
1958
|
-
sources: string[];
|
|
1959
|
-
names: string[];
|
|
1960
|
-
sourceRoot?: string | undefined;
|
|
1961
|
-
sourcesContent?: string[] | undefined;
|
|
1962
|
-
mappings: string;
|
|
1963
|
-
file: string;
|
|
1964
|
-
} | null | undefined;
|
|
1965
|
-
metadata?: BabelFileMetadata | undefined;
|
|
1966
|
-
}
|
|
1967
|
-
interface BabelFileMetadata {
|
|
1968
|
-
usedHelpers: string[];
|
|
1969
|
-
marked: Array<{
|
|
1970
|
-
type: string;
|
|
1971
|
-
message: string;
|
|
1972
|
-
loc: object;
|
|
1973
|
-
}>;
|
|
1974
|
-
modules: BabelFileModulesMetadata;
|
|
1975
|
-
}
|
|
1976
|
-
interface BabelFileModulesMetadata {
|
|
1977
|
-
imports: object[];
|
|
1978
|
-
exports: {
|
|
1979
|
-
exported: object[];
|
|
1980
|
-
specifiers: object[];
|
|
1981
|
-
};
|
|
1982
|
-
}
|
|
1983
|
-
type FileParseCallback = (err: Error | null, result: ParseResult | null) => any;
|
|
1984
|
-
/**
|
|
1985
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1986
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1987
|
-
*/
|
|
1988
|
-
declare function parse(code: string, callback: FileParseCallback): void;
|
|
1989
|
-
/**
|
|
1990
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1991
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1992
|
-
*/
|
|
1993
|
-
declare function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void;
|
|
1994
|
-
/**
|
|
1995
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
1996
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
1997
|
-
*/
|
|
1998
|
-
declare function parse(code: string, options?: TransformOptions): ParseResult | null;
|
|
1999
|
-
/**
|
|
2000
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
2001
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
2002
|
-
*/
|
|
2003
|
-
declare function parseSync(code: string, options?: TransformOptions): ParseResult | null;
|
|
2004
|
-
/**
|
|
2005
|
-
* Given some code, parse it using Babel's standard behavior.
|
|
2006
|
-
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
|
|
2007
|
-
*/
|
|
2008
|
-
declare function parseAsync(code: string, options?: TransformOptions): Promise<ParseResult | null>;
|
|
2009
|
-
/**
|
|
2010
|
-
* Resolve Babel's options fully, resulting in an options object where:
|
|
2011
|
-
*
|
|
2012
|
-
* * opts.plugins is a full list of Plugin instances.
|
|
2013
|
-
* * opts.presets is empty and all presets are flattened into opts.
|
|
2014
|
-
* * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel
|
|
2015
|
-
* will not make a second attempt to load config files.
|
|
2016
|
-
*
|
|
2017
|
-
* Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to
|
|
2018
|
-
* use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to
|
|
2019
|
-
* invalidate properly, but it is the best we have at the moment.
|
|
2020
|
-
*/
|
|
2021
|
-
declare function loadOptions(options?: TransformOptions): object | null;
|
|
2022
|
-
/**
|
|
2023
|
-
* To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and
|
|
2024
|
-
* presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it
|
|
2025
|
-
* as then see fit and pass it back to Babel again.
|
|
2026
|
-
*
|
|
2027
|
-
* * `babelrc: string | void` - The path of the `.babelrc` file, if there was one.
|
|
2028
|
-
* * `babelignore: string | void` - The path of the `.babelignore` file, if there was one.
|
|
2029
|
-
* * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back
|
|
2030
|
-
* to Babel again.
|
|
2031
|
-
* * `plugins: Array<ConfigItem>` - See below.
|
|
2032
|
-
* * `presets: Array<ConfigItem>` - See below.
|
|
2033
|
-
* * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to
|
|
2034
|
-
* Babel will not make a second attempt to load config files.
|
|
2035
|
-
*
|
|
2036
|
-
* `ConfigItem` instances expose properties to introspect the values, but each item should be treated as
|
|
2037
|
-
* immutable. If changes are desired, the item should be removed from the list and replaced with either a normal
|
|
2038
|
-
* Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for
|
|
2039
|
-
* information about `ConfigItem` fields.
|
|
2040
|
-
*/
|
|
2041
|
-
declare function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
|
|
2042
|
-
declare function loadPartialConfigAsync(options?: TransformOptions): Promise<Readonly<PartialConfig> | null>;
|
|
2043
|
-
interface PartialConfig {
|
|
2044
|
-
options: TransformOptions;
|
|
2045
|
-
babelrc?: string | undefined;
|
|
2046
|
-
babelignore?: string | undefined;
|
|
2047
|
-
config?: string | undefined;
|
|
2048
|
-
hasFilesystemConfig: () => boolean;
|
|
2049
|
-
}
|
|
2050
|
-
interface ConfigItem {
|
|
2051
|
-
/**
|
|
2052
|
-
* The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]`
|
|
2053
|
-
*/
|
|
2054
|
-
name?: string | undefined;
|
|
2055
|
-
/**
|
|
2056
|
-
* The resolved value of the plugin.
|
|
2057
|
-
*/
|
|
2058
|
-
value: object | ((...args: any[]) => any);
|
|
2059
|
-
/**
|
|
2060
|
-
* The options object passed to the plugin.
|
|
2061
|
-
*/
|
|
2062
|
-
options?: object | false | undefined;
|
|
2063
|
-
/**
|
|
2064
|
-
* The path that the options are relative to.
|
|
1352
|
+
* Use "commonjs" to parse code that is intended to be run in a CommonJS environment such as Node.js.
|
|
2065
1353
|
*/
|
|
2066
|
-
|
|
1354
|
+
sourceType?: SourceType;
|
|
2067
1355
|
/**
|
|
2068
|
-
*
|
|
2069
|
-
*
|
|
1356
|
+
* Correlate output AST nodes with their source filename.
|
|
1357
|
+
* Useful when generating code and source maps from the ASTs of multiple input files.
|
|
2070
1358
|
*/
|
|
2071
|
-
|
|
2072
|
-
/**
|
|
2073
|
-
* The file that the user requested, e.g. `"@babel/env"`
|
|
2074
|
-
*/
|
|
2075
|
-
request: string;
|
|
2076
|
-
/**
|
|
2077
|
-
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
|
|
2078
|
-
*/
|
|
2079
|
-
resolved: string;
|
|
2080
|
-
} | null | undefined;
|
|
2081
|
-
}
|
|
2082
|
-
type PluginOptions = object | undefined | false;
|
|
2083
|
-
type PluginTarget = string | object | ((...args: any[]) => any);
|
|
2084
|
-
type PluginItem = ConfigItem | PluginObj<any> | PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined];
|
|
2085
|
-
declare function resolvePlugin(name: string, dirname: string): string | null;
|
|
2086
|
-
declare function resolvePreset(name: string, dirname: string): string | null;
|
|
2087
|
-
interface CreateConfigItemOptions {
|
|
2088
|
-
dirname?: string | undefined;
|
|
2089
|
-
type?: "preset" | "plugin" | undefined;
|
|
2090
|
-
}
|
|
2091
|
-
/**
|
|
2092
|
-
* Allows build tooling to create and cache config items up front. If this function is called multiple times for a
|
|
2093
|
-
* given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected
|
|
2094
|
-
* plugins and presets to inject, pre-constructing the config items would be recommended.
|
|
2095
|
-
*/
|
|
2096
|
-
declare function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem;
|
|
2097
|
-
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
|
|
2098
|
-
/**
|
|
2099
|
-
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
|
|
2100
|
-
*/
|
|
2101
|
-
interface ConfigAPI {
|
|
1359
|
+
sourceFilename?: string;
|
|
2102
1360
|
/**
|
|
2103
|
-
*
|
|
2104
|
-
*
|
|
2105
|
-
*
|
|
1361
|
+
* By default, all source indexes start from 0.
|
|
1362
|
+
* You can provide a start index to alternatively start with.
|
|
1363
|
+
* Useful for integration with other source tools.
|
|
2106
1364
|
*/
|
|
2107
|
-
|
|
1365
|
+
startIndex?: number;
|
|
2108
1366
|
/**
|
|
2109
|
-
*
|
|
1367
|
+
* By default, the first line of code parsed is treated as line 1.
|
|
1368
|
+
* You can provide a line number to alternatively start with.
|
|
1369
|
+
* Useful for integration with other source tools.
|
|
2110
1370
|
*/
|
|
2111
|
-
|
|
1371
|
+
startLine?: number;
|
|
2112
1372
|
/**
|
|
2113
|
-
*
|
|
1373
|
+
* By default, the parsed code is treated as if it starts from line 1, column 0.
|
|
1374
|
+
* You can provide a column number to alternatively start with.
|
|
1375
|
+
* Useful for integration with other source tools.
|
|
2114
1376
|
*/
|
|
2115
|
-
|
|
2116
|
-
// async(): boolean
|
|
1377
|
+
startColumn?: number;
|
|
2117
1378
|
/**
|
|
2118
|
-
*
|
|
2119
|
-
* Since many instances of Babel may be running in the same process with different `caller` values,
|
|
2120
|
-
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
|
|
2121
|
-
*
|
|
2122
|
-
* The `caller` value is available as the first parameter of the callback function.
|
|
2123
|
-
* It is best used with something like this to toggle configuration behavior
|
|
2124
|
-
* based on a specific environment:
|
|
2125
|
-
*
|
|
2126
|
-
* @example
|
|
2127
|
-
* function isBabelRegister(caller?: { name: string }) {
|
|
2128
|
-
* return !!(caller && caller.name === "@babel/register")
|
|
2129
|
-
* }
|
|
2130
|
-
* api.caller(isBabelRegister)
|
|
2131
|
-
*
|
|
2132
|
-
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
|
|
1379
|
+
* Array containing the plugins that you want to enable.
|
|
2133
1380
|
*/
|
|
2134
|
-
|
|
1381
|
+
plugins?: Plugin[];
|
|
2135
1382
|
/**
|
|
2136
|
-
*
|
|
2137
|
-
*
|
|
2138
|
-
*
|
|
2139
|
-
* @example
|
|
2140
|
-
* api.assertVersion(7) // major version only
|
|
2141
|
-
* api.assertVersion("^7.2")
|
|
2142
|
-
*
|
|
2143
|
-
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
|
|
1383
|
+
* Should the parser work in strict mode.
|
|
1384
|
+
* Defaults to true if sourceType === 'module'. Otherwise, false.
|
|
2144
1385
|
*/
|
|
2145
|
-
|
|
2146
|
-
// tokTypes: typeof tokTypes
|
|
2147
|
-
}
|
|
2148
|
-
/**
|
|
2149
|
-
* JS configs are great because they can compute a config on the fly,
|
|
2150
|
-
* but the downside there is that it makes caching harder.
|
|
2151
|
-
* Babel wants to avoid re-executing the config function every time a file is compiled,
|
|
2152
|
-
* because then it would also need to re-execute any plugin and preset functions
|
|
2153
|
-
* referenced in that config.
|
|
2154
|
-
*
|
|
2155
|
-
* To avoid this, Babel expects users of config functions to tell it how to manage caching
|
|
2156
|
-
* within a config file.
|
|
2157
|
-
*
|
|
2158
|
-
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
|
2159
|
-
*/
|
|
2160
|
-
interface SimpleCacheConfigurator {
|
|
2161
|
-
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
|
|
2162
|
-
// (ever: boolean): void
|
|
2163
|
-
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
|
|
1386
|
+
strictMode?: boolean;
|
|
2164
1387
|
/**
|
|
2165
|
-
*
|
|
1388
|
+
* Adds a ranges property to each node: [node.start, node.end]
|
|
2166
1389
|
*/
|
|
2167
|
-
|
|
1390
|
+
ranges?: boolean;
|
|
2168
1391
|
/**
|
|
2169
|
-
*
|
|
1392
|
+
* Adds all parsed tokens to a tokens property on the File node.
|
|
2170
1393
|
*/
|
|
2171
|
-
|
|
1394
|
+
tokens?: boolean;
|
|
2172
1395
|
/**
|
|
2173
|
-
*
|
|
2174
|
-
*
|
|
2175
|
-
*
|
|
2176
|
-
*
|
|
2177
|
-
* api.cache.using(() => process.env.NODE_ENV)
|
|
1396
|
+
* By default, the parser adds information about parentheses by setting
|
|
1397
|
+
* `extra.parenthesized` to `true` as needed.
|
|
1398
|
+
* When this option is `true` the parser creates `ParenthesizedExpression`
|
|
1399
|
+
* AST nodes instead of using the `extra` property.
|
|
2178
1400
|
*/
|
|
2179
|
-
|
|
1401
|
+
createParenthesizedExpressions?: boolean;
|
|
2180
1402
|
/**
|
|
2181
|
-
*
|
|
2182
|
-
*
|
|
2183
|
-
*
|
|
2184
|
-
*
|
|
2185
|
-
* @example
|
|
2186
|
-
* api.cache.invalidate(() => process.env.NODE_ENV)
|
|
1403
|
+
* The default is false in Babel 7 and true in Babel 8
|
|
1404
|
+
* Set this to true to parse it as an `ImportExpression` node.
|
|
1405
|
+
* Otherwise `import(foo)` is parsed as `CallExpression(Import, [Identifier(foo)])`.
|
|
2187
1406
|
*/
|
|
2188
|
-
|
|
1407
|
+
createImportExpressions?: boolean;
|
|
2189
1408
|
}
|
|
2190
|
-
|
|
2191
|
-
type
|
|
2192
|
-
type
|
|
1409
|
+
type ParserOptions = Partial<Options>;
|
|
1410
|
+
type ParseError = ParseError$1<object>;
|
|
1411
|
+
type ParseResult<Result extends File | Expression = File> = Result & {
|
|
1412
|
+
comments: File["comments"];
|
|
1413
|
+
errors: null | ParseError[];
|
|
1414
|
+
tokens?: File["tokens"];
|
|
1415
|
+
};
|
|
2193
1416
|
/**
|
|
2194
|
-
*
|
|
2195
|
-
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
|
|
2196
|
-
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
|
|
2197
|
-
*
|
|
2198
|
-
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
|
1417
|
+
* Parse the provided code as an entire ECMAScript program.
|
|
2199
1418
|
*/
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
* @returns `true` if the `envName` is `===` any of the given strings
|
|
2207
|
-
*/
|
|
2208
|
-
(envName: string | readonly string[]): boolean; // the official documentation is misleading for this one...
|
|
2209
|
-
// this just passes the callback to `cache.using` but with an additional argument.
|
|
2210
|
-
// it returns its result instead of necessarily returning a boolean.
|
|
2211
|
-
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions["envName"]>) => T): T;
|
|
2212
|
-
}
|
|
2213
|
-
type ConfigFunction = (api: ConfigAPI) => TransformOptions;
|
|
1419
|
+
declare function parse(input: string, options?: ParserOptions): ParseResult<File>;
|
|
1420
|
+
declare function parseExpression(input: string, options?: ParserOptions): ParseResult<Expression>;
|
|
1421
|
+
declare const tokTypes: {
|
|
1422
|
+
// todo(flow->ts) real token type
|
|
1423
|
+
[name: string]: any;
|
|
1424
|
+
};
|
|
2214
1425
|
//#endregion
|
|
2215
1426
|
//#region .dts-emit/code/core/src/babel/babelParse.d.ts
|
|
2216
1427
|
declare const parserOptions: ParserOptions;
|
|
@@ -2219,7 +1430,31 @@ interface ASTNode {
|
|
|
2219
1430
|
type: string;
|
|
2220
1431
|
}
|
|
2221
1432
|
declare const babelPrint: (ast: ASTNode) => string;
|
|
2222
|
-
declare const babelParseExpression: (code: string) => ParseResult
|
|
1433
|
+
declare const babelParseExpression: (code: string) => ParseResult<Expression>;
|
|
1434
|
+
//#endregion
|
|
1435
|
+
//#region .dts-emit/code/core/src/babel/babel-file.d.ts
|
|
1436
|
+
/** A parsed file with its Program path, like the `File` of @babel/core. */
|
|
1437
|
+
interface BabelFile {
|
|
1438
|
+
ast: File;
|
|
1439
|
+
code: string;
|
|
1440
|
+
opts: {
|
|
1441
|
+
filename?: string;
|
|
1442
|
+
};
|
|
1443
|
+
path: NodePath<Program>;
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Makes the Program path of `ast` the same way the `File` class of @babel/core does, without
|
|
1447
|
+
* @babel/core. The hub gives `path.buildCodeFrameError` a code frame from `code`.
|
|
1448
|
+
*/
|
|
1449
|
+
declare function createBabelFile({
|
|
1450
|
+
code,
|
|
1451
|
+
ast,
|
|
1452
|
+
filename
|
|
1453
|
+
}: {
|
|
1454
|
+
code: string;
|
|
1455
|
+
ast: File;
|
|
1456
|
+
filename?: string;
|
|
1457
|
+
}): BabelFile;
|
|
2223
1458
|
//#endregion
|
|
2224
1459
|
//#region .dts-emit/code/core/src/babel/expression-resolver.d.ts
|
|
2225
1460
|
/** Recursively unwraps TypeScript type annotation expressions (as X, satisfies X, <X>expr). */
|
|
@@ -2294,8 +1529,19 @@ declare const getTargetConfigObject: (target: AST, exportDefault: ExportDefaultD
|
|
|
2294
1529
|
declare const canUpdateVitestConfigFile: (fileContent: string) => boolean;
|
|
2295
1530
|
//#endregion
|
|
2296
1531
|
//#region .dts-emit/code/core/src/babel/index.d.ts
|
|
2297
|
-
declare const traverse:
|
|
1532
|
+
declare const traverse: {
|
|
1533
|
+
<S>(parent: Node, opts: TraverseOptions<S>, scope: Scope | undefined, state: S, parentPath?: NodePath): void;
|
|
1534
|
+
(parent: Node, opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void;
|
|
1535
|
+
visitors: typeof visitors;
|
|
1536
|
+
verify: typeof visitors.verify;
|
|
1537
|
+
explode: typeof visitors.explode;
|
|
1538
|
+
cheap: (node: Node, enter: (node: Node) => void) => void;
|
|
1539
|
+
node: (node: Node, opts: TraverseOptions, scope?: Scope, state?: any, path?: NodePath, skipKeys?: Record<string, boolean>) => void;
|
|
1540
|
+
clearNode: (node: Node, opts?: Options$1) => void;
|
|
1541
|
+
removeProperties: (tree: Node, opts?: Options$1) => Node;
|
|
1542
|
+
hasType: (tree: Node, type: Node["type"], denylistTypes?: string[]) => boolean;
|
|
1543
|
+
cache: typeof cache;
|
|
1544
|
+
};
|
|
2298
1545
|
declare const generate: typeof generate$1;
|
|
2299
|
-
declare const BabelFileClass: any;
|
|
2300
1546
|
//#endregion
|
|
2301
|
-
export { type BabelFile,
|
|
1547
|
+
export { type BabelFile, type GeneratorOptions, type NodePath, type RecastOptions, babelParse, babelParseExpression, babelPrint, canUpdateVitestConfigFile, createBabelFile, generate, getConfigObjectFromMergeArg, getEffectiveMergeConfigCall, getTargetConfigObject, isDefineConfigLike, isImportedDefineConfigLikeIdentifier, babel_parser_d_exports as parser, parserOptions, recast, resolveExpression, traverse, index_d_exports as types, unwrapTSExpression };
|