@aussieljk/forkbook 0.0.0-stage → 0.0.1-2
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 +22 -0
- package/README.md +77 -2
- package/assets/addon-vitest/templates/vitest.config.4.template.ts +36 -0
- package/assets/browser/favicon-wrapper.svg +46 -0
- package/assets/browser/favicon.svg +1 -0
- 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/assets/builder-vite/iframe.html +99 -0
- package/assets/create/rendererAssets/.eslintrc.json +16 -0
- package/assets/create/rendererAssets/common/Configure.mdx +388 -0
- package/assets/create/rendererAssets/common/assets/accessibility.png +0 -0
- package/assets/create/rendererAssets/common/assets/accessibility.svg +1 -0
- package/assets/create/rendererAssets/common/assets/addon-library.png +0 -0
- package/assets/create/rendererAssets/common/assets/assets.png +0 -0
- package/assets/create/rendererAssets/common/assets/avif-test-image.avif +0 -0
- package/assets/create/rendererAssets/common/assets/context.png +0 -0
- package/assets/create/rendererAssets/common/assets/discord.svg +1 -0
- package/assets/create/rendererAssets/common/assets/docs.png +0 -0
- package/assets/create/rendererAssets/common/assets/figma-plugin.png +0 -0
- package/assets/create/rendererAssets/common/assets/github.svg +1 -0
- package/assets/create/rendererAssets/common/assets/share.png +0 -0
- package/assets/create/rendererAssets/common/assets/styling.png +0 -0
- package/assets/create/rendererAssets/common/assets/testing.png +0 -0
- package/assets/create/rendererAssets/common/assets/theming.png +0 -0
- package/assets/create/rendererAssets/common/assets/tutorials.svg +1 -0
- package/assets/create/rendererAssets/common/assets/youtube.svg +1 -0
- package/assets/create/rendererAssets/common/button.css +30 -0
- package/assets/create/rendererAssets/common/header.css +32 -0
- package/assets/create/rendererAssets/common/page.css +68 -0
- package/assets/create/templates/react-native/index.expo.js +20 -0
- package/assets/create/templates/react-native/index.js +25 -0
- package/assets/docs/addon-backgrounds.gif +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/highlight.png +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/react-native/metro-env.d.ts +69 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +116 -0
- package/assets/server/base-preview-head.html +494 -0
- package/assets/server/openBrowser.applescript +94 -0
- package/assets/server/template.ejs +87 -0
- package/dist/.build-stamp +0 -0
- package/dist/_browser-chunks/Color-PCLE2J36.js +1025 -0
- package/dist/_browser-chunks/DocsRenderer-JXND3PVQ.js +10 -0
- package/dist/_browser-chunks/WithTooltip-XSQFTBMB.js +1619 -0
- package/dist/_browser-chunks/chunk-2JDQ35OA.js +247 -0
- package/dist/_browser-chunks/chunk-2JT76G3E.js +104 -0
- package/dist/_browser-chunks/chunk-2MEPHP35.js +17 -0
- package/dist/_browser-chunks/chunk-2SCZVUKW.js +24 -0
- package/dist/_browser-chunks/chunk-46Z7NGAS.js +41 -0
- package/dist/_browser-chunks/chunk-4ATQOMJB.js +30 -0
- package/dist/_browser-chunks/chunk-52CW7FF7.js +49 -0
- package/dist/_browser-chunks/chunk-5I7E4GMO.js +62 -0
- package/dist/_browser-chunks/chunk-5P4QA6MY.js +20 -0
- package/dist/_browser-chunks/chunk-5WMXI5GW.js +816 -0
- package/dist/_browser-chunks/chunk-66OCZ54D.js +2604 -0
- package/dist/_browser-chunks/chunk-6SXYJQST.js +253 -0
- package/dist/_browser-chunks/chunk-AYRF6EJB.js +36 -0
- package/dist/_browser-chunks/chunk-B4AUNNU4.js +156 -0
- package/dist/_browser-chunks/chunk-BCP2FFXF.js +369 -0
- package/dist/_browser-chunks/chunk-C3D4HEFY.js +3396 -0
- package/dist/_browser-chunks/chunk-CFAOWGL7.js +43 -0
- package/dist/_browser-chunks/chunk-CFWWCCZV.js +223 -0
- package/dist/_browser-chunks/chunk-CNED6RYH.js +18 -0
- package/dist/_browser-chunks/chunk-DRQKCCAG.js +136 -0
- package/dist/_browser-chunks/chunk-ECQ75MKQ.js +0 -0
- package/dist/_browser-chunks/chunk-EIYAKDGP.js +302 -0
- package/dist/_browser-chunks/chunk-ENKK74N4.js +12 -0
- package/dist/_browser-chunks/chunk-FENFYI4X.js +698 -0
- package/dist/_browser-chunks/chunk-FJGWSWL5.js +155 -0
- package/dist/_browser-chunks/chunk-FVSEPWWX.js +2810 -0
- package/dist/_browser-chunks/chunk-GNZY6LOW.js +10116 -0
- package/dist/_browser-chunks/chunk-IE4ULIOQ.js +14 -0
- package/dist/_browser-chunks/chunk-IMSF75WX.js +42 -0
- package/dist/_browser-chunks/chunk-IWQGIXJS.js +14 -0
- package/dist/_browser-chunks/chunk-JMC7AIKT.js +108 -0
- package/dist/_browser-chunks/chunk-JPUOQJUI.js +8 -0
- package/dist/_browser-chunks/chunk-JSBKXXXF.js +218 -0
- package/dist/_browser-chunks/chunk-JWSKPMPC.js +73 -0
- package/dist/_browser-chunks/chunk-JYVGARBG.js +2943 -0
- package/dist/_browser-chunks/chunk-KBK7GKBN.js +35 -0
- package/dist/_browser-chunks/chunk-KQ7CRO2B.js +108 -0
- package/dist/_browser-chunks/chunk-LAWXTSXK.js +18 -0
- package/dist/_browser-chunks/chunk-LE2LTDW3.js +14 -0
- package/dist/_browser-chunks/chunk-LEVSOOLQ.js +48 -0
- package/dist/_browser-chunks/chunk-LV5PIKV4.js +93 -0
- package/dist/_browser-chunks/chunk-MDOL7KML.js +56 -0
- package/dist/_browser-chunks/chunk-MFMDGWP6.js +34 -0
- package/dist/_browser-chunks/chunk-MLBOOZL4.js +67 -0
- package/dist/_browser-chunks/chunk-NQUD4B7H.js +91 -0
- package/dist/_browser-chunks/chunk-NULBREPZ.js +43 -0
- package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
- package/dist/_browser-chunks/chunk-OD6IBQCC.js +117 -0
- package/dist/_browser-chunks/chunk-ODVJ3XZJ.js +157 -0
- package/dist/_browser-chunks/chunk-OQWFVDIN.js +386 -0
- package/dist/_browser-chunks/chunk-OVH3USFB.js +20 -0
- package/dist/_browser-chunks/chunk-OZZPSYQR.js +14 -0
- package/dist/_browser-chunks/chunk-P6PK47TQ.js +1970 -0
- package/dist/_browser-chunks/chunk-PFRNG3UC.js +22 -0
- package/dist/_browser-chunks/chunk-PJSMZ27A.js +13 -0
- package/dist/_browser-chunks/chunk-QC4HFS6K.js +41 -0
- package/dist/_browser-chunks/chunk-QDXFODK4.js +274 -0
- package/dist/_browser-chunks/chunk-RBCHTR7C.js +28 -0
- package/dist/_browser-chunks/chunk-RMYQ3QN3.js +294 -0
- package/dist/_browser-chunks/chunk-RNTIV5CE.js +411 -0
- package/dist/_browser-chunks/chunk-RSPAQWVJ.js +80 -0
- package/dist/_browser-chunks/chunk-S6TK43XQ.js +836 -0
- package/dist/_browser-chunks/chunk-SC67XZST.js +18 -0
- package/dist/_browser-chunks/chunk-SFVA4SBT.js +683 -0
- package/dist/_browser-chunks/chunk-SZYFOQMT.js +25 -0
- package/dist/_browser-chunks/chunk-TBJCJXK4.js +18 -0
- package/dist/_browser-chunks/chunk-UMDO3KB7.js +205 -0
- package/dist/_browser-chunks/chunk-V2G23FV7.js +11 -0
- package/dist/_browser-chunks/chunk-V5M7Q4HT.js +88 -0
- package/dist/_browser-chunks/chunk-W5M6NPS3.js +198 -0
- package/dist/_browser-chunks/chunk-W7NE2JXW.js +84 -0
- package/dist/_browser-chunks/chunk-WGVAAM43.js +1110 -0
- package/dist/_browser-chunks/chunk-WHQRNHXD.js +8 -0
- package/dist/_browser-chunks/chunk-WOSOWBCA.js +12 -0
- package/dist/_browser-chunks/chunk-WZ7KR7SH.js +85 -0
- package/dist/_browser-chunks/chunk-YEKO6BHJ.js +20 -0
- package/dist/_browser-chunks/chunk-YI2IBIQS.js +7 -0
- package/dist/_browser-chunks/chunk-YTIT5NA5.js +1966 -0
- package/dist/_browser-chunks/chunk-ZEHRUHTA.js +6 -0
- package/dist/_browser-chunks/chunk-ZTQ5MEJ5.js +203 -0
- package/dist/_browser-chunks/matchers-YLBYSYAF.js +1263 -0
- package/dist/_browser-chunks/react-dom-client-4OHE3QDV.js +9 -0
- package/dist/_node-chunks/attached-runtime-I2G4WLJI.js +282 -0
- package/dist/_node-chunks/builder-manager-VVHYQXCH.js +1661 -0
- package/dist/_node-chunks/chunk-2BUPBPFB.js +82 -0
- package/dist/_node-chunks/chunk-2DSIDINN.js +884 -0
- package/dist/_node-chunks/chunk-2RU7BKEW.js +23 -0
- package/dist/_node-chunks/chunk-34EO2PUT.js +26 -0
- package/dist/_node-chunks/chunk-3BKIBF5S.js +3008 -0
- package/dist/_node-chunks/chunk-3SDUYDXH.js +98 -0
- package/dist/_node-chunks/chunk-3T4ZSNPH.js +662 -0
- package/dist/_node-chunks/chunk-3W7F2B7P.js +79 -0
- package/dist/_node-chunks/chunk-3Y6AAY5H.js +80 -0
- package/dist/_node-chunks/chunk-42UWAGPW.js +1193 -0
- package/dist/_node-chunks/chunk-4FEANXWU.js +1986 -0
- package/dist/_node-chunks/chunk-5DQFEZEA.js +40 -0
- package/dist/_node-chunks/chunk-6KEHV53S.js +1218 -0
- package/dist/_node-chunks/chunk-6LMWA44H.js +3837 -0
- package/dist/_node-chunks/chunk-6YKBRP72.js +20 -0
- package/dist/_node-chunks/chunk-7GUDZVRQ.js +110 -0
- package/dist/_node-chunks/chunk-B5J7Q7J4.js +21 -0
- package/dist/_node-chunks/chunk-BS2WMZMR.js +90 -0
- package/dist/_node-chunks/chunk-BSKFCWQD.js +47 -0
- package/dist/_node-chunks/chunk-BXVYT7SB.js +36 -0
- package/dist/_node-chunks/chunk-CCOTJ4FC.js +688 -0
- package/dist/_node-chunks/chunk-CQKMLL5J.js +33 -0
- package/dist/_node-chunks/chunk-CXRU72ET.js +63 -0
- package/dist/_node-chunks/chunk-DC7DKR5K.js +20 -0
- package/dist/_node-chunks/chunk-DHJFTB4K.js +25 -0
- package/dist/_node-chunks/chunk-DUR55DJJ.js +1094 -0
- package/dist/_node-chunks/chunk-E6YESGLX.js +7032 -0
- package/dist/_node-chunks/chunk-EHUNOMDD.js +52345 -0
- package/dist/_node-chunks/chunk-ET7PWEO7.js +298 -0
- package/dist/_node-chunks/chunk-EWOX7HPJ.js +20 -0
- package/dist/_node-chunks/chunk-F3ZFKBHY.js +844 -0
- package/dist/_node-chunks/chunk-FK7KGTV7.js +26 -0
- package/dist/_node-chunks/chunk-FPZB5OI7.js +35 -0
- package/dist/_node-chunks/chunk-FW2HQUBQ.js +25 -0
- package/dist/_node-chunks/chunk-FY6UXW6G.js +11 -0
- package/dist/_node-chunks/chunk-GEFQN7K3.js +499 -0
- package/dist/_node-chunks/chunk-GRBLDJCR.js +989 -0
- package/dist/_node-chunks/chunk-H32DYT6P.js +87 -0
- package/dist/_node-chunks/chunk-H4PPVMP5.js +23 -0
- package/dist/_node-chunks/chunk-HMP2G23X.js +25 -0
- package/dist/_node-chunks/chunk-ICPBH3E7.js +59 -0
- package/dist/_node-chunks/chunk-IDEL2J23.js +23 -0
- package/dist/_node-chunks/chunk-IK4FGZLR.js +223 -0
- package/dist/_node-chunks/chunk-JDXXX6LB.js +68 -0
- package/dist/_node-chunks/chunk-JGGFYIG5.js +5468 -0
- package/dist/_node-chunks/chunk-JPAZLYJ3.js +29 -0
- package/dist/_node-chunks/chunk-JZOO7GGC.js +48 -0
- package/dist/_node-chunks/chunk-KISMCCP5.js +4744 -0
- package/dist/_node-chunks/chunk-LCK4ZQKG.js +115 -0
- package/dist/_node-chunks/chunk-LO56I6E2.js +132 -0
- package/dist/_node-chunks/chunk-LXBD4UL4.js +104 -0
- package/dist/_node-chunks/chunk-MA24JW6C.js +7162 -0
- package/dist/_node-chunks/chunk-MK2KYAI6.js +5414 -0
- package/dist/_node-chunks/chunk-NDWKJ4CL.js +2102 -0
- package/dist/_node-chunks/chunk-NIBT7XDZ.js +168 -0
- package/dist/_node-chunks/chunk-NPO45IMH.js +33 -0
- package/dist/_node-chunks/chunk-OISX4AGQ.js +414 -0
- package/dist/_node-chunks/chunk-OUW6R7C3.js +26 -0
- package/dist/_node-chunks/chunk-OWNFOGTA.js +194 -0
- package/dist/_node-chunks/chunk-Q7QNUM5H.js +49 -0
- package/dist/_node-chunks/chunk-QEQLR22M.js +1877 -0
- package/dist/_node-chunks/chunk-RRN2V55B.js +45 -0
- package/dist/_node-chunks/chunk-RWFIFGO5.js +144 -0
- package/dist/_node-chunks/chunk-RXNJDRGO.js +209 -0
- package/dist/_node-chunks/chunk-RZMQ7S3L.js +92 -0
- package/dist/_node-chunks/chunk-SIEXZVCR.js +51 -0
- package/dist/_node-chunks/chunk-SLWQNBGO.js +2034 -0
- package/dist/_node-chunks/chunk-SVTBJ7Q3.js +35 -0
- package/dist/_node-chunks/chunk-SWO5CDYU.js +32 -0
- package/dist/_node-chunks/chunk-TD5PLLQG.js +121 -0
- package/dist/_node-chunks/chunk-TEQGGSP7.js +33 -0
- package/dist/_node-chunks/chunk-TFCEV2XX.js +155 -0
- package/dist/_node-chunks/chunk-TFEWM4E3.js +1073 -0
- package/dist/_node-chunks/chunk-TINO74G5.js +21 -0
- package/dist/_node-chunks/chunk-TNJIXE37.js +40 -0
- package/dist/_node-chunks/chunk-TWI4GVH7.js +19 -0
- package/dist/_node-chunks/chunk-U5W53R2J.js +1011 -0
- package/dist/_node-chunks/chunk-UBOGWBEA.js +148 -0
- package/dist/_node-chunks/chunk-UMUBKI6E.js +3787 -0
- package/dist/_node-chunks/chunk-UVINFLGY.js +56 -0
- package/dist/_node-chunks/chunk-V2DY426G.js +1133 -0
- package/dist/_node-chunks/chunk-VLOXOXXE.js +45 -0
- package/dist/_node-chunks/chunk-W4OMYLSP.js +1297 -0
- package/dist/_node-chunks/chunk-WAXVSN3O.js +18 -0
- package/dist/_node-chunks/chunk-WCULS5TP.js +3767 -0
- package/dist/_node-chunks/chunk-WNZ2UMFM.js +153 -0
- package/dist/_node-chunks/chunk-WZJF2OUH.js +74 -0
- package/dist/_node-chunks/chunk-XGIUVY52.js +611 -0
- package/dist/_node-chunks/chunk-XHL2LVBM.js +415 -0
- package/dist/_node-chunks/chunk-XI6B6P47.js +59 -0
- package/dist/_node-chunks/chunk-XLP2ZKXV.js +60 -0
- package/dist/_node-chunks/chunk-YCMRA6RX.js +95 -0
- package/dist/_node-chunks/chunk-YZFWBA5L.js +2700 -0
- package/dist/_node-chunks/chunk-ZMAMXQKP.js +4731 -0
- package/dist/_node-chunks/chunk-ZWBCQ4MJ.js +110 -0
- package/dist/_node-chunks/dist-VTSTZKUB.js +16 -0
- package/dist/_node-chunks/globby-OEMHPBFY.js +2884 -0
- package/dist/_node-chunks/jiti-NFX6UU74.js +3848 -0
- package/dist/_node-chunks/lib-MDVARD7W.js +366 -0
- package/dist/_node-chunks/local-runtime-NTKIN2QT.js +78 -0
- package/dist/_node-chunks/mdx-plugin-MWISDWDQ.js +5680 -0
- package/dist/_node-chunks/monorepo-LIRFMQXE.js +121 -0
- package/dist/_node-chunks/monorepo-optimized-tests-relaxed-limits-no-story-deletion-CPDW4XTW.js +121 -0
- package/dist/_node-chunks/optimized-tests-HDOLR3EY.js +22 -0
- package/dist/_node-chunks/pattern-copy-play-EKHIUAU2.js +807 -0
- package/dist/_node-chunks/postinstallAddon-GYGMWDL6.js +20 -0
- package/dist/_node-chunks/rehype-external-links-BUN3HUCO.js +121 -0
- package/dist/_node-chunks/rehype-slug-PLADX223.js +52 -0
- package/dist/_node-chunks/relaxed-limits-GBHW6KIQ.js +117 -0
- package/dist/_node-chunks/run-KDTIZNSY.js +103 -0
- package/dist/_node-chunks/run-NL66VTNR.js +4532 -0
- package/dist/_node-chunks/session-id-KIIVOQLR.js +23 -0
- package/dist/_node-chunks/setup-MGC7BQO6.js +278 -0
- package/dist/_node-chunks/vitest.config.4.template-JH2THZFG.js +54 -0
- package/dist/actions/decorator.d.ts +7 -0
- package/dist/actions/decorator.js +43 -0
- package/dist/actions/index.d.ts +67 -0
- package/dist/actions/index.js +28 -0
- package/dist/addon-a11y/index.d.ts +52 -0
- package/dist/addon-a11y/index.js +16 -0
- package/dist/addon-a11y/manager.js +1429 -0
- package/dist/addon-a11y/preset.js +18 -0
- package/dist/addon-a11y/preview.d.ts +17 -0
- package/dist/addon-a11y/preview.js +15 -0
- package/dist/addon-docs/blocks.d.ts +1061 -0
- package/dist/addon-docs/blocks.js +2461 -0
- package/dist/addon-docs/index.d.ts +236 -0
- package/dist/addon-docs/index.js +16 -0
- package/dist/addon-docs/manager.js +90 -0
- package/dist/addon-docs/mdx-react-shim.d.ts +1 -0
- package/dist/addon-docs/mdx-react-shim.js +2 -0
- package/dist/addon-docs/preset.js +378 -0
- package/dist/addon-docs/preview.d.ts +4 -0
- package/dist/addon-docs/preview.js +7 -0
- package/dist/addon-links/index.d.ts +22 -0
- package/dist/addon-links/index.js +20 -0
- package/dist/addon-links/manager.js +14 -0
- package/dist/addon-links/preview.d.ts +6 -0
- package/dist/addon-links/preview.js +9 -0
- package/dist/addon-links/react/index.d.ts +25 -0
- package/dist/addon-links/react/index.js +52 -0
- package/dist/addon-mcp/preset.js +1345 -0
- package/dist/addon-mcp/preview.js +29 -0
- package/dist/addon-mcp/tools/preview-stories/preview-stories-app-script.js +1153 -0
- package/dist/addon-ondevice-actions/index.d.ts +4 -0
- package/dist/addon-ondevice-actions/index.js +7 -0
- package/dist/addon-ondevice-actions/register.js +7 -0
- package/dist/addon-ondevice-controls/index.d.ts +6 -0
- package/dist/addon-ondevice-controls/index.js +14 -0
- package/dist/addon-ondevice-controls/register.js +10 -0
- package/dist/addon-pseudo-states/index.d.ts +35 -0
- package/dist/addon-pseudo-states/index.js +15 -0
- package/dist/addon-pseudo-states/manager.js +53 -0
- package/dist/addon-pseudo-states/preview.d.ts +9 -0
- package/dist/addon-pseudo-states/preview.js +10 -0
- package/dist/addon-themes/index.d.ts +80 -0
- package/dist/addon-themes/index.js +104 -0
- package/dist/addon-themes/manager.js +97 -0
- package/dist/addon-themes/postinstall.js +33 -0
- package/dist/addon-themes/preview.d.ts +6 -0
- package/dist/addon-themes/preview.js +8 -0
- package/dist/addon-vitest/constants.d.ts +132 -0
- package/dist/addon-vitest/constants.js +66 -0
- package/dist/addon-vitest/index.d.ts +4 -0
- package/dist/addon-vitest/index.js +8 -0
- package/dist/addon-vitest/manager.js +665 -0
- package/dist/addon-vitest/node/coverage-reporter.js +1284 -0
- package/dist/addon-vitest/node/vitest.js +674 -0
- package/dist/addon-vitest/postinstall.js +24 -0
- package/dist/addon-vitest/preset.js +943 -0
- package/dist/addon-vitest/vitest-plugin/global-setup.js +162 -0
- package/dist/addon-vitest/vitest-plugin/index.d.ts +56 -0
- package/dist/addon-vitest/vitest-plugin/index.js +463 -0
- package/dist/addon-vitest/vitest-plugin/setup-file-with-project-annotations.js +9 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.browser.4.js +20 -0
- package/dist/addon-vitest/vitest-plugin/setup-file.js +50 -0
- package/dist/addon-vitest/vitest-plugin/test-utils.js +128 -0
- package/dist/babel/index.d.ts +2301 -0
- package/dist/babel/index.js +61 -0
- package/dist/backgrounds/index.d.ts +6 -0
- package/dist/backgrounds/index.js +15 -0
- package/dist/bin/core.js +1705 -0
- package/dist/bin/dispatcher.js +43 -0
- package/dist/bin/loader.js +115 -0
- package/dist/builder-vite/index.d.ts +50 -0
- package/dist/builder-vite/index.js +245 -0
- package/dist/builder-vite/preset.js +27 -0
- package/dist/channels/index.d.ts +2 -0
- package/dist/channels/index.js +352 -0
- package/dist/chunk-B2t1tGRh.d.ts +284 -0
- package/dist/chunk-BCoJQE-f.d.ts +602 -0
- package/dist/chunk-BGkgZp-H.d.ts +214 -0
- package/dist/chunk-BTVrWliM.d.ts +115 -0
- package/dist/chunk-BXLImeLy.d.ts +197 -0
- package/dist/chunk-BfBzpgct.d.ts +916 -0
- package/dist/chunk-Bpi2tz-6.d.ts +511 -0
- package/dist/chunk-BxWufQms.d.ts +142 -0
- package/dist/chunk-C-bavsOH.d.ts +34 -0
- package/dist/chunk-C2p5r3Vt.d.ts +13001 -0
- package/dist/chunk-C6PAgHLT.d.ts +12 -0
- package/dist/chunk-CMeX4WRe.d.ts +179 -0
- package/dist/chunk-Ct9xd6IM.d.ts +65 -0
- package/dist/chunk-CwQKNaYL.d.ts +15 -0
- package/dist/chunk-D7DwV41f.d.ts +3622 -0
- package/dist/chunk-DEVFdzxR.d.ts +253 -0
- package/dist/chunk-DaVb55-_.d.ts +124 -0
- package/dist/chunk-DgRNfmj_.d.ts +40 -0
- package/dist/chunk-DoIGKY33.d.ts +666 -0
- package/dist/chunk-Dr3R0DXk.d.ts +40 -0
- package/dist/chunk-DtHByo32.d.ts +55 -0
- package/dist/chunk-Dw1z1Pki.d.ts +933 -0
- package/dist/chunk-DzuY9DXg.d.ts +79 -0
- package/dist/chunk-FjDVzZTj.d.ts +62 -0
- package/dist/chunk-Kt1tW-D1.d.ts +59 -0
- package/dist/chunk-XP8oHzpE.d.ts +6 -0
- package/dist/chunk-gCX81nOr.d.ts +61 -0
- package/dist/chunk-pcFXCimE.d.ts +741 -0
- package/dist/cli/index.d.ts +1174 -0
- package/dist/cli/index.js +5613 -0
- package/dist/cli/skills/content/index.d.ts +72 -0
- package/dist/cli/skills/content/index.js +335 -0
- package/dist/cli/tools/sdk/child-host.d.ts +61 -0
- package/dist/cli/tools/sdk/child-host.js +131 -0
- package/dist/cli/tools/sdk/index.d.ts +137 -0
- package/dist/cli/tools/sdk/index.js +44 -0
- package/dist/cli-commands/bin/index.js +25 -0
- package/dist/client-logger/index.d.ts +31 -0
- package/dist/client-logger/index.js +63 -0
- package/dist/common/index.d.ts +1103 -0
- package/dist/common/index.js +364 -0
- package/dist/components/index.d.ts +1924 -0
- package/dist/components/index.js +13759 -0
- package/dist/core-events/index.d.ts +155 -0
- package/dist/core-events/index.js +136 -0
- package/dist/core-server/index.d.ts +2200 -0
- package/dist/core-server/index.js +4165 -0
- package/dist/core-server/presets/common-manager.css +170 -0
- package/dist/core-server/presets/common-manager.js +4168 -0
- package/dist/core-server/presets/common-override-preset.js +81 -0
- package/dist/core-server/presets/common-preset.js +2187 -0
- package/dist/create/bin/index.js +23 -0
- package/dist/create/index.js +25 -0
- package/dist/csf/csf-utils.d.ts +2 -0
- package/dist/csf/csf-utils.js +19 -0
- package/dist/csf/index.d.ts +7 -0
- package/dist/csf/index.js +2142 -0
- package/dist/csf-tools/index.d.ts +1157 -0
- package/dist/csf-tools/index.js +736 -0
- package/dist/docs-tools/index.d.ts +197 -0
- package/dist/docs-tools/index.js +61 -0
- package/dist/highlight/index.d.ts +10 -0
- package/dist/highlight/index.js +15 -0
- package/dist/instrumenter/index.d.ts +113 -0
- package/dist/instrumenter/index.js +2595 -0
- package/dist/manager/_manager-chunks/globals-runtime-8HkdnU2F.js +6144 -0
- package/dist/manager/_manager-chunks/globals-runtime-BIKBO23x.js +3389 -0
- package/dist/manager/_manager-chunks/globals-runtime-BdGkqNEt.js +45 -0
- package/dist/manager/_manager-chunks/globals-runtime-BmphMP6z.js +1190 -0
- package/dist/manager/_manager-chunks/globals-runtime-BvM-NY2g.js +13307 -0
- package/dist/manager/_manager-chunks/globals-runtime-C02fvgcd.js +9243 -0
- package/dist/manager/_manager-chunks/globals-runtime-DkAPXCvc.js +9766 -0
- package/dist/manager/_manager-chunks/globals-runtime-DpNYC-qi.js +5564 -0
- package/dist/manager/_manager-chunks/globals-runtime-DtcOnYHR.js +5357 -0
- package/dist/manager/_manager-chunks/globals-runtime-DwFqpqya.js +722 -0
- package/dist/manager/_manager-chunks/globals-runtime-FC201B7s.js +6837 -0
- package/dist/manager/_manager-chunks/globals-runtime-Rp_zjGnh.js +121 -0
- package/dist/manager/_manager-chunks/globals-runtime-ZHrQFa3-.js +10463 -0
- package/dist/manager/_manager-chunks/globals-runtime-eLPTIfX-.js +7759 -0
- package/dist/manager/_manager-chunks/globals-runtime-qKvCZHFY.js +4468 -0
- package/dist/manager/_manager-chunks/globals-runtime-sGpNlIJ1.js +5102 -0
- package/dist/manager/_manager-chunks/runtime-B1L9TH89.js +452 -0
- package/dist/manager/_manager-chunks/runtime-BK0zF7FN.js +22 -0
- package/dist/manager/_manager-chunks/runtime-BhkT2CXl.js +1408 -0
- package/dist/manager/_manager-chunks/runtime-Bly6WJLN.js +998 -0
- package/dist/manager/_manager-chunks/runtime-D0UOWx0U.js +979 -0
- package/dist/manager/_manager-chunks/runtime-D94Vq3oR.js +4014 -0
- package/dist/manager/_manager-chunks/runtime-DMig8mT7.js +77 -0
- package/dist/manager/_manager-chunks/runtime-EITvVbkG.js +46 -0
- package/dist/manager/_manager-chunks/runtime-cp5pazY2.js +8936 -0
- package/dist/manager/_manager-chunks/runtime-eDVAYF7N.js +6860 -0
- package/dist/manager/_manager-chunks/runtime-i-PDAHLR.js +2493 -0
- package/dist/manager/globals-runtime.js +2 -0
- package/dist/manager/globals.d.ts +23 -0
- package/dist/manager/globals.js +26 -0
- package/dist/manager/manager-stores.d.ts +2 -0
- package/dist/manager/manager-stores.js +19 -0
- package/dist/manager/runtime.js +2 -0
- package/dist/manager-api/index.d.ts +2 -0
- package/dist/manager-api/index.js +3257 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +20 -0
- package/dist/mcp/index.d.ts +270 -0
- package/dist/mcp/index.js +305 -0
- package/dist/mocking-utils/index.d.ts +689 -0
- package/dist/mocking-utils/index.js +521 -0
- package/dist/mocking-utils/mocker-runtime.js +1254 -0
- package/dist/nextjs-vite/config/preview.js +3 -0
- package/dist/nextjs-vite/export-mocks/cache/index.d.ts +25 -0
- package/dist/nextjs-vite/export-mocks/cache/index.js +29 -0
- package/dist/nextjs-vite/export-mocks/headers/index.d.ts +37 -0
- package/dist/nextjs-vite/export-mocks/headers/index.js +54 -0
- package/dist/nextjs-vite/export-mocks/link/index.d.ts +9 -0
- package/dist/nextjs-vite/export-mocks/link/index.js +59 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.d.ts +28 -0
- package/dist/nextjs-vite/export-mocks/navigation/index.js +58 -0
- package/dist/nextjs-vite/export-mocks/router/index.d.ts +34 -0
- package/dist/nextjs-vite/export-mocks/router/index.js +63 -0
- package/dist/nextjs-vite/index.d.ts +92 -0
- package/dist/nextjs-vite/index.js +58 -0
- package/dist/nextjs-vite/node/index.d.ts +6 -0
- package/dist/nextjs-vite/node/index.js +20 -0
- package/dist/nextjs-vite/preset.js +648 -0
- package/dist/nextjs-vite/preview.d.ts +20 -0
- package/dist/nextjs-vite/preview.js +11 -0
- package/dist/nextjs-vite/vite-plugin/index.d.ts +6 -0
- package/dist/nextjs-vite/vite-plugin/index.js +19 -0
- package/dist/nextjs-vite-plugin/index.d.ts +28 -0
- package/dist/nextjs-vite-plugin/index.js +923 -0
- package/dist/nextjs-vite-plugin/mocks/storybook.global.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-context.js +8 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/image-default-loader.js +23 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-image.js +28 -0
- package/dist/nextjs-vite-plugin/plugins/next-image/alias/next-legacy-image.js +17 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/cache/index.js +29 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/dynamic/index.js +40 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/headers/index.js +55 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/link/index.js +63 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/navigation/index.js +71 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/router/index.js +74 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/rsc/server-only.js +7 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/alias/safe-stable-stringify/index.js +13 -0
- package/dist/nextjs-vite-plugin/plugins/next-mocks/compatibility/draft-mode.compat.js +7 -0
- package/dist/node-logger/index.d.ts +495 -0
- package/dist/node-logger/index.js +42 -0
- package/dist/oxc-parser/index.d.ts +99 -0
- package/dist/oxc-parser/index.js +275 -0
- package/dist/oxc-parser/worker.js +37 -0
- package/dist/preview/_chunks/runtime-BIzIdDbb.js +10263 -0
- package/dist/preview/_chunks/runtime-BTPtVY1p.js +1102 -0
- package/dist/preview/_chunks/runtime-BZSnICCg.js +8484 -0
- package/dist/preview/_chunks/runtime-BdGkqNEt.js +45 -0
- package/dist/preview/_chunks/runtime-BwSxqk3t.js +63 -0
- package/dist/preview/_chunks/runtime-CqHxptiK.js +6143 -0
- package/dist/preview/_chunks/runtime-CsV4HZPV.js +5064 -0
- package/dist/preview/_chunks/runtime-CxZK_Ln3.js +284 -0
- package/dist/preview/_chunks/runtime-DZToXfvO.js +9767 -0
- package/dist/preview/_chunks/runtime-DrTjJkPY.js +3872 -0
- package/dist/preview/_chunks/runtime-DuHdxMFA.js +387 -0
- package/dist/preview/_chunks/runtime-iXdo8CR8.js +3635 -0
- package/dist/preview/_chunks/runtime-q3wt0e_N.js +6838 -0
- package/dist/preview/globals.d.ts +16 -0
- package/dist/preview/globals.js +20 -0
- package/dist/preview/runtime.js +6 -0
- package/dist/preview-api/index.d.ts +4 -0
- package/dist/preview-api/index.js +147 -0
- package/dist/preview-errors.d.ts +186 -0
- package/dist/preview-errors.js +56 -0
- package/dist/react/docgen/docgen-worker.js +38 -0
- package/dist/react/entry-preview-argtypes.js +9 -0
- package/dist/react/entry-preview-docs.js +12 -0
- package/dist/react/entry-preview-rsc.js +11 -0
- package/dist/react/entry-preview.js +21 -0
- package/dist/react/index.d.ts +119 -0
- package/dist/react/index.js +26 -0
- package/dist/react/preset.js +301 -0
- package/dist/react/preview.d.ts +2 -0
- package/dist/react/preview.js +11 -0
- package/dist/react-native/bin/get-stories.js +34 -0
- package/dist/react-native/index.d.ts +160 -0
- package/dist/react-native/index.js +1547 -0
- package/dist/react-native/metro/node.d.ts +83 -0
- package/dist/react-native/metro/node.js +21 -0
- package/dist/react-native/metro/withStorybook.d.ts +2269 -0
- package/dist/react-native/metro/withStorybook.js +138 -0
- package/dist/react-native/preview.d.ts +6 -0
- package/dist/react-native/preview.js +20 -0
- package/dist/react-native/scripts/generate.d.ts +22 -0
- package/dist/react-native/scripts/generate.js +18 -0
- package/dist/react-native/stub.js +20 -0
- package/dist/react-native-theming/index.d.ts +175 -0
- package/dist/react-native-theming/index.js +2591 -0
- package/dist/react-native-ui/index.d.ts +130 -0
- package/dist/react-native-ui/index.js +1448 -0
- package/dist/react-native-ui-common/index.d.ts +230 -0
- package/dist/react-native-ui-common/index.js +514 -0
- package/dist/react-vite/index.d.ts +4 -0
- package/dist/react-vite/index.js +8 -0
- package/dist/react-vite/node/index.d.ts +6 -0
- package/dist/react-vite/node/index.js +20 -0
- package/dist/react-vite/preset.d.ts +6 -0
- package/dist/react-vite/preset.js +21 -0
- package/dist/router/index.d.ts +141 -0
- package/dist/router/index.js +1217 -0
- package/dist/server-errors.d.ts +2 -0
- package/dist/server-errors.js +149 -0
- package/dist/shared/open-service/index.d.ts +3 -0
- package/dist/shared/open-service/index.js +115 -0
- package/dist/shared/open-service/services/docgen/worker/docgen-worker.js +75 -0
- package/dist/shared/open-service/toolsets/docs/public.d.ts +1296 -0
- package/dist/shared/open-service/toolsets/docs/public.js +991 -0
- package/dist/telemetry/index.d.ts +314 -0
- package/dist/telemetry/index.js +103 -0
- package/dist/test/index.d.ts +158 -0
- package/dist/test/index.js +19421 -0
- package/dist/theming/create.d.ts +15 -0
- package/dist/theming/create.js +11 -0
- package/dist/theming/index.d.ts +54 -0
- package/dist/theming/index.js +511 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +48 -0
- package/dist/viewport/index.d.ts +275 -0
- package/dist/viewport/index.js +21 -0
- package/package.json +1054 -4
- package/template/nextjs-vite/cli/.eslintrc.json +6 -0
- package/template/nextjs-vite/cli/js/Button.jsx +42 -0
- package/template/nextjs-vite/cli/js/Button.stories.js +49 -0
- package/template/nextjs-vite/cli/js/Configure.mdx +470 -0
- package/template/nextjs-vite/cli/js/Header.jsx +58 -0
- package/template/nextjs-vite/cli/js/Header.stories.js +30 -0
- package/template/nextjs-vite/cli/js/Page.jsx +68 -0
- package/template/nextjs-vite/cli/js/Page.stories.js +28 -0
- package/template/nextjs-vite/cli/ts/Button.stories.ts +54 -0
- package/template/nextjs-vite/cli/ts/Button.tsx +39 -0
- package/template/nextjs-vite/cli/ts/Configure.mdx +446 -0
- package/template/nextjs-vite/cli/ts/Header.stories.ts +34 -0
- package/template/nextjs-vite/cli/ts/Header.tsx +54 -0
- package/template/nextjs-vite/cli/ts/Page.stories.ts +33 -0
- package/template/nextjs-vite/cli/ts/Page.tsx +73 -0
- package/template/react/cli/.eslintrc.json +5 -0
- package/template/react/cli/js/Button.jsx +39 -0
- package/template/react/cli/js/Button.stories.js +49 -0
- package/template/react/cli/js/Header.jsx +56 -0
- package/template/react/cli/js/Header.stories.js +29 -0
- package/template/react/cli/js/Page.jsx +69 -0
- package/template/react/cli/js/Page.stories.js +28 -0
- package/template/react/cli/ts/Button.stories.ts +54 -0
- package/template/react/cli/ts/Button.tsx +37 -0
- package/template/react/cli/ts/Header.stories.ts +34 -0
- package/template/react/cli/ts/Header.tsx +56 -0
- package/template/react/cli/ts/Page.stories.ts +33 -0
- package/template/react/cli/ts/Page.tsx +73 -0
- package/template/react-vite/cli/.eslintrc.json +5 -0
- package/template/react-vite/cli/js/Button.jsx +39 -0
- package/template/react-vite/cli/js/Button.stories.js +49 -0
- package/template/react-vite/cli/js/Header.jsx +56 -0
- package/template/react-vite/cli/js/Header.stories.js +29 -0
- package/template/react-vite/cli/js/Page.jsx +69 -0
- package/template/react-vite/cli/js/Page.stories.js +28 -0
- package/template/react-vite/cli/ts/Button.stories.ts +54 -0
- package/template/react-vite/cli/ts/Button.tsx +37 -0
- package/template/react-vite/cli/ts/Header.stories.ts +34 -0
- package/template/react-vite/cli/ts/Header.tsx +56 -0
- package/template/react-vite/cli/ts/Page.stories.ts +33 -0
- package/template/react-vite/cli/ts/Page.tsx +73 -0
|
@@ -0,0 +1,2301 @@
|
|
|
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, 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$1, 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
|
+
import * as recast from "recast";
|
|
3
|
+
import { Options as RecastOptions } from "recast";
|
|
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
|
+
//#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
|
+
declare namespace visitors {
|
|
298
|
+
/**
|
|
299
|
+
* `explode()` will take a `Visitor` object with all of the various shorthands
|
|
300
|
+
* that we support, and validates & normalizes it into a common format, ready
|
|
301
|
+
* to be used in traversal.
|
|
302
|
+
*
|
|
303
|
+
* The various shorthands are:
|
|
304
|
+
* - `Identifier() { ... }` -> `Identifier: { enter() { ... } }`
|
|
305
|
+
* - `"Identifier|NumericLiteral": { ... }` -> `Identifier: { ... }, NumericLiteral: { ... }`
|
|
306
|
+
* - Aliases in `@babel/types`: e.g. `Property: { ... }` -> `ObjectProperty: { ... }, ClassProperty: { ... }`
|
|
307
|
+
*
|
|
308
|
+
* Other normalizations are:
|
|
309
|
+
* - Visitors of virtual types are wrapped, so that they are only visited when their dynamic check passes
|
|
310
|
+
* - `enter` and `exit` functions are wrapped in arrays, to ease merging of visitors
|
|
311
|
+
*/
|
|
312
|
+
function explode<S = unknown>(visitor: Visitor<S>): { [Type in Exclude<Node$1, DeprecatedAliases>["type"]]?: VisitNodeObject<S, Extract<Node$1, {
|
|
313
|
+
type: Type;
|
|
314
|
+
}>> };
|
|
315
|
+
function verify(visitor: Visitor): void;
|
|
316
|
+
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$1>) => VisitNodeFunction<unknown, Node$1> | null): Visitor;
|
|
318
|
+
}
|
|
319
|
+
declare namespace cache {
|
|
320
|
+
let path: WeakMap<Node$1, Map<Node$1, NodePath>>;
|
|
321
|
+
let scope: WeakMap<Node$1, Scope>;
|
|
322
|
+
function clear(): void;
|
|
323
|
+
function clearPath(): void;
|
|
324
|
+
function clearScope(): void;
|
|
325
|
+
}
|
|
326
|
+
type TraverseOptions<S = Node$1> = {
|
|
327
|
+
scope?: Scope;
|
|
328
|
+
noScope?: boolean;
|
|
329
|
+
denylist?: NodeType[]; /** @deprecated will be removed in Babel 8 */
|
|
330
|
+
blacklist?: NodeType[];
|
|
331
|
+
shouldSkip?: (node: NodePath) => boolean;
|
|
332
|
+
} & Visitor<S>;
|
|
333
|
+
declare class Scope {
|
|
334
|
+
/**
|
|
335
|
+
* This searches the current "scope" and collects all references/bindings
|
|
336
|
+
* within.
|
|
337
|
+
*/
|
|
338
|
+
constructor(path: NodePath, parentScope?: Scope);
|
|
339
|
+
uid: number;
|
|
340
|
+
path: NodePath;
|
|
341
|
+
block: Node$1;
|
|
342
|
+
labels: Map<string, NodePath<LabeledStatement>>;
|
|
343
|
+
parentBlock: Node$1;
|
|
344
|
+
parent: Scope;
|
|
345
|
+
hub: HubInterface;
|
|
346
|
+
bindings: {
|
|
347
|
+
[name: string]: Binding;
|
|
348
|
+
};
|
|
349
|
+
references: {
|
|
350
|
+
[name: string]: true;
|
|
351
|
+
};
|
|
352
|
+
globals: {
|
|
353
|
+
[name: string]: Identifier | JSXIdentifier;
|
|
354
|
+
};
|
|
355
|
+
uids: {
|
|
356
|
+
[name: string]: boolean;
|
|
357
|
+
};
|
|
358
|
+
data: Record<string | symbol, unknown>;
|
|
359
|
+
crawling: boolean;
|
|
360
|
+
static globals: string[];
|
|
361
|
+
/** Variables available in current context. */
|
|
362
|
+
static contextVariables: string[];
|
|
363
|
+
/** Traverse node with current scope and path. */
|
|
364
|
+
traverse<S>(node: Node$1 | Node$1[], opts: TraverseOptions<S>, state: S): void;
|
|
365
|
+
traverse(node: Node$1 | Node$1[], opts?: TraverseOptions, state?: any): void;
|
|
366
|
+
/** Generate a unique identifier and add it to the current scope. */
|
|
367
|
+
generateDeclaredUidIdentifier(name?: string): Identifier;
|
|
368
|
+
/** Generate a unique identifier. */
|
|
369
|
+
generateUidIdentifier(name?: string): Identifier;
|
|
370
|
+
/** Generate a unique `_id1` binding. */
|
|
371
|
+
generateUid(name?: string): string;
|
|
372
|
+
/** Generate a unique identifier based on a node. */
|
|
373
|
+
generateUidIdentifierBasedOnNode(parent: Node$1, defaultName?: string): Identifier;
|
|
374
|
+
/**
|
|
375
|
+
* Determine whether evaluating the specific input `node` is a consequenceless reference. ie.
|
|
376
|
+
* evaluating it wont result in potentially arbitrary code from being ran. The following are
|
|
377
|
+
* whitelisted and determined not to cause side effects:
|
|
378
|
+
*
|
|
379
|
+
* - `this` expressions
|
|
380
|
+
* - `super` expressions
|
|
381
|
+
* - Bound identifiers
|
|
382
|
+
*/
|
|
383
|
+
isStatic(node: Node$1): boolean;
|
|
384
|
+
/** Possibly generate a memoised identifier if it is not static and has consequences. */
|
|
385
|
+
maybeGenerateMemoised(node: Node$1, dontPush?: boolean): Identifier;
|
|
386
|
+
checkBlockScopedCollisions(local: Binding, kind: BindingKind, name: string, id: object): void;
|
|
387
|
+
rename(oldName: string, newName?: string, block?: Node$1): void;
|
|
388
|
+
dump(): void;
|
|
389
|
+
toArray(node: Node$1, i?: number | boolean, arrayLikeIsIterable?: boolean): ArrayExpression | CallExpression | Identifier;
|
|
390
|
+
hasLabel(name: string): boolean;
|
|
391
|
+
getLabel(name: string): NodePath<LabeledStatement> | undefined;
|
|
392
|
+
registerLabel(path: NodePath<LabeledStatement>): void;
|
|
393
|
+
registerDeclaration(path: NodePath): void;
|
|
394
|
+
buildUndefinedNode(): UnaryExpression;
|
|
395
|
+
registerConstantViolation(path: NodePath): void;
|
|
396
|
+
registerBinding(kind: BindingKind, path: NodePath, bindingPath?: NodePath): void;
|
|
397
|
+
addGlobal(node: Identifier | JSXIdentifier): void;
|
|
398
|
+
hasUid(name: string): boolean;
|
|
399
|
+
hasGlobal(name: string): boolean;
|
|
400
|
+
hasReference(name: string): boolean;
|
|
401
|
+
isPure(node: Node$1, constantsOnly?: boolean): boolean;
|
|
402
|
+
/**
|
|
403
|
+
* Set some arbitrary data on the current scope.
|
|
404
|
+
*/
|
|
405
|
+
setData(key: string, val: any): any;
|
|
406
|
+
/**
|
|
407
|
+
* Recursively walk up scope tree looking for the data `key`.
|
|
408
|
+
*/
|
|
409
|
+
getData(key: string): any;
|
|
410
|
+
/**
|
|
411
|
+
* Recursively walk up scope tree looking for the data `key` and if it exists,
|
|
412
|
+
* remove it.
|
|
413
|
+
*/
|
|
414
|
+
removeData(key: string): void;
|
|
415
|
+
crawl(): void;
|
|
416
|
+
push(opts: {
|
|
417
|
+
id: LVal;
|
|
418
|
+
init?: Expression;
|
|
419
|
+
unique?: boolean;
|
|
420
|
+
_blockHoist?: number | undefined;
|
|
421
|
+
kind?: "var" | "let" | "const";
|
|
422
|
+
}): void;
|
|
423
|
+
/** Walk up to the top of the scope tree and get the `Program`. */
|
|
424
|
+
getProgramParent(): Scope;
|
|
425
|
+
/** Walk up the scope tree until we hit either a Function or return null. */
|
|
426
|
+
getFunctionParent(): Scope | null;
|
|
427
|
+
/**
|
|
428
|
+
* Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the
|
|
429
|
+
* very top and hit Program.
|
|
430
|
+
*/
|
|
431
|
+
getBlockParent(): Scope;
|
|
432
|
+
/**
|
|
433
|
+
* Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope,
|
|
434
|
+
* then returns its block parent
|
|
435
|
+
* @returns An ancestry scope whose path is a block parent
|
|
436
|
+
*/
|
|
437
|
+
getPatternParent(): Scope;
|
|
438
|
+
/** Walks the scope tree and gathers **all** bindings. */
|
|
439
|
+
getAllBindings(): Record<string, Binding>;
|
|
440
|
+
/** Walks the scope tree and gathers all declarations of `kind`. */
|
|
441
|
+
getAllBindingsOfKind(...kinds: string[]): Record<string, Binding>;
|
|
442
|
+
bindingIdentifierEquals(name: string, node: Node$1): boolean;
|
|
443
|
+
getBinding(name: string): Binding | undefined;
|
|
444
|
+
getOwnBinding(name: string): Binding | undefined;
|
|
445
|
+
getBindingIdentifier(name: string): Identifier;
|
|
446
|
+
getOwnBindingIdentifier(name: string): Identifier;
|
|
447
|
+
hasOwnBinding(name: string): boolean;
|
|
448
|
+
hasBinding(name: string, optsOrNoGlobals?: boolean | {
|
|
449
|
+
noGlobals?: boolean;
|
|
450
|
+
noUids?: boolean;
|
|
451
|
+
}): boolean;
|
|
452
|
+
parentHasBinding(name: string, opts?: {
|
|
453
|
+
noGlobals?: boolean;
|
|
454
|
+
noUids?: boolean;
|
|
455
|
+
}): boolean;
|
|
456
|
+
/** Move a binding of `name` to another `scope`. */
|
|
457
|
+
moveBindingTo(name: string, scope: Scope): void;
|
|
458
|
+
removeOwnBinding(name: string): void;
|
|
459
|
+
removeBinding(name: string): void;
|
|
460
|
+
}
|
|
461
|
+
type BindingKind = "var" | "let" | "const" | "module" | "hoisted" | "param" | "local" | "unknown";
|
|
462
|
+
/**
|
|
463
|
+
* This class is responsible for a binding inside of a scope.
|
|
464
|
+
*
|
|
465
|
+
* It tracks the following:
|
|
466
|
+
*
|
|
467
|
+
* * Node path.
|
|
468
|
+
* * Amount of times referenced by other nodes.
|
|
469
|
+
* * Paths to nodes that reassign or modify this binding.
|
|
470
|
+
* * The kind of binding. (Is it a parameter, declaration etc)
|
|
471
|
+
*/
|
|
472
|
+
declare class Binding {
|
|
473
|
+
constructor(opts: {
|
|
474
|
+
identifier: Identifier;
|
|
475
|
+
scope: Scope;
|
|
476
|
+
path: NodePath;
|
|
477
|
+
kind: BindingKind;
|
|
478
|
+
});
|
|
479
|
+
identifier: Identifier;
|
|
480
|
+
scope: Scope;
|
|
481
|
+
path: NodePath;
|
|
482
|
+
kind: BindingKind;
|
|
483
|
+
referenced: boolean;
|
|
484
|
+
references: number;
|
|
485
|
+
referencePaths: NodePath[];
|
|
486
|
+
constant: boolean;
|
|
487
|
+
constantViolations: NodePath[];
|
|
488
|
+
hasDeoptedValue: boolean;
|
|
489
|
+
hasValue: boolean;
|
|
490
|
+
value: any;
|
|
491
|
+
deopValue(): void;
|
|
492
|
+
setValue(value: any): void;
|
|
493
|
+
clearValue(): void;
|
|
494
|
+
/** Register a constant violation with the provided `path`. */
|
|
495
|
+
reassign(path: NodePath): void;
|
|
496
|
+
/** Increment the amount of references to this binding. */
|
|
497
|
+
reference(path: NodePath): void;
|
|
498
|
+
/** Decrement the amount of references to this binding. */
|
|
499
|
+
dereference(): void;
|
|
500
|
+
}
|
|
501
|
+
type Visitor<S = unknown> = VisitNodeObject<S, Node$1> & { [N in Node$1 as N["type"]]?: VisitNode<S, N extends {
|
|
502
|
+
type: N["type"];
|
|
503
|
+
} ? N : never> } & { [K in keyof Aliases]?: VisitNode<S, Aliases[K]> } & { [K in keyof VirtualTypeAliases]?: VisitNode<S, VirtualTypeAliases[K]> } & {
|
|
504
|
+
// Babel supports `NodeTypesWithoutComment | NodeTypesWithoutComment | ... ` but it is
|
|
505
|
+
// too complex for TS. So we type it as a general visitor only if the key contains `|`
|
|
506
|
+
// this is good enough for non-visitor traverse options e.g. `noScope`
|
|
507
|
+
[k: `${string}|${string}`]: VisitNode<S, Node$1>;
|
|
508
|
+
};
|
|
509
|
+
type VisitNode<S, P extends Node$1> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
|
|
510
|
+
type VisitNodeFunction<S, P extends Node$1> = (this: S, path: NodePath<P>, state: S) => void;
|
|
511
|
+
type NodeType = Node$1["type"] | keyof Aliases;
|
|
512
|
+
interface VisitNodeObject<S, P extends Node$1> {
|
|
513
|
+
enter?: VisitNodeFunction<S, P>;
|
|
514
|
+
exit?: VisitNodeFunction<S, P>;
|
|
515
|
+
}
|
|
516
|
+
type NodeKeyOfArrays<T extends Node$1> = { [P in keyof T]-?: T[P] extends Array<Node$1 | null | undefined> ? P : never }[keyof T];
|
|
517
|
+
type NodePaths<T extends Node$1 | readonly Node$1[]> = T extends readonly Node$1[] ? { -readonly [K in keyof T]: NodePath<Extract<T[K], Node$1>> } : T extends Node$1 ? [NodePath<T>] : never;
|
|
518
|
+
type NodeListType<N, K extends keyof N> = N[K] extends Array<infer P> ? (P extends Node$1 ? P : never) : never;
|
|
519
|
+
type NodesInsertionParam<T extends Node$1> = T | readonly T[] | [T, ...T[]];
|
|
520
|
+
declare class NodePath<T = Node$1> {
|
|
521
|
+
constructor(hub: HubInterface, parent: Node$1);
|
|
522
|
+
parent: Node$1;
|
|
523
|
+
hub: Hub;
|
|
524
|
+
data: Record<string | symbol, unknown>;
|
|
525
|
+
context: TraversalContext;
|
|
526
|
+
scope: Scope;
|
|
527
|
+
contexts: TraversalContext[];
|
|
528
|
+
state: any;
|
|
529
|
+
opts: any; // exploded TraverseOptions
|
|
530
|
+
skipKeys: Record<string, boolean> | null;
|
|
531
|
+
parentPath: T extends Program ? null : NodePath;
|
|
532
|
+
container: Node$1 | Node$1[] | null;
|
|
533
|
+
listKey: string | null;
|
|
534
|
+
key: string | number | null;
|
|
535
|
+
node: T;
|
|
536
|
+
type: T extends Node$1 ? T["type"] : T extends null | undefined ? undefined : Node$1["type"] | undefined;
|
|
537
|
+
shouldSkip: boolean;
|
|
538
|
+
shouldStop: boolean;
|
|
539
|
+
removed: boolean;
|
|
540
|
+
inList: boolean;
|
|
541
|
+
parentKey: string;
|
|
542
|
+
typeAnnotation: object;
|
|
543
|
+
static get<C extends Node$1, K extends keyof C>(opts: {
|
|
544
|
+
hub?: HubInterface;
|
|
545
|
+
parentPath: NodePath | null;
|
|
546
|
+
parent: Node$1;
|
|
547
|
+
container: C;
|
|
548
|
+
key: K;
|
|
549
|
+
}): NodePath<C[K]>;
|
|
550
|
+
static get<C extends Node$1, L extends NodeKeyOfArrays<C>>(opts: {
|
|
551
|
+
hub?: HubInterface;
|
|
552
|
+
parentPath: NodePath | null;
|
|
553
|
+
parent: Node$1;
|
|
554
|
+
container: C;
|
|
555
|
+
listKey: L;
|
|
556
|
+
key: number;
|
|
557
|
+
}): C[L] extends Array<Node$1 | null | undefined> ? NodePath<C[L][number]> : never;
|
|
558
|
+
getScope(scope: Scope): Scope;
|
|
559
|
+
setData(key: string | symbol, val: any): any;
|
|
560
|
+
getData(key: string | symbol, def?: any): any;
|
|
561
|
+
hasNode(): this is NodePath<Exclude<T, null | undefined>>;
|
|
562
|
+
buildCodeFrameError(msg: string, Error?: ErrorConstructor): Error;
|
|
563
|
+
traverse<T>(visitor: TraverseOptions<T>, state: T): void;
|
|
564
|
+
traverse(visitor: TraverseOptions): void;
|
|
565
|
+
set(key: string, node: any): void;
|
|
566
|
+
getPathLocation(): string; // Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
|
|
567
|
+
debug(buildMessage: () => string): void; // #region ------------------------- ancestry -------------------------
|
|
568
|
+
/**
|
|
569
|
+
* Starting at the parent path of the current `NodePath` and going up the
|
|
570
|
+
* tree, return the first `NodePath` that causes the provided `callback`
|
|
571
|
+
* to return a truthy value, or `null` if the `callback` never returns a
|
|
572
|
+
* truthy value.
|
|
573
|
+
*/
|
|
574
|
+
findParent(callback: (path: NodePath) => boolean): NodePath | null;
|
|
575
|
+
/**
|
|
576
|
+
* Starting at current `NodePath` and going up the tree, return the first
|
|
577
|
+
* `NodePath` that causes the provided `callback` to return a truthy value,
|
|
578
|
+
* or `null` if the `callback` never returns a truthy value.
|
|
579
|
+
*/
|
|
580
|
+
find(callback: (path: NodePath) => boolean): NodePath | null;
|
|
581
|
+
/** Get the parent function of the current path. */
|
|
582
|
+
getFunctionParent(): NodePath<Function> | null;
|
|
583
|
+
/** Walk up the tree until we hit a parent node path in a list. */
|
|
584
|
+
getStatementParent(): NodePath<Statement> | null;
|
|
585
|
+
/**
|
|
586
|
+
* Get the deepest common ancestor and then from it, get the earliest relationship path
|
|
587
|
+
* to that ancestor.
|
|
588
|
+
*
|
|
589
|
+
* Earliest is defined as being "before" all the other nodes in terms of list container
|
|
590
|
+
* position and visiting key.
|
|
591
|
+
*/
|
|
592
|
+
getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath;
|
|
593
|
+
/** Get the earliest path in the tree where the provided `paths` intersect. */
|
|
594
|
+
getDeepestCommonAncestorFrom(paths: NodePath[], filter?: (deepest: Node$1, i: number, ancestries: NodePath[][]) => NodePath): NodePath;
|
|
595
|
+
/**
|
|
596
|
+
* Build an array of node paths containing the entire ancestry of the current node path.
|
|
597
|
+
*
|
|
598
|
+
* NOTE: The current node path is included in this.
|
|
599
|
+
*/
|
|
600
|
+
getAncestry(): [this, ...NodePath[]];
|
|
601
|
+
/**
|
|
602
|
+
* A helper to find if `this` path is an ancestor of `maybeDescendant`
|
|
603
|
+
*/
|
|
604
|
+
isAncestor(maybeDescendant: NodePath): boolean;
|
|
605
|
+
/**
|
|
606
|
+
* A helper to find if `this` path is a descendant of `maybeAncestor`
|
|
607
|
+
*/
|
|
608
|
+
isDescendant(maybeAncestor: NodePath): boolean;
|
|
609
|
+
inType(...candidateTypes: string[]): boolean; // #endregion
|
|
610
|
+
// #region ------------------------- inference -------------------------
|
|
611
|
+
/** Infer the type of the current `NodePath`. */
|
|
612
|
+
getTypeAnnotation(): FlowType | TSType;
|
|
613
|
+
isBaseType(baseName: string, soft?: boolean): boolean;
|
|
614
|
+
couldBeBaseType(name: string): boolean;
|
|
615
|
+
baseTypeStrictlyMatches(rightArg: NodePath): boolean;
|
|
616
|
+
isGenericType(genericName: string): boolean; // #endregion
|
|
617
|
+
// #region ------------------------- replacement -------------------------
|
|
618
|
+
/**
|
|
619
|
+
* Replace a node with an array of multiple. This method performs the following steps:
|
|
620
|
+
*
|
|
621
|
+
* - Inherit the comments of first provided node with that of the current node.
|
|
622
|
+
* - Insert the provided nodes after the current node.
|
|
623
|
+
* - Remove the current node.
|
|
624
|
+
*/
|
|
625
|
+
replaceWithMultiple<Nodes extends Node$1 | readonly Node$1[] | [Node$1, ...Node$1[]]>(nodes: Nodes): NodePaths<Nodes>;
|
|
626
|
+
/**
|
|
627
|
+
* Parse a string as an expression and replace the current node with the result.
|
|
628
|
+
*
|
|
629
|
+
* NOTE: This is typically not a good idea to use. Building source strings when
|
|
630
|
+
* transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's
|
|
631
|
+
* easier to use, your transforms will be extremely brittle.
|
|
632
|
+
*/
|
|
633
|
+
replaceWithSourceString(replacement: string): [NodePath];
|
|
634
|
+
/** Replace the current node with another. */
|
|
635
|
+
replaceWith<R extends Node$1>(replacementPath: R | NodePath<R>): [NodePath<R>];
|
|
636
|
+
replaceWith<R extends NodePath>(replacementPath: R): [R];
|
|
637
|
+
/**
|
|
638
|
+
* This method takes an array of statements nodes and then explodes it
|
|
639
|
+
* into expressions. This method retains completion records which is
|
|
640
|
+
* extremely important to retain original semantics.
|
|
641
|
+
*/
|
|
642
|
+
replaceExpressionWithStatements(nodes: Statement[]): NodePaths<Expression | Statement>;
|
|
643
|
+
replaceInline<Nodes extends Node$1 | readonly Node$1[] | [Node$1, ...Node$1[]]>(nodes: Nodes): NodePaths<Nodes>; // #endregion
|
|
644
|
+
// #region ------------------------- evaluation -------------------------
|
|
645
|
+
/**
|
|
646
|
+
* Walk the input `node` and statically evaluate if it's truthy.
|
|
647
|
+
*
|
|
648
|
+
* Returning `true` when we're sure that the expression will evaluate to a
|
|
649
|
+
* truthy value, `false` if we're sure that it will evaluate to a falsy
|
|
650
|
+
* value and `undefined` if we aren't sure. Because of this please do not
|
|
651
|
+
* rely on coercion when using this method and check with === if it's false.
|
|
652
|
+
*/
|
|
653
|
+
evaluateTruthy(): boolean | undefined;
|
|
654
|
+
/**
|
|
655
|
+
* Walk the input `node` and statically evaluate it.
|
|
656
|
+
*
|
|
657
|
+
* Returns an object in the form `{ confident, value, deopt }`. `confident`
|
|
658
|
+
* indicates whether or not we had to drop out of evaluating the expression
|
|
659
|
+
* because of hitting an unknown node that we couldn't confidently find the
|
|
660
|
+
* value of, in which case `deopt` is the path of said node.
|
|
661
|
+
*
|
|
662
|
+
* Example:
|
|
663
|
+
*
|
|
664
|
+
* t.evaluate(parse("5 + 5")) // { confident: true, value: 10 }
|
|
665
|
+
* t.evaluate(parse("!true")) // { confident: true, value: false }
|
|
666
|
+
* t.evaluate(parse("foo + foo")) // { confident: false, value: undefined, deopt: NodePath }
|
|
667
|
+
*/
|
|
668
|
+
evaluate(): {
|
|
669
|
+
confident: boolean;
|
|
670
|
+
value: any;
|
|
671
|
+
deopt?: NodePath;
|
|
672
|
+
}; // #endregion
|
|
673
|
+
// #region ------------------------- introspection -------------------------
|
|
674
|
+
/**
|
|
675
|
+
* Match the current node if it matches the provided `pattern`.
|
|
676
|
+
*
|
|
677
|
+
* For example, given the match `React.createClass` it would match the
|
|
678
|
+
* parsed nodes of `React.createClass` and `React["createClass"]`.
|
|
679
|
+
*/
|
|
680
|
+
matchesPattern(pattern: string, allowPartial?: boolean): boolean;
|
|
681
|
+
/**
|
|
682
|
+
* Check whether we have the input `key`. If the `key` references an array then we check
|
|
683
|
+
* if the array has any items, otherwise we just check if it's falsy.
|
|
684
|
+
*/
|
|
685
|
+
has(key: string): boolean; // has(key: keyof T): boolean;
|
|
686
|
+
isStatic(): boolean;
|
|
687
|
+
/** Alias of `has`. */
|
|
688
|
+
is(key: string): boolean; // is(key: keyof T): boolean;
|
|
689
|
+
/** Opposite of `has`. */
|
|
690
|
+
isnt(key: string): boolean; // isnt(key: keyof T): boolean;
|
|
691
|
+
/** Check whether the path node `key` strict equals `value`. */
|
|
692
|
+
equals(key: string, value: any): boolean; // equals(key: keyof T, value: any): boolean;
|
|
693
|
+
/**
|
|
694
|
+
* Check the type against our stored internal type of the node. This is handy when a node has
|
|
695
|
+
* been removed yet we still internally know the type and need it to calculate node replacement.
|
|
696
|
+
*/
|
|
697
|
+
isNodeType(type: string): boolean;
|
|
698
|
+
/**
|
|
699
|
+
* This checks whether or not we're in one of the following positions:
|
|
700
|
+
*
|
|
701
|
+
* for (KEY in right);
|
|
702
|
+
* for (KEY;;);
|
|
703
|
+
*
|
|
704
|
+
* This is because these spots allow VariableDeclarations AND normal expressions so we need
|
|
705
|
+
* to tell the path replacement that it's ok to replace this with an expression.
|
|
706
|
+
*/
|
|
707
|
+
canHaveVariableDeclarationOrExpression(): boolean;
|
|
708
|
+
/**
|
|
709
|
+
* This checks whether we are swapping an arrow function's body between an
|
|
710
|
+
* expression and a block statement (or vice versa).
|
|
711
|
+
*
|
|
712
|
+
* This is because arrow functions may implicitly return an expression, which
|
|
713
|
+
* is the same as containing a block statement.
|
|
714
|
+
*/
|
|
715
|
+
canSwapBetweenExpressionAndStatement(replacement: Node$1): boolean;
|
|
716
|
+
/** Check whether the current path references a completion record */
|
|
717
|
+
isCompletionRecord(allowInsideFunction?: boolean): boolean;
|
|
718
|
+
/**
|
|
719
|
+
* Check whether or not the current `key` allows either a single statement or block statement
|
|
720
|
+
* so we can explode it if necessary.
|
|
721
|
+
*/
|
|
722
|
+
isStatementOrBlock(): boolean;
|
|
723
|
+
/** Check if the currently assigned path references the `importName` of `moduleSource`. */
|
|
724
|
+
referencesImport(moduleSource: string, importName: string): boolean;
|
|
725
|
+
/** Get the source code associated with this node. */
|
|
726
|
+
getSource(): string;
|
|
727
|
+
/** Check if the current path will maybe execute before another path */
|
|
728
|
+
willIMaybeExecuteBefore(target: NodePath): boolean;
|
|
729
|
+
resolve(dangerous?: boolean, resolved?: NodePath[]): NodePath;
|
|
730
|
+
isConstantExpression(): boolean;
|
|
731
|
+
isInStrictMode(): boolean; // #endregion
|
|
732
|
+
// #region ------------------------- context -------------------------
|
|
733
|
+
call(key: string): boolean;
|
|
734
|
+
isDenylisted(): boolean;
|
|
735
|
+
/** @deprecated will be removed in Babel 8 */
|
|
736
|
+
isBlacklisted(): boolean;
|
|
737
|
+
visit(): boolean;
|
|
738
|
+
skip(): void;
|
|
739
|
+
skipKey(key: string): void;
|
|
740
|
+
stop(): void;
|
|
741
|
+
setScope(): void;
|
|
742
|
+
setContext(context?: TraversalContext): this;
|
|
743
|
+
/**
|
|
744
|
+
* Here we resync the node paths `key` and `container`. If they've changed according
|
|
745
|
+
* to what we have stored internally then we attempt to resync by crawling and looking
|
|
746
|
+
* for the new values.
|
|
747
|
+
*/
|
|
748
|
+
resync(): void;
|
|
749
|
+
popContext(): void;
|
|
750
|
+
pushContext(context: TraversalContext): void;
|
|
751
|
+
requeue(pathToQueue?: NodePath): void; // #endregion
|
|
752
|
+
// #region ------------------------- removal -------------------------
|
|
753
|
+
remove(): void; // #endregion
|
|
754
|
+
// #region ------------------------- conversion -------------------------
|
|
755
|
+
toComputedKey(): PrivateName | Expression;
|
|
756
|
+
/** @deprecated Use `arrowFunctionToExpression` */
|
|
757
|
+
arrowFunctionToShadowed(): void;
|
|
758
|
+
/**
|
|
759
|
+
* Given an arbitrary function, process its content as if it were an arrow function, moving references
|
|
760
|
+
* to "this", "arguments", "super", and such into the function's parent scope. This method is useful if
|
|
761
|
+
* you have wrapped some set of items in an IIFE or other function, but want "this", "arguments", and super"
|
|
762
|
+
* to continue behaving as expected.
|
|
763
|
+
*/
|
|
764
|
+
unwrapFunctionEnvironment(): void;
|
|
765
|
+
/**
|
|
766
|
+
* Convert a given arrow function into a normal ES5 function expression.
|
|
767
|
+
*/
|
|
768
|
+
arrowFunctionToExpression({
|
|
769
|
+
allowInsertArrow,
|
|
770
|
+
allowInsertArrowWithRest,
|
|
771
|
+
/** @deprecated Use `noNewArrows` instead */specCompliant,
|
|
772
|
+
noNewArrows
|
|
773
|
+
}?: {
|
|
774
|
+
allowInsertArrow?: boolean;
|
|
775
|
+
allowInsertArrowWithRest?: boolean;
|
|
776
|
+
specCompliant?: boolean;
|
|
777
|
+
noNewArrows?: boolean;
|
|
778
|
+
}): NodePath<Exclude<Function, Method | ArrowFunctionExpression> | CallExpression>;
|
|
779
|
+
ensureBlock(this: NodePath<Loop | WithStatement | Function | LabeledStatement | CatchClause>): asserts this is NodePath<T & {
|
|
780
|
+
body: BlockStatement;
|
|
781
|
+
}>; // #endregion
|
|
782
|
+
// #region ------------------------- modification -------------------------
|
|
783
|
+
/** Insert the provided nodes before the current one. */
|
|
784
|
+
insertBefore<Nodes extends NodesInsertionParam<Node$1>>(nodes: Nodes): NodePaths<Nodes>;
|
|
785
|
+
/**
|
|
786
|
+
* Insert the provided nodes after the current one. When inserting nodes after an
|
|
787
|
+
* expression, ensure that the completion record is correct by pushing the current node.
|
|
788
|
+
*/
|
|
789
|
+
insertAfter<Nodes extends NodesInsertionParam<Node$1>>(nodes: Nodes): NodePaths<Nodes>;
|
|
790
|
+
/** Update all sibling node paths after `fromIndex` by `incrementBy`. */
|
|
791
|
+
updateSiblingKeys(fromIndex: number, incrementBy: number): void;
|
|
792
|
+
/**
|
|
793
|
+
* Insert child nodes at the start of the current node.
|
|
794
|
+
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
795
|
+
* @param nodes - the nodes to insert.
|
|
796
|
+
*/
|
|
797
|
+
unshiftContainer<T extends Node$1, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
798
|
+
/**
|
|
799
|
+
* Insert child nodes at the end of the current node.
|
|
800
|
+
* @param listKey - The key at which the child nodes are stored (usually body).
|
|
801
|
+
* @param nodes - the nodes to insert.
|
|
802
|
+
*/
|
|
803
|
+
pushContainer<T extends Node$1, K extends NodeKeyOfArrays<T>, Nodes extends NodesInsertionParam<NodeListType<T, K>>>(this: NodePath<T>, listKey: K, nodes: Nodes): NodePaths<Nodes>;
|
|
804
|
+
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
|
|
805
|
+
hoist(scope: Scope): void; // #endregion
|
|
806
|
+
// #region ------------------------- family -------------------------
|
|
807
|
+
getOpposite(): NodePath | null;
|
|
808
|
+
getCompletionRecords(): NodePath[];
|
|
809
|
+
getSibling(key: string | number): NodePath;
|
|
810
|
+
getPrevSibling(): NodePath;
|
|
811
|
+
getNextSibling(): NodePath;
|
|
812
|
+
getAllPrevSiblings(): NodePath[];
|
|
813
|
+
getAllNextSiblings(): NodePath[];
|
|
814
|
+
get<K extends keyof T>(key: K, context?: boolean | TraversalContext): NodePathResult<T[K]>;
|
|
815
|
+
get<P extends string>(path: P, context?: boolean | TraversalContext): NodePathResult<ImplGetRecursive<T, P>>;
|
|
816
|
+
get(key: string, context?: boolean | TraversalContext): NodePath | NodePath[];
|
|
817
|
+
getBindingIdentifiers(duplicates: true): Record<string, Identifier[]>;
|
|
818
|
+
getBindingIdentifiers(duplicates?: false): Record<string, Identifier>;
|
|
819
|
+
getBindingIdentifiers(duplicates?: boolean): Record<string, Identifier | Identifier[]>;
|
|
820
|
+
getOuterBindingIdentifiers(duplicates: true): Record<string, Identifier[]>;
|
|
821
|
+
getOuterBindingIdentifiers(duplicates?: false): Record<string, Identifier>;
|
|
822
|
+
getOuterBindingIdentifiers(duplicates?: boolean): Record<string, Identifier | Identifier[]>;
|
|
823
|
+
getBindingIdentifierPaths(duplicates: true, outerOnly?: boolean): Record<string, Array<NodePath<Identifier>>>;
|
|
824
|
+
getBindingIdentifierPaths(duplicates?: false, outerOnly?: boolean): Record<string, NodePath<Identifier>>;
|
|
825
|
+
getBindingIdentifierPaths(duplicates?: boolean, outerOnly?: boolean): Record<string, NodePath<Identifier> | Array<NodePath<Identifier>>>;
|
|
826
|
+
getOuterBindingIdentifierPaths(duplicates: true): Record<string, Array<NodePath<Identifier>>>;
|
|
827
|
+
getOuterBindingIdentifierPaths(duplicates?: false): Record<string, NodePath<Identifier>>;
|
|
828
|
+
getOuterBindingIdentifierPaths(duplicates?: boolean, outerOnly?: boolean): Record<string, NodePath<Identifier> | Array<NodePath<Identifier>>>; // #endregion
|
|
829
|
+
// #region ------------------------- comments -------------------------
|
|
830
|
+
/** Share comments amongst siblings. */
|
|
831
|
+
shareCommentsWithSiblings(): void;
|
|
832
|
+
addComment(type: CommentTypeShorthand, content: string, line?: boolean): void;
|
|
833
|
+
/** Give node `comments` of the specified `type`. */
|
|
834
|
+
addComments(type: CommentTypeShorthand, comments: Comment[]): void; // #endregion
|
|
835
|
+
// #region ------------------------- isXXX -------------------------
|
|
836
|
+
isAccessor(opts?: object): this is NodePath<Accessor>;
|
|
837
|
+
isAnyTypeAnnotation(opts?: object): this is NodePath<AnyTypeAnnotation>;
|
|
838
|
+
isArgumentPlaceholder(opts?: object): this is NodePath<ArgumentPlaceholder>;
|
|
839
|
+
isArrayExpression(opts?: object): this is NodePath<ArrayExpression>;
|
|
840
|
+
isArrayPattern(opts?: object): this is NodePath<ArrayPattern>;
|
|
841
|
+
isArrayTypeAnnotation(opts?: object): this is NodePath<ArrayTypeAnnotation>;
|
|
842
|
+
isArrowFunctionExpression(opts?: object): this is NodePath<ArrowFunctionExpression>;
|
|
843
|
+
isAssignmentExpression(opts?: object): this is NodePath<AssignmentExpression>;
|
|
844
|
+
isAssignmentPattern(opts?: object): this is NodePath<AssignmentPattern>;
|
|
845
|
+
isAwaitExpression(opts?: object): this is NodePath<AwaitExpression>;
|
|
846
|
+
isBigIntLiteral(opts?: object): this is NodePath<BigIntLiteral>;
|
|
847
|
+
isBinary(opts?: object): this is NodePath<Binary>;
|
|
848
|
+
isBinaryExpression(opts?: object): this is NodePath<BinaryExpression>;
|
|
849
|
+
isBindExpression(opts?: object): this is NodePath<BindExpression>;
|
|
850
|
+
isBlock(opts?: object): this is NodePath<Block>;
|
|
851
|
+
isBlockParent(opts?: object): this is NodePath<BlockParent>;
|
|
852
|
+
isBlockStatement(opts?: object): this is NodePath<BlockStatement>;
|
|
853
|
+
isBooleanLiteral(opts?: object): this is NodePath<BooleanLiteral>;
|
|
854
|
+
isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<BooleanLiteralTypeAnnotation>;
|
|
855
|
+
isBooleanTypeAnnotation(opts?: object): this is NodePath<BooleanTypeAnnotation>;
|
|
856
|
+
isBreakStatement(opts?: object): this is NodePath<BreakStatement>;
|
|
857
|
+
isCallExpression(opts?: object): this is NodePath<CallExpression>;
|
|
858
|
+
isCatchClause(opts?: object): this is NodePath<CatchClause>;
|
|
859
|
+
isClass(opts?: object): this is NodePath<Class>;
|
|
860
|
+
isClassAccessorProperty(opts?: object): this is NodePath<ClassAccessorProperty>;
|
|
861
|
+
isClassBody(opts?: object): this is NodePath<ClassBody>;
|
|
862
|
+
isClassDeclaration(opts?: object): this is NodePath<ClassDeclaration>;
|
|
863
|
+
isClassExpression(opts?: object): this is NodePath<ClassExpression>;
|
|
864
|
+
isClassImplements(opts?: object): this is NodePath<ClassImplements>;
|
|
865
|
+
isClassMethod(opts?: object): this is NodePath<ClassMethod>;
|
|
866
|
+
isClassPrivateMethod(opts?: object): this is NodePath<ClassPrivateMethod>;
|
|
867
|
+
isClassPrivateProperty(opts?: object): this is NodePath<ClassPrivateProperty>;
|
|
868
|
+
isClassProperty(opts?: object): this is NodePath<ClassProperty>;
|
|
869
|
+
isCompletionStatement(opts?: object): this is NodePath<CompletionStatement>;
|
|
870
|
+
isConditional(opts?: object): this is NodePath<Conditional>;
|
|
871
|
+
isConditionalExpression(opts?: object): this is NodePath<ConditionalExpression>;
|
|
872
|
+
isContinueStatement(opts?: object): this is NodePath<ContinueStatement>;
|
|
873
|
+
isDebuggerStatement(opts?: object): this is NodePath<DebuggerStatement>;
|
|
874
|
+
isDecimalLiteral(opts?: object): this is NodePath<DecimalLiteral>;
|
|
875
|
+
isDeclaration(opts?: object): this is NodePath<Declaration>;
|
|
876
|
+
isDeclareClass(opts?: object): this is NodePath<DeclareClass>;
|
|
877
|
+
isDeclareExportAllDeclaration(opts?: object): this is NodePath<DeclareExportAllDeclaration>;
|
|
878
|
+
isDeclareExportDeclaration(opts?: object): this is NodePath<DeclareExportDeclaration>;
|
|
879
|
+
isDeclareFunction(opts?: object): this is NodePath<DeclareFunction>;
|
|
880
|
+
isDeclareInterface(opts?: object): this is NodePath<DeclareInterface>;
|
|
881
|
+
isDeclareModule(opts?: object): this is NodePath<DeclareModule>;
|
|
882
|
+
isDeclareModuleExports(opts?: object): this is NodePath<DeclareModuleExports>;
|
|
883
|
+
isDeclareOpaqueType(opts?: object): this is NodePath<DeclareOpaqueType>;
|
|
884
|
+
isDeclareTypeAlias(opts?: object): this is NodePath<DeclareTypeAlias>;
|
|
885
|
+
isDeclareVariable(opts?: object): this is NodePath<DeclareVariable>;
|
|
886
|
+
isDeclaredPredicate(opts?: object): this is NodePath<DeclaredPredicate>;
|
|
887
|
+
isDecorator(opts?: object): this is NodePath<Decorator>;
|
|
888
|
+
isDirective(opts?: object): this is NodePath<Directive>;
|
|
889
|
+
isDirectiveLiteral(opts?: object): this is NodePath<DirectiveLiteral>;
|
|
890
|
+
isDoExpression(opts?: object): this is NodePath<DoExpression>;
|
|
891
|
+
isDoWhileStatement(opts?: object): this is NodePath<DoWhileStatement>;
|
|
892
|
+
isEmptyStatement(opts?: object): this is NodePath<EmptyStatement>;
|
|
893
|
+
isEmptyTypeAnnotation(opts?: object): this is NodePath<EmptyTypeAnnotation>;
|
|
894
|
+
isEnumBody(opts?: object): this is NodePath<EnumBody>;
|
|
895
|
+
isEnumBooleanBody(opts?: object): this is NodePath<EnumBooleanBody>;
|
|
896
|
+
isEnumBooleanMember(opts?: object): this is NodePath<EnumBooleanMember>;
|
|
897
|
+
isEnumDeclaration(opts?: object): this is NodePath<EnumDeclaration>;
|
|
898
|
+
isEnumDefaultedMember(opts?: object): this is NodePath<EnumDefaultedMember>;
|
|
899
|
+
isEnumMember(opts?: object): this is NodePath<EnumMember>;
|
|
900
|
+
isEnumNumberBody(opts?: object): this is NodePath<EnumNumberBody>;
|
|
901
|
+
isEnumNumberMember(opts?: object): this is NodePath<EnumNumberMember>;
|
|
902
|
+
isEnumStringBody(opts?: object): this is NodePath<EnumStringBody>;
|
|
903
|
+
isEnumStringMember(opts?: object): this is NodePath<EnumStringMember>;
|
|
904
|
+
isEnumSymbolBody(opts?: object): this is NodePath<EnumSymbolBody>;
|
|
905
|
+
isExistsTypeAnnotation(opts?: object): this is NodePath<ExistsTypeAnnotation>;
|
|
906
|
+
isExportAllDeclaration(opts?: object): this is NodePath<ExportAllDeclaration>;
|
|
907
|
+
isExportDeclaration(opts?: object): this is NodePath<ExportDeclaration>;
|
|
908
|
+
isExportDefaultDeclaration(opts?: object): this is NodePath<ExportDefaultDeclaration>;
|
|
909
|
+
isExportDefaultSpecifier(opts?: object): this is NodePath<ExportDefaultSpecifier>;
|
|
910
|
+
isExportNamedDeclaration(opts?: object): this is NodePath<ExportNamedDeclaration>;
|
|
911
|
+
isExportNamespaceSpecifier(opts?: object): this is NodePath<ExportNamespaceSpecifier>;
|
|
912
|
+
isExportSpecifier(opts?: object): this is NodePath<ExportSpecifier>;
|
|
913
|
+
isExpression(opts?: object): this is NodePath<Expression>;
|
|
914
|
+
isExpressionStatement(opts?: object): this is NodePath<ExpressionStatement>;
|
|
915
|
+
isExpressionWrapper(opts?: object): this is NodePath<ExpressionWrapper>;
|
|
916
|
+
isFile(opts?: object): this is NodePath<File>;
|
|
917
|
+
isFlow(opts?: object): this is NodePath<Flow>;
|
|
918
|
+
isFlowBaseAnnotation(opts?: object): this is NodePath<FlowBaseAnnotation>;
|
|
919
|
+
isFlowDeclaration(opts?: object): this is NodePath<FlowDeclaration>;
|
|
920
|
+
isFlowPredicate(opts?: object): this is NodePath<FlowPredicate>;
|
|
921
|
+
isFlowType(opts?: object): this is NodePath<FlowType>;
|
|
922
|
+
isFor(opts?: object): this is NodePath<For>;
|
|
923
|
+
isForInStatement(opts?: object): this is NodePath<ForInStatement>;
|
|
924
|
+
isForOfStatement(opts?: object): this is NodePath<ForOfStatement>;
|
|
925
|
+
isForStatement(opts?: object): this is NodePath<ForStatement>;
|
|
926
|
+
isForXStatement(opts?: object): this is NodePath<ForXStatement>;
|
|
927
|
+
isFunction(opts?: object): this is NodePath<Function>;
|
|
928
|
+
isFunctionDeclaration(opts?: object): this is NodePath<FunctionDeclaration>;
|
|
929
|
+
isFunctionExpression(opts?: object): this is NodePath<FunctionExpression>;
|
|
930
|
+
isFunctionParameter(opts?: object): this is NodePath<FunctionParameter>;
|
|
931
|
+
isFunctionParent(opts?: object): this is NodePath<FunctionParent>;
|
|
932
|
+
isFunctionTypeAnnotation(opts?: object): this is NodePath<FunctionTypeAnnotation>;
|
|
933
|
+
isFunctionTypeParam(opts?: object): this is NodePath<FunctionTypeParam>;
|
|
934
|
+
isGenericTypeAnnotation(opts?: object): this is NodePath<GenericTypeAnnotation>;
|
|
935
|
+
isIdentifier(opts?: object): this is NodePath<Identifier>;
|
|
936
|
+
isIfStatement(opts?: object): this is NodePath<IfStatement>;
|
|
937
|
+
isImmutable(opts?: object): this is NodePath<Immutable>;
|
|
938
|
+
isImport(opts?: object): this is NodePath<Import>;
|
|
939
|
+
isImportAttribute(opts?: object): this is NodePath<ImportAttribute>;
|
|
940
|
+
isImportDeclaration(opts?: object): this is NodePath<ImportDeclaration>;
|
|
941
|
+
isImportExpression(opts?: object): this is NodePath<ImportExpression>;
|
|
942
|
+
isImportDefaultSpecifier(opts?: object): this is NodePath<ImportDefaultSpecifier>;
|
|
943
|
+
isImportNamespaceSpecifier(opts?: object): this is NodePath<ImportNamespaceSpecifier>;
|
|
944
|
+
isImportOrExportDeclaration(opts?: object): this is NodePath<ImportOrExportDeclaration>;
|
|
945
|
+
isImportSpecifier(opts?: object): this is NodePath<ImportSpecifier>;
|
|
946
|
+
isIndexedAccessType(opts?: object): this is NodePath<IndexedAccessType>;
|
|
947
|
+
isInferredPredicate(opts?: object): this is NodePath<InferredPredicate>;
|
|
948
|
+
isInterfaceDeclaration(opts?: object): this is NodePath<InterfaceDeclaration>;
|
|
949
|
+
isInterfaceExtends(opts?: object): this is NodePath<InterfaceExtends>;
|
|
950
|
+
isInterfaceTypeAnnotation(opts?: object): this is NodePath<InterfaceTypeAnnotation>;
|
|
951
|
+
isInterpreterDirective(opts?: object): this is NodePath<InterpreterDirective>;
|
|
952
|
+
isIntersectionTypeAnnotation(opts?: object): this is NodePath<IntersectionTypeAnnotation>;
|
|
953
|
+
isJSX(opts?: object): this is NodePath<JSX>;
|
|
954
|
+
isJSXAttribute(opts?: object): this is NodePath<JSXAttribute>;
|
|
955
|
+
isJSXClosingElement(opts?: object): this is NodePath<JSXClosingElement>;
|
|
956
|
+
isJSXClosingFragment(opts?: object): this is NodePath<JSXClosingFragment>;
|
|
957
|
+
isJSXElement(opts?: object): this is NodePath<JSXElement>;
|
|
958
|
+
isJSXEmptyExpression(opts?: object): this is NodePath<JSXEmptyExpression>;
|
|
959
|
+
isJSXExpressionContainer(opts?: object): this is NodePath<JSXExpressionContainer>;
|
|
960
|
+
isJSXFragment(opts?: object): this is NodePath<JSXFragment>;
|
|
961
|
+
isJSXIdentifier(opts?: object): this is NodePath<JSXIdentifier>;
|
|
962
|
+
isJSXMemberExpression(opts?: object): this is NodePath<JSXMemberExpression>;
|
|
963
|
+
isJSXNamespacedName(opts?: object): this is NodePath<JSXNamespacedName>;
|
|
964
|
+
isJSXOpeningElement(opts?: object): this is NodePath<JSXOpeningElement>;
|
|
965
|
+
isJSXOpeningFragment(opts?: object): this is NodePath<JSXOpeningFragment>;
|
|
966
|
+
isJSXSpreadAttribute(opts?: object): this is NodePath<JSXSpreadAttribute>;
|
|
967
|
+
isJSXSpreadChild(opts?: object): this is NodePath<JSXSpreadChild>;
|
|
968
|
+
isJSXText(opts?: object): this is NodePath<JSXText>;
|
|
969
|
+
isLVal(opts?: object): this is NodePath<LVal>;
|
|
970
|
+
isLabeledStatement(opts?: object): this is NodePath<LabeledStatement>;
|
|
971
|
+
isLiteral(opts?: object): this is NodePath<Literal>;
|
|
972
|
+
isLogicalExpression(opts?: object): this is NodePath<LogicalExpression>;
|
|
973
|
+
isLoop(opts?: object): this is NodePath<Loop>;
|
|
974
|
+
isMemberExpression(opts?: object): this is NodePath<MemberExpression>;
|
|
975
|
+
isMetaProperty(opts?: object): this is NodePath<MetaProperty>;
|
|
976
|
+
isMethod(opts?: object): this is NodePath<Method>;
|
|
977
|
+
isMiscellaneous(opts?: object): this is NodePath<Miscellaneous>;
|
|
978
|
+
isMixedTypeAnnotation(opts?: object): this is NodePath<MixedTypeAnnotation>;
|
|
979
|
+
isModuleDeclaration(opts?: object): this is NodePath<ModuleDeclaration>;
|
|
980
|
+
isModuleExpression(opts?: object): this is NodePath<ModuleExpression>;
|
|
981
|
+
isModuleSpecifier(opts?: object): this is NodePath<ModuleSpecifier>;
|
|
982
|
+
isNewExpression(opts?: object): this is NodePath<NewExpression>;
|
|
983
|
+
isNoop(opts?: object): this is NodePath<Noop>;
|
|
984
|
+
isNullLiteral(opts?: object): this is NodePath<NullLiteral>;
|
|
985
|
+
isNullLiteralTypeAnnotation(opts?: object): this is NodePath<NullLiteralTypeAnnotation>;
|
|
986
|
+
isNullableTypeAnnotation(opts?: object): this is NodePath<NullableTypeAnnotation>;
|
|
987
|
+
/** @deprecated Use `isNumericLiteral` */
|
|
988
|
+
isNumberLiteral(opts?: object): this is NodePath<NumberLiteral$1>;
|
|
989
|
+
isNumberLiteralTypeAnnotation(opts?: object): this is NodePath<NumberLiteralTypeAnnotation>;
|
|
990
|
+
isNumberTypeAnnotation(opts?: object): this is NodePath<NumberTypeAnnotation>;
|
|
991
|
+
isNumericLiteral(opts?: object): this is NodePath<NumericLiteral>;
|
|
992
|
+
isObjectExpression(opts?: object): this is NodePath<ObjectExpression>;
|
|
993
|
+
isObjectMember(opts?: object): this is NodePath<ObjectMember>;
|
|
994
|
+
isObjectMethod(opts?: object): this is NodePath<ObjectMethod>;
|
|
995
|
+
isObjectPattern(opts?: object): this is NodePath<ObjectPattern>;
|
|
996
|
+
isObjectProperty(opts?: object): this is NodePath<ObjectProperty>;
|
|
997
|
+
isObjectTypeAnnotation(opts?: object): this is NodePath<ObjectTypeAnnotation>;
|
|
998
|
+
isObjectTypeCallProperty(opts?: object): this is NodePath<ObjectTypeCallProperty>;
|
|
999
|
+
isObjectTypeIndexer(opts?: object): this is NodePath<ObjectTypeIndexer>;
|
|
1000
|
+
isObjectTypeInternalSlot(opts?: object): this is NodePath<ObjectTypeInternalSlot>;
|
|
1001
|
+
isObjectTypeProperty(opts?: object): this is NodePath<ObjectTypeProperty>;
|
|
1002
|
+
isObjectTypeSpreadProperty(opts?: object): this is NodePath<ObjectTypeSpreadProperty>;
|
|
1003
|
+
isOpaqueType(opts?: object): this is NodePath<OpaqueType>;
|
|
1004
|
+
isOptionalCallExpression(opts?: object): this is NodePath<OptionalCallExpression>;
|
|
1005
|
+
isOptionalIndexedAccessType(opts?: object): this is NodePath<OptionalIndexedAccessType>;
|
|
1006
|
+
isOptionalMemberExpression(opts?: object): this is NodePath<OptionalMemberExpression>;
|
|
1007
|
+
isParenthesizedExpression(opts?: object): this is NodePath<ParenthesizedExpression>;
|
|
1008
|
+
isPattern(opts?: object): this is NodePath<Pattern>;
|
|
1009
|
+
isPatternLike(opts?: object): this is NodePath<PatternLike>;
|
|
1010
|
+
isPipelineBareFunction(opts?: object): this is NodePath<PipelineBareFunction>;
|
|
1011
|
+
isPipelinePrimaryTopicReference(opts?: object): this is NodePath<PipelinePrimaryTopicReference>;
|
|
1012
|
+
isPipelineTopicExpression(opts?: object): this is NodePath<PipelineTopicExpression>;
|
|
1013
|
+
isPlaceholder(opts?: object): this is NodePath<Placeholder>;
|
|
1014
|
+
isPrivate(opts?: object): this is NodePath<Private>;
|
|
1015
|
+
isPrivateName(opts?: object): this is NodePath<PrivateName>;
|
|
1016
|
+
isProgram(opts?: object): this is NodePath<Program>;
|
|
1017
|
+
isProperty(opts?: object): this is NodePath<Property>;
|
|
1018
|
+
isPureish(opts?: object): this is NodePath<Pureish>;
|
|
1019
|
+
isQualifiedTypeIdentifier(opts?: object): this is NodePath<QualifiedTypeIdentifier>;
|
|
1020
|
+
isRecordExpression(opts?: object): this is NodePath<RecordExpression>;
|
|
1021
|
+
isRegExpLiteral(opts?: object): this is NodePath<RegExpLiteral>;
|
|
1022
|
+
/** @deprecated Use `isRegExpLiteral` */
|
|
1023
|
+
isRegexLiteral(opts?: object): this is NodePath<RegexLiteral$1>;
|
|
1024
|
+
isRestElement(opts?: object): this is NodePath<RestElement>;
|
|
1025
|
+
/** @deprecated Use `isRestElement` */
|
|
1026
|
+
isRestProperty(opts?: object): this is NodePath<RestProperty$1>;
|
|
1027
|
+
isReturnStatement(opts?: object): this is NodePath<ReturnStatement>;
|
|
1028
|
+
isScopable(opts?: object): this is NodePath<Scopable>;
|
|
1029
|
+
isSequenceExpression(opts?: object): this is NodePath<SequenceExpression>;
|
|
1030
|
+
isSpreadElement(opts?: object): this is NodePath<SpreadElement>;
|
|
1031
|
+
/** @deprecated Use `isSpreadElement` */
|
|
1032
|
+
isSpreadProperty(opts?: object): this is NodePath<SpreadProperty$1>;
|
|
1033
|
+
isStandardized(opts?: object): this is NodePath<Standardized>;
|
|
1034
|
+
isStatement(opts?: object): this is NodePath<Statement>;
|
|
1035
|
+
isStaticBlock(opts?: object): this is NodePath<StaticBlock>;
|
|
1036
|
+
isStringLiteral(opts?: object): this is NodePath<StringLiteral>;
|
|
1037
|
+
isStringLiteralTypeAnnotation(opts?: object): this is NodePath<StringLiteralTypeAnnotation>;
|
|
1038
|
+
isStringTypeAnnotation(opts?: object): this is NodePath<StringTypeAnnotation>;
|
|
1039
|
+
isSuper(opts?: object): this is NodePath<Super>;
|
|
1040
|
+
isSwitchCase(opts?: object): this is NodePath<SwitchCase>;
|
|
1041
|
+
isSwitchStatement(opts?: object): this is NodePath<SwitchStatement>;
|
|
1042
|
+
isSymbolTypeAnnotation(opts?: object): this is NodePath<SymbolTypeAnnotation>;
|
|
1043
|
+
isTSAnyKeyword(opts?: object): this is NodePath<TSAnyKeyword>;
|
|
1044
|
+
isTSArrayType(opts?: object): this is NodePath<TSArrayType>;
|
|
1045
|
+
isTSAsExpression(opts?: object): this is NodePath<TSAsExpression>;
|
|
1046
|
+
isTSBaseType(opts?: object): this is NodePath<TSBaseType>;
|
|
1047
|
+
isTSBigIntKeyword(opts?: object): this is NodePath<TSBigIntKeyword>;
|
|
1048
|
+
isTSBooleanKeyword(opts?: object): this is NodePath<TSBooleanKeyword>;
|
|
1049
|
+
isTSCallSignatureDeclaration(opts?: object): this is NodePath<TSCallSignatureDeclaration>;
|
|
1050
|
+
isTSConditionalType(opts?: object): this is NodePath<TSConditionalType>;
|
|
1051
|
+
isTSConstructSignatureDeclaration(opts?: object): this is NodePath<TSConstructSignatureDeclaration>;
|
|
1052
|
+
isTSConstructorType(opts?: object): this is NodePath<TSConstructorType>;
|
|
1053
|
+
isTSDeclareFunction(opts?: object): this is NodePath<TSDeclareFunction>;
|
|
1054
|
+
isTSDeclareMethod(opts?: object): this is NodePath<TSDeclareMethod>;
|
|
1055
|
+
isTSEntityName(opts?: object): this is NodePath<TSEntityName>;
|
|
1056
|
+
isTSEnumBody(opts?: object): this is NodePath<TSEnumBody>;
|
|
1057
|
+
isTSEnumDeclaration(opts?: object): this is NodePath<TSEnumDeclaration>;
|
|
1058
|
+
isTSEnumMember(opts?: object): this is NodePath<TSEnumMember>;
|
|
1059
|
+
isTSExportAssignment(opts?: object): this is NodePath<TSExportAssignment>;
|
|
1060
|
+
isTSExpressionWithTypeArguments(opts?: object): this is NodePath<TSExpressionWithTypeArguments>;
|
|
1061
|
+
isTSExternalModuleReference(opts?: object): this is NodePath<TSExternalModuleReference>;
|
|
1062
|
+
isTSFunctionType(opts?: object): this is NodePath<TSFunctionType>;
|
|
1063
|
+
isTSImportEqualsDeclaration(opts?: object): this is NodePath<TSImportEqualsDeclaration>;
|
|
1064
|
+
isTSImportType(opts?: object): this is NodePath<TSImportType>;
|
|
1065
|
+
isTSIndexSignature(opts?: object): this is NodePath<TSIndexSignature>;
|
|
1066
|
+
isTSIndexedAccessType(opts?: object): this is NodePath<TSIndexedAccessType>;
|
|
1067
|
+
isTSInferType(opts?: object): this is NodePath<TSInferType>;
|
|
1068
|
+
isTSInstantiationExpression(opts?: object): this is NodePath<TSInstantiationExpression>;
|
|
1069
|
+
isTSInterfaceBody(opts?: object): this is NodePath<TSInterfaceBody>;
|
|
1070
|
+
isTSInterfaceDeclaration(opts?: object): this is NodePath<TSInterfaceDeclaration>;
|
|
1071
|
+
isTSIntersectionType(opts?: object): this is NodePath<TSIntersectionType>;
|
|
1072
|
+
isTSIntrinsicKeyword(opts?: object): this is NodePath<TSIntrinsicKeyword>;
|
|
1073
|
+
isTSLiteralType(opts?: object): this is NodePath<TSLiteralType>;
|
|
1074
|
+
isTSMappedType(opts?: object): this is NodePath<TSMappedType>;
|
|
1075
|
+
isTSMethodSignature(opts?: object): this is NodePath<TSMethodSignature>;
|
|
1076
|
+
isTSModuleBlock(opts?: object): this is NodePath<TSModuleBlock>;
|
|
1077
|
+
isTSModuleDeclaration(opts?: object): this is NodePath<TSModuleDeclaration>;
|
|
1078
|
+
isTSNamedTupleMember(opts?: object): this is NodePath<TSNamedTupleMember>;
|
|
1079
|
+
isTSNamespaceExportDeclaration(opts?: object): this is NodePath<TSNamespaceExportDeclaration>;
|
|
1080
|
+
isTSNeverKeyword(opts?: object): this is NodePath<TSNeverKeyword>;
|
|
1081
|
+
isTSNonNullExpression(opts?: object): this is NodePath<TSNonNullExpression>;
|
|
1082
|
+
isTSNullKeyword(opts?: object): this is NodePath<TSNullKeyword>;
|
|
1083
|
+
isTSNumberKeyword(opts?: object): this is NodePath<TSNumberKeyword>;
|
|
1084
|
+
isTSObjectKeyword(opts?: object): this is NodePath<TSObjectKeyword>;
|
|
1085
|
+
isTSOptionalType(opts?: object): this is NodePath<TSOptionalType>;
|
|
1086
|
+
isTSParameterProperty(opts?: object): this is NodePath<TSParameterProperty>;
|
|
1087
|
+
isTSParenthesizedType(opts?: object): this is NodePath<TSParenthesizedType>;
|
|
1088
|
+
isTSPropertySignature(opts?: object): this is NodePath<TSPropertySignature>;
|
|
1089
|
+
isTSQualifiedName(opts?: object): this is NodePath<TSQualifiedName>;
|
|
1090
|
+
isTSRestType(opts?: object): this is NodePath<TSRestType>;
|
|
1091
|
+
isTSSatisfiesExpression(opts?: object): this is NodePath<TSSatisfiesExpression>;
|
|
1092
|
+
isTSStringKeyword(opts?: object): this is NodePath<TSStringKeyword>;
|
|
1093
|
+
isTSSymbolKeyword(opts?: object): this is NodePath<TSSymbolKeyword>;
|
|
1094
|
+
isTSTemplateLiteralType(opts?: object): this is NodePath<TSTemplateLiteralType>;
|
|
1095
|
+
isTSThisType(opts?: object): this is NodePath<TSThisType>;
|
|
1096
|
+
isTSTupleType(opts?: object): this is NodePath<TSTupleType>;
|
|
1097
|
+
isTSType(opts?: object): this is NodePath<TSType>;
|
|
1098
|
+
isTSTypeAliasDeclaration(opts?: object): this is NodePath<TSTypeAliasDeclaration>;
|
|
1099
|
+
isTSTypeAnnotation(opts?: object): this is NodePath<TSTypeAnnotation>;
|
|
1100
|
+
isTSTypeAssertion(opts?: object): this is NodePath<TSTypeAssertion>;
|
|
1101
|
+
isTSTypeElement(opts?: object): this is NodePath<TSTypeElement>;
|
|
1102
|
+
isTSTypeLiteral(opts?: object): this is NodePath<TSTypeLiteral>;
|
|
1103
|
+
isTSTypeOperator(opts?: object): this is NodePath<TSTypeOperator>;
|
|
1104
|
+
isTSTypeParameter(opts?: object): this is NodePath<TSTypeParameter>;
|
|
1105
|
+
isTSTypeParameterDeclaration(opts?: object): this is NodePath<TSTypeParameterDeclaration>;
|
|
1106
|
+
isTSTypeParameterInstantiation(opts?: object): this is NodePath<TSTypeParameterInstantiation>;
|
|
1107
|
+
isTSTypePredicate(opts?: object): this is NodePath<TSTypePredicate>;
|
|
1108
|
+
isTSTypeQuery(opts?: object): this is NodePath<TSTypeQuery>;
|
|
1109
|
+
isTSTypeReference(opts?: object): this is NodePath<TSTypeReference>;
|
|
1110
|
+
isTSUndefinedKeyword(opts?: object): this is NodePath<TSUndefinedKeyword>;
|
|
1111
|
+
isTSUnionType(opts?: object): this is NodePath<TSUnionType>;
|
|
1112
|
+
isTSUnknownKeyword(opts?: object): this is NodePath<TSUnknownKeyword>;
|
|
1113
|
+
isTSVoidKeyword(opts?: object): this is NodePath<TSVoidKeyword>;
|
|
1114
|
+
isTaggedTemplateExpression(opts?: object): this is NodePath<TaggedTemplateExpression>;
|
|
1115
|
+
isTemplateElement(opts?: object): this is NodePath<TemplateElement>;
|
|
1116
|
+
isTemplateLiteral(opts?: object): this is NodePath<TemplateLiteral>;
|
|
1117
|
+
isTerminatorless(opts?: object): this is NodePath<Terminatorless>;
|
|
1118
|
+
isThisExpression(opts?: object): this is NodePath<ThisExpression>;
|
|
1119
|
+
isThisTypeAnnotation(opts?: object): this is NodePath<ThisTypeAnnotation>;
|
|
1120
|
+
isThrowStatement(opts?: object): this is NodePath<ThrowStatement>;
|
|
1121
|
+
isTopicReference(opts?: object): this is NodePath<TopicReference>;
|
|
1122
|
+
isTryStatement(opts?: object): this is NodePath<TryStatement>;
|
|
1123
|
+
isTupleExpression(opts?: object): this is NodePath<TupleExpression>;
|
|
1124
|
+
isTupleTypeAnnotation(opts?: object): this is NodePath<TupleTypeAnnotation>;
|
|
1125
|
+
isTypeAlias(opts?: object): this is NodePath<TypeAlias>;
|
|
1126
|
+
isTypeAnnotation(opts?: object): this is NodePath<TypeAnnotation>;
|
|
1127
|
+
isTypeCastExpression(opts?: object): this is NodePath<TypeCastExpression>;
|
|
1128
|
+
isTypeParameter(opts?: object): this is NodePath<TypeParameter>;
|
|
1129
|
+
isTypeParameterDeclaration(opts?: object): this is NodePath<TypeParameterDeclaration>;
|
|
1130
|
+
isTypeParameterInstantiation(opts?: object): this is NodePath<TypeParameterInstantiation>;
|
|
1131
|
+
isTypeScript(opts?: object): this is NodePath<TypeScript>;
|
|
1132
|
+
isTypeofTypeAnnotation(opts?: object): this is NodePath<TypeofTypeAnnotation>;
|
|
1133
|
+
isUnaryExpression(opts?: object): this is NodePath<UnaryExpression>;
|
|
1134
|
+
isUnaryLike(opts?: object): this is NodePath<UnaryLike>;
|
|
1135
|
+
isUnionTypeAnnotation(opts?: object): this is NodePath<UnionTypeAnnotation>;
|
|
1136
|
+
isUpdateExpression(opts?: object): this is NodePath<UpdateExpression>;
|
|
1137
|
+
isUserWhitespacable(opts?: object): this is NodePath<UserWhitespacable>;
|
|
1138
|
+
isV8IntrinsicIdentifier(opts?: object): this is NodePath<V8IntrinsicIdentifier>;
|
|
1139
|
+
isVariableDeclaration(opts?: object): this is NodePath<VariableDeclaration>;
|
|
1140
|
+
isVariableDeclarator(opts?: object): this is NodePath<VariableDeclarator>;
|
|
1141
|
+
isVariance(opts?: object): this is NodePath<Variance>;
|
|
1142
|
+
isVoidPattern(opts?: object): this is NodePath<VoidPattern>;
|
|
1143
|
+
isVoidTypeAnnotation(opts?: object): this is NodePath<VoidTypeAnnotation>;
|
|
1144
|
+
isWhile(opts?: object): this is NodePath<While>;
|
|
1145
|
+
isWhileStatement(opts?: object): this is NodePath<WhileStatement>;
|
|
1146
|
+
isWithStatement(opts?: object): this is NodePath<WithStatement>;
|
|
1147
|
+
isYieldExpression(opts?: object): this is NodePath<YieldExpression>;
|
|
1148
|
+
isBindingIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["BindingIdentifier"]>;
|
|
1149
|
+
isBlockScoped(opts?: object): this is NodePath<FunctionDeclaration | ClassDeclaration | VariableDeclaration>;
|
|
1150
|
+
/** @deprecated */
|
|
1151
|
+
isExistentialTypeParam(opts?: object): this is NodePath<VirtualTypeAliases["ExistentialTypeParam"]>;
|
|
1152
|
+
isForAwaitStatement(opts?: object): this is NodePath<VirtualTypeAliases["ForAwaitStatement"]>;
|
|
1153
|
+
isGenerated(opts?: object): boolean;
|
|
1154
|
+
/** @deprecated */
|
|
1155
|
+
isNumericLiteralTypeAnnotation(opts?: object): void;
|
|
1156
|
+
isPure(opts?: object): boolean;
|
|
1157
|
+
isReferenced(opts?: object): boolean;
|
|
1158
|
+
isReferencedIdentifier(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedIdentifier"]>;
|
|
1159
|
+
isReferencedMemberExpression(opts?: object): this is NodePath<VirtualTypeAliases["ReferencedMemberExpression"]>;
|
|
1160
|
+
isScope(opts?: object): this is NodePath<VirtualTypeAliases["Scope"]>;
|
|
1161
|
+
isUser(opts?: object): boolean;
|
|
1162
|
+
isVar(opts?: object): this is NodePath<VirtualTypeAliases["Var"]>; // #endregion
|
|
1163
|
+
// #region ------------------------- assertXXX -------------------------
|
|
1164
|
+
assertAccessor(opts?: object): asserts this is NodePath<Accessor>;
|
|
1165
|
+
assertAnyTypeAnnotation(opts?: object): asserts this is NodePath<AnyTypeAnnotation>;
|
|
1166
|
+
assertArgumentPlaceholder(opts?: object): asserts this is NodePath<ArgumentPlaceholder>;
|
|
1167
|
+
assertArrayExpression(opts?: object): asserts this is NodePath<ArrayExpression>;
|
|
1168
|
+
assertArrayPattern(opts?: object): asserts this is NodePath<ArrayPattern>;
|
|
1169
|
+
assertArrayTypeAnnotation(opts?: object): asserts this is NodePath<ArrayTypeAnnotation>;
|
|
1170
|
+
assertArrowFunctionExpression(opts?: object): asserts this is NodePath<ArrowFunctionExpression>;
|
|
1171
|
+
assertAssignmentExpression(opts?: object): asserts this is NodePath<AssignmentExpression>;
|
|
1172
|
+
assertAssignmentPattern(opts?: object): asserts this is NodePath<AssignmentPattern>;
|
|
1173
|
+
assertAwaitExpression(opts?: object): asserts this is NodePath<AwaitExpression>;
|
|
1174
|
+
assertBigIntLiteral(opts?: object): asserts this is NodePath<BigIntLiteral>;
|
|
1175
|
+
assertBinary(opts?: object): asserts this is NodePath<Binary>;
|
|
1176
|
+
assertBinaryExpression(opts?: object): asserts this is NodePath<BinaryExpression>;
|
|
1177
|
+
assertBindExpression(opts?: object): asserts this is NodePath<BindExpression>;
|
|
1178
|
+
assertBlock(opts?: object): asserts this is NodePath<Block>;
|
|
1179
|
+
assertBlockParent(opts?: object): asserts this is NodePath<BlockParent>;
|
|
1180
|
+
assertBlockStatement(opts?: object): asserts this is NodePath<BlockStatement>;
|
|
1181
|
+
assertBooleanLiteral(opts?: object): asserts this is NodePath<BooleanLiteral>;
|
|
1182
|
+
assertBooleanLiteralTypeAnnotation(opts?: object): asserts this is NodePath<BooleanLiteralTypeAnnotation>;
|
|
1183
|
+
assertBooleanTypeAnnotation(opts?: object): asserts this is NodePath<BooleanTypeAnnotation>;
|
|
1184
|
+
assertBreakStatement(opts?: object): asserts this is NodePath<BreakStatement>;
|
|
1185
|
+
assertCallExpression(opts?: object): asserts this is NodePath<CallExpression>;
|
|
1186
|
+
assertCatchClause(opts?: object): asserts this is NodePath<CatchClause>;
|
|
1187
|
+
assertClass(opts?: object): asserts this is NodePath<Class>;
|
|
1188
|
+
assertClassAccessorProperty(opts?: object): asserts this is NodePath<ClassAccessorProperty>;
|
|
1189
|
+
assertClassBody(opts?: object): asserts this is NodePath<ClassBody>;
|
|
1190
|
+
assertClassDeclaration(opts?: object): asserts this is NodePath<ClassDeclaration>;
|
|
1191
|
+
assertClassExpression(opts?: object): asserts this is NodePath<ClassExpression>;
|
|
1192
|
+
assertClassImplements(opts?: object): asserts this is NodePath<ClassImplements>;
|
|
1193
|
+
assertClassMethod(opts?: object): asserts this is NodePath<ClassMethod>;
|
|
1194
|
+
assertClassPrivateMethod(opts?: object): asserts this is NodePath<ClassPrivateMethod>;
|
|
1195
|
+
assertClassPrivateProperty(opts?: object): asserts this is NodePath<ClassPrivateProperty>;
|
|
1196
|
+
assertClassProperty(opts?: object): asserts this is NodePath<ClassProperty>;
|
|
1197
|
+
assertCompletionStatement(opts?: object): asserts this is NodePath<CompletionStatement>;
|
|
1198
|
+
assertConditional(opts?: object): asserts this is NodePath<Conditional>;
|
|
1199
|
+
assertConditionalExpression(opts?: object): asserts this is NodePath<ConditionalExpression>;
|
|
1200
|
+
assertContinueStatement(opts?: object): asserts this is NodePath<ContinueStatement>;
|
|
1201
|
+
assertDebuggerStatement(opts?: object): asserts this is NodePath<DebuggerStatement>;
|
|
1202
|
+
assertDecimalLiteral(opts?: object): asserts this is NodePath<DecimalLiteral>;
|
|
1203
|
+
assertDeclaration(opts?: object): asserts this is NodePath<Declaration>;
|
|
1204
|
+
assertDeclareClass(opts?: object): asserts this is NodePath<DeclareClass>;
|
|
1205
|
+
assertDeclareExportAllDeclaration(opts?: object): asserts this is NodePath<DeclareExportAllDeclaration>;
|
|
1206
|
+
assertDeclareExportDeclaration(opts?: object): asserts this is NodePath<DeclareExportDeclaration>;
|
|
1207
|
+
assertDeclareFunction(opts?: object): asserts this is NodePath<DeclareFunction>;
|
|
1208
|
+
assertDeclareInterface(opts?: object): asserts this is NodePath<DeclareInterface>;
|
|
1209
|
+
assertDeclareModule(opts?: object): asserts this is NodePath<DeclareModule>;
|
|
1210
|
+
assertDeclareModuleExports(opts?: object): asserts this is NodePath<DeclareModuleExports>;
|
|
1211
|
+
assertDeclareOpaqueType(opts?: object): asserts this is NodePath<DeclareOpaqueType>;
|
|
1212
|
+
assertDeclareTypeAlias(opts?: object): asserts this is NodePath<DeclareTypeAlias>;
|
|
1213
|
+
assertDeclareVariable(opts?: object): asserts this is NodePath<DeclareVariable>;
|
|
1214
|
+
assertDeclaredPredicate(opts?: object): asserts this is NodePath<DeclaredPredicate>;
|
|
1215
|
+
assertDecorator(opts?: object): asserts this is NodePath<Decorator>;
|
|
1216
|
+
assertDirective(opts?: object): asserts this is NodePath<Directive>;
|
|
1217
|
+
assertDirectiveLiteral(opts?: object): asserts this is NodePath<DirectiveLiteral>;
|
|
1218
|
+
assertDoExpression(opts?: object): asserts this is NodePath<DoExpression>;
|
|
1219
|
+
assertDoWhileStatement(opts?: object): asserts this is NodePath<DoWhileStatement>;
|
|
1220
|
+
assertEmptyStatement(opts?: object): asserts this is NodePath<EmptyStatement>;
|
|
1221
|
+
assertEmptyTypeAnnotation(opts?: object): asserts this is NodePath<EmptyTypeAnnotation>;
|
|
1222
|
+
assertEnumBody(opts?: object): asserts this is NodePath<EnumBody>;
|
|
1223
|
+
assertEnumBooleanBody(opts?: object): asserts this is NodePath<EnumBooleanBody>;
|
|
1224
|
+
assertEnumBooleanMember(opts?: object): asserts this is NodePath<EnumBooleanMember>;
|
|
1225
|
+
assertEnumDeclaration(opts?: object): asserts this is NodePath<EnumDeclaration>;
|
|
1226
|
+
assertEnumDefaultedMember(opts?: object): asserts this is NodePath<EnumDefaultedMember>;
|
|
1227
|
+
assertEnumMember(opts?: object): asserts this is NodePath<EnumMember>;
|
|
1228
|
+
assertEnumNumberBody(opts?: object): asserts this is NodePath<EnumNumberBody>;
|
|
1229
|
+
assertEnumNumberMember(opts?: object): asserts this is NodePath<EnumNumberMember>;
|
|
1230
|
+
assertEnumStringBody(opts?: object): asserts this is NodePath<EnumStringBody>;
|
|
1231
|
+
assertEnumStringMember(opts?: object): asserts this is NodePath<EnumStringMember>;
|
|
1232
|
+
assertEnumSymbolBody(opts?: object): asserts this is NodePath<EnumSymbolBody>;
|
|
1233
|
+
assertExistsTypeAnnotation(opts?: object): asserts this is NodePath<ExistsTypeAnnotation>;
|
|
1234
|
+
assertExportAllDeclaration(opts?: object): asserts this is NodePath<ExportAllDeclaration>;
|
|
1235
|
+
assertExportDeclaration(opts?: object): asserts this is NodePath<ExportDeclaration>;
|
|
1236
|
+
assertExportDefaultDeclaration(opts?: object): asserts this is NodePath<ExportDefaultDeclaration>;
|
|
1237
|
+
assertExportDefaultSpecifier(opts?: object): asserts this is NodePath<ExportDefaultSpecifier>;
|
|
1238
|
+
assertExportNamedDeclaration(opts?: object): asserts this is NodePath<ExportNamedDeclaration>;
|
|
1239
|
+
assertExportNamespaceSpecifier(opts?: object): asserts this is NodePath<ExportNamespaceSpecifier>;
|
|
1240
|
+
assertExportSpecifier(opts?: object): asserts this is NodePath<ExportSpecifier>;
|
|
1241
|
+
assertExpression(opts?: object): asserts this is NodePath<Expression>;
|
|
1242
|
+
assertExpressionStatement(opts?: object): asserts this is NodePath<ExpressionStatement>;
|
|
1243
|
+
assertExpressionWrapper(opts?: object): asserts this is NodePath<ExpressionWrapper>;
|
|
1244
|
+
assertFile(opts?: object): asserts this is NodePath<File>;
|
|
1245
|
+
assertFlow(opts?: object): asserts this is NodePath<Flow>;
|
|
1246
|
+
assertFlowBaseAnnotation(opts?: object): asserts this is NodePath<FlowBaseAnnotation>;
|
|
1247
|
+
assertFlowDeclaration(opts?: object): asserts this is NodePath<FlowDeclaration>;
|
|
1248
|
+
assertFlowPredicate(opts?: object): asserts this is NodePath<FlowPredicate>;
|
|
1249
|
+
assertFlowType(opts?: object): asserts this is NodePath<FlowType>;
|
|
1250
|
+
assertFor(opts?: object): asserts this is NodePath<For>;
|
|
1251
|
+
assertForInStatement(opts?: object): asserts this is NodePath<ForInStatement>;
|
|
1252
|
+
assertForOfStatement(opts?: object): asserts this is NodePath<ForOfStatement>;
|
|
1253
|
+
assertForStatement(opts?: object): asserts this is NodePath<ForStatement>;
|
|
1254
|
+
assertForXStatement(opts?: object): asserts this is NodePath<ForXStatement>;
|
|
1255
|
+
assertFunction(opts?: object): asserts this is NodePath<Function>;
|
|
1256
|
+
assertFunctionDeclaration(opts?: object): asserts this is NodePath<FunctionDeclaration>;
|
|
1257
|
+
assertFunctionExpression(opts?: object): asserts this is NodePath<FunctionExpression>;
|
|
1258
|
+
assertFunctionParameter(opts?: object): asserts this is NodePath<FunctionParameter>;
|
|
1259
|
+
assertFunctionParent(opts?: object): asserts this is NodePath<FunctionParent>;
|
|
1260
|
+
assertFunctionTypeAnnotation(opts?: object): asserts this is NodePath<FunctionTypeAnnotation>;
|
|
1261
|
+
assertFunctionTypeParam(opts?: object): asserts this is NodePath<FunctionTypeParam>;
|
|
1262
|
+
assertGenericTypeAnnotation(opts?: object): asserts this is NodePath<GenericTypeAnnotation>;
|
|
1263
|
+
assertIdentifier(opts?: object): asserts this is NodePath<Identifier>;
|
|
1264
|
+
assertIfStatement(opts?: object): asserts this is NodePath<IfStatement>;
|
|
1265
|
+
assertImmutable(opts?: object): asserts this is NodePath<Immutable>;
|
|
1266
|
+
assertImport(opts?: object): asserts this is NodePath<Import>;
|
|
1267
|
+
assertImportAttribute(opts?: object): asserts this is NodePath<ImportAttribute>;
|
|
1268
|
+
assertImportDeclaration(opts?: object): asserts this is NodePath<ImportDeclaration>;
|
|
1269
|
+
assertImportExpression(opts?: object): asserts this is NodePath<ImportExpression>;
|
|
1270
|
+
assertImportDefaultSpecifier(opts?: object): asserts this is NodePath<ImportDefaultSpecifier>;
|
|
1271
|
+
assertImportNamespaceSpecifier(opts?: object): asserts this is NodePath<ImportNamespaceSpecifier>;
|
|
1272
|
+
assertImportOrExportDeclaration(opts?: object): asserts this is NodePath<ImportOrExportDeclaration>;
|
|
1273
|
+
assertImportSpecifier(opts?: object): asserts this is NodePath<ImportSpecifier>;
|
|
1274
|
+
assertIndexedAccessType(opts?: object): asserts this is NodePath<IndexedAccessType>;
|
|
1275
|
+
assertInferredPredicate(opts?: object): asserts this is NodePath<InferredPredicate>;
|
|
1276
|
+
assertInterfaceDeclaration(opts?: object): asserts this is NodePath<InterfaceDeclaration>;
|
|
1277
|
+
assertInterfaceExtends(opts?: object): asserts this is NodePath<InterfaceExtends>;
|
|
1278
|
+
assertInterfaceTypeAnnotation(opts?: object): asserts this is NodePath<InterfaceTypeAnnotation>;
|
|
1279
|
+
assertInterpreterDirective(opts?: object): asserts this is NodePath<InterpreterDirective>;
|
|
1280
|
+
assertIntersectionTypeAnnotation(opts?: object): asserts this is NodePath<IntersectionTypeAnnotation>;
|
|
1281
|
+
assertJSX(opts?: object): asserts this is NodePath<JSX>;
|
|
1282
|
+
assertJSXAttribute(opts?: object): asserts this is NodePath<JSXAttribute>;
|
|
1283
|
+
assertJSXClosingElement(opts?: object): asserts this is NodePath<JSXClosingElement>;
|
|
1284
|
+
assertJSXClosingFragment(opts?: object): asserts this is NodePath<JSXClosingFragment>;
|
|
1285
|
+
assertJSXElement(opts?: object): asserts this is NodePath<JSXElement>;
|
|
1286
|
+
assertJSXEmptyExpression(opts?: object): asserts this is NodePath<JSXEmptyExpression>;
|
|
1287
|
+
assertJSXExpressionContainer(opts?: object): asserts this is NodePath<JSXExpressionContainer>;
|
|
1288
|
+
assertJSXFragment(opts?: object): asserts this is NodePath<JSXFragment>;
|
|
1289
|
+
assertJSXIdentifier(opts?: object): asserts this is NodePath<JSXIdentifier>;
|
|
1290
|
+
assertJSXMemberExpression(opts?: object): asserts this is NodePath<JSXMemberExpression>;
|
|
1291
|
+
assertJSXNamespacedName(opts?: object): asserts this is NodePath<JSXNamespacedName>;
|
|
1292
|
+
assertJSXOpeningElement(opts?: object): asserts this is NodePath<JSXOpeningElement>;
|
|
1293
|
+
assertJSXOpeningFragment(opts?: object): asserts this is NodePath<JSXOpeningFragment>;
|
|
1294
|
+
assertJSXSpreadAttribute(opts?: object): asserts this is NodePath<JSXSpreadAttribute>;
|
|
1295
|
+
assertJSXSpreadChild(opts?: object): asserts this is NodePath<JSXSpreadChild>;
|
|
1296
|
+
assertJSXText(opts?: object): asserts this is NodePath<JSXText>;
|
|
1297
|
+
assertLVal(opts?: object): asserts this is NodePath<LVal>;
|
|
1298
|
+
assertLabeledStatement(opts?: object): asserts this is NodePath<LabeledStatement>;
|
|
1299
|
+
assertLiteral(opts?: object): asserts this is NodePath<Literal>;
|
|
1300
|
+
assertLogicalExpression(opts?: object): asserts this is NodePath<LogicalExpression>;
|
|
1301
|
+
assertLoop(opts?: object): asserts this is NodePath<Loop>;
|
|
1302
|
+
assertMemberExpression(opts?: object): asserts this is NodePath<MemberExpression>;
|
|
1303
|
+
assertMetaProperty(opts?: object): asserts this is NodePath<MetaProperty>;
|
|
1304
|
+
assertMethod(opts?: object): asserts this is NodePath<Method>;
|
|
1305
|
+
assertMiscellaneous(opts?: object): asserts this is NodePath<Miscellaneous>;
|
|
1306
|
+
assertMixedTypeAnnotation(opts?: object): asserts this is NodePath<MixedTypeAnnotation>;
|
|
1307
|
+
assertModuleDeclaration(opts?: object): asserts this is NodePath<ModuleDeclaration>;
|
|
1308
|
+
assertModuleExpression(opts?: object): asserts this is NodePath<ModuleExpression>;
|
|
1309
|
+
assertModuleSpecifier(opts?: object): asserts this is NodePath<ModuleSpecifier>;
|
|
1310
|
+
assertNewExpression(opts?: object): asserts this is NodePath<NewExpression>;
|
|
1311
|
+
assertNoop(opts?: object): asserts this is NodePath<Noop>;
|
|
1312
|
+
assertNullLiteral(opts?: object): asserts this is NodePath<NullLiteral>;
|
|
1313
|
+
assertNullLiteralTypeAnnotation(opts?: object): asserts this is NodePath<NullLiteralTypeAnnotation>;
|
|
1314
|
+
assertNullableTypeAnnotation(opts?: object): asserts this is NodePath<NullableTypeAnnotation>;
|
|
1315
|
+
/** @deprecated Use `assertNumericLiteral` */
|
|
1316
|
+
assertNumberLiteral(opts?: object): asserts this is NodePath<NumberLiteral$1>;
|
|
1317
|
+
assertNumberLiteralTypeAnnotation(opts?: object): asserts this is NodePath<NumberLiteralTypeAnnotation>;
|
|
1318
|
+
assertNumberTypeAnnotation(opts?: object): asserts this is NodePath<NumberTypeAnnotation>;
|
|
1319
|
+
assertNumericLiteral(opts?: object): asserts this is NodePath<NumericLiteral>;
|
|
1320
|
+
assertObjectExpression(opts?: object): asserts this is NodePath<ObjectExpression>;
|
|
1321
|
+
assertObjectMember(opts?: object): asserts this is NodePath<ObjectMember>;
|
|
1322
|
+
assertObjectMethod(opts?: object): asserts this is NodePath<ObjectMethod>;
|
|
1323
|
+
assertObjectPattern(opts?: object): asserts this is NodePath<ObjectPattern>;
|
|
1324
|
+
assertObjectProperty(opts?: object): asserts this is NodePath<ObjectProperty>;
|
|
1325
|
+
assertObjectTypeAnnotation(opts?: object): asserts this is NodePath<ObjectTypeAnnotation>;
|
|
1326
|
+
assertObjectTypeCallProperty(opts?: object): asserts this is NodePath<ObjectTypeCallProperty>;
|
|
1327
|
+
assertObjectTypeIndexer(opts?: object): asserts this is NodePath<ObjectTypeIndexer>;
|
|
1328
|
+
assertObjectTypeInternalSlot(opts?: object): asserts this is NodePath<ObjectTypeInternalSlot>;
|
|
1329
|
+
assertObjectTypeProperty(opts?: object): asserts this is NodePath<ObjectTypeProperty>;
|
|
1330
|
+
assertObjectTypeSpreadProperty(opts?: object): asserts this is NodePath<ObjectTypeSpreadProperty>;
|
|
1331
|
+
assertOpaqueType(opts?: object): asserts this is NodePath<OpaqueType>;
|
|
1332
|
+
assertOptionalCallExpression(opts?: object): asserts this is NodePath<OptionalCallExpression>;
|
|
1333
|
+
assertOptionalIndexedAccessType(opts?: object): asserts this is NodePath<OptionalIndexedAccessType>;
|
|
1334
|
+
assertOptionalMemberExpression(opts?: object): asserts this is NodePath<OptionalMemberExpression>;
|
|
1335
|
+
assertParenthesizedExpression(opts?: object): asserts this is NodePath<ParenthesizedExpression>;
|
|
1336
|
+
assertPattern(opts?: object): asserts this is NodePath<Pattern>;
|
|
1337
|
+
assertPatternLike(opts?: object): asserts this is NodePath<PatternLike>;
|
|
1338
|
+
assertPipelineBareFunction(opts?: object): asserts this is NodePath<PipelineBareFunction>;
|
|
1339
|
+
assertPipelinePrimaryTopicReference(opts?: object): asserts this is NodePath<PipelinePrimaryTopicReference>;
|
|
1340
|
+
assertPipelineTopicExpression(opts?: object): asserts this is NodePath<PipelineTopicExpression>;
|
|
1341
|
+
assertPlaceholder(opts?: object): asserts this is NodePath<Placeholder>;
|
|
1342
|
+
assertPrivate(opts?: object): asserts this is NodePath<Private>;
|
|
1343
|
+
assertPrivateName(opts?: object): asserts this is NodePath<PrivateName>;
|
|
1344
|
+
assertProgram(opts?: object): asserts this is NodePath<Program>;
|
|
1345
|
+
assertProperty(opts?: object): asserts this is NodePath<Property>;
|
|
1346
|
+
assertPureish(opts?: object): asserts this is NodePath<Pureish>;
|
|
1347
|
+
assertQualifiedTypeIdentifier(opts?: object): asserts this is NodePath<QualifiedTypeIdentifier>;
|
|
1348
|
+
assertRecordExpression(opts?: object): asserts this is NodePath<RecordExpression>;
|
|
1349
|
+
assertRegExpLiteral(opts?: object): asserts this is NodePath<RegExpLiteral>;
|
|
1350
|
+
/** @deprecated Use `assertRegExpLiteral` */
|
|
1351
|
+
assertRegexLiteral(opts?: object): asserts this is NodePath<RegexLiteral$1>;
|
|
1352
|
+
assertRestElement(opts?: object): asserts this is NodePath<RestElement>;
|
|
1353
|
+
/** @deprecated Use `assertRestElement` */
|
|
1354
|
+
assertRestProperty(opts?: object): asserts this is NodePath<RestProperty$1>;
|
|
1355
|
+
assertReturnStatement(opts?: object): asserts this is NodePath<ReturnStatement>;
|
|
1356
|
+
assertScopable(opts?: object): asserts this is NodePath<Scopable>;
|
|
1357
|
+
assertSequenceExpression(opts?: object): asserts this is NodePath<SequenceExpression>;
|
|
1358
|
+
assertSpreadElement(opts?: object): asserts this is NodePath<SpreadElement>;
|
|
1359
|
+
/** @deprecated Use `assertSpreadElement` */
|
|
1360
|
+
assertSpreadProperty(opts?: object): asserts this is NodePath<SpreadProperty$1>;
|
|
1361
|
+
assertStandardized(opts?: object): asserts this is NodePath<Standardized>;
|
|
1362
|
+
assertStatement(opts?: object): asserts this is NodePath<Statement>;
|
|
1363
|
+
assertStaticBlock(opts?: object): asserts this is NodePath<StaticBlock>;
|
|
1364
|
+
assertStringLiteral(opts?: object): asserts this is NodePath<StringLiteral>;
|
|
1365
|
+
assertStringLiteralTypeAnnotation(opts?: object): asserts this is NodePath<StringLiteralTypeAnnotation>;
|
|
1366
|
+
assertStringTypeAnnotation(opts?: object): asserts this is NodePath<StringTypeAnnotation>;
|
|
1367
|
+
assertSuper(opts?: object): asserts this is NodePath<Super>;
|
|
1368
|
+
assertSwitchCase(opts?: object): asserts this is NodePath<SwitchCase>;
|
|
1369
|
+
assertSwitchStatement(opts?: object): asserts this is NodePath<SwitchStatement>;
|
|
1370
|
+
assertSymbolTypeAnnotation(opts?: object): asserts this is NodePath<SymbolTypeAnnotation>;
|
|
1371
|
+
assertTSAnyKeyword(opts?: object): asserts this is NodePath<TSAnyKeyword>;
|
|
1372
|
+
assertTSArrayType(opts?: object): asserts this is NodePath<TSArrayType>;
|
|
1373
|
+
assertTSAsExpression(opts?: object): asserts this is NodePath<TSAsExpression>;
|
|
1374
|
+
assertTSBaseType(opts?: object): asserts this is NodePath<TSBaseType>;
|
|
1375
|
+
assertTSBigIntKeyword(opts?: object): asserts this is NodePath<TSBigIntKeyword>;
|
|
1376
|
+
assertTSBooleanKeyword(opts?: object): asserts this is NodePath<TSBooleanKeyword>;
|
|
1377
|
+
assertTSCallSignatureDeclaration(opts?: object): asserts this is NodePath<TSCallSignatureDeclaration>;
|
|
1378
|
+
assertTSConditionalType(opts?: object): asserts this is NodePath<TSConditionalType>;
|
|
1379
|
+
assertTSConstructSignatureDeclaration(opts?: object): asserts this is NodePath<TSConstructSignatureDeclaration>;
|
|
1380
|
+
assertTSConstructorType(opts?: object): asserts this is NodePath<TSConstructorType>;
|
|
1381
|
+
assertTSDeclareFunction(opts?: object): asserts this is NodePath<TSDeclareFunction>;
|
|
1382
|
+
assertTSDeclareMethod(opts?: object): asserts this is NodePath<TSDeclareMethod>;
|
|
1383
|
+
assertTSEntityName(opts?: object): asserts this is NodePath<TSEntityName>;
|
|
1384
|
+
assertTSEnumBody(opts?: object): asserts this is NodePath<TSEnumBody>;
|
|
1385
|
+
assertTSEnumDeclaration(opts?: object): asserts this is NodePath<TSEnumDeclaration>;
|
|
1386
|
+
assertTSEnumMember(opts?: object): asserts this is NodePath<TSEnumMember>;
|
|
1387
|
+
assertTSExportAssignment(opts?: object): asserts this is NodePath<TSExportAssignment>;
|
|
1388
|
+
assertTSExpressionWithTypeArguments(opts?: object): asserts this is NodePath<TSExpressionWithTypeArguments>;
|
|
1389
|
+
assertTSExternalModuleReference(opts?: object): asserts this is NodePath<TSExternalModuleReference>;
|
|
1390
|
+
assertTSFunctionType(opts?: object): asserts this is NodePath<TSFunctionType>;
|
|
1391
|
+
assertTSImportEqualsDeclaration(opts?: object): asserts this is NodePath<TSImportEqualsDeclaration>;
|
|
1392
|
+
assertTSImportType(opts?: object): asserts this is NodePath<TSImportType>;
|
|
1393
|
+
assertTSIndexSignature(opts?: object): asserts this is NodePath<TSIndexSignature>;
|
|
1394
|
+
assertTSIndexedAccessType(opts?: object): asserts this is NodePath<TSIndexedAccessType>;
|
|
1395
|
+
assertTSInferType(opts?: object): asserts this is NodePath<TSInferType>;
|
|
1396
|
+
assertTSInstantiationExpression(opts?: object): asserts this is NodePath<TSInstantiationExpression>;
|
|
1397
|
+
assertTSInterfaceBody(opts?: object): asserts this is NodePath<TSInterfaceBody>;
|
|
1398
|
+
assertTSInterfaceDeclaration(opts?: object): asserts this is NodePath<TSInterfaceDeclaration>;
|
|
1399
|
+
assertTSIntersectionType(opts?: object): asserts this is NodePath<TSIntersectionType>;
|
|
1400
|
+
assertTSIntrinsicKeyword(opts?: object): asserts this is NodePath<TSIntrinsicKeyword>;
|
|
1401
|
+
assertTSLiteralType(opts?: object): asserts this is NodePath<TSLiteralType>;
|
|
1402
|
+
assertTSMappedType(opts?: object): asserts this is NodePath<TSMappedType>;
|
|
1403
|
+
assertTSMethodSignature(opts?: object): asserts this is NodePath<TSMethodSignature>;
|
|
1404
|
+
assertTSModuleBlock(opts?: object): asserts this is NodePath<TSModuleBlock>;
|
|
1405
|
+
assertTSModuleDeclaration(opts?: object): asserts this is NodePath<TSModuleDeclaration>;
|
|
1406
|
+
assertTSNamedTupleMember(opts?: object): asserts this is NodePath<TSNamedTupleMember>;
|
|
1407
|
+
assertTSNamespaceExportDeclaration(opts?: object): asserts this is NodePath<TSNamespaceExportDeclaration>;
|
|
1408
|
+
assertTSNeverKeyword(opts?: object): asserts this is NodePath<TSNeverKeyword>;
|
|
1409
|
+
assertTSNonNullExpression(opts?: object): asserts this is NodePath<TSNonNullExpression>;
|
|
1410
|
+
assertTSNullKeyword(opts?: object): asserts this is NodePath<TSNullKeyword>;
|
|
1411
|
+
assertTSNumberKeyword(opts?: object): asserts this is NodePath<TSNumberKeyword>;
|
|
1412
|
+
assertTSObjectKeyword(opts?: object): asserts this is NodePath<TSObjectKeyword>;
|
|
1413
|
+
assertTSOptionalType(opts?: object): asserts this is NodePath<TSOptionalType>;
|
|
1414
|
+
assertTSParameterProperty(opts?: object): asserts this is NodePath<TSParameterProperty>;
|
|
1415
|
+
assertTSParenthesizedType(opts?: object): asserts this is NodePath<TSParenthesizedType>;
|
|
1416
|
+
assertTSPropertySignature(opts?: object): asserts this is NodePath<TSPropertySignature>;
|
|
1417
|
+
assertTSQualifiedName(opts?: object): asserts this is NodePath<TSQualifiedName>;
|
|
1418
|
+
assertTSRestType(opts?: object): asserts this is NodePath<TSRestType>;
|
|
1419
|
+
assertTSSatisfiesExpression(opts?: object): asserts this is NodePath<TSSatisfiesExpression>;
|
|
1420
|
+
assertTSStringKeyword(opts?: object): asserts this is NodePath<TSStringKeyword>;
|
|
1421
|
+
assertTSSymbolKeyword(opts?: object): asserts this is NodePath<TSSymbolKeyword>;
|
|
1422
|
+
assertTSTemplateLiteralType(opts?: object): asserts this is NodePath<TSTemplateLiteralType>;
|
|
1423
|
+
assertTSThisType(opts?: object): asserts this is NodePath<TSThisType>;
|
|
1424
|
+
assertTSTupleType(opts?: object): asserts this is NodePath<TSTupleType>;
|
|
1425
|
+
assertTSType(opts?: object): asserts this is NodePath<TSType>;
|
|
1426
|
+
assertTSTypeAliasDeclaration(opts?: object): asserts this is NodePath<TSTypeAliasDeclaration>;
|
|
1427
|
+
assertTSTypeAnnotation(opts?: object): asserts this is NodePath<TSTypeAnnotation>;
|
|
1428
|
+
assertTSTypeAssertion(opts?: object): asserts this is NodePath<TSTypeAssertion>;
|
|
1429
|
+
assertTSTypeElement(opts?: object): asserts this is NodePath<TSTypeElement>;
|
|
1430
|
+
assertTSTypeLiteral(opts?: object): asserts this is NodePath<TSTypeLiteral>;
|
|
1431
|
+
assertTSTypeOperator(opts?: object): asserts this is NodePath<TSTypeOperator>;
|
|
1432
|
+
assertTSTypeParameter(opts?: object): asserts this is NodePath<TSTypeParameter>;
|
|
1433
|
+
assertTSTypeParameterDeclaration(opts?: object): asserts this is NodePath<TSTypeParameterDeclaration>;
|
|
1434
|
+
assertTSTypeParameterInstantiation(opts?: object): asserts this is NodePath<TSTypeParameterInstantiation>;
|
|
1435
|
+
assertTSTypePredicate(opts?: object): asserts this is NodePath<TSTypePredicate>;
|
|
1436
|
+
assertTSTypeQuery(opts?: object): asserts this is NodePath<TSTypeQuery>;
|
|
1437
|
+
assertTSTypeReference(opts?: object): asserts this is NodePath<TSTypeReference>;
|
|
1438
|
+
assertTSUndefinedKeyword(opts?: object): asserts this is NodePath<TSUndefinedKeyword>;
|
|
1439
|
+
assertTSUnionType(opts?: object): asserts this is NodePath<TSUnionType>;
|
|
1440
|
+
assertTSUnknownKeyword(opts?: object): asserts this is NodePath<TSUnknownKeyword>;
|
|
1441
|
+
assertTSVoidKeyword(opts?: object): asserts this is NodePath<TSVoidKeyword>;
|
|
1442
|
+
assertTaggedTemplateExpression(opts?: object): asserts this is NodePath<TaggedTemplateExpression>;
|
|
1443
|
+
assertTemplateElement(opts?: object): asserts this is NodePath<TemplateElement>;
|
|
1444
|
+
assertTemplateLiteral(opts?: object): asserts this is NodePath<TemplateLiteral>;
|
|
1445
|
+
assertTerminatorless(opts?: object): asserts this is NodePath<Terminatorless>;
|
|
1446
|
+
assertThisExpression(opts?: object): asserts this is NodePath<ThisExpression>;
|
|
1447
|
+
assertThisTypeAnnotation(opts?: object): asserts this is NodePath<ThisTypeAnnotation>;
|
|
1448
|
+
assertThrowStatement(opts?: object): asserts this is NodePath<ThrowStatement>;
|
|
1449
|
+
assertTopicReference(opts?: object): asserts this is NodePath<TopicReference>;
|
|
1450
|
+
assertTryStatement(opts?: object): asserts this is NodePath<TryStatement>;
|
|
1451
|
+
assertTupleExpression(opts?: object): asserts this is NodePath<TupleExpression>;
|
|
1452
|
+
assertTupleTypeAnnotation(opts?: object): asserts this is NodePath<TupleTypeAnnotation>;
|
|
1453
|
+
assertTypeAlias(opts?: object): asserts this is NodePath<TypeAlias>;
|
|
1454
|
+
assertTypeAnnotation(opts?: object): asserts this is NodePath<TypeAnnotation>;
|
|
1455
|
+
assertTypeCastExpression(opts?: object): asserts this is NodePath<TypeCastExpression>;
|
|
1456
|
+
assertTypeParameter(opts?: object): asserts this is NodePath<TypeParameter>;
|
|
1457
|
+
assertTypeParameterDeclaration(opts?: object): asserts this is NodePath<TypeParameterDeclaration>;
|
|
1458
|
+
assertTypeParameterInstantiation(opts?: object): asserts this is NodePath<TypeParameterInstantiation>;
|
|
1459
|
+
assertTypeScript(opts?: object): asserts this is NodePath<TypeScript>;
|
|
1460
|
+
assertTypeofTypeAnnotation(opts?: object): asserts this is NodePath<TypeofTypeAnnotation>;
|
|
1461
|
+
assertUnaryExpression(opts?: object): asserts this is NodePath<UnaryExpression>;
|
|
1462
|
+
assertUnaryLike(opts?: object): asserts this is NodePath<UnaryLike>;
|
|
1463
|
+
assertUnionTypeAnnotation(opts?: object): asserts this is NodePath<UnionTypeAnnotation>;
|
|
1464
|
+
assertUpdateExpression(opts?: object): asserts this is NodePath<UpdateExpression>;
|
|
1465
|
+
assertUserWhitespacable(opts?: object): asserts this is NodePath<UserWhitespacable>;
|
|
1466
|
+
assertV8IntrinsicIdentifier(opts?: object): asserts this is NodePath<V8IntrinsicIdentifier>;
|
|
1467
|
+
assertVariableDeclaration(opts?: object): asserts this is NodePath<VariableDeclaration>;
|
|
1468
|
+
assertVariableDeclarator(opts?: object): asserts this is NodePath<VariableDeclarator>;
|
|
1469
|
+
assertVariance(opts?: object): asserts this is NodePath<Variance>;
|
|
1470
|
+
assertVoidPattern(opts?: object): asserts this is NodePath<VoidPattern>;
|
|
1471
|
+
assertVoidTypeAnnotation(opts?: object): asserts this is NodePath<VoidTypeAnnotation>;
|
|
1472
|
+
assertWhile(opts?: object): asserts this is NodePath<While>;
|
|
1473
|
+
assertWhileStatement(opts?: object): asserts this is NodePath<WhileStatement>;
|
|
1474
|
+
assertWithStatement(opts?: object): asserts this is NodePath<WithStatement>;
|
|
1475
|
+
assertYieldExpression(opts?: object): asserts this is NodePath<YieldExpression>; // #endregion
|
|
1476
|
+
}
|
|
1477
|
+
interface HubInterface {
|
|
1478
|
+
getCode(): string | undefined;
|
|
1479
|
+
getScope(): Scope | undefined;
|
|
1480
|
+
addHelper(name: string): any;
|
|
1481
|
+
buildError(node: Node$1, msg: string, Error: ErrorConstructor): Error;
|
|
1482
|
+
}
|
|
1483
|
+
declare class Hub implements HubInterface {
|
|
1484
|
+
constructor();
|
|
1485
|
+
getCode(): string | undefined;
|
|
1486
|
+
getScope(): Scope | undefined;
|
|
1487
|
+
addHelper(name: string): any;
|
|
1488
|
+
buildError(node: Node$1, msg: string, Error?: ErrorConstructor): Error;
|
|
1489
|
+
}
|
|
1490
|
+
interface TraversalContext<S = unknown> {
|
|
1491
|
+
parentPath: NodePath;
|
|
1492
|
+
scope: Scope;
|
|
1493
|
+
state: S;
|
|
1494
|
+
opts: TraverseOptions;
|
|
1495
|
+
}
|
|
1496
|
+
// Based on `GetFieldType`s from `@types/lodash/common/object.d.ts`:
|
|
1497
|
+
// dprint-ignore
|
|
1498
|
+
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
|
+
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
|
+
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$1 | null | undefined> extends never ? never : NodePath<Extract<T, Node$1 | null | undefined>>) | (T extends Array<Node$1 | null | undefined> ? Array<NodePath<T[number]>> : never);
|
|
1502
|
+
interface VirtualTypeAliases {
|
|
1503
|
+
BindingIdentifier: Identifier;
|
|
1504
|
+
BlockScoped: Node$1;
|
|
1505
|
+
ExistentialTypeParam: ExistsTypeAnnotation;
|
|
1506
|
+
Flow: Flow | ImportDeclaration | ExportDeclaration | ImportSpecifier;
|
|
1507
|
+
ForAwaitStatement: ForOfStatement;
|
|
1508
|
+
Generated: Node$1;
|
|
1509
|
+
NumericLiteralTypeAnnotation: NumberLiteralTypeAnnotation;
|
|
1510
|
+
Pure: Node$1;
|
|
1511
|
+
Referenced: Node$1;
|
|
1512
|
+
ReferencedIdentifier: Identifier | JSXIdentifier;
|
|
1513
|
+
ReferencedMemberExpression: MemberExpression;
|
|
1514
|
+
RestProperty: RestElement;
|
|
1515
|
+
Scope: Scopable | Pattern;
|
|
1516
|
+
SpreadProperty: RestElement;
|
|
1517
|
+
User: Node$1;
|
|
1518
|
+
Var: VariableDeclaration;
|
|
1519
|
+
}
|
|
1520
|
+
declare namespace index_d_exports {
|
|
1521
|
+
export { BabelFile, BabelFileMetadata, BabelFileModulesMetadata, BabelFileResult, ConfigAPI, ConfigFunction, ConfigItem, CreateConfigItemOptions, DEFAULT_EXTENSIONS, EnvFunction, FileParseCallback, FileResultCallback, GeneratorOptions, MatchPattern, MatchPatternContext, Node, NodePath, ParseResult, ParserOptions, PartialConfig, PluginItem, PluginObj, PluginOptions, PluginPass, PluginTarget, SimpleCacheCallback, SimpleCacheConfigurator, SimpleCacheKey, TransformCaller, TransformOptions, Visitor, createConfigItem, loadOptions, loadPartialConfig, loadPartialConfigAsync, parse, parseAsync, parseSync, resolvePlugin, resolvePreset, templateBuilder as template, transform, transformAsync, transformFile, transformFileAsync, transformFileSync, transformFromAst, transformFromAstAsync, transformFromAstSync, transformSync, traverse$1 as traverse, index_d_exports$1 as types, version };
|
|
1522
|
+
}
|
|
1523
|
+
type Node = Node$1;
|
|
1524
|
+
type ParseResult = ReturnType<typeof parse$1>;
|
|
1525
|
+
declare const version: string;
|
|
1526
|
+
declare const DEFAULT_EXTENSIONS: [".js", ".jsx", ".es6", ".es", ".mjs"];
|
|
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;
|
|
1540
|
+
}
|
|
1541
|
+
interface TransformOptions {
|
|
1542
|
+
/**
|
|
1543
|
+
* Specify which assumptions it can make about your code, to better optimize the compilation result. **NOTE**: This replaces the various `loose` options in plugins in favor of
|
|
1544
|
+
* top-level options that can apply to multiple plugins
|
|
1545
|
+
*
|
|
1546
|
+
* @see https://babeljs.io/docs/en/assumptions
|
|
1547
|
+
*/
|
|
1548
|
+
assumptions?: {
|
|
1549
|
+
[name: string]: boolean;
|
|
1550
|
+
} | null | undefined;
|
|
1551
|
+
/**
|
|
1552
|
+
* Include the AST in the returned object
|
|
1553
|
+
*
|
|
1554
|
+
* Default: `false`
|
|
1555
|
+
*/
|
|
1556
|
+
ast?: boolean | null | undefined;
|
|
1557
|
+
/**
|
|
1558
|
+
* Attach a comment after all non-user injected code
|
|
1559
|
+
*
|
|
1560
|
+
* Default: `null`
|
|
1561
|
+
*/
|
|
1562
|
+
auxiliaryCommentAfter?: string | null | undefined;
|
|
1563
|
+
/**
|
|
1564
|
+
* Attach a comment before all non-user injected code
|
|
1565
|
+
*
|
|
1566
|
+
* Default: `null`
|
|
1567
|
+
*/
|
|
1568
|
+
auxiliaryCommentBefore?: string | null | undefined;
|
|
1569
|
+
/**
|
|
1570
|
+
* Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of.
|
|
1571
|
+
*
|
|
1572
|
+
* Default: `"."`
|
|
1573
|
+
*/
|
|
1574
|
+
root?: string | null | undefined;
|
|
1575
|
+
/**
|
|
1576
|
+
* This option, combined with the "root" value, defines how Babel chooses its project root.
|
|
1577
|
+
* The different modes define different ways that Babel can process the "root" value to get
|
|
1578
|
+
* the final project root.
|
|
1579
|
+
*
|
|
1580
|
+
* @see https://babeljs.io/docs/en/next/options#rootmode
|
|
1581
|
+
*/
|
|
1582
|
+
rootMode?: "root" | "upward" | "upward-optional" | undefined;
|
|
1583
|
+
/**
|
|
1584
|
+
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
|
|
1585
|
+
*
|
|
1586
|
+
* Default: `undefined`
|
|
1587
|
+
*/
|
|
1588
|
+
configFile?: string | boolean | null | undefined;
|
|
1589
|
+
/**
|
|
1590
|
+
* Specify whether or not to use .babelrc and
|
|
1591
|
+
* .babelignore files.
|
|
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;
|
|
1764
|
+
/**
|
|
1765
|
+
* An object containing the options to be passed down to the babel parser, @babel/parser
|
|
1766
|
+
*
|
|
1767
|
+
* Default: `{}`
|
|
1768
|
+
*/
|
|
1769
|
+
parserOpts?: ParserOptions | null | undefined;
|
|
1770
|
+
/**
|
|
1771
|
+
* List of plugins to load and use
|
|
1772
|
+
*
|
|
1773
|
+
* Default: `[]`
|
|
1774
|
+
*/
|
|
1775
|
+
plugins?: PluginItem[] | null | undefined;
|
|
1776
|
+
/**
|
|
1777
|
+
* List of presets (a set of plugins) to load and use
|
|
1778
|
+
*
|
|
1779
|
+
* Default: `[]`
|
|
1780
|
+
*/
|
|
1781
|
+
presets?: PluginItem[] | null | undefined;
|
|
1782
|
+
/**
|
|
1783
|
+
* Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns)
|
|
1784
|
+
*
|
|
1785
|
+
* Default: `false`
|
|
1786
|
+
*/
|
|
1787
|
+
retainLines?: boolean | null | undefined;
|
|
1788
|
+
/**
|
|
1789
|
+
* An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used
|
|
1790
|
+
*
|
|
1791
|
+
* Default: `null`
|
|
1792
|
+
*/
|
|
1793
|
+
shouldPrintComment?: ((commentContents: string) => boolean) | null | undefined;
|
|
1794
|
+
/**
|
|
1795
|
+
* Set `sources[0]` on returned source map
|
|
1796
|
+
*
|
|
1797
|
+
* Default: `(filenameRelative)`
|
|
1798
|
+
*/
|
|
1799
|
+
sourceFileName?: string | null | undefined;
|
|
1800
|
+
/**
|
|
1801
|
+
* If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a sourceMappingURL directive is added to the bottom of the returned code. If set to `"both"`
|
|
1802
|
+
* then a `map` property is returned as well as a source map comment appended. **This does not emit sourcemap files by itself!**
|
|
1803
|
+
*
|
|
1804
|
+
* Default: `false`
|
|
1805
|
+
*/
|
|
1806
|
+
sourceMaps?: boolean | "inline" | "both" | null | undefined;
|
|
1807
|
+
/**
|
|
1808
|
+
* The root from which all sources are relative
|
|
1809
|
+
*
|
|
1810
|
+
* Default: `(moduleRoot)`
|
|
1811
|
+
*/
|
|
1812
|
+
sourceRoot?: string | null | undefined;
|
|
1813
|
+
/**
|
|
1814
|
+
* Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6
|
|
1815
|
+
* `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.
|
|
1816
|
+
*
|
|
1817
|
+
* Default: `("module")`
|
|
1818
|
+
*/
|
|
1819
|
+
sourceType?: "script" | "module" | "unambiguous" | null | undefined;
|
|
1820
|
+
/**
|
|
1821
|
+
* If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
|
|
1822
|
+
*/
|
|
1823
|
+
test?: MatchPattern | MatchPattern[] | undefined;
|
|
1824
|
+
/**
|
|
1825
|
+
* Describes the environments you support/target for your project.
|
|
1826
|
+
* This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries))
|
|
1827
|
+
*
|
|
1828
|
+
* Default: `{}`
|
|
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.
|
|
2065
|
+
*/
|
|
2066
|
+
dirname: string;
|
|
2067
|
+
/**
|
|
2068
|
+
* Information about the plugin's file, if Babel knows it.
|
|
2069
|
+
* *
|
|
2070
|
+
*/
|
|
2071
|
+
file?: {
|
|
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 {
|
|
2102
|
+
/**
|
|
2103
|
+
* The version string for the Babel version that is loading the config file.
|
|
2104
|
+
*
|
|
2105
|
+
* @see https://babeljs.io/docs/en/next/config-files#apiversion
|
|
2106
|
+
*/
|
|
2107
|
+
version: string;
|
|
2108
|
+
/**
|
|
2109
|
+
* @see https://babeljs.io/docs/en/next/config-files#apicache
|
|
2110
|
+
*/
|
|
2111
|
+
cache: SimpleCacheConfigurator;
|
|
2112
|
+
/**
|
|
2113
|
+
* @see https://babeljs.io/docs/en/next/config-files#apienv
|
|
2114
|
+
*/
|
|
2115
|
+
env: EnvFunction; // undocumented; currently hardcoded to return 'false'
|
|
2116
|
+
// async(): boolean
|
|
2117
|
+
/**
|
|
2118
|
+
* This API is used as a way to access the `caller` data that has been passed to Babel.
|
|
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
|
|
2133
|
+
*/
|
|
2134
|
+
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions["caller"]) => T): T;
|
|
2135
|
+
/**
|
|
2136
|
+
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
|
|
2137
|
+
* This API exposes a simple way to do that with:
|
|
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
|
|
2144
|
+
*/
|
|
2145
|
+
assertVersion(versionRange: number | string): boolean; // NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
|
|
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
|
|
2164
|
+
/**
|
|
2165
|
+
* Permacache the computed config and never call the function again.
|
|
2166
|
+
*/
|
|
2167
|
+
forever(): void;
|
|
2168
|
+
/**
|
|
2169
|
+
* Do not cache this config, and re-execute the function every time.
|
|
2170
|
+
*/
|
|
2171
|
+
never(): void;
|
|
2172
|
+
/**
|
|
2173
|
+
* Any time the using callback returns a value other than the one that was expected,
|
|
2174
|
+
* the overall config function will be called again and a new entry will be added to the cache.
|
|
2175
|
+
*
|
|
2176
|
+
* @example
|
|
2177
|
+
* api.cache.using(() => process.env.NODE_ENV)
|
|
2178
|
+
*/
|
|
2179
|
+
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
|
2180
|
+
/**
|
|
2181
|
+
* Any time the using callback returns a value other than the one that was expected,
|
|
2182
|
+
* the overall config function will be called again and all entries in the cache will
|
|
2183
|
+
* be replaced with the result.
|
|
2184
|
+
*
|
|
2185
|
+
* @example
|
|
2186
|
+
* api.cache.invalidate(() => process.env.NODE_ENV)
|
|
2187
|
+
*/
|
|
2188
|
+
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
|
|
2189
|
+
}
|
|
2190
|
+
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
|
|
2191
|
+
type SimpleCacheKey = string | boolean | number | null | undefined;
|
|
2192
|
+
type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
|
|
2193
|
+
/**
|
|
2194
|
+
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
|
|
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
|
|
2199
|
+
*/
|
|
2200
|
+
interface EnvFunction {
|
|
2201
|
+
/**
|
|
2202
|
+
* @returns the current `envName` string
|
|
2203
|
+
*/
|
|
2204
|
+
(): string;
|
|
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;
|
|
2214
|
+
//#endregion
|
|
2215
|
+
//#region .dts-emit/code/core/src/babel/babelParse.d.ts
|
|
2216
|
+
declare const parserOptions: ParserOptions;
|
|
2217
|
+
declare const babelParse: (code: string) => File;
|
|
2218
|
+
interface ASTNode {
|
|
2219
|
+
type: string;
|
|
2220
|
+
}
|
|
2221
|
+
declare const babelPrint: (ast: ASTNode) => string;
|
|
2222
|
+
declare const babelParseExpression: (code: string) => ParseResult$1<Expression>;
|
|
2223
|
+
//#endregion
|
|
2224
|
+
//#region .dts-emit/code/core/src/babel/expression-resolver.d.ts
|
|
2225
|
+
/** Recursively unwraps TypeScript type annotation expressions (as X, satisfies X, <X>expr). */
|
|
2226
|
+
declare const unwrapTSExpression: (expr: Expression | Declaration) => Expression;
|
|
2227
|
+
/**
|
|
2228
|
+
* Resolves an expression through variable references and TypeScript type annotations. Handles:
|
|
2229
|
+
* Identifier (variable lookup), TSAsExpression, TSSatisfiesExpression, TSTypeAssertion. Limits
|
|
2230
|
+
* recursion depth to prevent infinite loops on circular variable references.
|
|
2231
|
+
*/
|
|
2232
|
+
declare const resolveExpression: (expr: Expression | Declaration | null | undefined, ast: File, depth?: number, maxDepth?: number) => Expression | null;
|
|
2233
|
+
//#endregion
|
|
2234
|
+
//#region .dts-emit/code/core/src/babel/vitest-config-helpers.d.ts
|
|
2235
|
+
type AST = File;
|
|
2236
|
+
/**
|
|
2237
|
+
* Returns true if the identifier `localName` is a local alias for `defineConfig` or `defineProject`
|
|
2238
|
+
* imported from either `vitest/config` or `vite`.
|
|
2239
|
+
*/
|
|
2240
|
+
declare const isImportedDefineConfigLikeIdentifier: (localName: string, ast: AST) => boolean;
|
|
2241
|
+
/** Returns true if a CallExpression is a call to defineConfig or defineProject (or an alias). */
|
|
2242
|
+
declare const isDefineConfigLike: (node: CallExpression, ast: AST) => boolean;
|
|
2243
|
+
/**
|
|
2244
|
+
* Resolves a `mergeConfig` argument to an ObjectExpression when possible. Handles:
|
|
2245
|
+
*
|
|
2246
|
+
* - Plain object literals: `{ test: {...} }`
|
|
2247
|
+
* - Variable references: `const vitestConfig = {...}; mergeConfig(viteConfig, vitestConfig)`
|
|
2248
|
+
* - Wrapped calls (e.g. `defineConfig({ ... })`): returns the inner ObjectExpression
|
|
2249
|
+
* - TypeScript type annotations: `mergeConfig(...) as ViteUserConfig`
|
|
2250
|
+
*/
|
|
2251
|
+
declare const getConfigObjectFromMergeArg: (arg: Expression, ast: AST) => ObjectExpression | null;
|
|
2252
|
+
/**
|
|
2253
|
+
* Extracts the effective `mergeConfig(...)` call from a declaration, unwrapping:
|
|
2254
|
+
*
|
|
2255
|
+
* - TypeScript type annotations (`as X`, `satisfies X`)
|
|
2256
|
+
* - `defineConfig(mergeConfig(...))` outer wrapper
|
|
2257
|
+
* - Variable references (`export default config` where `config = mergeConfig(...)`)
|
|
2258
|
+
*
|
|
2259
|
+
* Returns null when the declaration is not or does not contain a `mergeConfig` call.
|
|
2260
|
+
*/
|
|
2261
|
+
declare const getEffectiveMergeConfigCall: (decl: Expression | Declaration, ast: AST) => CallExpression | null;
|
|
2262
|
+
/**
|
|
2263
|
+
* Resolves the default export to the actual config ObjectExpression we can merge into. Handles:
|
|
2264
|
+
*
|
|
2265
|
+
* - `export default { ... }` — plain object
|
|
2266
|
+
* - `export default defineConfig({ ... })` — defineConfig with object
|
|
2267
|
+
* - `export default defineProject({ ... })` — defineProject with object
|
|
2268
|
+
* - `export default config` — variable reference to any of the above
|
|
2269
|
+
* - Any of the above wrapped in TypeScript type annotations
|
|
2270
|
+
*
|
|
2271
|
+
* Returns null when a writable ObjectExpression cannot be located.
|
|
2272
|
+
*/
|
|
2273
|
+
declare const getTargetConfigObject: (target: AST, exportDefault: ExportDefaultDeclaration) => ObjectExpression | null;
|
|
2274
|
+
/**
|
|
2275
|
+
* Returns `true` when a Vitest/Vite config file's default export uses a pattern that
|
|
2276
|
+
* `updateConfigFile` (from addon-vitest) can auto-update.
|
|
2277
|
+
*
|
|
2278
|
+
* Supported patterns:
|
|
2279
|
+
*
|
|
2280
|
+
* - `export default { test: {...} }`
|
|
2281
|
+
* - `export default defineConfig({ ... })` / `defineProject({ ... })`
|
|
2282
|
+
* - `export default mergeConfig(viteConfig, { ... })`
|
|
2283
|
+
* - `export default mergeConfig(viteConfig, defineConfig({ ... }))`
|
|
2284
|
+
* - `export default defineConfig(mergeConfig(...))`
|
|
2285
|
+
* - `export default config` (variable referencing any of the above)
|
|
2286
|
+
* - Any of the above wrapped in `as X` or `satisfies X` TypeScript annotations
|
|
2287
|
+
*
|
|
2288
|
+
* Unsupported patterns (returns `false`):
|
|
2289
|
+
*
|
|
2290
|
+
* - Callback-based defineConfig with non-literal/dynamic returns that cannot be safely resolved
|
|
2291
|
+
* - Completely unrecognizable export shapes
|
|
2292
|
+
* - No `export default` declaration at all
|
|
2293
|
+
*/
|
|
2294
|
+
declare const canUpdateVitestConfigFile: (fileContent: string) => boolean;
|
|
2295
|
+
//#endregion
|
|
2296
|
+
//#region .dts-emit/code/core/src/babel/index.d.ts
|
|
2297
|
+
declare const traverse: typeof traverse$1;
|
|
2298
|
+
declare const generate: typeof generate$1;
|
|
2299
|
+
declare const BabelFileClass: any;
|
|
2300
|
+
//#endregion
|
|
2301
|
+
export { type BabelFile, BabelFileClass, type GeneratorOptions, type NodePath, type RecastOptions, babelParse, babelParseExpression, babelPrint, canUpdateVitestConfigFile, index_d_exports as core, generate, getConfigObjectFromMergeArg, getEffectiveMergeConfigCall, getTargetConfigObject, isDefineConfigLike, isImportedDefineConfigLikeIdentifier, babel_parser_d_exports as parser, parserOptions, recast, resolveExpression, transformSync, traverse, index_d_exports$1 as types, unwrapTSExpression };
|