@modern-js/module-tools 2.0.0-beta.2 → 2.0.0-beta.4

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 (449) hide show
  1. package/CHANGELOG.md +276 -205
  2. package/bin/modern.js +7 -1
  3. package/compiled/@babel/code-frame/index.d.ts +1 -0
  4. package/compiled/@babel/code-frame/index.js +1 -0
  5. package/compiled/@babel/code-frame/license +22 -0
  6. package/compiled/@babel/code-frame/package.json +1 -0
  7. package/compiled/@babel/generator/index.d.ts +1 -0
  8. package/compiled/@babel/generator/index.js +1 -0
  9. package/compiled/@babel/generator/license +22 -0
  10. package/compiled/@babel/generator/package.json +1 -0
  11. package/compiled/@babel/helper-validator-identifier/index.d.ts +1 -0
  12. package/compiled/@babel/helper-validator-identifier/index.js +1 -0
  13. package/compiled/@babel/helper-validator-identifier/license +22 -0
  14. package/compiled/@babel/helper-validator-identifier/package.json +1 -0
  15. package/compiled/@babel/highlight/index.d.ts +1 -0
  16. package/compiled/@babel/highlight/index.js +1 -0
  17. package/compiled/@babel/highlight/license +22 -0
  18. package/compiled/@babel/highlight/package.json +1 -0
  19. package/compiled/@babel/parser/@babel/types/lib/index-legacy.d.ts +2742 -0
  20. package/compiled/@babel/parser/index.js +1 -0
  21. package/compiled/@babel/parser/license +19 -0
  22. package/compiled/@babel/parser/package.json +1 -0
  23. package/compiled/@babel/parser/typings/babel-parser.d.ts +214 -0
  24. package/compiled/@babel/template/index.d.ts +1 -0
  25. package/compiled/@babel/template/index.js +1 -0
  26. package/compiled/@babel/template/license +22 -0
  27. package/compiled/@babel/template/package.json +1 -0
  28. package/compiled/@babel/traverse/index.d.ts +1199 -0
  29. package/compiled/@babel/traverse/index.js +1 -0
  30. package/compiled/@babel/traverse/license +22 -0
  31. package/compiled/@babel/traverse/package.json +1 -0
  32. package/compiled/@babel/types/index.js +1 -0
  33. package/compiled/@babel/types/lib/index-legacy.d.ts +2732 -0
  34. package/compiled/@babel/types/license +22 -0
  35. package/compiled/@babel/types/package.json +1 -0
  36. package/compiled/@rollup/plugin-json/@rollup/pluginutils/types/index.d.ts +86 -0
  37. package/compiled/@rollup/plugin-json/estree/index.d.ts +548 -0
  38. package/compiled/@rollup/plugin-json/index.js +1 -0
  39. package/compiled/@rollup/plugin-json/license +21 -0
  40. package/compiled/@rollup/plugin-json/package.json +1 -0
  41. package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +948 -0
  42. package/compiled/@rollup/plugin-json/types/index.d.ts +41 -0
  43. package/compiled/find-up/index.d.ts +138 -0
  44. package/compiled/find-up/index.js +1 -0
  45. package/compiled/find-up/license +9 -0
  46. package/compiled/find-up/locate-path/index.d.ts +83 -0
  47. package/compiled/find-up/package.json +1 -0
  48. package/compiled/less/index.d.ts +282 -0
  49. package/compiled/less/index.js +1 -0
  50. package/compiled/less/package.json +1 -0
  51. package/compiled/normalize-path/index.d.ts +8 -0
  52. package/compiled/normalize-path/index.js +8 -0
  53. package/compiled/normalize-path/license +21 -0
  54. package/compiled/normalize-path/package.json +1 -0
  55. package/compiled/p-map/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
  56. package/compiled/p-map/cacheable-lookup/index.d.ts +139 -0
  57. package/compiled/p-map/cacheable-request/index.d.ts +137 -0
  58. package/compiled/p-map/got/dist/source/as-promise/index.d.ts +3 -0
  59. package/compiled/p-map/got/dist/source/as-promise/types.d.ts +256 -0
  60. package/compiled/p-map/got/dist/source/core/index.d.ts +1124 -0
  61. package/compiled/p-map/got/dist/source/core/utils/dns-ip-version.d.ts +5 -0
  62. package/compiled/p-map/got/dist/source/core/utils/options-to-url.d.ts +14 -0
  63. package/compiled/p-map/got/dist/source/core/utils/timed-out.d.ts +29 -0
  64. package/compiled/p-map/got/dist/source/index.d.ts +4 -0
  65. package/compiled/p-map/got/dist/source/types.d.ts +344 -0
  66. package/compiled/p-map/http-cache-semantics/index.d.ts +170 -0
  67. package/compiled/p-map/index.d.ts +67 -0
  68. package/compiled/p-map/index.js +1 -0
  69. package/compiled/p-map/keyv/src/index.d.ts +104 -0
  70. package/compiled/p-map/license +9 -0
  71. package/compiled/p-map/p-cancelable/index.d.ts +176 -0
  72. package/compiled/p-map/package.json +1 -0
  73. package/compiled/p-map/responselike/index.d.ts +34 -0
  74. package/compiled/postcss-custom-properties/index.d.ts +1 -0
  75. package/compiled/postcss-custom-properties/index.js +1 -0
  76. package/compiled/postcss-custom-properties/package.json +1 -0
  77. package/compiled/postcss-flexbugs-fixes/index.d.ts +1 -0
  78. package/compiled/postcss-flexbugs-fixes/index.js +1 -0
  79. package/compiled/postcss-flexbugs-fixes/license +20 -0
  80. package/compiled/postcss-flexbugs-fixes/package.json +1 -0
  81. package/compiled/postcss-font-variant/index.d.ts +1 -0
  82. package/compiled/postcss-font-variant/index.js +1 -0
  83. package/compiled/postcss-font-variant/license +20 -0
  84. package/compiled/postcss-font-variant/package.json +1 -0
  85. package/compiled/postcss-initial/index.d.ts +1 -0
  86. package/compiled/postcss-initial/index.js +1 -0
  87. package/compiled/postcss-initial/license +20 -0
  88. package/compiled/postcss-initial/package.json +1 -0
  89. package/compiled/postcss-media-minmax/index.d.ts +1 -0
  90. package/compiled/postcss-media-minmax/index.js +1 -0
  91. package/compiled/postcss-media-minmax/license +22 -0
  92. package/compiled/postcss-media-minmax/package.json +1 -0
  93. package/compiled/postcss-nesting/index.d.ts +1 -0
  94. package/compiled/postcss-nesting/index.js +2 -0
  95. package/compiled/postcss-nesting/package.json +1 -0
  96. package/compiled/postcss-page-break/index.d.ts +1 -0
  97. package/compiled/postcss-page-break/index.js +1 -0
  98. package/compiled/postcss-page-break/license +20 -0
  99. package/compiled/postcss-page-break/package.json +1 -0
  100. package/compiled/postcss-value-parser/index.d.ts +1 -0
  101. package/compiled/postcss-value-parser/index.js +1 -0
  102. package/compiled/postcss-value-parser/license +22 -0
  103. package/compiled/postcss-value-parser/package.json +1 -0
  104. package/compiled/rollup/fsevents.node +0 -0
  105. package/compiled/rollup/index.js +82 -0
  106. package/compiled/rollup/package.json +1 -0
  107. package/compiled/rollup/types/rollup.d.ts +948 -0
  108. package/compiled/rollup-plugin-dts/dist/rollup-plugin-dts.d.ts +21 -0
  109. package/compiled/rollup-plugin-dts/index.js +1 -0
  110. package/compiled/rollup-plugin-dts/package.json +1 -0
  111. package/compiled/rollup-plugin-dts/rollup/dist/rollup.d.ts +948 -0
  112. package/compiled/sass/index.js +1 -0
  113. package/compiled/sass/license +1619 -0
  114. package/compiled/sass/package.json +1 -0
  115. package/compiled/sass/types/compile.d.ts +152 -0
  116. package/compiled/sass/types/exception.d.ts +41 -0
  117. package/compiled/sass/types/importer.d.ts +294 -0
  118. package/compiled/sass/types/index.d.ts +80 -0
  119. package/compiled/sass/types/legacy/exception.d.ts +54 -0
  120. package/compiled/sass/types/legacy/function.d.ts +756 -0
  121. package/compiled/sass/types/legacy/importer.d.ts +168 -0
  122. package/compiled/sass/types/legacy/options.d.ts +642 -0
  123. package/compiled/sass/types/legacy/plugin_this.d.ts +73 -0
  124. package/compiled/sass/types/legacy/render.d.ts +139 -0
  125. package/compiled/sass/types/logger/index.d.ts +94 -0
  126. package/compiled/sass/types/logger/source_location.d.ts +21 -0
  127. package/compiled/sass/types/logger/source_span.d.ts +34 -0
  128. package/compiled/sass/types/options.d.ts +435 -0
  129. package/compiled/sass/types/util/promise_or.d.ts +17 -0
  130. package/compiled/sass/types/value/argument_list.d.ts +47 -0
  131. package/compiled/sass/types/value/boolean.d.ts +29 -0
  132. package/compiled/sass/types/value/color.d.ts +107 -0
  133. package/compiled/sass/types/value/function.d.ts +22 -0
  134. package/compiled/sass/types/value/index.d.ts +173 -0
  135. package/compiled/sass/types/value/list.d.ts +54 -0
  136. package/compiled/sass/types/value/map.d.ts +41 -0
  137. package/compiled/sass/types/value/number.d.ts +305 -0
  138. package/compiled/sass/types/value/string.d.ts +84 -0
  139. package/compiled/signal-exit/index.d.ts +24 -0
  140. package/compiled/signal-exit/index.js +1 -0
  141. package/compiled/signal-exit/package.json +1 -0
  142. package/dist/builder/build.d.ts +23 -0
  143. package/dist/builder/build.js +265 -0
  144. package/dist/builder/build.js.map +1 -0
  145. package/dist/builder/clear.d.ts +3 -0
  146. package/dist/builder/clear.js +74 -0
  147. package/dist/builder/clear.js.map +1 -0
  148. package/dist/builder/copy.d.ts +9 -0
  149. package/dist/builder/copy.js +207 -0
  150. package/dist/builder/copy.js.map +1 -0
  151. package/dist/builder/dts/index.d.ts +2 -0
  152. package/dist/builder/dts/index.js +27 -0
  153. package/dist/builder/dts/index.js.map +1 -0
  154. package/dist/builder/dts/rollup.d.ts +17 -0
  155. package/dist/builder/dts/rollup.js +180 -0
  156. package/dist/builder/dts/rollup.js.map +1 -0
  157. package/dist/builder/dts/tsc.d.ts +3 -0
  158. package/dist/builder/dts/tsc.js +160 -0
  159. package/dist/builder/dts/tsc.js.map +1 -0
  160. package/dist/builder/index.d.ts +8 -0
  161. package/dist/builder/index.js +124 -0
  162. package/dist/builder/index.js.map +1 -0
  163. package/dist/builder/platform.d.ts +4 -0
  164. package/dist/builder/platform.js +140 -0
  165. package/dist/builder/platform.js.map +1 -0
  166. package/dist/cli.d.ts +3 -0
  167. package/dist/cli.js +103 -0
  168. package/dist/cli.js.map +1 -0
  169. package/dist/command.d.ts +7 -0
  170. package/dist/command.js +169 -0
  171. package/dist/command.js.map +1 -0
  172. package/dist/config/defineConfig.d.ts +2 -0
  173. package/dist/config/defineConfig.js +25 -0
  174. package/dist/config/defineConfig.js.map +1 -0
  175. package/dist/config/normalize.d.ts +17 -0
  176. package/dist/config/normalize.js +177 -0
  177. package/dist/config/normalize.js.map +1 -0
  178. package/dist/config/schema.d.ts +641 -0
  179. package/dist/config/schema.js +207 -0
  180. package/dist/config/schema.js.map +1 -0
  181. package/dist/constants/build-presets.d.ts +81 -0
  182. package/dist/constants/build-presets.js +219 -0
  183. package/dist/constants/build-presets.js.map +1 -0
  184. package/dist/constants/build.d.ts +5 -0
  185. package/dist/constants/build.js +71 -0
  186. package/dist/constants/build.js.map +1 -0
  187. package/dist/constants/colors.d.ts +4 -0
  188. package/dist/constants/colors.js +29 -0
  189. package/dist/constants/colors.js.map +1 -0
  190. package/dist/constants/dts.d.ts +4 -0
  191. package/dist/constants/dts.js +45 -0
  192. package/dist/constants/dts.js.map +1 -0
  193. package/dist/constants/file.d.ts +3 -0
  194. package/dist/constants/file.js +29 -0
  195. package/dist/constants/file.js.map +1 -0
  196. package/dist/constants/legacy-build-presets.d.ts +13 -0
  197. package/dist/constants/legacy-build-presets.js +189 -0
  198. package/dist/constants/legacy-build-presets.js.map +1 -0
  199. package/dist/constants/log.d.ts +8 -0
  200. package/dist/constants/log.js +36 -0
  201. package/dist/constants/log.js.map +1 -0
  202. package/dist/dev.d.ts +10 -0
  203. package/dist/dev.js +135 -0
  204. package/dist/dev.js.map +1 -0
  205. package/dist/{types/features/build/error.d.ts → error.d.ts} +1 -1
  206. package/dist/error.js +139 -0
  207. package/dist/error.js.map +1 -0
  208. package/dist/hooks/build.d.ts +22 -0
  209. package/dist/hooks/build.js +35 -0
  210. package/dist/hooks/build.js.map +1 -0
  211. package/dist/hooks/dev.d.ts +12 -0
  212. package/dist/hooks/dev.js +33 -0
  213. package/dist/hooks/dev.js.map +1 -0
  214. package/dist/hooks/index.d.ts +29 -0
  215. package/dist/hooks/index.js +44 -0
  216. package/dist/hooks/index.js.map +1 -0
  217. package/dist/hooks/misc.d.ts +5 -0
  218. package/dist/hooks/misc.js +29 -0
  219. package/dist/hooks/misc.js.map +1 -0
  220. package/dist/index.d.ts +5 -0
  221. package/dist/index.js +32 -0
  222. package/dist/index.js.map +1 -0
  223. package/dist/{types/locale → locale}/en.d.ts +0 -0
  224. package/dist/locale/en.js +47 -0
  225. package/dist/locale/en.js.map +1 -0
  226. package/dist/{types/locale → locale}/index.d.ts +0 -0
  227. package/dist/locale/index.js +34 -0
  228. package/dist/locale/index.js.map +1 -0
  229. package/dist/{types/locale → locale}/zh.d.ts +0 -0
  230. package/dist/locale/zh.js +47 -0
  231. package/dist/locale/zh.js.map +1 -0
  232. package/dist/plugins.d.ts +2 -0
  233. package/dist/plugins.js +51 -0
  234. package/dist/plugins.js.map +1 -0
  235. package/dist/types/color.d.ts +1 -0
  236. package/dist/{js/modern/features/build/types.js → types/color.js} +0 -0
  237. package/dist/types/command.d.ts +11 -0
  238. package/dist/{js/modern/schema/types.js → types/command.js} +0 -0
  239. package/dist/types/config/index.d.ts +95 -0
  240. package/dist/types/config/index.js +19 -0
  241. package/dist/types/config/index.js.map +1 -0
  242. package/dist/types/config/style.d.ts +12 -0
  243. package/dist/{js/modern/types.js → types/config/style.js} +0 -0
  244. package/dist/types/context.d.ts +5 -0
  245. package/dist/{js/node/features/build/types.js → types/context.js} +0 -0
  246. package/dist/types/copy.d.ts +15 -0
  247. package/dist/{js/node/schema/types.js → types/copy.js} +0 -0
  248. package/dist/types/{utils/tsconfig.d.ts → dts.d.ts} +11 -3
  249. package/dist/{js/node/types.js → types/dts.js} +0 -0
  250. package/dist/types/hooks.d.ts +25 -0
  251. package/dist/types/hooks.js +0 -0
  252. package/dist/types/index.d.ts +17 -6
  253. package/dist/types/index.js +23 -0
  254. package/dist/types/index.js.map +1 -0
  255. package/dist/types/utils.d.ts +7 -0
  256. package/dist/types/utils.js +0 -0
  257. package/dist/utils/builder.d.ts +8 -0
  258. package/dist/utils/builder.js +117 -0
  259. package/dist/utils/builder.js.map +1 -0
  260. package/dist/utils/config.d.ts +6 -0
  261. package/dist/utils/config.js +172 -0
  262. package/dist/utils/config.js.map +1 -0
  263. package/dist/utils/context.d.ts +7 -0
  264. package/dist/utils/context.js +68 -0
  265. package/dist/utils/context.js.map +1 -0
  266. package/dist/utils/dts.d.ts +14 -0
  267. package/dist/utils/dts.js +197 -0
  268. package/dist/utils/dts.js.map +1 -0
  269. package/dist/utils/input.d.ts +16 -0
  270. package/dist/utils/input.js +124 -0
  271. package/dist/utils/input.js.map +1 -0
  272. package/dist/utils/language.d.ts +2 -0
  273. package/dist/utils/language.js +75 -0
  274. package/dist/utils/language.js.map +1 -0
  275. package/dist/utils/libuild-plugins.d.ts +6 -0
  276. package/dist/utils/libuild-plugins.js +90 -0
  277. package/dist/utils/libuild-plugins.js.map +1 -0
  278. package/dist/utils/log.d.ts +2 -0
  279. package/dist/utils/log.js +76 -0
  280. package/dist/utils/log.js.map +1 -0
  281. package/dist/utils/onExit.d.ts +1 -0
  282. package/dist/utils/onExit.js +71 -0
  283. package/dist/utils/onExit.js.map +1 -0
  284. package/dist/utils/path.d.ts +1 -0
  285. package/dist/utils/path.js +73 -0
  286. package/dist/utils/path.js.map +1 -0
  287. package/dist/utils/style.d.ts +31 -0
  288. package/dist/utils/style.js +134 -0
  289. package/dist/utils/style.js.map +1 -0
  290. package/dist/{types/utils/tspaths-transform/index.d.ts → utils/tspaths-transform.d.ts} +0 -0
  291. package/dist/utils/tspaths-transform.js +115 -0
  292. package/dist/utils/tspaths-transform.js.map +1 -0
  293. package/package.json +47 -73
  294. package/dist/js/modern/cli/build.js +0 -11
  295. package/dist/js/modern/cli/dev.js +0 -11
  296. package/dist/js/modern/cli/index.js +0 -3
  297. package/dist/js/modern/cli/new.js +0 -13
  298. package/dist/js/modern/commands/build.js +0 -69
  299. package/dist/js/modern/commands/dev.js +0 -43
  300. package/dist/js/modern/commands/index.js +0 -2
  301. package/dist/js/modern/features/build/build-platform.js +0 -69
  302. package/dist/js/modern/features/build/bundle/index.js +0 -9
  303. package/dist/js/modern/features/build/bundle/runRollup.js +0 -136
  304. package/dist/js/modern/features/build/bundle/runSpeedy.js +0 -176
  305. package/dist/js/modern/features/build/bundleless/copy-assets.js +0 -75
  306. package/dist/js/modern/features/build/bundleless/generator-dts/index.js +0 -106
  307. package/dist/js/modern/features/build/bundleless/generator-dts/utils.js +0 -94
  308. package/dist/js/modern/features/build/bundleless/index.js +0 -21
  309. package/dist/js/modern/features/build/bundleless/runBabel.js +0 -242
  310. package/dist/js/modern/features/build/bundleless/style.js +0 -241
  311. package/dist/js/modern/features/build/constants.js +0 -98
  312. package/dist/js/modern/features/build/error.js +0 -127
  313. package/dist/js/modern/features/build/index.js +0 -117
  314. package/dist/js/modern/features/build/legacy-constants.js +0 -103
  315. package/dist/js/modern/features/build/logger/index.js +0 -2
  316. package/dist/js/modern/features/build/logger/logText.js +0 -56
  317. package/dist/js/modern/features/build/logger/loggerManager.js +0 -93
  318. package/dist/js/modern/features/build/normalize.js +0 -277
  319. package/dist/js/modern/features/build/utils.js +0 -92
  320. package/dist/js/modern/features/dev/index.js +0 -47
  321. package/dist/js/modern/hooks/build.js +0 -20
  322. package/dist/js/modern/hooks/dev.js +0 -14
  323. package/dist/js/modern/hooks/index.js +0 -15
  324. package/dist/js/modern/index.js +0 -63
  325. package/dist/js/modern/locale/en.js +0 -25
  326. package/dist/js/modern/locale/index.js +0 -10
  327. package/dist/js/modern/locale/zh.js +0 -25
  328. package/dist/js/modern/schema/build-config.js +0 -117
  329. package/dist/js/modern/schema/index.js +0 -4
  330. package/dist/js/modern/schema/output.js +0 -45
  331. package/dist/js/modern/schema/source.js +0 -7
  332. package/dist/js/modern/schema/tools.js +0 -6
  333. package/dist/js/modern/utils/babel.js +0 -84
  334. package/dist/js/modern/utils/color.js +0 -2
  335. package/dist/js/modern/utils/constants.js +0 -3
  336. package/dist/js/modern/utils/copy.js +0 -70
  337. package/dist/js/modern/utils/init-env.js +0 -13
  338. package/dist/js/modern/utils/json.js +0 -13
  339. package/dist/js/modern/utils/language.js +0 -6
  340. package/dist/js/modern/utils/logger.js +0 -96
  341. package/dist/js/modern/utils/readline.js +0 -17
  342. package/dist/js/modern/utils/tsconfig.js +0 -13
  343. package/dist/js/modern/utils/tspaths-transform/constants.js +0 -5
  344. package/dist/js/modern/utils/tspaths-transform/index.js +0 -113
  345. package/dist/js/modern/utils/tspaths-transform/utils.js +0 -18
  346. package/dist/js/modern/utils/valide.js +0 -26
  347. package/dist/js/node/cli/build.js +0 -18
  348. package/dist/js/node/cli/dev.js +0 -18
  349. package/dist/js/node/cli/index.js +0 -38
  350. package/dist/js/node/cli/new.js +0 -20
  351. package/dist/js/node/commands/build.js +0 -80
  352. package/dist/js/node/commands/dev.js +0 -52
  353. package/dist/js/node/commands/index.js +0 -19
  354. package/dist/js/node/features/build/build-platform.js +0 -76
  355. package/dist/js/node/features/build/bundle/index.js +0 -17
  356. package/dist/js/node/features/build/bundle/runRollup.js +0 -145
  357. package/dist/js/node/features/build/bundle/runSpeedy.js +0 -186
  358. package/dist/js/node/features/build/bundleless/copy-assets.js +0 -84
  359. package/dist/js/node/features/build/bundleless/generator-dts/index.js +0 -114
  360. package/dist/js/node/features/build/bundleless/generator-dts/utils.js +0 -105
  361. package/dist/js/node/features/build/bundleless/index.js +0 -29
  362. package/dist/js/node/features/build/bundleless/runBabel.js +0 -255
  363. package/dist/js/node/features/build/bundleless/style.js +0 -254
  364. package/dist/js/node/features/build/constants.js +0 -116
  365. package/dist/js/node/features/build/error.js +0 -139
  366. package/dist/js/node/features/build/index.js +0 -128
  367. package/dist/js/node/features/build/legacy-constants.js +0 -111
  368. package/dist/js/node/features/build/logger/index.js +0 -27
  369. package/dist/js/node/features/build/logger/logText.js +0 -66
  370. package/dist/js/node/features/build/logger/loggerManager.js +0 -95
  371. package/dist/js/node/features/build/normalize.js +0 -288
  372. package/dist/js/node/features/build/utils.js +0 -107
  373. package/dist/js/node/features/dev/index.js +0 -56
  374. package/dist/js/node/hooks/build.js +0 -32
  375. package/dist/js/node/hooks/dev.js +0 -24
  376. package/dist/js/node/hooks/index.js +0 -36
  377. package/dist/js/node/index.js +0 -83
  378. package/dist/js/node/locale/en.js +0 -32
  379. package/dist/js/node/locale/index.js +0 -17
  380. package/dist/js/node/locale/zh.js +0 -32
  381. package/dist/js/node/schema/build-config.js +0 -126
  382. package/dist/js/node/schema/index.js +0 -11
  383. package/dist/js/node/schema/output.js +0 -52
  384. package/dist/js/node/schema/source.js +0 -14
  385. package/dist/js/node/schema/tools.js +0 -13
  386. package/dist/js/node/utils/babel.js +0 -93
  387. package/dist/js/node/utils/color.js +0 -9
  388. package/dist/js/node/utils/constants.js +0 -11
  389. package/dist/js/node/utils/copy.js +0 -79
  390. package/dist/js/node/utils/init-env.js +0 -20
  391. package/dist/js/node/utils/json.js +0 -20
  392. package/dist/js/node/utils/language.js +0 -12
  393. package/dist/js/node/utils/logger.js +0 -107
  394. package/dist/js/node/utils/readline.js +0 -25
  395. package/dist/js/node/utils/tsconfig.js +0 -21
  396. package/dist/js/node/utils/tspaths-transform/constants.js +0 -12
  397. package/dist/js/node/utils/tspaths-transform/index.js +0 -123
  398. package/dist/js/node/utils/tspaths-transform/utils.js +0 -25
  399. package/dist/js/node/utils/valide.js +0 -34
  400. package/dist/types/cli/build.d.ts +0 -3
  401. package/dist/types/cli/dev.d.ts +0 -3
  402. package/dist/types/cli/index.d.ts +0 -3
  403. package/dist/types/cli/new.d.ts +0 -2
  404. package/dist/types/commands/build.d.ts +0 -17
  405. package/dist/types/commands/dev.d.ts +0 -5
  406. package/dist/types/commands/index.d.ts +0 -2
  407. package/dist/types/features/build/build-platform.d.ts +0 -7
  408. package/dist/types/features/build/bundle/index.d.ts +0 -3
  409. package/dist/types/features/build/bundle/runRollup.d.ts +0 -3
  410. package/dist/types/features/build/bundle/runSpeedy.d.ts +0 -10
  411. package/dist/types/features/build/bundleless/copy-assets.d.ts +0 -3
  412. package/dist/types/features/build/bundleless/generator-dts/index.d.ts +0 -3
  413. package/dist/types/features/build/bundleless/generator-dts/utils.d.ts +0 -21
  414. package/dist/types/features/build/bundleless/index.d.ts +0 -4
  415. package/dist/types/features/build/bundleless/runBabel.d.ts +0 -32
  416. package/dist/types/features/build/bundleless/style.d.ts +0 -25
  417. package/dist/types/features/build/constants.d.ts +0 -18
  418. package/dist/types/features/build/index.d.ts +0 -12
  419. package/dist/types/features/build/legacy-constants.d.ts +0 -8
  420. package/dist/types/features/build/logger/index.d.ts +0 -2
  421. package/dist/types/features/build/logger/logText.d.ts +0 -39
  422. package/dist/types/features/build/logger/loggerManager.d.ts +0 -40
  423. package/dist/types/features/build/normalize.d.ts +0 -19
  424. package/dist/types/features/build/types.d.ts +0 -15
  425. package/dist/types/features/build/utils.d.ts +0 -36
  426. package/dist/types/features/dev/index.d.ts +0 -9
  427. package/dist/types/hooks/build.d.ts +0 -46
  428. package/dist/types/hooks/dev.d.ts +0 -20
  429. package/dist/types/hooks/index.d.ts +0 -30
  430. package/dist/types/schema/build-config.d.ts +0 -205
  431. package/dist/types/schema/index.d.ts +0 -217
  432. package/dist/types/schema/output.d.ts +0 -215
  433. package/dist/types/schema/source.d.ts +0 -6
  434. package/dist/types/schema/tools.d.ts +0 -6
  435. package/dist/types/schema/types.d.ts +0 -45
  436. package/dist/types/types.d.ts +0 -51
  437. package/dist/types/utils/babel.d.ts +0 -8
  438. package/dist/types/utils/color.d.ts +0 -2
  439. package/dist/types/utils/constants.d.ts +0 -2
  440. package/dist/types/utils/copy.d.ts +0 -5
  441. package/dist/types/utils/init-env.d.ts +0 -21
  442. package/dist/types/utils/json.d.ts +0 -4
  443. package/dist/types/utils/language.d.ts +0 -1
  444. package/dist/types/utils/logger.d.ts +0 -58
  445. package/dist/types/utils/readline.d.ts +0 -9
  446. package/dist/types/utils/tspaths-transform/constants.d.ts +0 -1
  447. package/dist/types/utils/tspaths-transform/utils.d.ts +0 -4
  448. package/dist/types/utils/valide.d.ts +0 -12
  449. package/types.d.ts +0 -1
