@histoire/vendors 0.8.4 → 0.9.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 (254) hide show
  1. package/dist/client/b-floating-vue.d.ts +3 -0
  2. package/dist/client/{floating-vue.js → b-floating-vue.js} +1 -1
  3. package/dist/client/b-iconify.d.ts +1 -0
  4. package/dist/client/{iconify.js → b-iconify.js} +0 -0
  5. package/dist/client/b-pinia.d.ts +1 -0
  6. package/dist/client/{pinia.js → b-pinia.js} +41 -8
  7. package/dist/client/b-scroll.d.ts +2 -0
  8. package/dist/client/{scroll.js → b-scroll.js} +1 -1
  9. package/dist/client/b-vue-router.d.ts +1 -0
  10. package/dist/client/{vue-router.js → b-vue-router.js} +279 -158
  11. package/dist/client/b-vue-use.d.ts +1 -0
  12. package/dist/client/{vue-use.js → b-vue-use.js} +1070 -603
  13. package/dist/client/b-vue.d.ts +1 -0
  14. package/dist/client/{vue.js → b-vue.js} +1 -1
  15. package/dist/client/node_modules/@babel/parser/package.json +45 -0
  16. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +214 -0
  17. package/dist/client/node_modules/@floating-ui/core/index.d.ts +1 -0
  18. package/dist/client/node_modules/@floating-ui/core/package.json +70 -0
  19. package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +1 -0
  20. package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +4 -0
  21. package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +2 -0
  22. package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +9 -0
  23. package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +4 -0
  24. package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +11 -0
  25. package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +6 -0
  26. package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +9 -0
  27. package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +10 -0
  28. package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +2 -0
  29. package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +5 -0
  30. package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +21 -0
  31. package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +32 -0
  32. package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +6 -0
  33. package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +148 -0
  34. package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +2 -0
  35. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +2 -0
  36. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +5 -0
  37. package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +2 -0
  38. package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +2 -0
  39. package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +2 -0
  40. package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +2 -0
  41. package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +2 -0
  42. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +2 -0
  43. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +1 -0
  44. package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +2 -0
  45. package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +2 -0
  46. package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +2 -0
  47. package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +1 -0
  48. package/dist/client/node_modules/@floating-ui/dom/index.d.ts +1 -0
  49. package/dist/client/node_modules/@floating-ui/dom/package.json +75 -0
  50. package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +7 -0
  51. package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +2 -0
  52. package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +27 -0
  53. package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +1 -0
  54. package/dist/client/node_modules/@floating-ui/dom/src/utils/convertOffsetParentRelativeRectToViewportRelativeRect.d.ts +6 -0
  55. package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +2 -0
  56. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +6 -0
  57. package/dist/client/node_modules/@floating-ui/dom/src/utils/getComputedStyle.d.ts +1 -0
  58. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +2 -0
  59. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentElement.d.ts +1 -0
  60. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentRect.d.ts +2 -0
  61. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeName.d.ts +1 -0
  62. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeScroll.d.ts +2 -0
  63. package/dist/client/node_modules/@floating-ui/dom/src/utils/getOffsetParent.d.ts +1 -0
  64. package/dist/client/node_modules/@floating-ui/dom/src/utils/getParentNode.d.ts +1 -0
  65. package/dist/client/node_modules/@floating-ui/dom/src/utils/getRectRelativeToOffsetParent.d.ts +2 -0
  66. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +1 -0
  67. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +1 -0
  68. package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -0
  69. package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -0
  70. package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +15 -0
  71. package/dist/client/node_modules/@floating-ui/dom/src/utils/math.d.ts +3 -0
  72. package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +2 -0
  73. package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +680 -0
  74. package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +347 -0
  75. package/dist/client/node_modules/@iconify/vue/offline/package.json +14 -0
  76. package/dist/client/node_modules/@iconify/vue/package.json +61 -0
  77. package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +176 -0
  78. package/dist/client/node_modules/@types/web-bluetooth/package.json +40 -0
  79. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +1198 -0
  80. package/dist/client/node_modules/@vue/compiler-core/package.json +43 -0
  81. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +66 -0
  82. package/dist/client/node_modules/@vue/compiler-dom/package.json +43 -0
  83. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +321 -0
  84. package/dist/client/node_modules/@vue/compiler-sfc/package.json +59 -0
  85. package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +6 -0
  86. package/dist/client/node_modules/@vue/compiler-ssr/package.json +34 -0
  87. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/api.d.ts +108 -0
  88. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/app.d.ts +1 -0
  89. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/component.d.ts +77 -0
  90. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/context.d.ts +5 -0
  91. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/hooks.d.ts +179 -0
  92. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/index.d.ts +6 -0
  93. package/dist/client/node_modules/@vue/devtools-api/lib/esm/api/util.d.ts +4 -0
  94. package/dist/client/node_modules/@vue/devtools-api/lib/esm/const.d.ts +2 -0
  95. package/dist/client/node_modules/@vue/devtools-api/lib/esm/env.d.ts +15 -0
  96. package/dist/client/node_modules/@vue/devtools-api/lib/esm/index.d.ts +18 -0
  97. package/dist/client/node_modules/@vue/devtools-api/lib/esm/plugin.d.ts +47 -0
  98. package/dist/client/node_modules/@vue/devtools-api/lib/esm/proxy.d.ts +20 -0
  99. package/dist/client/node_modules/@vue/devtools-api/lib/esm/time.d.ts +2 -0
  100. package/dist/client/node_modules/@vue/devtools-api/package.json +37 -0
  101. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +347 -0
  102. package/dist/client/node_modules/@vue/reactivity/package.json +41 -0
  103. package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +33 -0
  104. package/dist/client/node_modules/@vue/reactivity-transform/package.json +41 -0
  105. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +2018 -0
  106. package/dist/client/node_modules/@vue/runtime-core/package.json +38 -0
  107. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1522 -0
  108. package/dist/client/node_modules/@vue/runtime-dom/package.json +42 -0
  109. package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +100 -0
  110. package/dist/client/node_modules/@vue/server-renderer/package.json +41 -0
  111. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +356 -0
  112. package/dist/client/node_modules/@vue/shared/package.json +33 -0
  113. package/dist/client/node_modules/@vueuse/core/index.d.ts +4305 -0
  114. package/dist/client/node_modules/@vueuse/core/metadata.d.ts +1 -0
  115. package/dist/client/node_modules/@vueuse/core/node_modules/@vueuse/shared/index.d.ts +874 -0
  116. package/dist/client/node_modules/@vueuse/core/node_modules/@vueuse/shared/package.json +50 -0
  117. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/index.d.ts +22 -0
  118. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v2/index.d.ts +31 -0
  119. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v2.7/index.d.ts +52 -0
  120. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/lib/v3/index.d.ts +22 -0
  121. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +47 -0
  122. package/dist/client/node_modules/@vueuse/core/package.json +59 -0
  123. package/dist/client/node_modules/@vueuse/metadata/index.d.ts +75 -0
  124. package/dist/client/node_modules/@vueuse/metadata/package.json +39 -0
  125. package/dist/client/node_modules/compute-scroll-into-view/package.json +90 -0
  126. package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +19 -0
  127. package/dist/client/node_modules/csstype/index.d.ts +38372 -0
  128. package/dist/client/node_modules/csstype/package.json +57 -0
  129. package/dist/client/node_modules/estree-walker/dist/esm/package.json +1 -0
  130. package/dist/client/node_modules/estree-walker/package.json +37 -0
  131. package/dist/client/node_modules/estree-walker/src/package.json +1 -0
  132. package/dist/client/node_modules/estree-walker/types/async.d.ts +53 -0
  133. package/dist/client/node_modules/estree-walker/types/index.d.ts +56 -0
  134. package/dist/client/node_modules/estree-walker/types/sync.d.ts +53 -0
  135. package/dist/client/node_modules/estree-walker/types/walker.d.ts +37 -0
  136. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +25 -0
  137. package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +25 -0
  138. package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +374 -0
  139. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +366 -0
  140. package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +48 -0
  141. package/dist/client/node_modules/floating-vue/dist/components/PopperMethods.d.ts +9 -0
  142. package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +28 -0
  143. package/dist/client/node_modules/floating-vue/dist/components/ThemeClass.d.ts +6 -0
  144. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +25 -0
  145. package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +28 -0
  146. package/dist/client/node_modules/floating-vue/dist/config.d.ts +11 -0
  147. package/dist/client/node_modules/floating-vue/dist/directives/v-close-popper.d.ts +13 -0
  148. package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.d.ts +27 -0
  149. package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.spec.d.ts +1 -0
  150. package/dist/client/node_modules/floating-vue/dist/index.d.ts +414 -0
  151. package/dist/client/node_modules/floating-vue/dist/util/assign-deep.d.ts +1 -0
  152. package/dist/client/node_modules/floating-vue/dist/util/env.d.ts +2 -0
  153. package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +12 -0
  154. package/dist/client/node_modules/floating-vue/dist/util/frame.d.ts +1 -0
  155. package/dist/client/node_modules/floating-vue/dist/util/lang.d.ts +1 -0
  156. package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +3 -0
  157. package/dist/client/node_modules/floating-vue/package.json +71 -0
  158. package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +1 -0
  159. package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +5 -0
  160. package/dist/client/node_modules/magic-string/index.d.ts +221 -0
  161. package/dist/client/node_modules/magic-string/package.json +52 -0
  162. package/dist/client/node_modules/nanoid/async/index.d.ts +56 -0
  163. package/dist/client/node_modules/nanoid/async/package.json +12 -0
  164. package/dist/client/node_modules/nanoid/index.d.ts +91 -0
  165. package/dist/client/node_modules/nanoid/non-secure/index.d.ts +33 -0
  166. package/dist/client/node_modules/nanoid/non-secure/package.json +6 -0
  167. package/dist/client/node_modules/nanoid/package.json +60 -0
  168. package/dist/client/node_modules/nanoid/url-alphabet/package.json +6 -0
  169. package/dist/client/node_modules/picocolors/package.json +25 -0
  170. package/dist/client/node_modules/picocolors/picocolors.d.ts +5 -0
  171. package/dist/client/node_modules/pinia/dist/pinia.d.ts +963 -0
  172. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +22 -0
  173. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +31 -0
  174. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +52 -0
  175. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +22 -0
  176. package/dist/client/node_modules/pinia/node_modules/vue-demi/package.json +47 -0
  177. package/dist/client/node_modules/pinia/package.json +101 -0
  178. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +106 -0
  179. package/dist/client/node_modules/postcss/lib/comment.d.ts +56 -0
  180. package/dist/client/node_modules/postcss/lib/container.d.ts +442 -0
  181. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +239 -0
  182. package/dist/client/node_modules/postcss/lib/declaration.d.ts +124 -0
  183. package/dist/client/node_modules/postcss/lib/document.d.ts +57 -0
  184. package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +5 -0
  185. package/dist/client/node_modules/postcss/lib/input.d.ts +150 -0
  186. package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +176 -0
  187. package/dist/client/node_modules/postcss/lib/list.d.ts +51 -0
  188. package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +37 -0
  189. package/dist/client/node_modules/postcss/lib/node.d.ts +478 -0
  190. package/dist/client/node_modules/postcss/lib/parse.d.ts +5 -0
  191. package/dist/client/node_modules/postcss/lib/postcss.d.ts +473 -0
  192. package/dist/client/node_modules/postcss/lib/previous-map.d.ts +72 -0
  193. package/dist/client/node_modules/postcss/lib/processor.d.ts +102 -0
  194. package/dist/client/node_modules/postcss/lib/result.d.ts +196 -0
  195. package/dist/client/node_modules/postcss/lib/root.d.ts +73 -0
  196. package/dist/client/node_modules/postcss/lib/rule.d.ts +104 -0
  197. package/dist/client/node_modules/postcss/lib/stringifier.d.ts +37 -0
  198. package/dist/client/node_modules/postcss/lib/stringify.d.ts +5 -0
  199. package/dist/client/node_modules/postcss/lib/warning.d.ts +138 -0
  200. package/dist/client/node_modules/postcss/package.json +85 -0
  201. package/dist/client/node_modules/scroll-into-view-if-needed/package.json +144 -0
  202. package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +13 -0
  203. package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +19 -0
  204. package/dist/client/node_modules/source-map/package.json +73 -0
  205. package/dist/client/node_modules/source-map/source-map.d.ts +98 -0
  206. package/dist/client/node_modules/source-map-js/package.json +71 -0
  207. package/dist/client/node_modules/source-map-js/source-map.d.ts +115 -0
  208. package/dist/client/node_modules/sourcemap-codec/dist/types/sourcemap-codec.d.ts +5 -0
  209. package/dist/client/node_modules/sourcemap-codec/package.json +53 -0
  210. package/dist/client/node_modules/vue/compiler-sfc/index.d.ts +1 -0
  211. package/dist/client/node_modules/vue/compiler-sfc/package.json +5 -0
  212. package/dist/client/node_modules/vue/dist/vue.d.ts +9 -0
  213. package/dist/client/node_modules/vue/macros-global.d.ts +19 -0
  214. package/dist/client/node_modules/vue/macros.d.ts +110 -0
  215. package/dist/client/node_modules/vue/package.json +75 -0
  216. package/dist/client/node_modules/vue/ref-macros.d.ts +2 -0
  217. package/dist/client/node_modules/vue/server-renderer/index.d.ts +1 -0
  218. package/dist/client/node_modules/vue/server-renderer/package.json +5 -0
  219. package/dist/client/node_modules/vue-resize/package.json +77 -0
  220. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +1491 -0
  221. package/dist/client/node_modules/vue-router/package.json +114 -0
  222. package/dist/client/vue.runtime.esm-bundler.js +24 -19
  223. package/entries.js +7 -7
  224. package/floating-vue.d.ts +3 -0
  225. package/iconify.d.ts +3 -0
  226. package/package.json +13 -4
  227. package/pinia.d.ts +3 -0
  228. package/rollup.config.mjs +116 -0
  229. package/scroll.d.ts +3 -0
  230. package/src/client/b-floating-vue.ts +3 -0
  231. package/src/client/b-iconify.ts +1 -0
  232. package/src/client/b-pinia.ts +1 -0
  233. package/src/client/b-scroll.ts +2 -0
  234. package/src/client/b-vue-router.ts +1 -0
  235. package/src/client/b-vue-use.ts +1 -0
  236. package/src/client/b-vue.ts +1 -0
  237. package/vue-router.d.ts +3 -0
  238. package/vue-use.d.ts +3 -0
  239. package/vue.d.ts +3 -0
  240. package/dist/client/floating-vue.d.ts +0 -2
  241. package/dist/client/iconify.d.ts +0 -1
  242. package/dist/client/pinia.d.ts +0 -1
  243. package/dist/client/scroll.d.ts +0 -1
  244. package/dist/client/vue-router.d.ts +0 -1
  245. package/dist/client/vue-use.d.ts +0 -1
  246. package/dist/client/vue.d.ts +0 -1
  247. package/rollup.config.js +0 -37
  248. package/src/client/floating-vue.ts +0 -2
  249. package/src/client/iconify.ts +0 -1
  250. package/src/client/pinia.ts +0 -1
  251. package/src/client/scroll.ts +0 -1
  252. package/src/client/vue-router.ts +0 -1
  253. package/src/client/vue-use.ts +0 -1
  254. package/src/client/vue.ts +0 -1
