@compass-labs/api-sdk 2.1.11-rc.0 → 2.1.12-rc.0

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.
Files changed (622) hide show
  1. package/CONTRIBUTING.md +26 -0
  2. package/USAGE.md +20 -0
  3. package/codeSamples_typescript.yaml +551 -0
  4. package/dist/commonjs/funcs/bridgeCctpMint.d.ts +2 -4
  5. package/dist/commonjs/funcs/bridgeCctpMint.d.ts.map +1 -1
  6. package/dist/commonjs/funcs/bridgeCctpMint.js +2 -4
  7. package/dist/commonjs/funcs/bridgeCctpMint.js.map +1 -1
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/sdk/bridge.d.ts +2 -4
  11. package/dist/commonjs/sdk/bridge.d.ts.map +1 -1
  12. package/dist/commonjs/sdk/bridge.js +2 -4
  13. package/dist/commonjs/sdk/bridge.js.map +1 -1
  14. package/dist/esm/funcs/bridgeCctpMint.d.ts +2 -4
  15. package/dist/esm/funcs/bridgeCctpMint.d.ts.map +1 -1
  16. package/dist/esm/funcs/bridgeCctpMint.js +2 -4
  17. package/dist/esm/funcs/bridgeCctpMint.js.map +1 -1
  18. package/dist/esm/lib/config.d.ts +2 -2
  19. package/dist/esm/lib/config.js +2 -2
  20. package/dist/esm/sdk/bridge.d.ts +2 -4
  21. package/dist/esm/sdk/bridge.d.ts.map +1 -1
  22. package/dist/esm/sdk/bridge.js +2 -4
  23. package/dist/esm/sdk/bridge.js.map +1 -1
  24. package/docs/lib/utils/retryconfig.md +24 -0
  25. package/docs/models/components/aaveavgrateresponse.md +27 -0
  26. package/docs/models/components/aaveborrowparams.md +24 -0
  27. package/docs/models/components/aaveborrowparamsamount.md +19 -0
  28. package/docs/models/components/aaveborrowrequest.md +29 -0
  29. package/docs/models/components/aaveborrowrequestamount.md +19 -0
  30. package/docs/models/components/aaveborrowrequestchain.md +15 -0
  31. package/docs/models/components/aavehistoricaltransactionsresponse.md +23 -0
  32. package/docs/models/components/aavehistoricaltransactionsresponsetransaction.md +148 -0
  33. package/docs/models/components/aaveliquiditychangeresponse.md +21 -0
  34. package/docs/models/components/aavelooprequest.md +46 -0
  35. package/docs/models/components/aavelooprequestchain.md +15 -0
  36. package/docs/models/components/aaveposition.md +25 -0
  37. package/docs/models/components/aaverateresponse.md +27 -0
  38. package/docs/models/components/aaverepayparams.md +24 -0
  39. package/docs/models/components/aaverepayparamsamount.md +19 -0
  40. package/docs/models/components/aaverepayrequest.md +29 -0
  41. package/docs/models/components/aaverepayrequestamount.md +19 -0
  42. package/docs/models/components/aaverepayrequestchain.md +15 -0
  43. package/docs/models/components/aavereserveoverviewresponse.md +21 -0
  44. package/docs/models/components/aavestdrateresponse.md +27 -0
  45. package/docs/models/components/aavesupplyparams.md +22 -0
  46. package/docs/models/components/aavesupplyparamsamount.md +19 -0
  47. package/docs/models/components/aavesupplyrequest.md +26 -0
  48. package/docs/models/components/aavesupplyrequestamount.md +19 -0
  49. package/docs/models/components/aavesupplyrequestchain.md +15 -0
  50. package/docs/models/components/aavesupportedtokenmetadata.md +23 -0
  51. package/docs/models/components/aavesupportedtokensresponse.md +24 -0
  52. package/docs/models/components/aavetokenpriceresponse.md +17 -0
  53. package/docs/models/components/aaveusdcratesresponse.md +40 -0
  54. package/docs/models/components/aaveuserpositionpertokenresponse.md +33 -0
  55. package/docs/models/components/aaveuserpositionsummaryresponse.md +27 -0
  56. package/docs/models/components/aavevenue.md +19 -0
  57. package/docs/models/components/aavewithdrawparams.md +23 -0
  58. package/docs/models/components/aavewithdrawparamsamount.md +19 -0
  59. package/docs/models/components/aavewithdrawrequest.md +27 -0
  60. package/docs/models/components/aavewithdrawrequestamount.md +19 -0
  61. package/docs/models/components/aavewithdrawrequestchain.md +15 -0
  62. package/docs/models/components/aerodromelppositionsresponse.md +17 -0
  63. package/docs/models/components/aerodromeposition.md +41 -0
  64. package/docs/models/components/aerodromeslipstreambuyexactlyparams.md +29 -0
  65. package/docs/models/components/aerodromeslipstreambuyexactlyparamsamountinmaximum.md +19 -0
  66. package/docs/models/components/aerodromeslipstreambuyexactlyparamsamountout.md +19 -0
  67. package/docs/models/components/aerodromeslipstreambuyexactlyrequest.md +33 -0
  68. package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountinmaximum.md +19 -0
  69. package/docs/models/components/aerodromeslipstreambuyexactlyrequestamountout.md +19 -0
  70. package/docs/models/components/aerodromeslipstreambuyexactlyrequestchain.md +15 -0
  71. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparams.md +32 -0
  72. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount0desired.md +19 -0
  73. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount0min.md +19 -0
  74. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount1desired.md +19 -0
  75. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionparamsamount1min.md +19 -0
  76. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequest.md +31 -0
  77. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0desired.md +19 -0
  78. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount0min.md +19 -0
  79. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1desired.md +19 -0
  80. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestamount1min.md +19 -0
  81. package/docs/models/components/aerodromeslipstreamincreaseliquidityprovisionrequestchain.md +15 -0
  82. package/docs/models/components/aerodromeslipstreammintliquidityprovisionparams.md +38 -0
  83. package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount0desired.md +19 -0
  84. package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount0min.md +19 -0
  85. package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount1desired.md +19 -0
  86. package/docs/models/components/aerodromeslipstreammintliquidityprovisionparamsamount1min.md +19 -0
  87. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequest.md +43 -0
  88. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0desired.md +19 -0
  89. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount0min.md +19 -0
  90. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1desired.md +19 -0
  91. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestamount1min.md +19 -0
  92. package/docs/models/components/aerodromeslipstreammintliquidityprovisionrequestchain.md +15 -0
  93. package/docs/models/components/aerodromeslipstreampoolpriceresponse.md +23 -0
  94. package/docs/models/components/aerodromeslipstreamsellexactlyparams.md +29 -0
  95. package/docs/models/components/aerodromeslipstreamsellexactlyparamsamountin.md +19 -0
  96. package/docs/models/components/aerodromeslipstreamsellexactlyparamsamountoutminimum.md +19 -0
  97. package/docs/models/components/aerodromeslipstreamsellexactlyrequest.md +33 -0
  98. package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountin.md +19 -0
  99. package/docs/models/components/aerodromeslipstreamsellexactlyrequestamountoutminimum.md +19 -0
  100. package/docs/models/components/aerodromeslipstreamsellexactlyrequestchain.md +15 -0
  101. package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionparams.md +26 -0
  102. package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionparamspercentageforwithdrawal.md +19 -0
  103. package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequest.md +25 -0
  104. package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequestchain.md +15 -0
  105. package/docs/models/components/aerodromeslipstreamwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +19 -0
  106. package/docs/models/components/allowanceinforesponse.md +27 -0
  107. package/docs/models/components/approvetransferrequest.md +22 -0
  108. package/docs/models/components/approvetransferresponse.md +48 -0
  109. package/docs/models/components/apy.md +23 -0
  110. package/docs/models/components/batchedsafeoperationsresponseinput.md +47 -0
  111. package/docs/models/components/batchedsafeoperationsresponseoutput.md +47 -0
  112. package/docs/models/components/batcheduseroperationsrequest.md +36 -0
  113. package/docs/models/components/batcheduseroperationsrequestchain.md +15 -0
  114. package/docs/models/components/batcheduseroperationsresponse.md +17 -0
  115. package/docs/models/components/body.md +424 -0
  116. package/docs/models/components/borrow.md +37 -0
  117. package/docs/models/components/borrowratemode.md +17 -0
  118. package/docs/models/components/bundlertransactionresponse.md +28 -0
  119. package/docs/models/components/chain.md +17 -0
  120. package/docs/models/components/chaininfo.md +18 -0
  121. package/docs/models/components/chainratedata.md +21 -0
  122. package/docs/models/components/compassapibackendv1modelsgenericreadresponseportfoliotokenbalance.md +27 -0
  123. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionapydata.md +20 -0
  124. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionasset.md +27 -0
  125. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionmarketstate.md +34 -0
  126. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionvaultposition.md +52 -0
  127. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsecheckuserpositionvaultstate.md +24 -0
  128. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketapydata.md +23 -0
  129. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketasset.md +27 -0
  130. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketmarketstate.md +28 -0
  131. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketsasset.md +23 -0
  132. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetmarketsmarketstate.md +31 -0
  133. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetvaultsasset.md +25 -0
  134. package/docs/models/components/compassapibackendv1modelsmorphoreadresponsegetvaultsvaultstate.md +28 -0
  135. package/docs/models/components/compassapibackendv1modelspendlereadresponsemarketuserposition.md +28 -0
  136. package/docs/models/components/compassapibackendv1modelspendlereadresponsepositionstokenbalance.md +19 -0
  137. package/docs/models/components/compassapibackendv1modelsvaultsreadresponsevaultuserposition.md +19 -0
  138. package/docs/models/components/compassapibackendv1modelswildcatreadresponsemarketuserposition.md +19 -0
  139. package/docs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.md +27 -0
  140. package/docs/models/components/compassapibackendv2modelsgassponsorshippermit2typeddataeip712domain.md +21 -0
  141. package/docs/models/components/compassapibackendv2modelsgassponsorshippermit2typeddataeip712types.md +61 -0
  142. package/docs/models/components/compassapibackendv2modelsgassponsorshippermittypeddataeip712domain.md +26 -0
  143. package/docs/models/components/compassapibackendv2modelsgassponsorshippermittypeddataeip712types.md +21 -0
  144. package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712domain.md +23 -0
  145. package/docs/models/components/compassapibackendv2modelssafetransactresponsebatchedsafeoperationseip712types.md +23 -0
  146. package/docs/models/components/cooldownend.md +19 -0
  147. package/docs/models/components/cooldownposition.md +21 -0
  148. package/docs/models/components/createaccountrequest.md +24 -0
  149. package/docs/models/components/createaccountrequestchain.md +15 -0
  150. package/docs/models/components/createaccountresponse.md +31 -0
  151. package/docs/models/components/denomination.md +17 -0
  152. package/docs/models/components/depositforburnrequest.md +27 -0
  153. package/docs/models/components/depositforburnrequestamount.md +19 -0
  154. package/docs/models/components/depositforburnrequestchain.md +17 -0
  155. package/docs/models/components/depositforburnrequesttransfermode.md +17 -0
  156. package/docs/models/components/depositforburnresponse.md +68 -0
  157. package/docs/models/components/depositforburnresponsetransfermode.md +17 -0
  158. package/docs/models/components/destinationchain.md +17 -0
  159. package/docs/models/components/details.md +33 -0
  160. package/docs/models/components/earnmanagerequest.md +30 -0
  161. package/docs/models/components/earnmanagerequestaction.md +17 -0
  162. package/docs/models/components/earnmanageresponse.md +29 -0
  163. package/docs/models/components/earnpositionresponse.md +26 -0
  164. package/docs/models/components/earnpositionsresponse.md +17 -0
  165. package/docs/models/components/earnswaprequest.md +29 -0
  166. package/docs/models/components/earnswaprequestamountin.md +19 -0
  167. package/docs/models/components/earnswapresponse.md +58 -0
  168. package/docs/models/components/earntransferrequest.md +27 -0
  169. package/docs/models/components/earntransferrequestaction.md +17 -0
  170. package/docs/models/components/earntransferrequestamount.md +19 -0
  171. package/docs/models/components/earntransferresponse.md +56 -0
  172. package/docs/models/components/earntransferresponseeip712.md +102 -0
  173. package/docs/models/components/eip712domainfield.md +21 -0
  174. package/docs/models/components/eip712field.md +19 -0
  175. package/docs/models/components/ensnameinforesponse.md +21 -0
  176. package/docs/models/components/erc20data.md +23 -0
  177. package/docs/models/components/ethenadepositparams.md +20 -0
  178. package/docs/models/components/ethenadepositparamsamount.md +19 -0
  179. package/docs/models/components/ethenadepositrequest.md +24 -0
  180. package/docs/models/components/ethenadepositrequestamount.md +19 -0
  181. package/docs/models/components/ethenadepositrequestchain.md +15 -0
  182. package/docs/models/components/ethenagetvaultresponse.md +45 -0
  183. package/docs/models/components/ethenarequesttowithdrawparams.md +19 -0
  184. package/docs/models/components/ethenarequesttowithdrawrequest.md +23 -0
  185. package/docs/models/components/ethenarequesttowithdrawrequestchain.md +15 -0
  186. package/docs/models/components/ethenarequesttowithdrawtransactionresponse.md +29 -0
  187. package/docs/models/components/ethenarequesttowithdrawtransactionresponsetransaction.md +33 -0
  188. package/docs/models/components/ethenaunstakeparams.md +18 -0
  189. package/docs/models/components/ethenaunstakerequest.md +22 -0
  190. package/docs/models/components/ethenaunstakerequestchain.md +15 -0
  191. package/docs/models/components/fee.md +21 -0
  192. package/docs/models/components/feeamount.md +19 -0
  193. package/docs/models/components/feeenum.md +19 -0
  194. package/docs/models/components/initialcollateralamount.md +19 -0
  195. package/docs/models/components/interestratemode.md +19 -0
  196. package/docs/models/components/liquidationcall.md +45 -0
  197. package/docs/models/components/loantovalue.md +19 -0
  198. package/docs/models/components/loc.md +17 -0
  199. package/docs/models/components/lpbalance.md +21 -0
  200. package/docs/models/components/market.md +17 -0
  201. package/docs/models/components/marketposition.md +35 -0
  202. package/docs/models/components/markettokens.md +50 -0
  203. package/docs/models/components/maxslippagepercent.md +19 -0
  204. package/docs/models/components/maxsupplyapydata.md +24 -0
  205. package/docs/models/components/mintpreparecompletedresponse.md +27 -0
  206. package/docs/models/components/mintpreparependingresponse.md +33 -0
  207. package/docs/models/components/mintpreparereadyresponse.md +36 -0
  208. package/docs/models/components/mintpreparerequest.md +22 -0
  209. package/docs/models/components/morphoborrowparams.md +23 -0
  210. package/docs/models/components/morphoborrowparamsamount.md +19 -0
  211. package/docs/models/components/morphoborrowrequest.md +28 -0
  212. package/docs/models/components/morphoborrowrequestamount.md +19 -0
  213. package/docs/models/components/morphoborrowrequestchain.md +15 -0
  214. package/docs/models/components/morphocheckmarketpositionresponse.md +25 -0
  215. package/docs/models/components/morphocheckuserpositionresponse.md +28 -0
  216. package/docs/models/components/morphodepositparams.md +22 -0
  217. package/docs/models/components/morphodepositparamsamount.md +19 -0
  218. package/docs/models/components/morphodepositrequest.md +26 -0
  219. package/docs/models/components/morphodepositrequestamount.md +19 -0
  220. package/docs/models/components/morphodepositrequestchain.md +15 -0
  221. package/docs/models/components/morphogetmarketresponse.md +71 -0
  222. package/docs/models/components/morphogetmarketsresponse.md +17 -0
  223. package/docs/models/components/morphogetvaultsresponse.md +17 -0
  224. package/docs/models/components/morphomarket.md +49 -0
  225. package/docs/models/components/morphorepayparams.md +23 -0
  226. package/docs/models/components/morphorepayrequest.md +28 -0
  227. package/docs/models/components/morphorepayrequestchain.md +15 -0
  228. package/docs/models/components/morphosupplycollateralparams.md +23 -0
  229. package/docs/models/components/morphosupplycollateralparamsamount.md +19 -0
  230. package/docs/models/components/morphosupplycollateralrequest.md +28 -0
  231. package/docs/models/components/morphosupplycollateralrequestamount.md +19 -0
  232. package/docs/models/components/morphosupplycollateralrequestchain.md +15 -0
  233. package/docs/models/components/morphovault.md +51 -0
  234. package/docs/models/components/morphowithdrawcollateralparams.md +23 -0
  235. package/docs/models/components/morphowithdrawcollateralparamsamount.md +19 -0
  236. package/docs/models/components/morphowithdrawcollateralrequest.md +28 -0
  237. package/docs/models/components/morphowithdrawcollateralrequestamount.md +19 -0
  238. package/docs/models/components/morphowithdrawcollateralrequestchain.md +15 -0
  239. package/docs/models/components/morphowithdrawparams.md +22 -0
  240. package/docs/models/components/morphowithdrawrequest.md +26 -0
  241. package/docs/models/components/morphowithdrawrequestchain.md +15 -0
  242. package/docs/models/components/movement10percent.md +18 -0
  243. package/docs/models/components/multicallauthorizationrequest.md +25 -0
  244. package/docs/models/components/multicallauthorizationrequestchain.md +15 -0
  245. package/docs/models/components/multicallauthorizationresponse.md +23 -0
  246. package/docs/models/components/multicallexecuterequest.md +84 -0
  247. package/docs/models/components/multicallexecuterequestchain.md +15 -0
  248. package/docs/models/components/multiplier.md +19 -0
  249. package/docs/models/components/odosswapparams.md +25 -0
  250. package/docs/models/components/odosswapparamsamountin.md +19 -0
  251. package/docs/models/components/odosswaprequest.md +29 -0
  252. package/docs/models/components/odosswaprequestamountin.md +19 -0
  253. package/docs/models/components/odosswaprequestchain.md +15 -0
  254. package/docs/models/components/odostransactionresponse.md +23 -0
  255. package/docs/models/components/odostransactionresponsetransaction.md +33 -0
  256. package/docs/models/components/openposition.md +33 -0
  257. package/docs/models/components/operationtype.md +17 -0
  258. package/docs/models/components/pendlegetmarketresponse.md +55 -0
  259. package/docs/models/components/pendlelistmarketsresponse.md +42 -0
  260. package/docs/models/components/pendlelistuserpositionsresponse.md +67 -0
  261. package/docs/models/components/pendlemanageliquidityparams.md +27 -0
  262. package/docs/models/components/pendlemanageliquidityparamsaction.md +17 -0
  263. package/docs/models/components/pendlemanageliquidityparamsamountin.md +19 -0
  264. package/docs/models/components/pendlemanageliquidityrequest.md +31 -0
  265. package/docs/models/components/pendlemanageliquidityrequestaction.md +17 -0
  266. package/docs/models/components/pendlemanageliquidityrequestamountin.md +19 -0
  267. package/docs/models/components/pendlemanageliquidityrequestchain.md +15 -0
  268. package/docs/models/components/pendlemarket.md +48 -0
  269. package/docs/models/components/pendleredeemyieldparams.md +19 -0
  270. package/docs/models/components/pendleredeemyieldrequest.md +23 -0
  271. package/docs/models/components/pendleredeemyieldrequestchain.md +15 -0
  272. package/docs/models/components/pendletradeptparams.md +27 -0
  273. package/docs/models/components/pendletradeptparamsaction.md +17 -0
  274. package/docs/models/components/pendletradeptparamsamountin.md +19 -0
  275. package/docs/models/components/pendletradeptrequest.md +31 -0
  276. package/docs/models/components/pendletradeptrequestaction.md +17 -0
  277. package/docs/models/components/pendletradeptrequestamountin.md +19 -0
  278. package/docs/models/components/pendletradeptrequestchain.md +15 -0
  279. package/docs/models/components/pendletradeytparams.md +27 -0
  280. package/docs/models/components/pendletradeytparamsaction.md +17 -0
  281. package/docs/models/components/pendletradeytparamsamountin.md +19 -0
  282. package/docs/models/components/pendletradeytrequest.md +31 -0
  283. package/docs/models/components/pendletradeytrequestaction.md +17 -0
  284. package/docs/models/components/pendletradeytrequestamountin.md +19 -0
  285. package/docs/models/components/pendletradeytrequestchain.md +15 -0
  286. package/docs/models/components/pendletxresponse.md +29 -0
  287. package/docs/models/components/pendletxresponsetransaction.md +33 -0
  288. package/docs/models/components/permit2typeddatainput.md +76 -0
  289. package/docs/models/components/permit2typeddataoutput.md +76 -0
  290. package/docs/models/components/permitfield.md +21 -0
  291. package/docs/models/components/permitmessage.md +27 -0
  292. package/docs/models/components/permittransferfrommessage.md +26 -0
  293. package/docs/models/components/permittypeddataresponseinput.md +39 -0
  294. package/docs/models/components/permittypeddataresponseoutput.md +39 -0
  295. package/docs/models/components/portfolio.md +28 -0
  296. package/docs/models/components/position.md +70 -0
  297. package/docs/models/components/positionunion.md +32 -0
  298. package/docs/models/components/protocol.md +15 -0
  299. package/docs/models/components/r.md +19 -0
  300. package/docs/models/components/repay.md +35 -0
  301. package/docs/models/components/reserve.md +22 -0
  302. package/docs/models/components/s.md +19 -0
  303. package/docs/models/components/safetxfield.md +21 -0
  304. package/docs/models/components/safetxmessage.md +37 -0
  305. package/docs/models/components/security.md +17 -0
  306. package/docs/models/components/setallowanceparams.md +25 -0
  307. package/docs/models/components/setallowanceparamsamount.md +19 -0
  308. package/docs/models/components/setallowanceparamscontractenum.md +15 -0
  309. package/docs/models/components/setallowanceparamscontractunion.md +20 -0
  310. package/docs/models/components/setallowancerequest.md +29 -0
  311. package/docs/models/components/setallowancerequestamount.md +19 -0
  312. package/docs/models/components/setallowancerequestchain.md +15 -0
  313. package/docs/models/components/setallowancerequestcontractenum.md +15 -0
  314. package/docs/models/components/setallowancerequestcontractunion.md +19 -0
  315. package/docs/models/components/signedauthorization.md +27 -0
  316. package/docs/models/components/skybuyparams.md +21 -0
  317. package/docs/models/components/skybuyparamsamount.md +19 -0
  318. package/docs/models/components/skybuyparamstokenin.md +17 -0
  319. package/docs/models/components/skybuyrequest.md +25 -0
  320. package/docs/models/components/skybuyrequestamount.md +19 -0
  321. package/docs/models/components/skybuyrequestchain.md +15 -0
  322. package/docs/models/components/skybuyrequesttokenin.md +17 -0
  323. package/docs/models/components/skycheckpositionresponse.md +19 -0
  324. package/docs/models/components/skydepositparams.md +20 -0
  325. package/docs/models/components/skydepositparamsamount.md +19 -0
  326. package/docs/models/components/skydepositrequest.md +24 -0
  327. package/docs/models/components/skydepositrequestamount.md +19 -0
  328. package/docs/models/components/skydepositrequestchain.md +15 -0
  329. package/docs/models/components/skysellparams.md +21 -0
  330. package/docs/models/components/skysellparamsamount.md +19 -0
  331. package/docs/models/components/skysellparamstokenout.md +17 -0
  332. package/docs/models/components/skysellrequest.md +25 -0
  333. package/docs/models/components/skysellrequestamount.md +19 -0
  334. package/docs/models/components/skysellrequestchain.md +15 -0
  335. package/docs/models/components/skysellrequesttokenout.md +17 -0
  336. package/docs/models/components/skywithdrawparams.md +20 -0
  337. package/docs/models/components/skywithdrawrequest.md +24 -0
  338. package/docs/models/components/skywithdrawrequestchain.md +15 -0
  339. package/docs/models/components/slippage.md +19 -0
  340. package/docs/models/components/sponsorgasrequest.md +84 -0
  341. package/docs/models/components/sponsorgasrequesteip712.md +129 -0
  342. package/docs/models/components/sponsorgasresponse.md +27 -0
  343. package/docs/models/components/supply.md +35 -0
  344. package/docs/models/components/supportedchaininfo.md +19 -0
  345. package/docs/models/components/swapborrowrate.md +39 -0
  346. package/docs/models/components/syposition.md +19 -0
  347. package/docs/models/components/tokenbalanceresponse.md +25 -0
  348. package/docs/models/components/tokenconfig.md +23 -0
  349. package/docs/models/components/tokenlistresponse.md +26 -0
  350. package/docs/models/components/tokenpermissions.md +19 -0
  351. package/docs/models/components/tokenpriceresponse.md +17 -0
  352. package/docs/models/components/tokentransferparams.md +25 -0
  353. package/docs/models/components/tokentransferparamsamount.md +19 -0
  354. package/docs/models/components/tokentransferrequest.md +29 -0
  355. package/docs/models/components/tokentransferrequestamount.md +19 -0
  356. package/docs/models/components/tokentransferrequestchain.md +15 -0
  357. package/docs/models/components/transactionresponse.md +21 -0
  358. package/docs/models/components/transactionresponsetransaction.md +33 -0
  359. package/docs/models/components/underlyingtoken.md +23 -0
  360. package/docs/models/components/uniswapbuyexactlyparams.md +27 -0
  361. package/docs/models/components/uniswapbuyexactlyparamsamountout.md +19 -0
  362. package/docs/models/components/uniswapbuyexactlyrequest.md +33 -0
  363. package/docs/models/components/uniswapbuyexactlyrequestamountout.md +19 -0
  364. package/docs/models/components/uniswapbuyexactlyrequestchain.md +15 -0
  365. package/docs/models/components/uniswapbuyexactlytransactionresponse.md +29 -0
  366. package/docs/models/components/uniswapbuyexactlytransactionresponsetransaction.md +33 -0
  367. package/docs/models/components/uniswapbuyquoteinforesponse.md +19 -0
  368. package/docs/models/components/uniswapcheckinrangeresponse.md +17 -0
  369. package/docs/models/components/uniswapincreaseliquidityprovisionparams.md +27 -0
  370. package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount0desired.md +19 -0
  371. package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount0min.md +19 -0
  372. package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount1desired.md +19 -0
  373. package/docs/models/components/uniswapincreaseliquidityprovisionparamsamount1min.md +19 -0
  374. package/docs/models/components/uniswapincreaseliquidityprovisionrequest.md +33 -0
  375. package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0desired.md +19 -0
  376. package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount0min.md +19 -0
  377. package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1desired.md +19 -0
  378. package/docs/models/components/uniswapincreaseliquidityprovisionrequestamount1min.md +19 -0
  379. package/docs/models/components/uniswapincreaseliquidityprovisionrequestchain.md +15 -0
  380. package/docs/models/components/uniswaplppositionsinforesponse.md +17 -0
  381. package/docs/models/components/uniswapmintliquidityprovisionparams.md +36 -0
  382. package/docs/models/components/uniswapmintliquidityprovisionparamsamount0desired.md +19 -0
  383. package/docs/models/components/uniswapmintliquidityprovisionparamsamount0min.md +19 -0
  384. package/docs/models/components/uniswapmintliquidityprovisionparamsamount1desired.md +19 -0
  385. package/docs/models/components/uniswapmintliquidityprovisionparamsamount1min.md +19 -0
  386. package/docs/models/components/uniswapmintliquidityprovisionrequest.md +43 -0
  387. package/docs/models/components/uniswapmintliquidityprovisionrequestamount0desired.md +19 -0
  388. package/docs/models/components/uniswapmintliquidityprovisionrequestamount0min.md +19 -0
  389. package/docs/models/components/uniswapmintliquidityprovisionrequestamount1desired.md +19 -0
  390. package/docs/models/components/uniswapmintliquidityprovisionrequestamount1min.md +19 -0
  391. package/docs/models/components/uniswapmintliquidityprovisionrequestchain.md +15 -0
  392. package/docs/models/components/uniswappoolpriceresponse.md +23 -0
  393. package/docs/models/components/uniswappositionssolidityresponse.md +40 -0
  394. package/docs/models/components/uniswapsellexactlyparams.md +29 -0
  395. package/docs/models/components/uniswapsellexactlyparamsamountin.md +19 -0
  396. package/docs/models/components/uniswapsellexactlyrequest.md +33 -0
  397. package/docs/models/components/uniswapsellexactlyrequestamountin.md +19 -0
  398. package/docs/models/components/uniswapsellexactlyrequestchain.md +15 -0
  399. package/docs/models/components/uniswapsellexactlytransactionresponse.md +23 -0
  400. package/docs/models/components/uniswapsellexactlytransactionresponsetransaction.md +33 -0
  401. package/docs/models/components/uniswapsellquoteinforesponse.md +19 -0
  402. package/docs/models/components/uniswapwithdrawliquidityprovisionparams.md +26 -0
  403. package/docs/models/components/uniswapwithdrawliquidityprovisionparamspercentageforwithdrawal.md +19 -0
  404. package/docs/models/components/uniswapwithdrawliquidityprovisionrequest.md +25 -0
  405. package/docs/models/components/uniswapwithdrawliquidityprovisionrequestchain.md +15 -0
  406. package/docs/models/components/uniswapwithdrawliquidityprovisionrequestpercentageforwithdrawal.md +19 -0
  407. package/docs/models/components/unsignedmulticalltransaction.md +35 -0
  408. package/docs/models/components/unsignedtransaction.md +33 -0
  409. package/docs/models/components/unwrapwethparams.md +21 -0
  410. package/docs/models/components/unwrapwethparamsamount.md +19 -0
  411. package/docs/models/components/unwrapwethrequest.md +25 -0
  412. package/docs/models/components/unwrapwethrequestamount.md +19 -0
  413. package/docs/models/components/unwrapwethrequestchain.md +15 -0
  414. package/docs/models/components/usageascollateral.md +35 -0
  415. package/docs/models/components/useroperation.md +21 -0
  416. package/docs/models/components/useroperationresponse.md +21 -0
  417. package/docs/models/components/userposition.md +30 -0
  418. package/docs/models/components/userstate.md +27 -0
  419. package/docs/models/components/validationerror.md +23 -0
  420. package/docs/models/components/vault.md +47 -0
  421. package/docs/models/components/vaultdepositparams.md +22 -0
  422. package/docs/models/components/vaultdepositparamsamount.md +19 -0
  423. package/docs/models/components/vaultdepositrequest.md +26 -0
  424. package/docs/models/components/vaultdepositrequestamount.md +19 -0
  425. package/docs/models/components/vaultdepositrequestchain.md +15 -0
  426. package/docs/models/components/vaultgetvaultresponse.md +42 -0
  427. package/docs/models/components/vaultinfo.md +57 -0
  428. package/docs/models/components/vaultslistresponse.md +25 -0
  429. package/docs/models/components/vaultvenue.md +19 -0
  430. package/docs/models/components/vaultwithdrawparams.md +22 -0
  431. package/docs/models/components/vaultwithdrawrequest.md +26 -0
  432. package/docs/models/components/vaultwithdrawrequestchain.md +15 -0
  433. package/docs/models/components/venue.md +25 -0
  434. package/docs/models/components/weeklyapys.md +23 -0
  435. package/docs/models/components/wildcatgetmarketresponse.md +57 -0
  436. package/docs/models/components/withdraw.md +35 -0
  437. package/docs/models/components/wrapethparams.md +21 -0
  438. package/docs/models/components/wrapethparamsamount.md +19 -0
  439. package/docs/models/components/wrapethrequest.md +25 -0
  440. package/docs/models/components/wrapethrequestamount.md +19 -0
  441. package/docs/models/components/wrapethrequestchain.md +15 -0
  442. package/docs/models/components/yieldrange.md +19 -0
  443. package/docs/models/errors/httpvalidationerror.md +15 -0
  444. package/docs/models/errors/mintpreparenotfoundresponseerror.md +22 -0
  445. package/docs/models/operations/amountin.md +19 -0
  446. package/docs/models/operations/amountout.md +19 -0
  447. package/docs/models/operations/contract.md +19 -0
  448. package/docs/models/operations/contractenum.md +15 -0
  449. package/docs/models/operations/direction.md +17 -0
  450. package/docs/models/operations/response200v2cctpmint.md +38 -0
  451. package/docs/models/operations/responsev1transactionbundleraaveloop.md +34 -0
  452. package/docs/models/operations/v1aaveaavesupportedtokenschain.md +15 -0
  453. package/docs/models/operations/v1aaveaavesupportedtokensrequest.md +18 -0
  454. package/docs/models/operations/v1aaveavgratechain.md +15 -0
  455. package/docs/models/operations/v1aaveavgraterequest.md +22 -0
  456. package/docs/models/operations/v1aavehistoricaltransactionschain.md +15 -0
  457. package/docs/models/operations/v1aavehistoricaltransactionsrequest.md +23 -0
  458. package/docs/models/operations/v1aaveliquiditychangechain.md +15 -0
  459. package/docs/models/operations/v1aaveliquiditychangerequest.md +23 -0
  460. package/docs/models/operations/v1aaveratechain.md +15 -0
  461. package/docs/models/operations/v1aaveraterequest.md +20 -0
  462. package/docs/models/operations/v1aavereserveoverviewchain.md +15 -0
  463. package/docs/models/operations/v1aavereserveoverviewrequest.md +20 -0
  464. package/docs/models/operations/v1aavestdratechain.md +15 -0
  465. package/docs/models/operations/v1aavestdraterequest.md +22 -0
  466. package/docs/models/operations/v1aavetokenpricechain.md +15 -0
  467. package/docs/models/operations/v1aavetokenpricerequest.md +20 -0
  468. package/docs/models/operations/v1aaveuserpositionpertokenchain.md +15 -0
  469. package/docs/models/operations/v1aaveuserpositionpertokenrequest.md +22 -0
  470. package/docs/models/operations/v1aaveuserpositionsummarychain.md +15 -0
  471. package/docs/models/operations/v1aaveuserpositionsummaryrequest.md +20 -0
  472. package/docs/models/operations/v1aerodromeslipstreamliquidityprovisionpositionschain.md +15 -0
  473. package/docs/models/operations/v1aerodromeslipstreamliquidityprovisionpositionsrequest.md +19 -0
  474. package/docs/models/operations/v1aerodromeslipstreampoolpricechain.md +15 -0
  475. package/docs/models/operations/v1aerodromeslipstreampoolpricerequest.md +23 -0
  476. package/docs/models/operations/v1ethenavaultchain.md +15 -0
  477. package/docs/models/operations/v1ethenavaultrequest.md +20 -0
  478. package/docs/models/operations/v1genericallowancechain.md +15 -0
  479. package/docs/models/operations/v1genericallowancerequest.md +23 -0
  480. package/docs/models/operations/v1genericenschain.md +15 -0
  481. package/docs/models/operations/v1genericensrequest.md +19 -0
  482. package/docs/models/operations/v1genericportfoliochain.md +15 -0
  483. package/docs/models/operations/v1genericportfoliorequest.md +19 -0
  484. package/docs/models/operations/v1genericsupportedchainsrequest.md +17 -0
  485. package/docs/models/operations/v1morphomarketchain.md +15 -0
  486. package/docs/models/operations/v1morphomarketpositionchain.md +15 -0
  487. package/docs/models/operations/v1morphomarketpositionrequest.md +22 -0
  488. package/docs/models/operations/v1morphomarketrequest.md +20 -0
  489. package/docs/models/operations/v1morphomarketschain.md +15 -0
  490. package/docs/models/operations/v1morphomarketsrequest.md +21 -0
  491. package/docs/models/operations/v1morphouserpositionchain.md +15 -0
  492. package/docs/models/operations/v1morphouserpositionrequest.md +19 -0
  493. package/docs/models/operations/v1morphovaultchain.md +15 -0
  494. package/docs/models/operations/v1morphovaultrequest.md +22 -0
  495. package/docs/models/operations/v1morphovaultschain.md +15 -0
  496. package/docs/models/operations/v1morphovaultsrequest.md +19 -0
  497. package/docs/models/operations/v1pendlemarketchain.md +15 -0
  498. package/docs/models/operations/v1pendlemarketrequest.md +22 -0
  499. package/docs/models/operations/v1pendlemarketschain.md +15 -0
  500. package/docs/models/operations/v1pendlemarketsrequest.md +17 -0
  501. package/docs/models/operations/v1pendlepositionschain.md +15 -0
  502. package/docs/models/operations/v1pendlepositionsrequest.md +19 -0
  503. package/docs/models/operations/v1skypositionchain.md +15 -0
  504. package/docs/models/operations/v1skypositionrequest.md +19 -0
  505. package/docs/models/operations/v1tokenbalancechain.md +15 -0
  506. package/docs/models/operations/v1tokenbalancerequest.md +21 -0
  507. package/docs/models/operations/v1tokenlistchain.md +15 -0
  508. package/docs/models/operations/v1tokenlistrequest.md +17 -0
  509. package/docs/models/operations/v1tokenpricechain.md +15 -0
  510. package/docs/models/operations/v1tokenpricerequest.md +20 -0
  511. package/docs/models/operations/v1uniswapliquidityprovisioninrangechain.md +15 -0
  512. package/docs/models/operations/v1uniswapliquidityprovisioninrangerequest.md +19 -0
  513. package/docs/models/operations/v1uniswapliquidityprovisionpositionschain.md +15 -0
  514. package/docs/models/operations/v1uniswapliquidityprovisionpositionsrequest.md +19 -0
  515. package/docs/models/operations/v1uniswappoolpricechain.md +15 -0
  516. package/docs/models/operations/v1uniswappoolpricefeeenum.md +19 -0
  517. package/docs/models/operations/v1uniswappoolpricerequest.md +23 -0
  518. package/docs/models/operations/v1uniswapquotebuyexactlychain.md +15 -0
  519. package/docs/models/operations/v1uniswapquotebuyexactlyfeeenum.md +19 -0
  520. package/docs/models/operations/v1uniswapquotebuyexactlyrequest.md +25 -0
  521. package/docs/models/operations/v1uniswapquotesellexactlychain.md +15 -0
  522. package/docs/models/operations/v1uniswapquotesellexactlyfeeenum.md +19 -0
  523. package/docs/models/operations/v1uniswapquotesellexactlyrequest.md +25 -0
  524. package/docs/models/operations/v1vaultsvaultchain.md +15 -0
  525. package/docs/models/operations/v1vaultsvaultrequest.md +22 -0
  526. package/docs/models/operations/v1wildcatmarketchain.md +15 -0
  527. package/docs/models/operations/v1wildcatmarketrequest.md +22 -0
  528. package/docs/models/operations/v2cctpmintresponse.md +26 -0
  529. package/docs/models/operations/v2earnaavetokenratesrequest.md +17 -0
  530. package/docs/models/operations/v2earnpositionschain.md +15 -0
  531. package/docs/models/operations/v2earnpositionspositionidrequest.md +21 -0
  532. package/docs/models/operations/v2earnpositionsrequest.md +25 -0
  533. package/docs/models/operations/v2earnvaultschain.md +15 -0
  534. package/docs/models/operations/v2earnvaultsrequest.md +25 -0
  535. package/docs/sdks/aavev3/README.md +1247 -0
  536. package/docs/sdks/aerodromeslipstream/README.md +702 -0
  537. package/docs/sdks/bridge/README.md +222 -0
  538. package/docs/sdks/earn/README.md +696 -0
  539. package/docs/sdks/erc4626vaults/README.md +264 -0
  540. package/docs/sdks/ethena/README.md +357 -0
  541. package/docs/sdks/gassponsorship/README.md +296 -0
  542. package/docs/sdks/morpho/README.md +1066 -0
  543. package/docs/sdks/pendle/README.md +630 -0
  544. package/docs/sdks/sky/README.md +458 -0
  545. package/docs/sdks/smartaccount/README.md +106 -0
  546. package/docs/sdks/swap/README.md +100 -0
  547. package/docs/sdks/token/README.md +481 -0
  548. package/docs/sdks/transactionbundler/README.md +411 -0
  549. package/docs/sdks/uniswapv3/README.md +947 -0
  550. package/docs/sdks/universal/README.md +419 -0
  551. package/docs/sdks/wildcat/README.md +88 -0
  552. package/eslint.config.mjs +22 -0
  553. package/examples/README.md +31 -0
  554. package/examples/node_modules/@esbuild/linux-x64/README.md +3 -0
  555. package/examples/node_modules/@esbuild/linux-x64/bin/esbuild +0 -0
  556. package/examples/node_modules/@types/node/LICENSE +21 -0
  557. package/examples/node_modules/@types/node/README.md +15 -0
  558. package/examples/node_modules/dotenv/CHANGELOG.md +520 -0
  559. package/examples/node_modules/dotenv/LICENSE +23 -0
  560. package/examples/node_modules/dotenv/README-es.md +411 -0
  561. package/examples/node_modules/dotenv/README.md +645 -0
  562. package/examples/node_modules/dotenv/SECURITY.md +1 -0
  563. package/examples/node_modules/esbuild/LICENSE.md +21 -0
  564. package/examples/node_modules/esbuild/README.md +3 -0
  565. package/examples/node_modules/esbuild/bin/esbuild +0 -0
  566. package/examples/node_modules/get-tsconfig/LICENSE +21 -0
  567. package/examples/node_modules/get-tsconfig/README.md +235 -0
  568. package/examples/node_modules/get-tsconfig/dist/index.cjs +7 -0
  569. package/examples/node_modules/get-tsconfig/dist/index.d.cts +2088 -0
  570. package/examples/node_modules/get-tsconfig/dist/index.d.mts +2088 -0
  571. package/examples/node_modules/get-tsconfig/dist/index.mjs +0 -0
  572. package/examples/node_modules/resolve-pkg-maps/LICENSE +21 -0
  573. package/examples/node_modules/resolve-pkg-maps/README.md +216 -0
  574. package/examples/node_modules/resolve-pkg-maps/dist/index.cjs +1 -0
  575. package/examples/node_modules/resolve-pkg-maps/dist/index.d.cts +11 -0
  576. package/examples/node_modules/resolve-pkg-maps/dist/index.d.mts +11 -0
  577. package/examples/node_modules/resolve-pkg-maps/dist/index.mjs +0 -0
  578. package/examples/node_modules/tsx/LICENSE +21 -0
  579. package/examples/node_modules/tsx/README.md +32 -0
  580. package/examples/node_modules/tsx/dist/cjs/api/index.cjs +1 -0
  581. package/examples/node_modules/tsx/dist/cjs/api/index.d.cts +35 -0
  582. package/examples/node_modules/tsx/dist/cjs/api/index.d.mts +35 -0
  583. package/examples/node_modules/tsx/dist/cjs/api/index.mjs +0 -0
  584. package/examples/node_modules/tsx/dist/cjs/index.cjs +1 -0
  585. package/examples/node_modules/tsx/dist/cjs/index.mjs +0 -0
  586. package/examples/node_modules/tsx/dist/cli.cjs +54 -0
  587. package/examples/node_modules/tsx/dist/cli.mjs +0 -0
  588. package/examples/node_modules/tsx/dist/client-D6NvIMSC.cjs +1 -0
  589. package/examples/node_modules/tsx/dist/esm/api/index.cjs +1 -0
  590. package/examples/node_modules/tsx/dist/esm/api/index.d.cts +35 -0
  591. package/examples/node_modules/tsx/dist/esm/api/index.d.mts +35 -0
  592. package/examples/node_modules/tsx/dist/esm/api/index.mjs +0 -0
  593. package/examples/node_modules/tsx/dist/esm/index.cjs +2 -0
  594. package/examples/node_modules/tsx/dist/esm/index.mjs +0 -0
  595. package/examples/node_modules/tsx/dist/get-pipe-path-BoR10qr8.cjs +1 -0
  596. package/examples/node_modules/tsx/dist/index-BWFBUo6r.cjs +1 -0
  597. package/examples/node_modules/tsx/dist/index-gckBtVBf.cjs +14 -0
  598. package/examples/node_modules/tsx/dist/lexer-DgIbo0BU.cjs +3 -0
  599. package/examples/node_modules/tsx/dist/loader.cjs +1 -0
  600. package/examples/node_modules/tsx/dist/loader.mjs +0 -0
  601. package/examples/node_modules/tsx/dist/node-features-roYmp9jK.cjs +1 -0
  602. package/examples/node_modules/tsx/dist/package-Dxt5kIHw.cjs +1 -0
  603. package/examples/node_modules/tsx/dist/patch-repl.cjs +1 -0
  604. package/examples/node_modules/tsx/dist/patch-repl.mjs +0 -0
  605. package/examples/node_modules/tsx/dist/preflight.cjs +1 -0
  606. package/examples/node_modules/tsx/dist/preflight.mjs +0 -0
  607. package/examples/node_modules/tsx/dist/register-2sWVXuRQ.cjs +1 -0
  608. package/examples/node_modules/tsx/dist/register-D46fvsV_.cjs +4 -0
  609. package/examples/node_modules/tsx/dist/repl.cjs +3 -0
  610. package/examples/node_modules/tsx/dist/repl.mjs +0 -0
  611. package/examples/node_modules/tsx/dist/require-D4F1Lv60.cjs +1 -0
  612. package/examples/node_modules/tsx/dist/suppress-warnings.cjs +1 -0
  613. package/examples/node_modules/tsx/dist/suppress-warnings.mjs +0 -0
  614. package/examples/node_modules/tsx/dist/temporary-directory-B83uKxJF.cjs +1 -0
  615. package/examples/node_modules/undici-types/LICENSE +21 -0
  616. package/examples/node_modules/undici-types/README.md +6 -0
  617. package/package.json +1 -1
  618. package/src/funcs/bridgeCctpMint.ts +2 -4
  619. package/src/lib/config.ts +2 -2
  620. package/src/sdk/bridge.ts +2 -4
  621. package/tsconfig.json +1 -1
  622. package/examples/node_modules/.package-lock.json +0 -159