@@ -0,0 +1,435 @@
1
+ import {FileImporter, Importer} from './importer';
2
+ import {Logger} from './logger';
3
+ import {Value} from './value';
4
+ import {PromiseOr} from './util/promise_or';
5
+
6
+ /**
7
+ * Syntaxes supported by Sass:
8
+ *
9
+ * - `'scss'` is the [SCSS
10
+ * syntax](https://sass-lang.com/documentation/syntax#scss).
11
+ * - `'indented'` is the [indented
12
+ * syntax](https://sass-lang.com/documentation/syntax#the-indented-syntax)
13
+ * - `'css'` is plain CSS, which is parsed like SCSS but forbids the use of any
14
+ * special Sass features.
15
+ *
16
+ * @category Options
17
+ */
18
+ export type Syntax = 'scss' | 'indented' | 'css';
19
+
20
+ /**
21
+ * Possible output styles for the compiled CSS:
22
+ *
23
+ * - `"expanded"` (the default for Dart Sass) writes each selector and
24
+ * declaration on its own line.
25
+ *
26
+ * - `"compressed"` removes as many extra characters as possible, and writes
27
+ * the entire stylesheet on a single line.
28
+ *
29
+ * @category Options
30
+ */
31
+ export type OutputStyle = 'expanded' | 'compressed';
32
+
33
+ /**
34
+ * A callback that implements a custom Sass function. This can be passed to
35
+ * [[Options.functions]].
36
+ *
37
+ * ```js
38
+ * const result = sass.compile('style.scss', {
39
+ * functions: {
40
+ * "sum($arg1, $arg2)": (args) => {
41
+ * const arg1 = args[0].assertNumber('arg1');
42
+ * const value1 = arg1.value;
43
+ * const value2 = args[1].assertNumber('arg2')
44
+ * .convertValueToMatch(arg1, 'arg2', 'arg1');
45
+ * return new sass.SassNumber(value1 + value2).coerceToMatch(arg1);
46
+ * }
47
+ * }
48
+ * });
49
+ * ```
50
+ *
51
+ * @typeParam sync - A `CustomFunction<'sync'>` must return synchronously, but
52
+ * in return it can be passed to [[compile]] and [[compileString]] in addition
53
+ * to [[compileAsync]] and [[compileStringAsync]].
54
+ *
55
+ * A `CustomFunction<'async'>` may either return synchronously or
56
+ * asynchronously, but it can only be used with [[compileAsync]] and
57
+ * [[compileStringAsync]].
58
+ *
59
+ * @param args - An array of arguments passed by the function's caller. If the
60
+ * function takes [arbitrary
61
+ * arguments](https://sass-lang.com/documentation/at-rules/function#taking-arbitrary-arguments),
62
+ * the last element will be a [[SassArgumentList]].
63
+ *
64
+ * @returns The function's result. This may be in the form of a `Promise`, but
65
+ * if it is the function may only be passed to [[compileAsync]] and
66
+ * [[compileStringAsync]], not [[compile]] or [[compileString]].
67
+ *
68
+ * @throws any - This function may throw an error, which the Sass compiler will
69
+ * treat as the function call failing. If the exception object has a `message`
70
+ * property, it will be used as the wrapped exception's message; otherwise, the
71
+ * exception object's `toString()` will be used. This means it's safe for custom
72
+ * functions to throw plain strings.
73
+ *
74
+ * @category Custom Function
75
+ */
76
+ export type CustomFunction<sync extends 'sync' | 'async'> = (
77
+ args: Value[]
78
+ ) => PromiseOr<Value, sync>;
79
+
80
+ /**
81
+ * Options that can be passed to [[compile]], [[compileAsync]],
82
+ * [[compileString]], or [[compileStringAsync]].
83
+ *
84
+ * @typeParam sync - This lets the TypeScript checker verify that asynchronous
85
+ * [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to
86
+ * [[compile]] or [[compileString]].
87
+ *
88
+ * @category Options
89
+ */
90
+ export interface Options<sync extends 'sync' | 'async'> {
91
+ /**
92
+ * If this is `true`, the compiler will exclusively use ASCII characters in
93
+ * its error and warning messages. Otherwise, it may use non-ASCII Unicode
94
+ * characters as well.
95
+ *
96
+ * @defaultValue `false`
97
+ * @category Messages
98
+ */
99
+ alertAscii?: boolean;
100
+
101
+ /**
102
+ * If this is `true`, the compiler will use ANSI color escape codes in its
103
+ * error and warning messages. If it's `false`, it won't use these. If it's
104
+ * undefined, the compiler will determine whether or not to use colors
105
+ * depending on whether the user is using an interactive terminal.
106
+ *
107
+ * @category Messages
108
+ */
109
+ alertColor?: boolean;
110
+
111
+ /**
112
+ * If `true`, the compiler may prepend `@charset "UTF-8";` or U+FEFF
113
+ * (byte-order marker) if it outputs non-ASCII CSS.
114
+ *
115
+ * If `false`, the compiler never emits these byte sequences. This is ideal
116
+ * when concatenating or embedding in HTML `<style>` tags. (The output will
117
+ * still be UTF-8.)
118
+ *
119
+ * @defaultValue `true`
120
+ * @category Output
121
+ * @compatibility dart: "1.54.0", node: false
122
+ */
123
+ charset?: boolean;
124
+
125
+ /**
126
+ * Additional built-in Sass functions that are available in all stylesheets.
127
+ * This option takes an object whose keys are Sass function signatures like
128
+ * you'd write for the [`@function
129
+ * rule`](https://sass-lang.com/documentation/at-rules/function) and whose
130
+ * values are [[CustomFunction]]s.
131
+ *
132
+ * Functions are passed JavaScript representations of [Sass value
133
+ * types](https://sass-lang.com/documentation/js-api#value-types), and must
134
+ * return the same.
135
+ *
136
+ * When writing custom functions, it's important to make them as user-friendly
137
+ * and as close to the standards set by Sass's core functions as possible. Some
138
+ * good guidelines to follow include:
139
+ *
140
+ * * Use `Value.assert*` methods, like [[Value.assertString]], to cast untyped
141
+ * `Value` objects to more specific types. For values that were passed
142
+ * directly as arguments, pass in the argument name as well. This ensures
143
+ * that the user gets good error messages when they pass in the wrong type
144
+ * to your function.
145
+ *
146
+ * * Individual classes may have more specific `assert*` methods, like
147
+ * [[SassNumber.assertInt]], which should be used when possible.
148
+ *
149
+ * * In Sass, every value counts as a list. Rather than trying to detect the
150
+ * [[SassList]] type, you should use [[Value.asList]] to treat all values as
151
+ * lists.
152
+ *
153
+ * * When manipulating values like lists, strings, and numbers that have
154
+ * metadata (comma versus space separated, bracketed versus unbracketed,
155
+ * quoted versus unquoted, units), the output metadata should match the
156
+ * input metadata.
157
+ *
158
+ * * When in doubt, lists should default to comma-separated, strings should
159
+ * default to quoted, and numbers should default to unitless.
160
+ *
161
+ * * In Sass, lists and strings use one-based indexing and use negative
162
+ * indices to index from the end of value. Functions should follow these
163
+ * conventions. [[Value.sassIndexToListIndex]] and
164
+ * [[SassString.sassIndexToStringIndex]] can be used to do this
165
+ * automatically.
166
+ *
167
+ * * String indexes in Sass refer to Unicode code points while JavaScript
168
+ * string indices refer to UTF-16 code units. For example, the character
169
+ * U+1F60A SMILING FACE WITH SMILING EYES is a single Unicode code point but
170
+ * is represented in UTF-16 as two code units (`0xD83D` and `0xDE0A`). So in
171
+ * JavaScript, `"a😊b".charCodeAt(1)` returns `0xD83D`, whereas in Sass
172
+ * `str-slice("a😊b", 1, 1)` returns `"😊"`. Functions should follow Sass's
173
+ * convention. [[SassString.sassIndexToStringIndex]] can be used to do this
174
+ * automatically, and the [[SassString.sassLength]] getter can be used to
175
+ * access a string's length in code points.
176
+ *
177
+ * @example
178
+ *
179
+ * ```js
180
+ * sass.compileString(`
181
+ * h1 {
182
+ * font-size: pow(2, 5) * 1px;
183
+ * }`, {
184
+ * functions: {
185
+ * // Note: in real code, you should use `math.pow()` from the built-in
186
+ * // `sass:math` module.
187
+ * 'pow($base, $exponent)': function(args) {
188
+ * const base = args[0].assertNumber('base').assertNoUnits('base');
189
+ * const exponent =
190
+ * args[1].assertNumber('exponent').assertNoUnits('exponent');
191
+ *
192
+ * return new sass.SassNumber(Math.pow(base.value, exponent.value));
193
+ * }
194
+ * }
195
+ * });
196
+ * ```
197
+ *
198
+ * @category Plugins
199
+ */
200
+ functions?: Record<string, CustomFunction<sync>>;
201
+
202
+ /**
203
+ * Custom importers that control how Sass resolves loads from rules like
204
+ * [`@use`](https://sass-lang.com/documentation/at-rules/use) and
205
+ * [`@import`](https://sass-lang.com/documentation/at-rules/import).
206
+ *
207
+ * Loads are resolved by trying, in order:
208
+ *
209
+ * - The importer that was used to load the current stylesheet, with the
210
+ * loaded URL resolved relative to the current stylesheet's canonical URL.
211
+ *
212
+ * - Each [[Importer]] or [[FileImporter]] in [[importers]], in order.
213
+ *
214
+ * - Each load path in [[loadPaths]], in order.
215
+ *
216
+ * If none of these return a Sass file, the load fails and Sass throws an
217
+ * error.
218
+ *
219
+ * @category Plugins
220
+ */
221
+ importers?: (Importer<sync> | FileImporter<sync>)[];
222
+
223
+ /**
224
+ * Paths in which to look for stylesheets loaded by rules like
225
+ * [`@use`](https://sass-lang.com/documentation/at-rules/use) and
226
+ * [`@import`](https://sass-lang.com/documentation/at-rules/import).
227
+ *
228
+ * A load path `loadPath` is equivalent to the following [[FileImporter]]:
229
+ *
230
+ * ```js
231
+ * {
232
+ * findFileUrl(url) {
233
+ * // Load paths only support relative URLs.
234
+ * if (/^[a-z]+:/i.test(url)) return null;
235
+ * return new URL(url, pathToFileURL(loadPath));
236
+ * }
237
+ * }
238
+ * ```
239
+ *
240
+ * @category Input
241
+ */
242
+ loadPaths?: string[];
243
+
244
+ /**
245
+ * An object to use to handle warnings and/or debug messages from Sass.
246
+ *
247
+ * By default, Sass emits warnings and debug messages to standard error, but
248
+ * if [[Logger.warn]] or [[Logger.debug]] is set, this will invoke them
249
+ * instead.
250
+ *
251
+ * The special value [[Logger.silent]] can be used to easily silence all
252
+ * messages.
253
+ *
254
+ * @category Messages
255
+ */
256
+ logger?: Logger;
257
+
258
+ /**
259
+ * If this option is set to `true`, Sass won’t print warnings that are caused
260
+ * by dependencies. A “dependency” is defined as any file that’s loaded
261
+ * through [[loadPaths]] or [[importer]]. Stylesheets that are imported
262
+ * relative to the entrypoint are not considered dependencies.
263
+ *
264
+ * This is useful for silencing deprecation warnings that you can’t fix on
265
+ * your own. However, please <em>also</em> notify your dependencies of the deprecations
266
+ * so that they can get fixed as soon as possible!
267
+ *
268
+ * **Heads up!** If [[compileString]] or [[compileStringAsync]] is called
269
+ * without [[StringWithoutImporter.url]], <em>all</em> stylesheets it loads
270
+ * will be considered dependencies. Since it doesn’t have a path of its own,
271
+ * everything it loads is coming from a load path rather than a relative
272
+ * import.
273
+ *
274
+ * @defaultValue `false`
275
+ * @category Messages
276
+ */
277
+ quietDeps?: boolean;
278
+
279
+ /**
280
+ * Whether or not Sass should generate a source map. If it does, the source
281
+ * map will be available as [[CompileResult.sourceMap]].
282
+ *
283
+ * **Heads up!** Sass doesn't automatically add a `sourceMappingURL` comment
284
+ * to the generated CSS. It's up to callers to do that, since callers have
285
+ * full knowledge of where the CSS and the source map will exist in relation
286
+ * to one another and how they'll be served to the browser.
287
+ *
288
+ * @defaultValue `false`
289
+ * @category Output
290
+ */
291
+ sourceMap?: boolean;
292
+
293
+ /**
294
+ * Whether Sass should include the sources in the generated source map.
295
+ *
296
+ * This option has no effect if [[sourceMap]] is `false`.
297
+ *
298
+ * @defaultValue `false`
299
+ * @category Output
300
+ */
301
+ sourceMapIncludeSources?: boolean;
302
+
303
+ /**
304
+ * The [[OutputStyle]] of the compiled CSS.
305
+ *
306
+ * @example
307
+ *
308
+ * ```js
309
+ * const source = `
310
+ * h1 {
311
+ * font-size: 40px;
312
+ * code {
313
+ * font-face: Roboto Mono;
314
+ * }
315
+ * }`;
316
+ *
317
+ * let result = sass.compileString(source, {style: "expanded"});
318
+ * console.log(result.css.toString());
319
+ * // h1 {
320
+ * // font-size: 40px;
321
+ * // }
322
+ * // h1 code {
323
+ * // font-face: Roboto Mono;
324
+ * // }
325
+ *
326
+ * result = sass.compileString(source, {style: "compressed"})
327
+ * console.log(result.css.toString());
328
+ * // h1{font-size:40px}h1 code{font-face:Roboto Mono}
329
+ * ```
330
+ *
331
+ * @category Output
332
+ */
333
+ style?: OutputStyle;
334
+
335
+ /**
336
+ * By default, Dart Sass will print only five instances of the same
337
+ * deprecation warning per compilation to avoid deluging users in console
338
+ * noise. If you set `verbose` to `true`, it will instead print every
339
+ * deprecation warning it encounters.
340
+ *
341
+ * @defaultValue `false`
342
+ * @category Messages
343
+ */
344
+ verbose?: boolean;
345
+ }
346
+
347
+ /**
348
+ * Options that can be passed to [[compileString]] or [[compileStringAsync]].
349
+ *
350
+ * If the [[StringOptionsWithImporter.importer]] field isn't passed, the
351
+ * entrypoint file can load files relative to itself if a `file://` URL is
352
+ * passed to the [[url]] field.
353
+ *
354
+ * @typeParam sync - This lets the TypeScript checker verify that asynchronous
355
+ * [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to
356
+ * [[compile]] or [[compileString]].
357
+ *
358
+ * @category Options
359
+ */
360
+ export interface StringOptionsWithoutImporter<sync extends 'sync' | 'async'>
361
+ extends Options<sync> {
362
+ /**
363
+ * The [[Syntax]] to use to parse the entrypoint stylesheet.
364
+ *
365
+ * @default `'scss'`
366
+ *
367
+ * @category Input
368
+ */
369
+ syntax?: Syntax;
370
+
371
+ /**
372
+ * The canonical URL of the entrypoint stylesheet.
373
+ *
374
+ * A relative load's URL is first resolved relative to [[url]], then resolved
375
+ * to a file on disk if it's a `file://` URL. If it can't be resolved to a
376
+ * file on disk, it's then passed to [[importers]] and [[loadPaths]].
377
+ *
378
+ * @category Input
379
+ */
380
+ url?: URL;
381
+ }
382
+
383
+ /**
384
+ * Options that can be passed to [[compileString]] or [[compileStringAsync]].
385
+ *
386
+ * If the [[StringOptionsWithImporter.importer]] field is passed, the entrypoint
387
+ * file uses it to load files relative to itself and the [[url]] field is
388
+ * mandatory.
389
+ *
390
+ * @typeParam sync - This lets the TypeScript checker verify that asynchronous
391
+ * [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to
392
+ * [[compile]] or [[compileString]].
393
+ *
394
+ * @category Options
395
+ */
396
+ export interface StringOptionsWithImporter<sync extends 'sync' | 'async'>
397
+ extends StringOptionsWithoutImporter<sync> {
398
+ /**
399
+ * The importer to use to handle loads that are relative to the entrypoint
400
+ * stylesheet.
401
+ *
402
+ * A relative load's URL is first resolved relative to [[url]], then passed to
403
+ * [[importer]]. If the importer doesn't recognize it, it's then passed to
404
+ * [[importers]] and [[loadPaths]].
405
+ *
406
+ * @category Input
407
+ */
408
+ importer: Importer<sync> | FileImporter<sync>;
409
+
410
+ /**
411
+ * The canonical URL of the entrypoint stylesheet. If this is passed along
412
+ * with [[importer]], it's used to resolve relative loads in the entrypoint
413
+ * stylesheet.
414
+ *
415
+ * @category Input
416
+ */
417
+ url: URL;
418
+ }
419
+
420
+ /**
421
+ * Options that can be passed to [[compileString]] or [[compileStringAsync]].
422
+ *
423
+ * This is a [[StringOptionsWithImporter]] if it has a
424
+ * [[StringOptionsWithImporter.importer]] field, and a
425
+ * [[StringOptionsWithoutImporter]] otherwise.
426
+ *
427
+ * @typeParam sync - This lets the TypeScript checker verify that asynchronous
428
+ * [[Importer]]s, [[FileImporter]]s, and [[CustomFunction]]s aren't passed to
429
+ * [[compile]] or [[compileString]].
430
+ *
431
+ * @category Options
432
+ */
433
+ export type StringOptions<sync extends 'sync' | 'async'> =
434
+ | StringOptionsWithImporter<sync>
435
+ | StringOptionsWithoutImporter<sync>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * A utility type for choosing between synchronous and asynchronous return
3
+ * values.
4
+ *
5
+ * This is used as the return value for plugins like [[CustomFunction]],
6
+ * [[Importer]], and [[FileImporter]] so that TypeScript enforces that
7
+ * asynchronous plugins are only passed to [[compileAsync]] and
8
+ * [[compileStringAsync]], not [[compile]] or [[compileString]].
9
+ *
10
+ * @typeParam sync - If this is `'sync'`, this can only be a `T`. If it's
11
+ * `'async'`, this can be either a `T` or a `Promise<T>`.
12
+ *
13
+ * @category Other
14
+ */
15
+ export type PromiseOr<T, sync extends 'sync' | 'async'> = sync extends 'async'
16
+ ? T | Promise<T>
17
+ : T;
@@ -0,0 +1,47 @@
1
+ import {List, OrderedMap} from 'immutable';
2
+
3
+ import {Value} from './index';
4
+ import {SassList, ListSeparator} from './list';
5
+
6
+ /**
7
+ * Sass's [argument list
8
+ * type](https://sass-lang.com/documentation/values/lists#argument-lists).
9
+ *
10
+ * An argument list comes from a rest argument. It's distinct from a normal
11
+ * [[SassList]] in that it may contain a keyword map as well as the positional
12
+ * arguments.
13
+ *
14
+ * @category Custom Function
15
+ */
16
+ export class SassArgumentList extends SassList {
17
+ /**
18
+ * Creates a new argument list.
19
+ *
20
+ * @param contents - The positional arguments that make up the primary
21
+ * contents of the list. This may be either a plain JavaScript array or an
22
+ * immutable [[List]] from the [`immutable`
23
+ * package](https://immutable-js.com/).
24
+ *
25
+ * @param keywords - The keyword arguments attached to this argument list,
26
+ * whose names should exclude `$`. This can be either a plain JavaScript
27
+ * object with argument names as fields, or an immutable [[OrderedMap]] from
28
+ * the [`immutable` package](https://immutable-js.com/)
29
+ *
30
+ * @param separator - The separator for this list. Defaults to `','`.
31
+ */
32
+ constructor(
33
+ contents: Value[] | List<Value>,
34
+ keywords: Record<string, Value> | OrderedMap<string, Value>,
35
+ separator?: ListSeparator
36
+ );
37
+
38
+ /**
39
+ * The keyword arguments attached to this argument list.
40
+ *
41
+ * The argument names don't include `$`.
42
+ *
43
+ * @returns An immutable [[OrderedMap]] from the [`immutable`
44
+ * package](https://immutable-js.com/).
45
+ */
46
+ get keywords(): OrderedMap<string, Value>;
47
+ }
@@ -0,0 +1,29 @@
1
+ import {Value} from './index';
2
+
3
+ /**
4
+ * Sass's [`true` value](https://sass-lang.com/documentation/values/booleans).
5
+ *
6
+ * @category Custom Function
7
+ */
8
+ export const sassTrue: SassBoolean;
9
+
10
+ /**
11
+ * Sass's [`false` value](https://sass-lang.com/documentation/values/booleans).
12
+ *
13
+ * @category Custom Function
14
+ */
15
+ export const sassFalse: SassBoolean;
16
+
17
+ /**
18
+ * Sass's [boolean type](https://sass-lang.com/documentation/values/booleans).
19
+ *
20
+ * @category Custom Function
21
+ */
22
+ export class SassBoolean extends Value {
23
+ private constructor();
24
+
25
+ /**
26
+ * Whether this value is `true` or `false`.
27
+ */
28
+ get value(): boolean;
29
+ }
@@ -0,0 +1,107 @@
1
+ import {Value} from './index';
2
+
3
+ /**
4
+ * Sass's [color type](https://sass-lang.com/documentation/values/colors).
5
+ *
6
+ * No matter what representation was originally used to create this color, all
7
+ * of its channels are accessible.
8
+ *
9
+ * @category Custom Function
10
+ */
11
+ export class SassColor extends Value {
12
+ /**
13
+ * Creates an RGB color.
14
+ *
15
+ * @throws `Error` if `red`, `green`, and `blue` aren't between `0` and
16
+ * `255`, or if `alpha` isn't between `0` and `1`.
17
+ */
18
+ constructor(options: {
19
+ red: number;
20
+ green: number;
21
+ blue: number;
22
+ alpha?: number;
23
+ });
24
+
25
+ /**
26
+ * Creates an HSL color.
27
+ *
28
+ * @throws `Error` if `saturation` or `lightness` aren't between `0` and
29
+ * `100`, or if `alpha` isn't between `0` and `1`.
30
+ */
31
+ constructor(options: {
32
+ hue: number;
33
+ saturation: number;
34
+ lightness: number;
35
+ alpha?: number;
36
+ });
37
+
38
+ /**
39
+ * Creates an HWB color.
40
+ *
41
+ * @throws `Error` if `whiteness` or `blackness` aren't between `0` and `100`,
42
+ * or if `alpha` isn't between `0` and `1`.
43
+ */
44
+ constructor(options: {
45
+ hue: number;
46
+ whiteness: number;
47
+ blackness: number;
48
+ alpha?: number;
49
+ });
50
+
51
+ /** This color's red channel, between `0` and `255`. */
52
+ get red(): number;
53
+
54
+ /** This color's green channel, between `0` and `255`. */
55
+ get green(): number;
56
+
57
+ /** This color's blue channel, between `0` and `255`. */
58
+ get blue(): number;
59
+
60
+ /** This color's hue, between `0` and `360`. */
61
+ get hue(): number;
62
+
63
+ /** This color's saturation, between `0` and `100`. */
64
+ get saturation(): number;
65
+
66
+ /** This color's lightness, between `0` and `100`. */
67
+ get lightness(): number;
68
+
69
+ /** This color's whiteness, between `0` and `100`. */
70
+ get whiteness(): number;
71
+
72
+ /** This color's blackness, between `0` and `100`. */
73
+ get blackness(): number;
74
+
75
+ /** This color's alpha channel, between `0` and `1`. */
76
+ get alpha(): number;
77
+
78
+ /**
79
+ * Changes one or more of this color's RGB channels and returns the result.
80
+ */
81
+ change(options: {
82
+ red?: number;
83
+ green?: number;
84
+ blue?: number;
85
+ alpha?: number;
86
+ }): SassColor;
87
+
88
+ /**
89
+ * Changes one or more of this color's HSL channels and returns the result.
90
+ */
91
+ change(options: {
92
+ hue?: number;
93
+ saturation?: number;
94
+ lightness?: number;
95
+ alpha?: number;
96
+ }): SassColor;
97
+
98
+ /**
99
+ * Changes one or more of this color's HWB channels and returns the result.
100
+ */
101
+ change(options: {
102
+ hue?: number;
103
+ whiteness?: number;
104
+ blackness?: number;
105
+ alpha?: number;
106
+ }): SassColor;
107
+ }
@@ -0,0 +1,22 @@
1
+ import {Value} from './index';
2
+
3
+ /**
4
+ * Sass's [function type](https://sass-lang.com/documentation/values/functions).
5
+ *
6
+ * **Heads up!** Although first-class Sass functions can be processed by custom
7
+ * functions, there's no way to invoke them outside of a Sass stylesheet.
8
+ *
9
+ * @category Custom Function
10
+ */
11
+ export class SassFunction extends Value {
12
+ /**
13
+ * Creates a new first-class function that can be invoked using
14
+ * [`meta.call()`](https://sass-lang.com/documentation/modules/meta#call).
15
+ *
16
+ * @param signature - The function signature, like you'd write for the
17
+ * [`@function rule`](https://sass-lang.com/documentation/at-rules/function).
18
+ * @param callback - The callback that's invoked when this function is called,
19
+ * just like for a [[CustomFunction]].
20
+ */
21
+ constructor(signature: string, callback: (args: Value[]) => Value);
22
+ }