@@ -0,0 +1,442 @@
1
+ import Node, { ChildNode, NodeProps, ChildProps } from './node.js'
2
+ import Declaration from './declaration.js'
3
+ import Comment from './comment.js'
4
+ import AtRule from './at-rule.js'
5
+ import Rule from './rule.js'
6
+
7
+ interface ValueOptions {
8
+ /**
9
+ * An array of property names.
10
+ */
11
+ props?: string[]
12
+
13
+ /**
14
+ * String that’s used to narrow down values and speed up the regexp search.
15
+ */
16
+ fast?: string
17
+ }
18
+
19
+ export interface ContainerProps extends NodeProps {
20
+ nodes?: (ChildNode | ChildProps)[]
21
+ }
22
+
23
+ /**
24
+ * The `Root`, `AtRule`, and `Rule` container nodes
25
+ * inherit some common methods to help work with their children.
26
+ *
27
+ * Note that all containers can store any content. If you write a rule inside
28
+ * a rule, PostCSS will parse it.
29
+ */
30
+ export default abstract class Container<
31
+ Child extends Node = ChildNode
32
+ > extends Node {
33
+ /**
34
+ * An array containing the container’s children.
35
+ *
36
+ * ```js
37
+ * const root = postcss.parse('a { color: black }')
38
+ * root.nodes.length //=> 1
39
+ * root.nodes[0].selector //=> 'a'
40
+ * root.nodes[0].nodes[0].prop //=> 'color'
41
+ * ```
42
+ */
43
+ nodes: Child[]
44
+
45
+ /**
46
+ * The container’s first child.
47
+ *
48
+ * ```js
49
+ * rule.first === rules.nodes[0]
50
+ * ```
51
+ */
52
+ get first(): Child | undefined
53
+
54
+ /**
55
+ * The container’s last child.
56
+ *
57
+ * ```js
58
+ * rule.last === rule.nodes[rule.nodes.length - 1]
59
+ * ```
60
+ */
61
+ get last(): Child | undefined
62
+
63
+ /**
64
+ * Iterates through the container’s immediate children,
65
+ * calling `callback` for each child.
66
+ *
67
+ * Returning `false` in the callback will break iteration.
68
+ *
69
+ * This method only iterates through the container’s immediate children.
70
+ * If you need to recursively iterate through all the container’s descendant
71
+ * nodes, use `Container#walk`.
72
+ *
73
+ * Unlike the for `{}`-cycle or `Array#forEach` this iterator is safe
74
+ * if you are mutating the array of child nodes during iteration.
75
+ * PostCSS will adjust the current index to match the mutations.
76
+ *
77
+ * ```js
78
+ * const root = postcss.parse('a { color: black; z-index: 1 }')
79
+ * const rule = root.first
80
+ *
81
+ * for (const decl of rule.nodes) {
82
+ * decl.cloneBefore({ prop: '-webkit-' + decl.prop })
83
+ * // Cycle will be infinite, because cloneBefore moves the current node
84
+ * // to the next index
85
+ * }
86
+ *
87
+ * rule.each(decl => {
88
+ * decl.cloneBefore({ prop: '-webkit-' + decl.prop })
89
+ * // Will be executed only for color and z-index
90
+ * })
91
+ * ```
92
+ *
93
+ * @param callback Iterator receives each node and index.
94
+ * @return Returns `false` if iteration was broke.
95
+ */
96
+ each(
97
+ callback: (node: Child, index: number) => false | void
98
+ ): false | undefined
99
+
100
+ /**
101
+ * Traverses the container’s descendant nodes, calling callback
102
+ * for each node.
103
+ *
104
+ * Like container.each(), this method is safe to use
105
+ * if you are mutating arrays during iteration.
106
+ *
107
+ * If you only need to iterate through the container’s immediate children,
108
+ * use `Container#each`.
109
+ *
110
+ * ```js
111
+ * root.walk(node => {
112
+ * // Traverses all descendant nodes.
113
+ * })
114
+ * ```
115
+ *
116
+ * @param callback Iterator receives each node and index.
117
+ * @return Returns `false` if iteration was broke.
118
+ */
119
+ walk(
120
+ callback: (node: ChildNode, index: number) => false | void
121
+ ): false | undefined
122
+
123
+ /**
124
+ * Traverses the container’s descendant nodes, calling callback
125
+ * for each declaration node.
126
+ *
127
+ * If you pass a filter, iteration will only happen over declarations
128
+ * with matching properties.
129
+ *
130
+ * ```js
131
+ * root.walkDecls(decl => {
132
+ * checkPropertySupport(decl.prop)
133
+ * })
134
+ *
135
+ * root.walkDecls('border-radius', decl => {
136
+ * decl.remove()
137
+ * })
138
+ *
139
+ * root.walkDecls(/^background/, decl => {
140
+ * decl.value = takeFirstColorFromGradient(decl.value)
141
+ * })
142
+ * ```
143
+ *
144
+ * Like `Container#each`, this method is safe
145
+ * to use if you are mutating arrays during iteration.
146
+ *
147
+ * @param prop String or regular expression to filter declarations
148
+ * by property name.
149
+ * @param callback Iterator receives each node and index.
150
+ * @return Returns `false` if iteration was broke.
151
+ */
152
+ walkDecls(
153
+ propFilter: string | RegExp,
154
+ callback: (decl: Declaration, index: number) => false | void
155
+ ): false | undefined
156
+ walkDecls(
157
+ callback: (decl: Declaration, index: number) => false | void
158
+ ): false | undefined
159
+
160
+ /**
161
+ * Traverses the container’s descendant nodes, calling callback
162
+ * for each rule node.
163
+ *
164
+ * If you pass a filter, iteration will only happen over rules
165
+ * with matching selectors.
166
+ *
167
+ * Like `Container#each`, this method is safe
168
+ * to use if you are mutating arrays during iteration.
169
+ *
170
+ * ```js
171
+ * const selectors = []
172
+ * root.walkRules(rule => {
173
+ * selectors.push(rule.selector)
174
+ * })
175
+ * console.log(`Your CSS uses ${ selectors.length } selectors`)
176
+ * ```
177
+ *
178
+ * @param selector String or regular expression to filter rules by selector.
179
+ * @param callback Iterator receives each node and index.
180
+ * @return Returns `false` if iteration was broke.
181
+ */
182
+ walkRules(
183
+ selectorFilter: string | RegExp,
184
+ callback: (rule: Rule, index: number) => false | void
185
+ ): false | undefined
186
+ walkRules(
187
+ callback: (rule: Rule, index: number) => false | void
188
+ ): false | undefined
189
+
190
+ /**
191
+ * Traverses the container’s descendant nodes, calling callback
192
+ * for each at-rule node.
193
+ *
194
+ * If you pass a filter, iteration will only happen over at-rules
195
+ * that have matching names.
196
+ *
197
+ * Like `Container#each`, this method is safe
198
+ * to use if you are mutating arrays during iteration.
199
+ *
200
+ * ```js
201
+ * root.walkAtRules(rule => {
202
+ * if (isOld(rule.name)) rule.remove()
203
+ * })
204
+ *
205
+ * let first = false
206
+ * root.walkAtRules('charset', rule => {
207
+ * if (!first) {
208
+ * first = true
209
+ * } else {
210
+ * rule.remove()
211
+ * }
212
+ * })
213
+ * ```
214
+ *
215
+ * @param name String or regular expression to filter at-rules by name.
216
+ * @param callback Iterator receives each node and index.
217
+ * @return Returns `false` if iteration was broke.
218
+ */
219
+ walkAtRules(
220
+ nameFilter: string | RegExp,
221
+ callback: (atRule: AtRule, index: number) => false | void
222
+ ): false | undefined
223
+ walkAtRules(
224
+ callback: (atRule: AtRule, index: number) => false | void
225
+ ): false | undefined
226
+
227
+ /**
228
+ * Traverses the container’s descendant nodes, calling callback
229
+ * for each comment node.
230
+ *
231
+ * Like `Container#each`, this method is safe
232
+ * to use if you are mutating arrays during iteration.
233
+ *
234
+ * ```js
235
+ * root.walkComments(comment => {
236
+ * comment.remove()
237
+ * })
238
+ * ```
239
+ *
240
+ * @param callback Iterator receives each node and index.
241
+ * @return Returns `false` if iteration was broke.
242
+ */
243
+
244
+ walkComments(
245
+ callback: (comment: Comment, indexed: number) => false | void
246
+ ): false | undefined
247
+ walkComments(
248
+ callback: (comment: Comment, indexed: number) => false | void
249
+ ): false | undefined
250
+
251
+ /**
252
+ * Inserts new nodes to the end of the container.
253
+ *
254
+ * ```js
255
+ * const decl1 = new Declaration({ prop: 'color', value: 'black' })
256
+ * const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
257
+ * rule.append(decl1, decl2)
258
+ *
259
+ * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
260
+ * root.append({ selector: 'a' }) // rule
261
+ * rule.append({ prop: 'color', value: 'black' }) // declaration
262
+ * rule.append({ text: 'Comment' }) // comment
263
+ *
264
+ * root.append('a {}')
265
+ * root.first.append('color: black; z-index: 1')
266
+ * ```
267
+ *
268
+ * @param nodes New nodes.
269
+ * @return This node for methods chain.
270
+ */
271
+ append(
272
+ ...nodes: (Node | Node[] | ChildProps | ChildProps[] | string | string[])[]
273
+ ): this
274
+
275
+ /**
276
+ * Inserts new nodes to the start of the container.
277
+ *
278
+ * ```js
279
+ * const decl1 = new Declaration({ prop: 'color', value: 'black' })
280
+ * const decl2 = new Declaration({ prop: 'background-color', value: 'white' })
281
+ * rule.prepend(decl1, decl2)
282
+ *
283
+ * root.append({ name: 'charset', params: '"UTF-8"' }) // at-rule
284
+ * root.append({ selector: 'a' }) // rule
285
+ * rule.append({ prop: 'color', value: 'black' }) // declaration
286
+ * rule.append({ text: 'Comment' }) // comment
287
+ *
288
+ * root.append('a {}')
289
+ * root.first.append('color: black; z-index: 1')
290
+ * ```
291
+ *
292
+ * @param nodes New nodes.
293
+ * @return This node for methods chain.
294
+ */
295
+ prepend(
296
+ ...nodes: (Node | Node[] | ChildProps | ChildProps[] | string | string[])[]
297
+ ): this
298
+
299
+ /**
300
+ * Add child to the end of the node.
301
+ *
302
+ * ```js
303
+ * rule.push(new Declaration({ prop: 'color', value: 'black' }))
304
+ * ```
305
+ *
306
+ * @param child New node.
307
+ * @return This node for methods chain.
308
+ */
309
+ push(child: Child): this
310
+
311
+ /**
312
+ * Insert new node before old node within the container.
313
+ *
314
+ * ```js
315
+ * rule.insertBefore(decl, decl.clone({ prop: '-webkit-' + decl.prop }))
316
+ * ```
317
+ *
318
+ * @param oldNode Child or child’s index.
319
+ * @param newNode New node.
320
+ * @return This node for methods chain.
321
+ */
322
+ insertBefore(
323
+ oldNode: Child | number,
324
+ newNode: Child | ChildProps | string | Child[] | ChildProps[] | string[]
325
+ ): this
326
+
327
+ /**
328
+ * Insert new node after old node within the container.
329
+ *
330
+ * @param oldNode Child or child’s index.
331
+ * @param newNode New node.
332
+ * @return This node for methods chain.
333
+ */
334
+ insertAfter(
335
+ oldNode: Child | number,
336
+ newNode: Child | ChildProps | string | Child[] | ChildProps[] | string[]
337
+ ): this
338
+
339
+ /**
340
+ * Removes node from the container and cleans the parent properties
341
+ * from the node and its children.
342
+ *
343
+ * ```js
344
+ * rule.nodes.length //=> 5
345
+ * rule.removeChild(decl)
346
+ * rule.nodes.length //=> 4
347
+ * decl.parent //=> undefined
348
+ * ```
349
+ *
350
+ * @param child Child or child’s index.
351
+ * @return This node for methods chain.
352
+ */
353
+ removeChild(child: Child | number): this
354
+
355
+ /**
356
+ * Removes all children from the container
357
+ * and cleans their parent properties.
358
+ *
359
+ * ```js
360
+ * rule.removeAll()
361
+ * rule.nodes.length //=> 0
362
+ * ```
363
+ *
364
+ * @return This node for methods chain.
365
+ */
366
+ removeAll(): this
367
+
368
+ /**
369
+ * Passes all declaration values within the container that match pattern
370
+ * through callback, replacing those values with the returned result
371
+ * of callback.
372
+ *
373
+ * This method is useful if you are using a custom unit or function
374
+ * and need to iterate through all values.
375
+ *
376
+ * ```js
377
+ * root.replaceValues(/\d+rem/, { fast: 'rem' }, string => {
378
+ * return 15 * parseInt(string) + 'px'
379
+ * })
380
+ * ```
381
+ *
382
+ * @param pattern Replace pattern.
383
+ * @param {object} opts Options to speed up the search.
384
+ * @param callback String to replace pattern or callback
385
+ * that returns a new value. The callback
386
+ * will receive the same arguments
387
+ * as those passed to a function parameter
388
+ * of `String#replace`.
389
+ * @return This node for methods chain.
390
+ */
391
+ replaceValues(
392
+ pattern: string | RegExp,
393
+ options: ValueOptions,
394
+ replaced: string | { (substring: string, ...args: any[]): string }
395
+ ): this
396
+ replaceValues(
397
+ pattern: string | RegExp,
398
+ replaced: string | { (substring: string, ...args: any[]): string }
399
+ ): this
400
+
401
+ /**
402
+ * Returns `true` if callback returns `true`
403
+ * for all of the container’s children.
404
+ *
405
+ * ```js
406
+ * const noPrefixes = rule.every(i => i.prop[0] !== '-')
407
+ * ```
408
+ *
409
+ * @param condition Iterator returns true or false.
410
+ * @return Is every child pass condition.
411
+ */
412
+ every(
413
+ condition: (node: Child, index: number, nodes: Child[]) => boolean
414
+ ): boolean
415
+
416
+ /**
417
+ * Returns `true` if callback returns `true` for (at least) one
418
+ * of the container’s children.
419
+ *
420
+ * ```js
421
+ * const hasPrefix = rule.some(i => i.prop[0] === '-')
422
+ * ```
423
+ *
424
+ * @param condition Iterator returns true or false.
425
+ * @return Is some child pass condition.
426
+ */
427
+ some(
428
+ condition: (node: Child, index: number, nodes: Child[]) => boolean
429
+ ): boolean
430
+
431
+ /**
432
+ * Returns a `child`’s index within the `Container#nodes` array.
433
+ *
434
+ * ```js
435
+ * rule.index( rule.nodes[2] ) //=> 2
436
+ * ```
437
+ *
438
+ * @param child Child of the current container.
439
+ * @return Child index.
440
+ */
441
+ index(child: Child | number): number
442
+ }
@@ -0,0 +1,239 @@
1
+ import { FilePosition } from './input.js'
2
+
3
+ /**
4
+ * A position that is part of a range.
5
+ */
6
+ export interface RangePosition {
7
+ /**
8
+ * The line number in the input.
9
+ */
10
+ line: number
11
+
12
+ /**
13
+ * The column number in the input.
14
+ */
15
+ column: number
16
+ }
17
+
18
+ /**
19
+ * The CSS parser throws this error for broken CSS.
20
+ *
21
+ * Custom parsers can throw this error for broken custom syntax using
22
+ * the `Node#error` method.
23
+ *
24
+ * PostCSS will use the input source map to detect the original error location.
25
+ * If you wrote a Sass file, compiled it to CSS and then parsed it with PostCSS,
26
+ * PostCSS will show the original position in the Sass file.
27
+ *
28
+ * If you need the position in the PostCSS input
29
+ * (e.g., to debug the previous compiler), use `error.input.file`.
30
+ *
31
+ * ```js
32
+ * // Raising error from plugin
33
+ * throw node.error('Unknown variable', { plugin: 'postcss-vars' })
34
+ * ```
35
+ *
36
+ * ```js
37
+ * // Catching and checking syntax error
38
+ * try {
39
+ * postcss.parse('a{')
40
+ * } catch (error) {
41
+ * if (error.name === 'CssSyntaxError') {
42
+ * error //=> CssSyntaxError
43
+ * }
44
+ * }
45
+ * ```
46
+ */
47
+ export default class CssSyntaxError {
48
+ /**
49
+ * Instantiates a CSS syntax error. Can be instantiated for a single position
50
+ * or for a range.
51
+ * @param message Error message.
52
+ * @param lineOrStartPos If for a single position, the line number, or if for
53
+ * a range, the inclusive start position of the error.
54
+ * @param columnOrEndPos If for a single position, the column number, or if for
55
+ * a range, the exclusive end position of the error.
56
+ * @param source Source code of the broken file.
57
+ * @param file Absolute path to the broken file.
58
+ * @param plugin PostCSS plugin name, if error came from plugin.
59
+ */
60
+ constructor(
61
+ message: string,
62
+ lineOrStartPos?: number | RangePosition,
63
+ columnOrEndPos?: number | RangePosition,
64
+ source?: string,
65
+ file?: string,
66
+ plugin?: string
67
+ )
68
+
69
+ stack: string
70
+
71
+ /**
72
+ * Always equal to `'CssSyntaxError'`. You should always check error type
73
+ * by `error.name === 'CssSyntaxError'`
74
+ * instead of `error instanceof CssSyntaxError`,
75
+ * because npm could have several PostCSS versions.
76
+ *
77
+ * ```js
78
+ * if (error.name === 'CssSyntaxError') {
79
+ * error //=> CssSyntaxError
80
+ * }
81
+ * ```
82
+ */
83
+ name: 'CssSyntaxError'
84
+
85
+ /**
86
+ * Error message.
87
+ *
88
+ * ```js
89
+ * error.message //=> 'Unclosed block'
90
+ * ```
91
+ */
92
+ reason: string
93
+
94
+ /**
95
+ * Full error text in the GNU error format
96
+ * with plugin, file, line and column.
97
+ *
98
+ * ```js
99
+ * error.message //=> 'a.css:1:1: Unclosed block'
100
+ * ```
101
+ */
102
+ message: string
103
+
104
+ /**
105
+ * Absolute path to the broken file.
106
+ *
107
+ * ```js
108
+ * error.file //=> 'a.sass'
109
+ * error.input.file //=> 'a.css'
110
+ * ```
111
+ *
112
+ * PostCSS will use the input source map to detect the original location.
113
+ * If you need the position in the PostCSS input, use `error.input.file`.
114
+ */
115
+ file?: string
116
+
117
+ /**
118
+ * Source line of the error.
119
+ *
120
+ * ```js
121
+ * error.line //=> 2
122
+ * error.input.line //=> 4
123
+ * ```
124
+ *
125
+ * PostCSS will use the input source map to detect the original location.
126
+ * If you need the position in the PostCSS input, use `error.input.line`.
127
+ */
128
+ line?: number
129
+
130
+ /**
131
+ * Source column of the error.
132
+ *
133
+ * ```js
134
+ * error.column //=> 1
135
+ * error.input.column //=> 4
136
+ * ```
137
+ *
138
+ * PostCSS will use the input source map to detect the original location.
139
+ * If you need the position in the PostCSS input, use `error.input.column`.
140
+ */
141
+ column?: number
142
+
143
+ /**
144
+ * Source line of the error's end, exclusive. Provided if the error pertains
145
+ * to a range.
146
+ *
147
+ * ```js
148
+ * error.endLine //=> 3
149
+ * error.input.endLine //=> 4
150
+ * ```
151
+ *
152
+ * PostCSS will use the input source map to detect the original location.
153
+ * If you need the position in the PostCSS input, use `error.input.endLine`.
154
+ */
155
+ endLine?: number
156
+
157
+ /**
158
+ * Source column of the error's end, exclusive. Provided if the error pertains
159
+ * to a range.
160
+ *
161
+ * ```js
162
+ * error.endColumn //=> 1
163
+ * error.input.endColumn //=> 4
164
+ * ```
165
+ *
166
+ * PostCSS will use the input source map to detect the original location.
167
+ * If you need the position in the PostCSS input, use `error.input.endColumn`.
168
+ */
169
+ endColumn?: number
170
+
171
+ /**
172
+ * Source code of the broken file.
173
+ *
174
+ * ```js
175
+ * error.source //=> 'a { b {} }'
176
+ * error.input.source //=> 'a b { }'
177
+ * ```
178
+ */
179
+ source?: string
180
+
181
+ /**
182
+ * Plugin name, if error came from plugin.
183
+ *
184
+ * ```js
185
+ * error.plugin //=> 'postcss-vars'
186
+ * ```
187
+ */
188
+ plugin?: string
189
+
190
+ /**
191
+ * Input object with PostCSS internal information
192
+ * about input file. If input has source map
193
+ * from previous tool, PostCSS will use origin
194
+ * (for example, Sass) source. You can use this
195
+ * object to get PostCSS input source.
196
+ *
197
+ * ```js
198
+ * error.input.file //=> 'a.css'
199
+ * error.file //=> 'a.sass'
200
+ * ```
201
+ */
202
+ input?: FilePosition
203
+
204
+ /**
205
+ * Returns error position, message and source code of the broken part.
206
+ *
207
+ * ```js
208
+ * error.toString() //=> "CssSyntaxError: app.css:1:1: Unclosed block
209
+ * // > 1 | a {
210
+ * // | ^"
211
+ * ```
212
+ *
213
+ * @return Error position, message and source code.
214
+ */
215
+ toString(): string
216
+
217
+ /**
218
+ * Returns a few lines of CSS source that caused the error.
219
+ *
220
+ * If the CSS has an input source map without `sourceContent`,
221
+ * this method will return an empty string.
222
+ *
223
+ * ```js
224
+ * error.showSourceCode() //=> " 4 | }
225
+ * // 5 | a {
226
+ * // > 6 | bad
227
+ * // | ^
228
+ * // 7 | }
229
+ * // 8 | b {"
230
+ * ```
231
+ *
232
+ * @param color Whether arrow will be colored red by terminal
233
+ * color codes. By default, PostCSS will detect
234
+ * color support by `process.stdout.isTTY`
235
+ * and `process.env.NODE_DISABLE_COLORS`.
236
+ * @return Few lines of CSS source that caused the error.
237
+ */
238
+ showSourceCode(color?: boolean): string
239
+ }