@@ -0,0 +1,2088 @@
1
+ /**
2
+ Returns a boolean for whether the given type is `any`.
3
+
4
+ @link https://stackoverflow.com/a/49928360/1490091
5
+
6
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
7
+
8
+ @example
9
+ ```
10
+ import type {IsAny} from 'type-fest';
11
+
12
+ const typedObject = {a: 1, b: 2} as const;
13
+ const anyObject: any = {a: 1, b: 2};
14
+
15
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
16
+ return obj[key];
17
+ }
18
+
19
+ const typedA = get(typedObject, 'a');
20
+ //=> 1
21
+
22
+ const anyA = get(anyObject, 'a');
23
+ //=> any
24
+ ```
25
+
26
+ @category Type Guard
27
+ @category Utilities
28
+ */
29
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
30
+
31
+ /**
32
+ Returns a boolean for whether the given key is an optional key of type.
33
+
34
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
35
+
36
+ @example
37
+ ```
38
+ import type {IsOptionalKeyOf} from 'type-fest';
39
+
40
+ interface User {
41
+ name: string;
42
+ surname: string;
43
+
44
+ luckyNumber?: number;
45
+ }
46
+
47
+ interface Admin {
48
+ name: string;
49
+ surname?: string;
50
+ }
51
+
52
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
53
+ //=> true
54
+
55
+ type T2 = IsOptionalKeyOf<User, 'name'>;
56
+ //=> false
57
+
58
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
59
+ //=> boolean
60
+
61
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
62
+ //=> false
63
+
64
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
65
+ //=> boolean
66
+ ```
67
+
68
+ @category Type Guard
69
+ @category Utilities
70
+ */
71
+ type IsOptionalKeyOf<Type extends object, Key extends keyof Type> =
72
+ IsAny<Type | Key> extends true ? never
73
+ : Key extends keyof Type
74
+ ? Type extends Record<Key, Type[Key]>
75
+ ? false
76
+ : true
77
+ : false;
78
+
79
+ /**
80
+ Extract all optional keys from the given type.
81
+
82
+ This is useful when you want to create a new type that contains different type values for the optional keys only.
83
+
84
+ @example
85
+ ```
86
+ import type {OptionalKeysOf, Except} from 'type-fest';
87
+
88
+ interface User {
89
+ name: string;
90
+ surname: string;
91
+
92
+ luckyNumber?: number;
93
+ }
94
+
95
+ const REMOVE_FIELD = Symbol('remove field symbol');
96
+ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
97
+ [Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
98
+ };
99
+
100
+ const update1: UpdateOperation<User> = {
101
+ name: 'Alice'
102
+ };
103
+
104
+ const update2: UpdateOperation<User> = {
105
+ name: 'Bob',
106
+ luckyNumber: REMOVE_FIELD
107
+ };
108
+ ```
109
+
110
+ @category Utilities
111
+ */
112
+ type OptionalKeysOf<Type extends object> =
113
+ Type extends unknown // For distributing `Type`
114
+ ? (keyof {[Key in keyof Type as
115
+ IsOptionalKeyOf<Type, Key> extends false
116
+ ? never
117
+ : Key
118
+ ]: never
119
+ }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
120
+ : never; // Should never happen
121
+
122
+ /**
123
+ Extract all required keys from the given type.
124
+
125
+ This is useful when you want to create a new type that contains different type values for the required keys only or use the list of keys for validation purposes, etc...
126
+
127
+ @example
128
+ ```
129
+ import type {RequiredKeysOf} from 'type-fest';
130
+
131
+ declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
132
+
133
+ interface User {
134
+ name: string;
135
+ surname: string;
136
+
137
+ luckyNumber?: number;
138
+ }
139
+
140
+ const validator1 = createValidation<User>('name', value => value.length < 25);
141
+ const validator2 = createValidation<User>('surname', value => value.length < 25);
142
+ ```
143
+
144
+ @category Utilities
145
+ */
146
+ type RequiredKeysOf<Type extends object> =
147
+ Type extends unknown // For distributing `Type`
148
+ ? Exclude<keyof Type, OptionalKeysOf<Type>>
149
+ : never; // Should never happen
150
+
151
+ /**
152
+ Returns a boolean for whether the given type is `never`.
153
+
154
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
155
+ @link https://stackoverflow.com/a/53984913/10292952
156
+ @link https://www.zhenghao.io/posts/ts-never
157
+
158
+ Useful in type utilities, such as checking if something does not occur.
159
+
160
+ @example
161
+ ```
162
+ import type {IsNever, And} from 'type-fest';
163
+
164
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
165
+ type AreStringsEqual<A extends string, B extends string> =
166
+ And<
167
+ IsNever<Exclude<A, B>> extends true ? true : false,
168
+ IsNever<Exclude<B, A>> extends true ? true : false
169
+ >;
170
+
171
+ type EndIfEqual<I extends string, O extends string> =
172
+ AreStringsEqual<I, O> extends true
173
+ ? never
174
+ : void;
175
+
176
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
177
+ if (input === output) {
178
+ process.exit(0);
179
+ }
180
+ }
181
+
182
+ endIfEqual('abc', 'abc');
183
+ //=> never
184
+
185
+ endIfEqual('abc', '123');
186
+ //=> void
187
+ ```
188
+
189
+ @category Type Guard
190
+ @category Utilities
191
+ */
192
+ type IsNever<T> = [T] extends [never] ? true : false;
193
+
194
+ /**
195
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
196
+
197
+ Use-cases:
198
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
199
+
200
+ Note:
201
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
202
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
203
+
204
+ @example
205
+ ```
206
+ import {If} from 'type-fest';
207
+
208
+ type A = If<true, 'yes', 'no'>;
209
+ //=> 'yes'
210
+
211
+ type B = If<false, 'yes', 'no'>;
212
+ //=> 'no'
213
+
214
+ type C = If<boolean, 'yes', 'no'>;
215
+ //=> 'yes' | 'no'
216
+
217
+ type D = If<any, 'yes', 'no'>;
218
+ //=> 'yes' | 'no'
219
+
220
+ type E = If<never, 'yes', 'no'>;
221
+ //=> 'no'
222
+ ```
223
+
224
+ @example
225
+ ```
226
+ import {If, IsAny, IsNever} from 'type-fest';
227
+
228
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
229
+ //=> 'not any'
230
+
231
+ type B = If<IsNever<never>, 'is never', 'not never'>;
232
+ //=> 'is never'
233
+ ```
234
+
235
+ @example
236
+ ```
237
+ import {If, IsEqual} from 'type-fest';
238
+
239
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
240
+
241
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
242
+ //=> 'equal'
243
+
244
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
245
+ //=> 'not equal'
246
+ ```
247
+
248
+ @category Type Guard
249
+ @category Utilities
250
+ */
251
+ type If<Type extends boolean, IfBranch, ElseBranch> =
252
+ IsNever<Type> extends true
253
+ ? ElseBranch
254
+ : Type extends true
255
+ ? IfBranch
256
+ : ElseBranch;
257
+
258
+ /**
259
+ Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability.
260
+
261
+ @example
262
+ ```
263
+ import type {Simplify} from 'type-fest';
264
+
265
+ type PositionProps = {
266
+ top: number;
267
+ left: number;
268
+ };
269
+
270
+ type SizeProps = {
271
+ width: number;
272
+ height: number;
273
+ };
274
+
275
+ // In your editor, hovering over `Props` will show a flattened object with all the properties.
276
+ type Props = Simplify<PositionProps & SizeProps>;
277
+ ```
278
+
279
+ Sometimes it is desired to pass a value as a function argument that has a different type. At first inspection it may seem assignable, and then you discover it is not because the `value`'s type definition was defined as an interface. In the following example, `fn` requires an argument of type `Record<string, unknown>`. If the value is defined as a literal, then it is assignable. And if the `value` is defined as type using the `Simplify` utility the value is assignable. But if the `value` is defined as an interface, it is not assignable because the interface is not sealed and elsewhere a non-string property could be added to the interface.
280
+
281
+ If the type definition must be an interface (perhaps it was defined in a third-party npm package), then the `value` can be defined as `const value: Simplify<SomeInterface> = ...`. Then `value` will be assignable to the `fn` argument. Or the `value` can be cast as `Simplify<SomeInterface>` if you can't re-declare the `value`.
282
+
283
+ @example
284
+ ```
285
+ import type {Simplify} from 'type-fest';
286
+
287
+ interface SomeInterface {
288
+ foo: number;
289
+ bar?: string;
290
+ baz: number | undefined;
291
+ }
292
+
293
+ type SomeType = {
294
+ foo: number;
295
+ bar?: string;
296
+ baz: number | undefined;
297
+ };
298
+
299
+ const literal = {foo: 123, bar: 'hello', baz: 456};
300
+ const someType: SomeType = literal;
301
+ const someInterface: SomeInterface = literal;
302
+
303
+ function fn(object: Record<string, unknown>): void {}
304
+
305
+ fn(literal); // Good: literal object type is sealed
306
+ fn(someType); // Good: type is sealed
307
+ fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
308
+ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
309
+ ```
310
+
311
+ @link https://github.com/microsoft/TypeScript/issues/15300
312
+ @see SimplifyDeep
313
+ @category Object
314
+ */
315
+ type Simplify<T> = {[KeyType in keyof T]: T[KeyType]} & {};
316
+
317
+ /**
318
+ Returns a boolean for whether the two given types are equal.
319
+
320
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
321
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
322
+
323
+ Use-cases:
324
+ - If you want to make a conditional branch based on the result of a comparison of two types.
325
+
326
+ @example
327
+ ```
328
+ import type {IsEqual} from 'type-fest';
329
+
330
+ // This type returns a boolean for whether the given array includes the given item.
331
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
332
+ type Includes<Value extends readonly any[], Item> =
333
+ Value extends readonly [Value[0], ...infer rest]
334
+ ? IsEqual<Value[0], Item> extends true
335
+ ? true
336
+ : Includes<rest, Item>
337
+ : false;
338
+ ```
339
+
340
+ @category Type Guard
341
+ @category Utilities
342
+ */
343
+ type IsEqual<A, B> =
344
+ [A, B] extends [infer AA, infer BB]
345
+ ? [AA] extends [never]
346
+ ? [BB] extends [never]
347
+ ? true
348
+ : false
349
+ : [BB] extends [never]
350
+ ? false
351
+ : _IsEqual<AA, BB>
352
+ : false;
353
+
354
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
355
+ type _IsEqual<A, B> =
356
+ (<G>() => G extends A & G | G ? 1 : 2) extends
357
+ (<G>() => G extends B & G | G ? 1 : 2)
358
+ ? true
359
+ : false;
360
+
361
+ /**
362
+ Omit any index signatures from the given object type, leaving only explicitly defined properties.
363
+
364
+ This is the counterpart of `PickIndexSignature`.
365
+
366
+ Use-cases:
367
+ - Remove overly permissive signatures from third-party types.
368
+
369
+ This type was taken from this [StackOverflow answer](https://stackoverflow.com/a/68261113/420747).
370
+
371
+ It relies on the fact that an empty object (`{}`) is assignable to an object with just an index signature, like `Record<string, unknown>`, but not to an object with explicitly defined keys, like `Record<'foo' | 'bar', unknown>`.
372
+
373
+ (The actual value type, `unknown`, is irrelevant and could be any type. Only the key type matters.)
374
+
375
+ ```
376
+ const indexed: Record<string, unknown> = {}; // Allowed
377
+
378
+ const keyed: Record<'foo', unknown> = {}; // Error
379
+ // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
380
+ ```
381
+
382
+ Instead of causing a type error like the above, you can also use a [conditional type](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) to test whether a type is assignable to another:
383
+
384
+ ```
385
+ type Indexed = {} extends Record<string, unknown>
386
+ ? '✅ `{}` is assignable to `Record<string, unknown>`'
387
+ : '❌ `{}` is NOT assignable to `Record<string, unknown>`';
388
+ // => '✅ `{}` is assignable to `Record<string, unknown>`'
389
+
390
+ type Keyed = {} extends Record<'foo' | 'bar', unknown>
391
+ ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
392
+ : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
393
+ // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
394
+ ```
395
+
396
+ Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
397
+
398
+ ```
399
+ import type {OmitIndexSignature} from 'type-fest';
400
+
401
+ type OmitIndexSignature<ObjectType> = {
402
+ [KeyType in keyof ObjectType // Map each key of `ObjectType`...
403
+ ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
404
+ };
405
+ ```
406
+
407
+ ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
408
+
409
+ ```
410
+ import type {OmitIndexSignature} from 'type-fest';
411
+
412
+ type OmitIndexSignature<ObjectType> = {
413
+ [KeyType in keyof ObjectType
414
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
415
+ as {} extends Record<KeyType, unknown>
416
+ ? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
417
+ : ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
418
+ ]: ObjectType[KeyType];
419
+ };
420
+ ```
421
+
422
+ If `{}` is assignable, it means that `KeyType` is an index signature and we want to remove it. If it is not assignable, `KeyType` is a "real" key and we want to keep it.
423
+
424
+ @example
425
+ ```
426
+ import type {OmitIndexSignature} from 'type-fest';
427
+
428
+ interface Example {
429
+ // These index signatures will be removed.
430
+ [x: string]: any
431
+ [x: number]: any
432
+ [x: symbol]: any
433
+ [x: `head-${string}`]: string
434
+ [x: `${string}-tail`]: string
435
+ [x: `head-${string}-tail`]: string
436
+ [x: `${bigint}`]: string
437
+ [x: `embedded-${number}`]: string
438
+
439
+ // These explicitly defined keys will remain.
440
+ foo: 'bar';
441
+ qux?: 'baz';
442
+ }
443
+
444
+ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
445
+ // => { foo: 'bar'; qux?: 'baz' | undefined; }
446
+ ```
447
+
448
+ @see PickIndexSignature
449
+ @category Object
450
+ */
451
+ type OmitIndexSignature<ObjectType> = {
452
+ [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
453
+ ? never
454
+ : KeyType]: ObjectType[KeyType];
455
+ };
456
+
457
+ /**
458
+ Pick only index signatures from the given object type, leaving out all explicitly defined properties.
459
+
460
+ This is the counterpart of `OmitIndexSignature`.
461
+
462
+ @example
463
+ ```
464
+ import type {PickIndexSignature} from 'type-fest';
465
+
466
+ declare const symbolKey: unique symbol;
467
+
468
+ type Example = {
469
+ // These index signatures will remain.
470
+ [x: string]: unknown;
471
+ [x: number]: unknown;
472
+ [x: symbol]: unknown;
473
+ [x: `head-${string}`]: string;
474
+ [x: `${string}-tail`]: string;
475
+ [x: `head-${string}-tail`]: string;
476
+ [x: `${bigint}`]: string;
477
+ [x: `embedded-${number}`]: string;
478
+
479
+ // These explicitly defined keys will be removed.
480
+ ['kebab-case-key']: string;
481
+ [symbolKey]: string;
482
+ foo: 'bar';
483
+ qux?: 'baz';
484
+ };
485
+
486
+ type ExampleIndexSignature = PickIndexSignature<Example>;
487
+ // {
488
+ // [x: string]: unknown;
489
+ // [x: number]: unknown;
490
+ // [x: symbol]: unknown;
491
+ // [x: `head-${string}`]: string;
492
+ // [x: `${string}-tail`]: string;
493
+ // [x: `head-${string}-tail`]: string;
494
+ // [x: `${bigint}`]: string;
495
+ // [x: `embedded-${number}`]: string;
496
+ // }
497
+ ```
498
+
499
+ @see OmitIndexSignature
500
+ @category Object
501
+ */
502
+ type PickIndexSignature<ObjectType> = {
503
+ [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown>
504
+ ? KeyType
505
+ : never]: ObjectType[KeyType];
506
+ };
507
+
508
+ // Merges two objects without worrying about index signatures.
509
+ type SimpleMerge<Destination, Source> = {
510
+ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key];
511
+ } & Source;
512
+
513
+ /**
514
+ Merge two types into a new type. Keys of the second type overrides keys of the first type.
515
+
516
+ @example
517
+ ```
518
+ import type {Merge} from 'type-fest';
519
+
520
+ interface Foo {
521
+ [x: string]: unknown;
522
+ [x: number]: unknown;
523
+ foo: string;
524
+ bar: symbol;
525
+ }
526
+
527
+ type Bar = {
528
+ [x: number]: number;
529
+ [x: symbol]: unknown;
530
+ bar: Date;
531
+ baz: boolean;
532
+ };
533
+
534
+ export type FooBar = Merge<Foo, Bar>;
535
+ // => {
536
+ // [x: string]: unknown;
537
+ // [x: number]: number;
538
+ // [x: symbol]: unknown;
539
+ // foo: string;
540
+ // bar: Date;
541
+ // baz: boolean;
542
+ // }
543
+ ```
544
+
545
+ @category Object
546
+ */
547
+ type Merge<Destination, Source> =
548
+ Simplify<
549
+ SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>>
550
+ & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>
551
+ >;
552
+
553
+ /**
554
+ Merges user specified options with default options.
555
+
556
+ @example
557
+ ```
558
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
559
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
560
+ type SpecifiedOptions = {leavesOnly: true};
561
+
562
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
563
+ //=> {maxRecursionDepth: 10; leavesOnly: true}
564
+ ```
565
+
566
+ @example
567
+ ```
568
+ // Complains if default values are not provided for optional options
569
+
570
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
571
+ type DefaultPathsOptions = {maxRecursionDepth: 10};
572
+ type SpecifiedOptions = {};
573
+
574
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
575
+ // ~~~~~~~~~~~~~~~~~~~
576
+ // Property 'leavesOnly' is missing in type 'DefaultPathsOptions' but required in type '{ maxRecursionDepth: number; leavesOnly: boolean; }'.
577
+ ```
578
+
579
+ @example
580
+ ```
581
+ // Complains if an option's default type does not conform to the expected type
582
+
583
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
584
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: 'no'};
585
+ type SpecifiedOptions = {};
586
+
587
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
588
+ // ~~~~~~~~~~~~~~~~~~~
589
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
590
+ ```
591
+
592
+ @example
593
+ ```
594
+ // Complains if an option's specified type does not conform to the expected type
595
+
596
+ type PathsOptions = {maxRecursionDepth?: number; leavesOnly?: boolean};
597
+ type DefaultPathsOptions = {maxRecursionDepth: 10; leavesOnly: false};
598
+ type SpecifiedOptions = {leavesOnly: 'yes'};
599
+
600
+ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOptions>;
601
+ // ~~~~~~~~~~~~~~~~
602
+ // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
603
+ ```
604
+ */
605
+ type ApplyDefaultOptions<
606
+ Options extends object,
607
+ Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>,
608
+ SpecifiedOptions extends Options,
609
+ > =
610
+ If<IsAny<SpecifiedOptions>, Defaults,
611
+ If<IsNever<SpecifiedOptions>, Defaults,
612
+ Simplify<Merge<Defaults, {
613
+ [Key in keyof SpecifiedOptions
614
+ as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key
615
+ ]: SpecifiedOptions[Key]
616
+ }> & Required<Options>>>>;
617
+
618
+ /**
619
+ Filter out keys from an object.
620
+
621
+ Returns `never` if `Exclude` is strictly equal to `Key`.
622
+ Returns `never` if `Key` extends `Exclude`.
623
+ Returns `Key` otherwise.
624
+
625
+ @example
626
+ ```
627
+ type Filtered = Filter<'foo', 'foo'>;
628
+ //=> never
629
+ ```
630
+
631
+ @example
632
+ ```
633
+ type Filtered = Filter<'bar', string>;
634
+ //=> never
635
+ ```
636
+
637
+ @example
638
+ ```
639
+ type Filtered = Filter<'bar', 'foo'>;
640
+ //=> 'bar'
641
+ ```
642
+
643
+ @see {Except}
644
+ */
645
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
646
+
647
+ type ExceptOptions = {
648
+ /**
649
+ Disallow assigning non-specified properties.
650
+
651
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
652
+
653
+ @default false
654
+ */
655
+ requireExactProps?: boolean;
656
+ };
657
+
658
+ type DefaultExceptOptions = {
659
+ requireExactProps: false;
660
+ };
661
+
662
+ /**
663
+ Create a type from an object type without certain keys.
664
+
665
+ We recommend setting the `requireExactProps` option to `true`.
666
+
667
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
668
+
669
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
670
+
671
+ @example
672
+ ```
673
+ import type {Except} from 'type-fest';
674
+
675
+ type Foo = {
676
+ a: number;
677
+ b: string;
678
+ };
679
+
680
+ type FooWithoutA = Except<Foo, 'a'>;
681
+ //=> {b: string}
682
+
683
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
684
+ //=> errors: 'a' does not exist in type '{ b: string; }'
685
+
686
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
687
+ //=> {a: number} & Partial<Record<"b", never>>
688
+
689
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
690
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
691
+
692
+ // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures.
693
+
694
+ // Consider the following example:
695
+
696
+ type UserData = {
697
+ [metadata: string]: string;
698
+ email: string;
699
+ name: string;
700
+ role: 'admin' | 'user';
701
+ };
702
+
703
+ // `Omit` clearly doesn't behave as expected in this case:
704
+ type PostPayload = Omit<UserData, 'email'>;
705
+ //=> type PostPayload = { [x: string]: string; [x: number]: string; }
706
+
707
+ // In situations like this, `Except` works better.
708
+ // It simply removes the `email` key while preserving all the other keys.
709
+ type PostPayload = Except<UserData, 'email'>;
710
+ //=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; }
711
+ ```
712
+
713
+ @category Object
714
+ */
715
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> =
716
+ _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
717
+
718
+ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = {
719
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
720
+ } & (Options['requireExactProps'] extends true
721
+ ? Partial<Record<KeysType, never>>
722
+ : {});
723
+
724
+ declare namespace TsConfigJson {
725
+ namespace CompilerOptions {
726
+ type JSX =
727
+ | 'preserve'
728
+ | 'react'
729
+ | 'react-jsx'
730
+ | 'react-jsxdev'
731
+ | 'react-native';
732
+
733
+ type Module =
734
+ | 'CommonJS'
735
+ | 'AMD'
736
+ | 'System'
737
+ | 'UMD'
738
+ | 'ES6'
739
+ | 'ES2015'
740
+ | 'ES2020'
741
+ | 'ES2022'
742
+ | 'ESNext'
743
+ | 'Node16'
744
+ | 'Node18'
745
+ | 'Node20'
746
+ | 'NodeNext'
747
+ | 'Preserve'
748
+ | 'None'
749
+ // Lowercase alternatives
750
+ | 'commonjs'
751
+ | 'amd'
752
+ | 'system'
753
+ | 'umd'
754
+ | 'es6'
755
+ | 'es2015'
756
+ | 'es2020'
757
+ | 'es2022'
758
+ | 'esnext'
759
+ | 'node16'
760
+ | 'node18'
761
+ | 'node20'
762
+ | 'nodenext'
763
+ | 'preserve'
764
+ | 'none';
765
+
766
+ type NewLine =
767
+ | 'CRLF'
768
+ | 'LF'
769
+ // Lowercase alternatives
770
+ | 'crlf'
771
+ | 'lf';
772
+
773
+ type Target =
774
+ | 'ES3'
775
+ | 'ES5'
776
+ | 'ES6'
777
+ | 'ES2015'
778
+ | 'ES2016'
779
+ | 'ES2017'
780
+ | 'ES2018'
781
+ | 'ES2019'
782
+ | 'ES2020'
783
+ | 'ES2021'
784
+ | 'ES2022'
785
+ | 'ES2023'
786
+ | 'ES2024'
787
+ | 'ESNext'
788
+ // Lowercase alternatives
789
+ | 'es3'
790
+ | 'es5'
791
+ | 'es6'
792
+ | 'es2015'
793
+ | 'es2016'
794
+ | 'es2017'
795
+ | 'es2018'
796
+ | 'es2019'
797
+ | 'es2020'
798
+ | 'es2021'
799
+ | 'es2022'
800
+ | 'es2023'
801
+ | 'es2024'
802
+ | 'esnext';
803
+
804
+ type Lib =
805
+ | 'ES5'
806
+ | 'ES6'
807
+ | 'ES7'
808
+ | 'ES2015'
809
+ | 'ES2015.Collection'
810
+ | 'ES2015.Core'
811
+ | 'ES2015.Generator'
812
+ | 'ES2015.Iterable'
813
+ | 'ES2015.Promise'
814
+ | 'ES2015.Proxy'
815
+ | 'ES2015.Reflect'
816
+ | 'ES2015.Symbol.WellKnown'
817
+ | 'ES2015.Symbol'
818
+ | 'ES2016'
819
+ | 'ES2016.Array.Include'
820
+ | 'ES2017'
821
+ | 'ES2017.ArrayBuffer'
822
+ | 'ES2017.Date'
823
+ | 'ES2017.Intl'
824
+ | 'ES2017.Object'
825
+ | 'ES2017.SharedMemory'
826
+ | 'ES2017.String'
827
+ | 'ES2017.TypedArrays'
828
+ | 'ES2018'
829
+ | 'ES2018.AsyncGenerator'
830
+ | 'ES2018.AsyncIterable'
831
+ | 'ES2018.Intl'
832
+ | 'ES2018.Promise'
833
+ | 'ES2018.Regexp'
834
+ | 'ES2019'
835
+ | 'ES2019.Array'
836
+ | 'ES2019.Intl'
837
+ | 'ES2019.Object'
838
+ | 'ES2019.String'
839
+ | 'ES2019.Symbol'
840
+ | 'ES2020'
841
+ | 'ES2020.BigInt'
842
+ | 'ES2020.Date'
843
+ | 'ES2020.Intl'
844
+ | 'ES2020.Number'
845
+ | 'ES2020.Promise'
846
+ | 'ES2020.SharedMemory'
847
+ | 'ES2020.String'
848
+ | 'ES2020.Symbol.WellKnown'
849
+ | 'ES2021'
850
+ | 'ES2021.Intl'
851
+ | 'ES2021.Promise'
852
+ | 'ES2021.String'
853
+ | 'ES2021.WeakRef'
854
+ | 'ES2022'
855
+ | 'ES2022.Array'
856
+ | 'ES2022.Error'
857
+ | 'ES2022.Intl'
858
+ | 'ES2022.Object'
859
+ | 'ES2022.RegExp'
860
+ | 'ES2022.SharedMemory'
861
+ | 'ES2022.String'
862
+ | 'ES2023'
863
+ | 'ES2023.Array'
864
+ | 'ES2023.Collection'
865
+ | 'ES2023.Intl'
866
+ | 'ES2024'
867
+ | 'ES2024.ArrayBuffer'
868
+ | 'ES2024.Collection'
869
+ | 'ES2024.Object'
870
+ | 'ES2024.Promise'
871
+ | 'ES2024.Regexp'
872
+ | 'ES2024.SharedMemory'
873
+ | 'ES2024.String'
874
+ | 'ESNext'
875
+ | 'ESNext.Array'
876
+ | 'ESNext.AsyncIterable'
877
+ | 'ESNext.BigInt'
878
+ | 'ESNext.Collection'
879
+ | 'ESNext.Decorators'
880
+ | 'ESNext.Disposable'
881
+ | 'ESNext.Error'
882
+ | 'ESNext.Intl'
883
+ | 'ESNext.Iterator'
884
+ | 'ESNext.Object'
885
+ | 'ESNext.Promise'
886
+ | 'ESNext.Regexp'
887
+ | 'ESNext.String'
888
+ | 'ESNext.Symbol'
889
+ | 'ESNext.WeakRef'
890
+ | 'DOM'
891
+ | 'DOM.AsyncIterable'
892
+ | 'DOM.Iterable'
893
+ | 'Decorators'
894
+ | 'Decorators.Legacy'
895
+ | 'ScriptHost'
896
+ | 'WebWorker'
897
+ | 'WebWorker.AsyncIterable'
898
+ | 'WebWorker.ImportScripts'
899
+ | 'WebWorker.Iterable'
900
+ // Lowercase alternatives
901
+ | 'es5'
902
+ | 'es6'
903
+ | 'es7'
904
+ | 'es2015'
905
+ | 'es2015.collection'
906
+ | 'es2015.core'
907
+ | 'es2015.generator'
908
+ | 'es2015.iterable'
909
+ | 'es2015.promise'
910
+ | 'es2015.proxy'
911
+ | 'es2015.reflect'
912
+ | 'es2015.symbol.wellknown'
913
+ | 'es2015.symbol'
914
+ | 'es2016'
915
+ | 'es2016.array.include'
916
+ | 'es2017'
917
+ | 'es2017.arraybuffer'
918
+ | 'es2017.date'
919
+ | 'es2017.intl'
920
+ | 'es2017.object'
921
+ | 'es2017.sharedmemory'
922
+ | 'es2017.string'
923
+ | 'es2017.typedarrays'
924
+ | 'es2018'
925
+ | 'es2018.asyncgenerator'
926
+ | 'es2018.asynciterable'
927
+ | 'es2018.intl'
928
+ | 'es2018.promise'
929
+ | 'es2018.regexp'
930
+ | 'es2019'
931
+ | 'es2019.array'
932
+ | 'es2019.intl'
933
+ | 'es2019.object'
934
+ | 'es2019.string'
935
+ | 'es2019.symbol'
936
+ | 'es2020'
937
+ | 'es2020.bigint'
938
+ | 'es2020.date'
939
+ | 'es2020.intl'
940
+ | 'es2020.number'
941
+ | 'es2020.promise'
942
+ | 'es2020.sharedmemory'
943
+ | 'es2020.string'
944
+ | 'es2020.symbol.wellknown'
945
+ | 'es2021'
946
+ | 'es2021.intl'
947
+ | 'es2021.promise'
948
+ | 'es2021.string'
949
+ | 'es2021.weakref'
950
+ | 'es2022'
951
+ | 'es2022.array'
952
+ | 'es2022.error'
953
+ | 'es2022.intl'
954
+ | 'es2022.object'
955
+ | 'es2022.regexp'
956
+ | 'es2022.sharedmemory'
957
+ | 'es2022.string'
958
+ | 'es2023'
959
+ | 'es2023.array'
960
+ | 'es2023.collection'
961
+ | 'es2023.intl'
962
+ | 'es2024'
963
+ | 'es2024.arraybuffer'
964
+ | 'es2024.collection'
965
+ | 'es2024.object'
966
+ | 'es2024.promise'
967
+ | 'es2024.regexp'
968
+ | 'es2024.sharedmemory'
969
+ | 'es2024.string'
970
+ | 'esnext'
971
+ | 'esnext.array'
972
+ | 'esnext.asynciterable'
973
+ | 'esnext.bigint'
974
+ | 'esnext.collection'
975
+ | 'esnext.decorators'
976
+ | 'esnext.disposable'
977
+ | 'esnext.error'
978
+ | 'esnext.intl'
979
+ | 'esnext.iterator'
980
+ | 'esnext.object'
981
+ | 'esnext.promise'
982
+ | 'esnext.regexp'
983
+ | 'esnext.string'
984
+ | 'esnext.symbol'
985
+ | 'esnext.weakref'
986
+ | 'dom'
987
+ | 'dom.asynciterable'
988
+ | 'dom.iterable'
989
+ | 'decorators'
990
+ | 'decorators.legacy'
991
+ | 'scripthost'
992
+ | 'webworker'
993
+ | 'webworker.asynciterable'
994
+ | 'webworker.importscripts'
995
+ | 'webworker.iterable';
996
+
997
+ type Plugin = {
998
+ /**
999
+ Plugin name.
1000
+ */
1001
+ name: string;
1002
+ };
1003
+
1004
+ type ImportsNotUsedAsValues =
1005
+ | 'remove'
1006
+ | 'preserve'
1007
+ | 'error';
1008
+
1009
+ type FallbackPolling =
1010
+ | 'fixedPollingInterval'
1011
+ | 'priorityPollingInterval'
1012
+ | 'dynamicPriorityPolling'
1013
+ | 'fixedInterval'
1014
+ | 'priorityInterval'
1015
+ | 'dynamicPriority'
1016
+ | 'fixedChunkSize';
1017
+
1018
+ type WatchDirectory =
1019
+ | 'useFsEvents'
1020
+ | 'fixedPollingInterval'
1021
+ | 'dynamicPriorityPolling'
1022
+ | 'fixedChunkSizePolling';
1023
+
1024
+ type WatchFile =
1025
+ | 'fixedPollingInterval'
1026
+ | 'priorityPollingInterval'
1027
+ | 'dynamicPriorityPolling'
1028
+ | 'useFsEvents'
1029
+ | 'useFsEventsOnParentDirectory'
1030
+ | 'fixedChunkSizePolling';
1031
+
1032
+ type ModuleResolution =
1033
+ | 'classic'
1034
+ | 'node'
1035
+ | 'node10'
1036
+ | 'node16'
1037
+ | 'nodenext'
1038
+ | 'bundler'
1039
+ // Pascal-cased alternatives
1040
+ | 'Classic'
1041
+ | 'Node'
1042
+ | 'Node10'
1043
+ | 'Node16'
1044
+ | 'NodeNext'
1045
+ | 'Bundler';
1046
+
1047
+ type ModuleDetection =
1048
+ | 'auto'
1049
+ | 'legacy'
1050
+ | 'force';
1051
+
1052
+ type IgnoreDeprecations = '5.0';
1053
+ }
1054
+
1055
+ type CompilerOptions = {
1056
+ /**
1057
+ The character set of the input files.
1058
+
1059
+ @default 'utf8'
1060
+ @deprecated This option will be removed in TypeScript 5.5.
1061
+ */
1062
+ charset?: string;
1063
+
1064
+ /**
1065
+ Enables building for project references.
1066
+
1067
+ @default true
1068
+ */
1069
+ composite?: boolean;
1070
+
1071
+ /**
1072
+ Generates corresponding d.ts files.
1073
+
1074
+ @default false
1075
+ */
1076
+ declaration?: boolean;
1077
+
1078
+ /**
1079
+ Specify output directory for generated declaration files.
1080
+ */
1081
+ declarationDir?: string;
1082
+
1083
+ /**
1084
+ Show diagnostic information.
1085
+
1086
+ @default false
1087
+ */
1088
+ diagnostics?: boolean;
1089
+
1090
+ /**
1091
+ Reduce the number of projects loaded automatically by TypeScript.
1092
+
1093
+ @default false
1094
+ */
1095
+ disableReferencedProjectLoad?: boolean;
1096
+
1097
+ /**
1098
+ Enforces using indexed accessors for keys declared using an indexed type.
1099
+
1100
+ @default false
1101
+ */
1102
+ noPropertyAccessFromIndexSignature?: boolean;
1103
+
1104
+ /**
1105
+ Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
1106
+
1107
+ @default false
1108
+ */
1109
+ emitBOM?: boolean;
1110
+
1111
+ /**
1112
+ Only emit `.d.ts` declaration files.
1113
+
1114
+ @default false
1115
+ */
1116
+ emitDeclarationOnly?: boolean;
1117
+
1118
+ /**
1119
+ Differentiate between undefined and not present when type checking.
1120
+
1121
+ @default false
1122
+ */
1123
+ exactOptionalPropertyTypes?: boolean;
1124
+
1125
+ /**
1126
+ Enable incremental compilation.
1127
+
1128
+ @default `composite`
1129
+ */
1130
+ incremental?: boolean;
1131
+
1132
+ /**
1133
+ Specify file to store incremental compilation information.
1134
+
1135
+ @default '.tsbuildinfo'
1136
+ */
1137
+ tsBuildInfoFile?: string;
1138
+
1139
+ /**
1140
+ Emit a single file with source maps instead of having a separate file.
1141
+
1142
+ @default false
1143
+ */
1144
+ inlineSourceMap?: boolean;
1145
+
1146
+ /**
1147
+ Emit the source alongside the sourcemaps within a single file.
1148
+
1149
+ Requires `--inlineSourceMap` to be set.
1150
+
1151
+ @default false
1152
+ */
1153
+ inlineSources?: boolean;
1154
+
1155
+ /**
1156
+ Specify what JSX code is generated.
1157
+
1158
+ @default 'preserve'
1159
+ */
1160
+ jsx?: CompilerOptions.JSX;
1161
+
1162
+ /**
1163
+ Specifies the object invoked for `createElement` and `__spread` when targeting `'react'` JSX emit.
1164
+
1165
+ @default 'React'
1166
+ */
1167
+ reactNamespace?: string;
1168
+
1169
+ /**
1170
+ Specify the JSX factory function to use when targeting React JSX emit, e.g. `React.createElement` or `h`.
1171
+
1172
+ @default 'React.createElement'
1173
+ */
1174
+ jsxFactory?: string;
1175
+
1176
+ /**
1177
+ Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'.
1178
+
1179
+ @default 'React.Fragment'
1180
+ */
1181
+ jsxFragmentFactory?: string;
1182
+
1183
+ /**
1184
+ Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.
1185
+
1186
+ @default 'react'
1187
+ */
1188
+ jsxImportSource?: string;
1189
+
1190
+ /**
1191
+ Print names of files part of the compilation.
1192
+
1193
+ @default false
1194
+ */
1195
+ listFiles?: boolean;
1196
+
1197
+ /**
1198
+ Specifies the location where debugger should locate map files instead of generated locations.
1199
+ */
1200
+ mapRoot?: string;
1201
+
1202
+ /**
1203
+ Specify module code generation: 'None', 'CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015' or 'ESNext'. Only 'AMD' and 'System' can be used in conjunction with `--outFile`. 'ES6' and 'ES2015' values may be used when targeting 'ES5' or lower.
1204
+
1205
+ @default ['ES3', 'ES5'].includes(target) ? 'CommonJS' : 'ES6'
1206
+ */
1207
+ module?: CompilerOptions.Module;
1208
+
1209
+ /**
1210
+ Specifies module resolution strategy: 'node' (Node) or 'classic' (TypeScript pre 1.6).
1211
+
1212
+ @default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
1213
+ */
1214
+ moduleResolution?: CompilerOptions.ModuleResolution;
1215
+
1216
+ /**
1217
+ Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).
1218
+
1219
+ @default 'LF'
1220
+ */
1221
+ newLine?: CompilerOptions.NewLine;
1222
+
1223
+ /**
1224
+ Disable full type checking (only critical parse and emit errors will be reported).
1225
+
1226
+ @default false
1227
+ */
1228
+ noCheck?: boolean;
1229
+
1230
+ /**
1231
+ Do not emit output.
1232
+
1233
+ @default false
1234
+ */
1235
+ noEmit?: boolean;
1236
+
1237
+ /**
1238
+ Do not generate custom helper functions like `__extends` in compiled output.
1239
+
1240
+ @default false
1241
+ */
1242
+ noEmitHelpers?: boolean;
1243
+
1244
+ /**
1245
+ Do not emit outputs if any type checking errors were reported.
1246
+
1247
+ @default false
1248
+ */
1249
+ noEmitOnError?: boolean;
1250
+
1251
+ /**
1252
+ Warn on expressions and declarations with an implied 'any' type.
1253
+
1254
+ @default false
1255
+ */
1256
+ noImplicitAny?: boolean;
1257
+
1258
+ /**
1259
+ Raise error on 'this' expressions with an implied any type.
1260
+
1261
+ @default false
1262
+ */
1263
+ noImplicitThis?: boolean;
1264
+
1265
+ /**
1266
+ Report errors on unused locals.
1267
+
1268
+ @default false
1269
+ */
1270
+ noUnusedLocals?: boolean;
1271
+
1272
+ /**
1273
+ Report errors on unused parameters.
1274
+
1275
+ @default false
1276
+ */
1277
+ noUnusedParameters?: boolean;
1278
+
1279
+ /**
1280
+ Do not include the default library file (lib.d.ts).
1281
+
1282
+ @default false
1283
+ */
1284
+ noLib?: boolean;
1285
+
1286
+ /**
1287
+ Do not add triple-slash references or module import targets to the list of compiled files.
1288
+
1289
+ @default false
1290
+ */
1291
+ noResolve?: boolean;
1292
+
1293
+ /**
1294
+ Disable strict checking of generic signatures in function types.
1295
+
1296
+ @default false
1297
+ @deprecated This option will be removed in TypeScript 5.5.
1298
+ */
1299
+ noStrictGenericChecks?: boolean;
1300
+
1301
+ /**
1302
+ @deprecated use `skipLibCheck` instead.
1303
+ */
1304
+ skipDefaultLibCheck?: boolean;
1305
+
1306
+ /**
1307
+ Skip type checking of declaration files.
1308
+
1309
+ @default false
1310
+ */
1311
+ skipLibCheck?: boolean;
1312
+
1313
+ /**
1314
+ Concatenate and emit output to single file.
1315
+ */
1316
+ outFile?: string;
1317
+
1318
+ /**
1319
+ Redirect output structure to the directory.
1320
+ */
1321
+ outDir?: string;
1322
+
1323
+ /**
1324
+ Do not erase const enum declarations in generated code.
1325
+
1326
+ @default false
1327
+ */
1328
+ preserveConstEnums?: boolean;
1329
+
1330
+ /**
1331
+ Do not resolve symlinks to their real path; treat a symlinked file like a real one.
1332
+
1333
+ @default false
1334
+ */
1335
+ preserveSymlinks?: boolean;
1336
+
1337
+ /**
1338
+ Keep outdated console output in watch mode instead of clearing the screen.
1339
+
1340
+ @default false
1341
+ */
1342
+ preserveWatchOutput?: boolean;
1343
+
1344
+ /**
1345
+ Stylize errors and messages using color and context (experimental).
1346
+
1347
+ @default true // Unless piping to another program or redirecting output to a file.
1348
+ */
1349
+ pretty?: boolean;
1350
+
1351
+ /**
1352
+ Do not emit comments to output.
1353
+
1354
+ @default false
1355
+ */
1356
+ removeComments?: boolean;
1357
+
1358
+ /**
1359
+ Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files.
1360
+
1361
+ @default false
1362
+ */
1363
+ rewriteRelativeImportExtensions?: boolean;
1364
+
1365
+ /**
1366
+ Specifies the root directory of input files.
1367
+
1368
+ Use to control the output directory structure with `--outDir`.
1369
+ */
1370
+ rootDir?: string;
1371
+
1372
+ /**
1373
+ Unconditionally emit imports for unresolved files.
1374
+
1375
+ @default false
1376
+ */
1377
+ isolatedModules?: boolean;
1378
+
1379
+ /**
1380
+ Require sufficient annotation on exports so other tools can trivially generate declaration files.
1381
+
1382
+ @default false
1383
+ */
1384
+ isolatedDeclarations?: boolean;
1385
+
1386
+ /**
1387
+ Generates corresponding '.map' file.
1388
+
1389
+ @default false
1390
+ */
1391
+ sourceMap?: boolean;
1392
+
1393
+ /**
1394
+ Specifies the location where debugger should locate TypeScript files instead of source locations.
1395
+ */
1396
+ sourceRoot?: string;
1397
+
1398
+ /**
1399
+ Suppress excess property checks for object literals.
1400
+
1401
+ @default false
1402
+ @deprecated This option will be removed in TypeScript 5.5.
1403
+ */
1404
+ suppressExcessPropertyErrors?: boolean;
1405
+
1406
+ /**
1407
+ Suppress noImplicitAny errors for indexing objects lacking index signatures.
1408
+
1409
+ @default false
1410
+ @deprecated This option will be removed in TypeScript 5.5.
1411
+ */
1412
+ suppressImplicitAnyIndexErrors?: boolean;
1413
+
1414
+ /**
1415
+ Do not emit declarations for code that has an `@internal` annotation.
1416
+ */
1417
+ stripInternal?: boolean;
1418
+
1419
+ /**
1420
+ Specify ECMAScript target version.
1421
+
1422
+ @default 'es3'
1423
+ */
1424
+ target?: CompilerOptions.Target;
1425
+
1426
+ /**
1427
+ Default catch clause variables as `unknown` instead of `any`.
1428
+
1429
+ @default false
1430
+ */
1431
+ useUnknownInCatchVariables?: boolean;
1432
+
1433
+ /**
1434
+ Watch input files.
1435
+
1436
+ @default false
1437
+ @deprecated Use watchOptions instead.
1438
+ */
1439
+ watch?: boolean;
1440
+
1441
+ /**
1442
+ Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
1443
+
1444
+ @deprecated Use watchOptions.fallbackPolling instead.
1445
+ */
1446
+ fallbackPolling?: CompilerOptions.FallbackPolling;
1447
+
1448
+ /**
1449
+ Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
1450
+
1451
+ @default 'useFsEvents'
1452
+ @deprecated Use watchOptions.watchDirectory instead.
1453
+ */
1454
+ watchDirectory?: CompilerOptions.WatchDirectory;
1455
+
1456
+ /**
1457
+ Specify the strategy for watching individual files.
1458
+
1459
+ @default 'useFsEvents'
1460
+ @deprecated Use watchOptions.watchFile instead.
1461
+ */
1462
+ watchFile?: CompilerOptions.WatchFile;
1463
+
1464
+ /**
1465
+ Enables experimental support for ES7 decorators.
1466
+
1467
+ @default false
1468
+ */
1469
+ experimentalDecorators?: boolean;
1470
+
1471
+ /**
1472
+ Emit design-type metadata for decorated declarations in source.
1473
+
1474
+ @default false
1475
+ */
1476
+ emitDecoratorMetadata?: boolean;
1477
+
1478
+ /**
1479
+ Do not report errors on unused labels.
1480
+
1481
+ @default false
1482
+ */
1483
+ allowUnusedLabels?: boolean;
1484
+
1485
+ /**
1486
+ Report error when not all code paths in function return a value.
1487
+
1488
+ @default false
1489
+ */
1490
+ noImplicitReturns?: boolean;
1491
+
1492
+ /**
1493
+ Add `undefined` to a type when accessed using an index.
1494
+
1495
+ @default false
1496
+ */
1497
+ noUncheckedIndexedAccess?: boolean;
1498
+
1499
+ /**
1500
+ Report error if failed to find a source file for a side effect import.
1501
+
1502
+ @default false
1503
+ */
1504
+ noUncheckedSideEffectImports?: boolean;
1505
+
1506
+ /**
1507
+ Report errors for fallthrough cases in switch statement.
1508
+
1509
+ @default false
1510
+ */
1511
+ noFallthroughCasesInSwitch?: boolean;
1512
+
1513
+ /**
1514
+ Ensure overriding members in derived classes are marked with an override modifier.
1515
+
1516
+ @default false
1517
+ */
1518
+ noImplicitOverride?: boolean;
1519
+
1520
+ /**
1521
+ Do not report errors on unreachable code.
1522
+
1523
+ @default false
1524
+ */
1525
+ allowUnreachableCode?: boolean;
1526
+
1527
+ /**
1528
+ Disallow inconsistently-cased references to the same file.
1529
+
1530
+ @default true
1531
+ */
1532
+ forceConsistentCasingInFileNames?: boolean;
1533
+
1534
+ /**
1535
+ Emit a v8 CPU profile of the compiler run for debugging.
1536
+
1537
+ @default 'profile.cpuprofile'
1538
+ */
1539
+ generateCpuProfile?: string;
1540
+
1541
+ /**
1542
+ Generates an event trace and a list of types.
1543
+ */
1544
+ generateTrace?: boolean;
1545
+
1546
+ /**
1547
+ Base directory to resolve non-relative module names.
1548
+ */
1549
+ baseUrl?: string;
1550
+
1551
+ /**
1552
+ Specify path mapping to be computed relative to baseUrl option.
1553
+ */
1554
+ paths?: Record<string, string[]>;
1555
+
1556
+ /**
1557
+ List of TypeScript language server plugins to load.
1558
+ */
1559
+ plugins?: CompilerOptions.Plugin[];
1560
+
1561
+ /**
1562
+ Specify list of root directories to be used when resolving modules.
1563
+ */
1564
+ rootDirs?: string[];
1565
+
1566
+ /**
1567
+ Specify list of directories for type definition files to be included.
1568
+ */
1569
+ typeRoots?: string[];
1570
+
1571
+ /**
1572
+ Type declaration files to be included in compilation.
1573
+ */
1574
+ types?: string[];
1575
+
1576
+ /**
1577
+ Enable tracing of the name resolution process.
1578
+
1579
+ @default false
1580
+ */
1581
+ traceResolution?: boolean;
1582
+
1583
+ /**
1584
+ Allow javascript files to be compiled.
1585
+
1586
+ @default false
1587
+ */
1588
+ allowJs?: boolean;
1589
+
1590
+ /**
1591
+ Do not truncate error messages.
1592
+
1593
+ @default false
1594
+ */
1595
+ noErrorTruncation?: boolean;
1596
+
1597
+ /**
1598
+ Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
1599
+
1600
+ @default module === 'system' || esModuleInterop
1601
+ */
1602
+ allowSyntheticDefaultImports?: boolean;
1603
+
1604
+ /**
1605
+ Do not emit `'use strict'` directives in module output.
1606
+
1607
+ @default false
1608
+ @deprecated This option will be removed in TypeScript 5.5.
1609
+ */
1610
+ noImplicitUseStrict?: boolean;
1611
+
1612
+ /**
1613
+ Enable to list all emitted files.
1614
+
1615
+ @default false
1616
+ */
1617
+ listEmittedFiles?: boolean;
1618
+
1619
+ /**
1620
+ Disable size limit for JavaScript project.
1621
+
1622
+ @default false
1623
+ */
1624
+ disableSizeLimit?: boolean;
1625
+
1626
+ /**
1627
+ List of library files to be included in the compilation.
1628
+ */
1629
+ lib?: CompilerOptions.Lib[];
1630
+
1631
+ /**
1632
+ Enable strict null checks.
1633
+
1634
+ @default false
1635
+ */
1636
+ strictNullChecks?: boolean;
1637
+
1638
+ /**
1639
+ The maximum dependency depth to search under `node_modules` and load JavaScript files. Only applicable with `--allowJs`.
1640
+
1641
+ @default 0
1642
+ */
1643
+ maxNodeModuleJsDepth?: number;
1644
+
1645
+ /**
1646
+ Import emit helpers (e.g. `__extends`, `__rest`, etc..) from tslib.
1647
+
1648
+ @default false
1649
+ */
1650
+ importHelpers?: boolean;
1651
+
1652
+ /**
1653
+ Specify emit/checking behavior for imports that are only used for types.
1654
+
1655
+ @default 'remove'
1656
+ @deprecated Use `verbatimModuleSyntax` instead.
1657
+ */
1658
+ importsNotUsedAsValues?: CompilerOptions.ImportsNotUsedAsValues;
1659
+
1660
+ /**
1661
+ Parse in strict mode and emit `'use strict'` for each source file.
1662
+
1663
+ @default false
1664
+ */
1665
+ alwaysStrict?: boolean;
1666
+
1667
+ /**
1668
+ Enable all strict type checking options.
1669
+
1670
+ @default false
1671
+ */
1672
+ strict?: boolean;
1673
+
1674
+ /**
1675
+ Enable stricter checking of of the `bind`, `call`, and `apply` methods on functions.
1676
+
1677
+ @default false
1678
+ */
1679
+ strictBindCallApply?: boolean;
1680
+
1681
+ /**
1682
+ Provide full support for iterables in `for-of`, spread, and destructuring when targeting `ES5` or `ES3`.
1683
+
1684
+ @default false
1685
+ */
1686
+ downlevelIteration?: boolean;
1687
+
1688
+ /**
1689
+ Report errors in `.js` files.
1690
+
1691
+ @default false
1692
+ */
1693
+ checkJs?: boolean;
1694
+
1695
+ /**
1696
+ Built-in iterators are instantiated with a `TReturn` type of undefined instead of `any`.
1697
+
1698
+ @default false
1699
+ */
1700
+ strictBuiltinIteratorReturn?: boolean;
1701
+
1702
+ /**
1703
+ Disable bivariant parameter checking for function types.
1704
+
1705
+ @default false
1706
+ */
1707
+ strictFunctionTypes?: boolean;
1708
+
1709
+ /**
1710
+ Ensure non-undefined class properties are initialized in the constructor.
1711
+
1712
+ @default false
1713
+ */
1714
+ strictPropertyInitialization?: boolean;
1715
+
1716
+ /**
1717
+ Emit `__importStar` and `__importDefault` helpers for runtime Babel ecosystem compatibility and enable `--allowSyntheticDefaultImports` for typesystem compatibility.
1718
+
1719
+ @default false
1720
+ */
1721
+ esModuleInterop?: boolean;
1722
+
1723
+ /**
1724
+ Allow accessing UMD globals from modules.
1725
+
1726
+ @default false
1727
+ */
1728
+ allowUmdGlobalAccess?: boolean;
1729
+
1730
+ /**
1731
+ Resolve `keyof` to string valued property names only (no numbers or symbols).
1732
+
1733
+ @default false
1734
+ @deprecated This option will be removed in TypeScript 5.5.
1735
+ */
1736
+ keyofStringsOnly?: boolean;
1737
+
1738
+ /**
1739
+ Emit ECMAScript standard class fields.
1740
+
1741
+ @default false
1742
+ */
1743
+ useDefineForClassFields?: boolean;
1744
+
1745
+ /**
1746
+ Generates a sourcemap for each corresponding `.d.ts` file.
1747
+
1748
+ @default false
1749
+ */
1750
+ declarationMap?: boolean;
1751
+
1752
+ /**
1753
+ Include modules imported with `.json` extension.
1754
+
1755
+ @default false
1756
+ */
1757
+ resolveJsonModule?: boolean;
1758
+
1759
+ /**
1760
+ Have recompiles in '--incremental' and '--watch' assume that changes within a file will only affect files directly depending on it.
1761
+
1762
+ @default false
1763
+ */
1764
+ assumeChangesOnlyAffectDirectDependencies?: boolean;
1765
+
1766
+ /**
1767
+ Output more detailed compiler performance information after building.
1768
+
1769
+ @default false
1770
+ */
1771
+ extendedDiagnostics?: boolean;
1772
+
1773
+ /**
1774
+ Print names of files that are part of the compilation and then stop processing.
1775
+
1776
+ @default false
1777
+ */
1778
+ listFilesOnly?: boolean;
1779
+
1780
+ /**
1781
+ Disable preferring source files instead of declaration files when referencing composite projects.
1782
+
1783
+ @default true if composite, false otherwise
1784
+ */
1785
+ disableSourceOfProjectReferenceRedirect?: boolean;
1786
+
1787
+ /**
1788
+ Opt a project out of multi-project reference checking when editing.
1789
+
1790
+ @default false
1791
+ */
1792
+ disableSolutionSearching?: boolean;
1793
+
1794
+ /**
1795
+ Print names of files which TypeScript sees as a part of your project and the reason they are part of the compilation.
1796
+
1797
+ @default false
1798
+ */
1799
+ explainFiles?: boolean;
1800
+
1801
+ /**
1802
+ Preserve unused imported values in the JavaScript output that would otherwise be removed.
1803
+
1804
+ @default true
1805
+ @deprecated Use `verbatimModuleSyntax` instead.
1806
+ */
1807
+ preserveValueImports?: boolean;
1808
+
1809
+ /**
1810
+ List of file name suffixes to search when resolving a module.
1811
+ */
1812
+ moduleSuffixes?: string[];
1813
+
1814
+ /**
1815
+ Control what method is used to detect module-format JS files.
1816
+
1817
+ @default 'auto'
1818
+ */
1819
+ moduleDetection?: CompilerOptions.ModuleDetection;
1820
+
1821
+ /**
1822
+ Allows TypeScript files to import each other with a TypeScript-specific extension like .ts, .mts, or .tsx.
1823
+
1824
+ @default false
1825
+ */
1826
+ allowImportingTsExtensions?: boolean;
1827
+
1828
+ /**
1829
+ Forces TypeScript to consult the exports field of package.json files if it ever reads from a package in node_modules.
1830
+
1831
+ @default false
1832
+ */
1833
+ resolvePackageJsonExports?: boolean;
1834
+
1835
+ /**
1836
+ Forces TypeScript to consult the imports field of package.json files when performing a lookup that starts with # from a file whose ancestor directory contains a package.json.
1837
+
1838
+ @default false
1839
+ */
1840
+ resolvePackageJsonImports?: boolean;
1841
+
1842
+ /**
1843
+ Suppress errors for file formats that TypeScript does not understand.
1844
+
1845
+ @default false
1846
+ */
1847
+ allowArbitraryExtensions?: boolean;
1848
+
1849
+ /**
1850
+ List of additional conditions that should succeed when TypeScript resolves from package.json.
1851
+ */
1852
+ customConditions?: string[];
1853
+
1854
+ /**
1855
+ Anything that uses the type modifier is dropped entirely.
1856
+
1857
+ @default false
1858
+ */
1859
+ verbatimModuleSyntax?: boolean;
1860
+
1861
+ /**
1862
+ Suppress deprecation warnings
1863
+ */
1864
+ ignoreDeprecations?: CompilerOptions.IgnoreDeprecations;
1865
+
1866
+ /**
1867
+ Do not allow runtime constructs that are not part of ECMAScript.
1868
+
1869
+ @default false
1870
+ */
1871
+ erasableSyntaxOnly?: boolean;
1872
+
1873
+ /**
1874
+ Enable lib replacement.
1875
+
1876
+ @default true
1877
+ */
1878
+ libReplacement?: boolean;
1879
+ };
1880
+
1881
+ namespace WatchOptions {
1882
+ type WatchFileKind =
1883
+ | 'FixedPollingInterval'
1884
+ | 'PriorityPollingInterval'
1885
+ | 'DynamicPriorityPolling'
1886
+ | 'FixedChunkSizePolling'
1887
+ | 'UseFsEvents'
1888
+ | 'UseFsEventsOnParentDirectory';
1889
+
1890
+ type WatchDirectoryKind =
1891
+ | 'UseFsEvents'
1892
+ | 'FixedPollingInterval'
1893
+ | 'DynamicPriorityPolling'
1894
+ | 'FixedChunkSizePolling';
1895
+
1896
+ type PollingWatchKind =
1897
+ | 'FixedInterval'
1898
+ | 'PriorityInterval'
1899
+ | 'DynamicPriority'
1900
+ | 'FixedChunkSize';
1901
+ }
1902
+
1903
+ type WatchOptions = {
1904
+
1905
+ /**
1906
+ Specify the strategy for watching individual files.
1907
+
1908
+ @default 'UseFsEvents'
1909
+ */
1910
+ watchFile?: WatchOptions.WatchFileKind | Lowercase<WatchOptions.WatchFileKind>;
1911
+
1912
+ /**
1913
+ Specify the strategy for watching directories under systems that lack recursive file-watching functionality.
1914
+
1915
+ @default 'UseFsEvents'
1916
+ */
1917
+ watchDirectory?: WatchOptions.WatchDirectoryKind | Lowercase<WatchOptions.WatchDirectoryKind>;
1918
+
1919
+ /**
1920
+ Specify the polling strategy to use when the system runs out of or doesn't support native file watchers.
1921
+ */
1922
+ fallbackPolling?: WatchOptions.PollingWatchKind | Lowercase<WatchOptions.PollingWatchKind>;
1923
+
1924
+ /**
1925
+ Enable synchronous updates on directory watchers for platforms that don't support recursive watching natively.
1926
+ */
1927
+ synchronousWatchDirectory?: boolean;
1928
+
1929
+ /**
1930
+ Specifies a list of directories to exclude from watch.
1931
+ */
1932
+ excludeDirectories?: string[];
1933
+
1934
+ /**
1935
+ Specifies a list of files to exclude from watch.
1936
+ */
1937
+ excludeFiles?: string[];
1938
+ };
1939
+
1940
+ /**
1941
+ Auto type (.d.ts) acquisition options for this project.
1942
+ */
1943
+ type TypeAcquisition = {
1944
+ /**
1945
+ Enable auto type acquisition.
1946
+ */
1947
+ enable?: boolean;
1948
+
1949
+ /**
1950
+ Specifies a list of type declarations to be included in auto type acquisition. For example, `['jquery', 'lodash']`.
1951
+ */
1952
+ include?: string[];
1953
+
1954
+ /**
1955
+ Specifies a list of type declarations to be excluded from auto type acquisition. For example, `['jquery', 'lodash']`.
1956
+ */
1957
+ exclude?: string[];
1958
+
1959
+ /**
1960
+ Disable infering what types should be added based on filenames in a project.
1961
+ */
1962
+ disableFilenameBasedTypeAcquisition?: boolean;
1963
+ };
1964
+
1965
+ type References = {
1966
+ /**
1967
+ A normalized path on disk.
1968
+ */
1969
+ path: string;
1970
+
1971
+ /**
1972
+ The path as the user originally wrote it.
1973
+ */
1974
+ originalPath?: string;
1975
+
1976
+ /**
1977
+ True if the output of this reference should be prepended to the output of this project.
1978
+
1979
+ Only valid for `--outFile` compilations.
1980
+ @deprecated This option will be removed in TypeScript 5.5.
1981
+ */
1982
+ prepend?: boolean;
1983
+
1984
+ /**
1985
+ True if it is intended that this reference form a circularity.
1986
+ */
1987
+ circular?: boolean;
1988
+ };
1989
+ }
1990
+
1991
+ /**
1992
+ Type for [TypeScript's `tsconfig.json` file](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html) (TypeScript 3.7).
1993
+
1994
+ @category File
1995
+ */
1996
+ type TsConfigJson = {
1997
+ /**
1998
+ Instructs the TypeScript compiler how to compile `.ts` files.
1999
+ */
2000
+ compilerOptions?: TsConfigJson.CompilerOptions;
2001
+
2002
+ /**
2003
+ Instructs the TypeScript compiler how to watch files.
2004
+ */
2005
+ watchOptions?: TsConfigJson.WatchOptions;
2006
+
2007
+ /**
2008
+ Auto type (.d.ts) acquisition options for this project.
2009
+ */
2010
+ typeAcquisition?: TsConfigJson.TypeAcquisition;
2011
+
2012
+ /**
2013
+ Enable Compile-on-Save for this project.
2014
+ */
2015
+ compileOnSave?: boolean;
2016
+
2017
+ /**
2018
+ Path to base configuration file to inherit from.
2019
+ */
2020
+ extends?: string | string[];
2021
+
2022
+ /**
2023
+ If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`. When a `files` property is specified, only those files and those specified by `include` are included.
2024
+ */
2025
+ files?: string[];
2026
+
2027
+ /**
2028
+ Specifies a list of files to be excluded from compilation. The `exclude` property only affects the files included via the `include` property and not the `files` property.
2029
+
2030
+ Glob patterns require TypeScript version 2.0 or later.
2031
+ */
2032
+ exclude?: string[];
2033
+
2034
+ /**
2035
+ Specifies a list of glob patterns that match files to be included in compilation.
2036
+
2037
+ If no `files` or `include` property is present in a `tsconfig.json`, the compiler defaults to including all files in the containing directory and subdirectories except those specified by `exclude`.
2038
+ */
2039
+ include?: string[];
2040
+
2041
+ /**
2042
+ Referenced projects.
2043
+ */
2044
+ references?: TsConfigJson.References[];
2045
+ };
2046
+
2047
+ type TsConfigJsonResolved = Except<TsConfigJson, 'extends'>;
2048
+ type TsConfigResult = {
2049
+ /**
2050
+ * The path to the tsconfig.json file
2051
+ */
2052
+ path: string;
2053
+ /**
2054
+ * The resolved tsconfig.json file
2055
+ */
2056
+ config: TsConfigJsonResolved;
2057
+ };
2058
+ type Cache<value = any> = Map<string, value>;
2059
+
2060
+ /**
2061
+ * Finds a tsconfig file, defaulting to `tsconfig.json`, starting from a given path.
2062
+ *
2063
+ * @param searchPath Starting directory (default: `process.cwd()`).
2064
+ * @param configName Config file name (default: `tsconfig.json`).
2065
+ * @param cache Cache for previous results (default: new `Map()`).
2066
+ * @returns The tsconfig file path and parsed contents, or `null` if not found.
2067
+ */
2068
+ declare const getTsconfig: (searchPath?: string, configName?: string, cache?: Cache) => TsConfigResult | null;
2069
+
2070
+ /**
2071
+ * Parses a tsconfig file at a given path
2072
+ *
2073
+ * @param tsconfigPath - Path to the tsconfig file.
2074
+ * @param cache - Cache for storing parsed tsconfig results (default: new `Map()`).
2075
+ * @returns The parsed and resolved tsconfig JSON.
2076
+ */
2077
+ declare const parseTsconfig: (tsconfigPath: string, cache?: Cache<string>) => TsConfigJsonResolved;
2078
+
2079
+ /**
2080
+ * Reference:
2081
+ * https://github.com/microsoft/TypeScript/blob/3ccbe804f850f40d228d3c875be952d94d39aa1d/src/compiler/moduleNameResolver.ts#L2465
2082
+ */
2083
+ declare const createPathsMatcher: (tsconfig: TsConfigResult) => ((specifier: string) => string[]) | null;
2084
+
2085
+ type FileMatcher = (filePath: string) => (TsConfigJsonResolved | undefined);
2086
+ declare const createFilesMatcher: ({ config, path: tsconfigPath, }: TsConfigResult, caseSensitivePaths?: boolean) => FileMatcher;
2087
+
2088
+ export { type Cache, type FileMatcher, TsConfigJson, type TsConfigJsonResolved, type TsConfigResult, createFilesMatcher, createPathsMatcher, getTsconfig, parseTsconfig };