create-microact-app 1.0.1

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 (213) hide show
  1. package/index.js +95 -0
  2. package/package.json +21 -0
  3. package/templates/vanilla/.github/workflows/deploy.yml +38 -0
  4. package/templates/vanilla/index.html +13 -0
  5. package/templates/vanilla/node_modules/.package-lock.json +207 -0
  6. package/templates/vanilla/node_modules/@esbuild/darwin-x64/README.md +3 -0
  7. package/templates/vanilla/node_modules/@esbuild/darwin-x64/bin/esbuild +0 -0
  8. package/templates/vanilla/node_modules/@esbuild/darwin-x64/package.json +17 -0
  9. package/templates/vanilla/node_modules/@monygroupcorp/microact/README.md +154 -0
  10. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js +1749 -0
  11. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.cjs.js.map +1 -0
  12. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js +1743 -0
  13. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.esm.js.map +1 -0
  14. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js +2 -0
  15. package/templates/vanilla/node_modules/@monygroupcorp/microact/dist/microact.umd.js.map +1 -0
  16. package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.html +13 -0
  17. package/templates/vanilla/node_modules/@monygroupcorp/microact/example/index.js +63 -0
  18. package/templates/vanilla/node_modules/@monygroupcorp/microact/package.json +38 -0
  19. package/templates/vanilla/node_modules/@monygroupcorp/microact/rollup.config.cjs +30 -0
  20. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Component.js +831 -0
  21. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/DOMUpdater.js +320 -0
  22. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/EventBus.js +123 -0
  23. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/Router.js +253 -0
  24. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/UpdateScheduler.js +218 -0
  25. package/templates/vanilla/node_modules/@monygroupcorp/microact/src/index.js +6 -0
  26. package/templates/vanilla/node_modules/esbuild/LICENSE.md +21 -0
  27. package/templates/vanilla/node_modules/esbuild/README.md +3 -0
  28. package/templates/vanilla/node_modules/esbuild/bin/esbuild +0 -0
  29. package/templates/vanilla/node_modules/esbuild/install.js +287 -0
  30. package/templates/vanilla/node_modules/esbuild/lib/main.d.ts +660 -0
  31. package/templates/vanilla/node_modules/esbuild/lib/main.js +2393 -0
  32. package/templates/vanilla/node_modules/esbuild/package.json +42 -0
  33. package/templates/vanilla/node_modules/nanoid/LICENSE +20 -0
  34. package/templates/vanilla/node_modules/nanoid/README.md +39 -0
  35. package/templates/vanilla/node_modules/nanoid/async/index.browser.cjs +69 -0
  36. package/templates/vanilla/node_modules/nanoid/async/index.browser.js +34 -0
  37. package/templates/vanilla/node_modules/nanoid/async/index.cjs +71 -0
  38. package/templates/vanilla/node_modules/nanoid/async/index.d.ts +56 -0
  39. package/templates/vanilla/node_modules/nanoid/async/index.js +35 -0
  40. package/templates/vanilla/node_modules/nanoid/async/index.native.js +26 -0
  41. package/templates/vanilla/node_modules/nanoid/async/package.json +12 -0
  42. package/templates/vanilla/node_modules/nanoid/bin/nanoid.cjs +55 -0
  43. package/templates/vanilla/node_modules/nanoid/index.browser.cjs +72 -0
  44. package/templates/vanilla/node_modules/nanoid/index.browser.js +34 -0
  45. package/templates/vanilla/node_modules/nanoid/index.cjs +85 -0
  46. package/templates/vanilla/node_modules/nanoid/index.d.cts +91 -0
  47. package/templates/vanilla/node_modules/nanoid/index.d.ts +91 -0
  48. package/templates/vanilla/node_modules/nanoid/index.js +45 -0
  49. package/templates/vanilla/node_modules/nanoid/nanoid.js +1 -0
  50. package/templates/vanilla/node_modules/nanoid/non-secure/index.cjs +34 -0
  51. package/templates/vanilla/node_modules/nanoid/non-secure/index.d.ts +33 -0
  52. package/templates/vanilla/node_modules/nanoid/non-secure/index.js +21 -0
  53. package/templates/vanilla/node_modules/nanoid/non-secure/package.json +6 -0
  54. package/templates/vanilla/node_modules/nanoid/package.json +89 -0
  55. package/templates/vanilla/node_modules/nanoid/url-alphabet/index.cjs +7 -0
  56. package/templates/vanilla/node_modules/nanoid/url-alphabet/index.js +3 -0
  57. package/templates/vanilla/node_modules/nanoid/url-alphabet/package.json +6 -0
  58. package/templates/vanilla/node_modules/picocolors/LICENSE +15 -0
  59. package/templates/vanilla/node_modules/picocolors/README.md +21 -0
  60. package/templates/vanilla/node_modules/picocolors/package.json +25 -0
  61. package/templates/vanilla/node_modules/picocolors/picocolors.browser.js +4 -0
  62. package/templates/vanilla/node_modules/picocolors/picocolors.d.ts +5 -0
  63. package/templates/vanilla/node_modules/picocolors/picocolors.js +75 -0
  64. package/templates/vanilla/node_modules/picocolors/types.d.ts +51 -0
  65. package/templates/vanilla/node_modules/postcss/LICENSE +20 -0
  66. package/templates/vanilla/node_modules/postcss/README.md +29 -0
  67. package/templates/vanilla/node_modules/postcss/lib/at-rule.d.ts +140 -0
  68. package/templates/vanilla/node_modules/postcss/lib/at-rule.js +25 -0
  69. package/templates/vanilla/node_modules/postcss/lib/comment.d.ts +68 -0
  70. package/templates/vanilla/node_modules/postcss/lib/comment.js +13 -0
  71. package/templates/vanilla/node_modules/postcss/lib/container.d.ts +483 -0
  72. package/templates/vanilla/node_modules/postcss/lib/container.js +447 -0
  73. package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.d.ts +248 -0
  74. package/templates/vanilla/node_modules/postcss/lib/css-syntax-error.js +133 -0
  75. package/templates/vanilla/node_modules/postcss/lib/declaration.d.ts +151 -0
  76. package/templates/vanilla/node_modules/postcss/lib/declaration.js +24 -0
  77. package/templates/vanilla/node_modules/postcss/lib/document.d.ts +69 -0
  78. package/templates/vanilla/node_modules/postcss/lib/document.js +33 -0
  79. package/templates/vanilla/node_modules/postcss/lib/fromJSON.d.ts +9 -0
  80. package/templates/vanilla/node_modules/postcss/lib/fromJSON.js +54 -0
  81. package/templates/vanilla/node_modules/postcss/lib/input.d.ts +227 -0
  82. package/templates/vanilla/node_modules/postcss/lib/input.js +265 -0
  83. package/templates/vanilla/node_modules/postcss/lib/lazy-result.d.ts +190 -0
  84. package/templates/vanilla/node_modules/postcss/lib/lazy-result.js +550 -0
  85. package/templates/vanilla/node_modules/postcss/lib/list.d.ts +60 -0
  86. package/templates/vanilla/node_modules/postcss/lib/list.js +58 -0
  87. package/templates/vanilla/node_modules/postcss/lib/map-generator.js +368 -0
  88. package/templates/vanilla/node_modules/postcss/lib/no-work-result.d.ts +46 -0
  89. package/templates/vanilla/node_modules/postcss/lib/no-work-result.js +138 -0
  90. package/templates/vanilla/node_modules/postcss/lib/node.d.ts +556 -0
  91. package/templates/vanilla/node_modules/postcss/lib/node.js +449 -0
  92. package/templates/vanilla/node_modules/postcss/lib/parse.d.ts +9 -0
  93. package/templates/vanilla/node_modules/postcss/lib/parse.js +42 -0
  94. package/templates/vanilla/node_modules/postcss/lib/parser.js +611 -0
  95. package/templates/vanilla/node_modules/postcss/lib/postcss.d.mts +69 -0
  96. package/templates/vanilla/node_modules/postcss/lib/postcss.d.ts +458 -0
  97. package/templates/vanilla/node_modules/postcss/lib/postcss.js +101 -0
  98. package/templates/vanilla/node_modules/postcss/lib/postcss.mjs +30 -0
  99. package/templates/vanilla/node_modules/postcss/lib/previous-map.d.ts +81 -0
  100. package/templates/vanilla/node_modules/postcss/lib/previous-map.js +144 -0
  101. package/templates/vanilla/node_modules/postcss/lib/processor.d.ts +115 -0
  102. package/templates/vanilla/node_modules/postcss/lib/processor.js +67 -0
  103. package/templates/vanilla/node_modules/postcss/lib/result.d.ts +205 -0
  104. package/templates/vanilla/node_modules/postcss/lib/result.js +42 -0
  105. package/templates/vanilla/node_modules/postcss/lib/root.d.ts +87 -0
  106. package/templates/vanilla/node_modules/postcss/lib/root.js +61 -0
  107. package/templates/vanilla/node_modules/postcss/lib/rule.d.ts +126 -0
  108. package/templates/vanilla/node_modules/postcss/lib/rule.js +27 -0
  109. package/templates/vanilla/node_modules/postcss/lib/stringifier.d.ts +46 -0
  110. package/templates/vanilla/node_modules/postcss/lib/stringifier.js +353 -0
  111. package/templates/vanilla/node_modules/postcss/lib/stringify.d.ts +9 -0
  112. package/templates/vanilla/node_modules/postcss/lib/stringify.js +11 -0
  113. package/templates/vanilla/node_modules/postcss/lib/symbols.js +5 -0
  114. package/templates/vanilla/node_modules/postcss/lib/terminal-highlight.js +70 -0
  115. package/templates/vanilla/node_modules/postcss/lib/tokenize.js +266 -0
  116. package/templates/vanilla/node_modules/postcss/lib/warn-once.js +13 -0
  117. package/templates/vanilla/node_modules/postcss/lib/warning.d.ts +147 -0
  118. package/templates/vanilla/node_modules/postcss/lib/warning.js +37 -0
  119. package/templates/vanilla/node_modules/postcss/package.json +88 -0
  120. package/templates/vanilla/node_modules/rollup/LICENSE.md +695 -0
  121. package/templates/vanilla/node_modules/rollup/README.md +125 -0
  122. package/templates/vanilla/node_modules/rollup/dist/bin/rollup +1715 -0
  123. package/templates/vanilla/node_modules/rollup/dist/es/getLogFilter.js +64 -0
  124. package/templates/vanilla/node_modules/rollup/dist/es/package.json +1 -0
  125. package/templates/vanilla/node_modules/rollup/dist/es/rollup.js +17 -0
  126. package/templates/vanilla/node_modules/rollup/dist/es/shared/node-entry.js +27273 -0
  127. package/templates/vanilla/node_modules/rollup/dist/es/shared/watch.js +4857 -0
  128. package/templates/vanilla/node_modules/rollup/dist/getLogFilter.d.ts +5 -0
  129. package/templates/vanilla/node_modules/rollup/dist/getLogFilter.js +69 -0
  130. package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.d.ts +20 -0
  131. package/templates/vanilla/node_modules/rollup/dist/loadConfigFile.js +29 -0
  132. package/templates/vanilla/node_modules/rollup/dist/rollup.d.ts +1012 -0
  133. package/templates/vanilla/node_modules/rollup/dist/rollup.js +31 -0
  134. package/templates/vanilla/node_modules/rollup/dist/shared/fsevents-importer.js +37 -0
  135. package/templates/vanilla/node_modules/rollup/dist/shared/index.js +4571 -0
  136. package/templates/vanilla/node_modules/rollup/dist/shared/loadConfigFile.js +546 -0
  137. package/templates/vanilla/node_modules/rollup/dist/shared/rollup.js +27351 -0
  138. package/templates/vanilla/node_modules/rollup/dist/shared/watch-cli.js +561 -0
  139. package/templates/vanilla/node_modules/rollup/dist/shared/watch-proxy.js +87 -0
  140. package/templates/vanilla/node_modules/rollup/dist/shared/watch.js +316 -0
  141. package/templates/vanilla/node_modules/rollup/package.json +181 -0
  142. package/templates/vanilla/node_modules/source-map-js/LICENSE +28 -0
  143. package/templates/vanilla/node_modules/source-map-js/README.md +765 -0
  144. package/templates/vanilla/node_modules/source-map-js/lib/array-set.js +121 -0
  145. package/templates/vanilla/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  146. package/templates/vanilla/node_modules/source-map-js/lib/base64.js +67 -0
  147. package/templates/vanilla/node_modules/source-map-js/lib/binary-search.js +111 -0
  148. package/templates/vanilla/node_modules/source-map-js/lib/mapping-list.js +79 -0
  149. package/templates/vanilla/node_modules/source-map-js/lib/quick-sort.js +132 -0
  150. package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  151. package/templates/vanilla/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  152. package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  153. package/templates/vanilla/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  154. package/templates/vanilla/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  155. package/templates/vanilla/node_modules/source-map-js/lib/source-node.js +413 -0
  156. package/templates/vanilla/node_modules/source-map-js/lib/util.js +594 -0
  157. package/templates/vanilla/node_modules/source-map-js/package.json +71 -0
  158. package/templates/vanilla/node_modules/source-map-js/source-map.d.ts +104 -0
  159. package/templates/vanilla/node_modules/source-map-js/source-map.js +8 -0
  160. package/templates/vanilla/node_modules/vite/LICENSE.md +3396 -0
  161. package/templates/vanilla/node_modules/vite/README.md +20 -0
  162. package/templates/vanilla/node_modules/vite/bin/openChrome.applescript +95 -0
  163. package/templates/vanilla/node_modules/vite/bin/vite.js +61 -0
  164. package/templates/vanilla/node_modules/vite/client.d.ts +281 -0
  165. package/templates/vanilla/node_modules/vite/dist/client/client.mjs +725 -0
  166. package/templates/vanilla/node_modules/vite/dist/client/client.mjs.map +1 -0
  167. package/templates/vanilla/node_modules/vite/dist/client/env.mjs +30 -0
  168. package/templates/vanilla/node_modules/vite/dist/client/env.mjs.map +1 -0
  169. package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-7ec6f216.js +914 -0
  170. package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-827b23df.js +66713 -0
  171. package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-c423598f.js +561 -0
  172. package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f0c7dae0.js +7930 -0
  173. package/templates/vanilla/node_modules/vite/dist/node/chunks/dep-f1e8587f.js +7646 -0
  174. package/templates/vanilla/node_modules/vite/dist/node/cli.js +929 -0
  175. package/templates/vanilla/node_modules/vite/dist/node/constants.js +130 -0
  176. package/templates/vanilla/node_modules/vite/dist/node/index.d.ts +3548 -0
  177. package/templates/vanilla/node_modules/vite/dist/node/index.js +158 -0
  178. package/templates/vanilla/node_modules/vite/dist/node-cjs/publicUtils.cjs +4555 -0
  179. package/templates/vanilla/node_modules/vite/index.cjs +34 -0
  180. package/templates/vanilla/node_modules/vite/package.json +173 -0
  181. package/templates/vanilla/node_modules/vite/types/customEvent.d.ts +35 -0
  182. package/templates/vanilla/node_modules/vite/types/hmrPayload.d.ts +61 -0
  183. package/templates/vanilla/node_modules/vite/types/hot.d.ts +32 -0
  184. package/templates/vanilla/node_modules/vite/types/importGlob.d.ts +97 -0
  185. package/templates/vanilla/node_modules/vite/types/importMeta.d.ts +26 -0
  186. package/templates/vanilla/node_modules/vite/types/metadata.d.ts +10 -0
  187. package/templates/vanilla/node_modules/vite/types/package.json +4 -0
  188. package/templates/vanilla/package-lock.json +589 -0
  189. package/templates/vanilla/package.json +17 -0
  190. package/templates/vanilla/src/components/App.js +60 -0
  191. package/templates/vanilla/src/components/Card.js +21 -0
  192. package/templates/vanilla/src/components/Hero.js +15 -0
  193. package/templates/vanilla/src/components/InteractiveDemo.js +59 -0
  194. package/templates/vanilla/src/main.js +9 -0
  195. package/templates/vanilla/src/style/main.css +172 -0
  196. package/templates/vanilla/vite.config.js +8 -0
  197. package/templates/web3/.env.example +15 -0
  198. package/templates/web3/.github/workflows/deploy.yml +38 -0
  199. package/templates/web3/README.md +33 -0
  200. package/templates/web3/contracts/foundry.toml +11 -0
  201. package/templates/web3/contracts/script/Deploy.s.sol +13 -0
  202. package/templates/web3/contracts/src/Counter.sol +21 -0
  203. package/templates/web3/index.html +13 -0
  204. package/templates/web3/package.json +25 -0
  205. package/templates/web3/scripts/chain-start.mjs +305 -0
  206. package/templates/web3/scripts/chain-stop.mjs +34 -0
  207. package/templates/web3/scripts/deploy.mjs +155 -0
  208. package/templates/web3/scripts/setup.mjs +42 -0
  209. package/templates/web3/src/components/App.js +49 -0
  210. package/templates/web3/src/components/CounterCard.js +111 -0
  211. package/templates/web3/src/main.js +54 -0
  212. package/templates/web3/src/style/main.css +345 -0
  213. package/templates/web3/vite.config.js +29 -0
@@ -0,0 +1,556 @@
1
+ import AtRule = require('./at-rule.js')
2
+ import { AtRuleProps } from './at-rule.js'
3
+ import Comment, { CommentProps } from './comment.js'
4
+ import Container, { NewChild } from './container.js'
5
+ import CssSyntaxError from './css-syntax-error.js'
6
+ import Declaration, { DeclarationProps } from './declaration.js'
7
+ import Document from './document.js'
8
+ import Input from './input.js'
9
+ import { Stringifier, Syntax } from './postcss.js'
10
+ import Result from './result.js'
11
+ import Root from './root.js'
12
+ import Rule, { RuleProps } from './rule.js'
13
+ import Warning, { WarningOptions } from './warning.js'
14
+
15
+ declare namespace Node {
16
+ export type ChildNode = AtRule.default | Comment | Declaration | Rule
17
+
18
+ export type AnyNode =
19
+ | AtRule.default
20
+ | Comment
21
+ | Declaration
22
+ | Document
23
+ | Root
24
+ | Rule
25
+
26
+ export type ChildProps =
27
+ | AtRuleProps
28
+ | CommentProps
29
+ | DeclarationProps
30
+ | RuleProps
31
+
32
+ export interface Position {
33
+ /**
34
+ * Source line in file. In contrast to `offset` it starts from 1.
35
+ */
36
+ column: number
37
+
38
+ /**
39
+ * Source column in file.
40
+ */
41
+ line: number
42
+
43
+ /**
44
+ * Source offset in file. It starts from 0.
45
+ */
46
+ offset: number
47
+ }
48
+
49
+ export interface Range {
50
+ /**
51
+ * End position, exclusive.
52
+ */
53
+ end: Position
54
+
55
+ /**
56
+ * Start position, inclusive.
57
+ */
58
+ start: Position
59
+ }
60
+
61
+ /**
62
+ * Source represents an interface for the {@link Node.source} property.
63
+ */
64
+ export interface Source {
65
+ /**
66
+ * The inclusive ending position for the source
67
+ * code of a node.
68
+ *
69
+ * However, `end.offset` of a non `Root` node is the exclusive position.
70
+ * See https://github.com/postcss/postcss/pull/1879 for details.
71
+ *
72
+ * ```js
73
+ * const root = postcss.parse('a { color: black }')
74
+ * const a = root.first
75
+ * const color = a.first
76
+ *
77
+ * // The offset of `Root` node is the inclusive position
78
+ * css.source.end // { line: 1, column: 19, offset: 18 }
79
+ *
80
+ * // The offset of non `Root` node is the exclusive position
81
+ * a.source.end // { line: 1, column: 18, offset: 18 }
82
+ * color.source.end // { line: 1, column: 16, offset: 16 }
83
+ * ```
84
+ */
85
+ end?: Position
86
+
87
+ /**
88
+ * The source file from where a node has originated.
89
+ */
90
+ input: Input
91
+
92
+ /**
93
+ * The inclusive starting position for the source
94
+ * code of a node.
95
+ */
96
+ start?: Position
97
+ }
98
+
99
+ /**
100
+ * Interface represents an interface for an object received
101
+ * as parameter by Node class constructor.
102
+ */
103
+ export interface NodeProps {
104
+ source?: Source
105
+ }
106
+
107
+ export interface NodeErrorOptions {
108
+ /**
109
+ * An ending index inside a node's string that should be highlighted as
110
+ * source of error.
111
+ */
112
+ endIndex?: number
113
+ /**
114
+ * An index inside a node's string that should be highlighted as source
115
+ * of error.
116
+ */
117
+ index?: number
118
+ /**
119
+ * Plugin name that created this error. PostCSS will set it automatically.
120
+ */
121
+ plugin?: string
122
+ /**
123
+ * A word inside a node's string, that should be highlighted as source
124
+ * of error.
125
+ */
126
+ word?: string
127
+ }
128
+
129
+ // eslint-disable-next-line @typescript-eslint/no-shadow
130
+ class Node extends Node_ {}
131
+ export { Node as default }
132
+ }
133
+
134
+ /**
135
+ * It represents an abstract class that handles common
136
+ * methods for other CSS abstract syntax tree nodes.
137
+ *
138
+ * Any node that represents CSS selector or value should
139
+ * not extend the `Node` class.
140
+ */
141
+ declare abstract class Node_ {
142
+ /**
143
+ * It represents parent of the current node.
144
+ *
145
+ * ```js
146
+ * root.nodes[0].parent === root //=> true
147
+ * ```
148
+ */
149
+ parent: Container | Document | undefined
150
+
151
+ /**
152
+ * It represents unnecessary whitespace and characters present
153
+ * in the css source code.
154
+ *
155
+ * Information to generate byte-to-byte equal node string as it was
156
+ * in the origin input.
157
+ *
158
+ * The properties of the raws object are decided by parser,
159
+ * the default parser uses the following properties:
160
+ *
161
+ * * `before`: the space symbols before the node. It also stores `*`
162
+ * and `_` symbols before the declaration (IE hack).
163
+ * * `after`: the space symbols after the last child of the node
164
+ * to the end of the node.
165
+ * * `between`: the symbols between the property and value
166
+ * for declarations, selector and `{` for rules, or last parameter
167
+ * and `{` for at-rules.
168
+ * * `semicolon`: contains true if the last child has
169
+ * an (optional) semicolon.
170
+ * * `afterName`: the space between the at-rule name and its parameters.
171
+ * * `left`: the space symbols between `/*` and the comment’s text.
172
+ * * `right`: the space symbols between the comment’s text
173
+ * and <code>*&#47;</code>.
174
+ * - `important`: the content of the important statement,
175
+ * if it is not just `!important`.
176
+ *
177
+ * PostCSS filters out the comments inside selectors, declaration values
178
+ * and at-rule parameters but it stores the origin content in raws.
179
+ *
180
+ * ```js
181
+ * const root = postcss.parse('a {\n color:black\n}')
182
+ * root.first.first.raws //=> { before: '\n ', between: ':' }
183
+ * ```
184
+ */
185
+ raws: any
186
+
187
+ /**
188
+ * It represents information related to origin of a node and is required
189
+ * for generating source maps.
190
+ *
191
+ * The nodes that are created manually using the public APIs
192
+ * provided by PostCSS will have `source` undefined and
193
+ * will be absent in the source map.
194
+ *
195
+ * For this reason, the plugin developer should consider
196
+ * duplicating nodes as the duplicate node will have the
197
+ * same source as the original node by default or assign
198
+ * source to a node created manually.
199
+ *
200
+ * ```js
201
+ * decl.source.input.from //=> '/home/ai/source.css'
202
+ * decl.source.start //=> { line: 10, column: 2 }
203
+ * decl.source.end //=> { line: 10, column: 12 }
204
+ * ```
205
+ *
206
+ * ```js
207
+ * // Incorrect method, source not specified!
208
+ * const prefixed = postcss.decl({
209
+ * prop: '-moz-' + decl.prop,
210
+ * value: decl.value
211
+ * })
212
+ *
213
+ * // Correct method, source is inherited when duplicating.
214
+ * const prefixed = decl.clone({
215
+ * prop: '-moz-' + decl.prop
216
+ * })
217
+ * ```
218
+ *
219
+ * ```js
220
+ * if (atrule.name === 'add-link') {
221
+ * const rule = postcss.rule({
222
+ * selector: 'a',
223
+ * source: atrule.source
224
+ * })
225
+ *
226
+ * atrule.parent.insertBefore(atrule, rule)
227
+ * }
228
+ * ```
229
+ */
230
+ source?: Node.Source
231
+
232
+ /**
233
+ * It represents type of a node in
234
+ * an abstract syntax tree.
235
+ *
236
+ * A type of node helps in identification of a node
237
+ * and perform operation based on it's type.
238
+ *
239
+ * ```js
240
+ * const declaration = new Declaration({
241
+ * prop: 'color',
242
+ * value: 'black'
243
+ * })
244
+ *
245
+ * declaration.type //=> 'decl'
246
+ * ```
247
+ */
248
+ type: string
249
+
250
+ constructor(defaults?: object)
251
+
252
+ /**
253
+ * Insert new node after current node to current node’s parent.
254
+ *
255
+ * Just alias for `node.parent.insertAfter(node, add)`.
256
+ *
257
+ * ```js
258
+ * decl.after('color: black')
259
+ * ```
260
+ *
261
+ * @param newNode New node.
262
+ * @return This node for methods chain.
263
+ */
264
+ after(
265
+ newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
266
+ ): this
267
+
268
+ /**
269
+ * It assigns properties to an existing node instance.
270
+ *
271
+ * ```js
272
+ * decl.assign({ prop: 'word-wrap', value: 'break-word' })
273
+ * ```
274
+ *
275
+ * @param overrides New properties to override the node.
276
+ *
277
+ * @return `this` for method chaining.
278
+ */
279
+ assign(overrides: object): this
280
+
281
+ /**
282
+ * Insert new node before current node to current node’s parent.
283
+ *
284
+ * Just alias for `node.parent.insertBefore(node, add)`.
285
+ *
286
+ * ```js
287
+ * decl.before('content: ""')
288
+ * ```
289
+ *
290
+ * @param newNode New node.
291
+ * @return This node for methods chain.
292
+ */
293
+ before(
294
+ newNode: Node | Node.ChildProps | readonly Node[] | string | undefined
295
+ ): this
296
+
297
+ /**
298
+ * Clear the code style properties for the node and its children.
299
+ *
300
+ * ```js
301
+ * node.raws.before //=> ' '
302
+ * node.cleanRaws()
303
+ * node.raws.before //=> undefined
304
+ * ```
305
+ *
306
+ * @param keepBetween Keep the `raws.between` symbols.
307
+ */
308
+ cleanRaws(keepBetween?: boolean): void
309
+
310
+ /**
311
+ * It creates clone of an existing node, which includes all the properties
312
+ * and their values, that includes `raws` but not `type`.
313
+ *
314
+ * ```js
315
+ * decl.raws.before //=> "\n "
316
+ * const cloned = decl.clone({ prop: '-moz-' + decl.prop })
317
+ * cloned.raws.before //=> "\n "
318
+ * cloned.toString() //=> -moz-transform: scale(0)
319
+ * ```
320
+ *
321
+ * @param overrides New properties to override in the clone.
322
+ *
323
+ * @return Duplicate of the node instance.
324
+ */
325
+ clone(overrides?: object): this
326
+
327
+ /**
328
+ * Shortcut to clone the node and insert the resulting cloned node
329
+ * after the current node.
330
+ *
331
+ * @param overrides New properties to override in the clone.
332
+ * @return New node.
333
+ */
334
+ cloneAfter(overrides?: object): this
335
+
336
+ /**
337
+ * Shortcut to clone the node and insert the resulting cloned node
338
+ * before the current node.
339
+ *
340
+ * ```js
341
+ * decl.cloneBefore({ prop: '-moz-' + decl.prop })
342
+ * ```
343
+ *
344
+ * @param overrides Mew properties to override in the clone.
345
+ *
346
+ * @return New node
347
+ */
348
+ cloneBefore(overrides?: object): this
349
+
350
+ /**
351
+ * It creates an instance of the class `CssSyntaxError` and parameters passed
352
+ * to this method are assigned to the error instance.
353
+ *
354
+ * The error instance will have description for the
355
+ * error, original position of the node in the
356
+ * source, showing line and column number.
357
+ *
358
+ * If any previous map is present, it would be used
359
+ * to get original position of the source.
360
+ *
361
+ * The Previous Map here is referred to the source map
362
+ * generated by previous compilation, example: Less,
363
+ * Stylus and Sass.
364
+ *
365
+ * This method returns the error instance instead of
366
+ * throwing it.
367
+ *
368
+ * ```js
369
+ * if (!variables[name]) {
370
+ * throw decl.error(`Unknown variable ${name}`, { word: name })
371
+ * // CssSyntaxError: postcss-vars:a.sass:4:3: Unknown variable $black
372
+ * // color: $black
373
+ * // a
374
+ * // ^
375
+ * // background: white
376
+ * }
377
+ * ```
378
+ *
379
+ * @param message Description for the error instance.
380
+ * @param options Options for the error instance.
381
+ *
382
+ * @return Error instance is returned.
383
+ */
384
+ error(message: string, options?: Node.NodeErrorOptions): CssSyntaxError
385
+
386
+ /**
387
+ * Returns the next child of the node’s parent.
388
+ * Returns `undefined` if the current node is the last child.
389
+ *
390
+ * ```js
391
+ * if (comment.text === 'delete next') {
392
+ * const next = comment.next()
393
+ * if (next) {
394
+ * next.remove()
395
+ * }
396
+ * }
397
+ * ```
398
+ *
399
+ * @return Next node.
400
+ */
401
+ next(): Node.ChildNode | undefined
402
+
403
+ /**
404
+ * Get the position for a word or an index inside the node.
405
+ *
406
+ * @param opts Options.
407
+ * @return Position.
408
+ */
409
+ positionBy(opts?: Pick<WarningOptions, 'index' | 'word'>): Node.Position
410
+
411
+ /**
412
+ * Convert string index to line/column.
413
+ *
414
+ * @param index The symbol number in the node’s string.
415
+ * @return Symbol position in file.
416
+ */
417
+ positionInside(index: number): Node.Position
418
+
419
+ /**
420
+ * Returns the previous child of the node’s parent.
421
+ * Returns `undefined` if the current node is the first child.
422
+ *
423
+ * ```js
424
+ * const annotation = decl.prev()
425
+ * if (annotation.type === 'comment') {
426
+ * readAnnotation(annotation.text)
427
+ * }
428
+ * ```
429
+ *
430
+ * @return Previous node.
431
+ */
432
+ prev(): Node.ChildNode | undefined
433
+
434
+ /**
435
+ * Get the range for a word or start and end index inside the node.
436
+ * The start index is inclusive; the end index is exclusive.
437
+ *
438
+ * @param opts Options.
439
+ * @return Range.
440
+ */
441
+ rangeBy(
442
+ opts?: Pick<WarningOptions, 'end' | 'endIndex' | 'index' | 'start' | 'word'>
443
+ ): Node.Range
444
+
445
+ /**
446
+ * Returns a `raws` value. If the node is missing
447
+ * the code style property (because the node was manually built or cloned),
448
+ * PostCSS will try to autodetect the code style property by looking
449
+ * at other nodes in the tree.
450
+ *
451
+ * ```js
452
+ * const root = postcss.parse('a { background: white }')
453
+ * root.nodes[0].append({ prop: 'color', value: 'black' })
454
+ * root.nodes[0].nodes[1].raws.before //=> undefined
455
+ * root.nodes[0].nodes[1].raw('before') //=> ' '
456
+ * ```
457
+ *
458
+ * @param prop Name of code style property.
459
+ * @param defaultType Name of default value, it can be missed
460
+ * if the value is the same as prop.
461
+ * @return {string} Code style value.
462
+ */
463
+ raw(prop: string, defaultType?: string): string
464
+
465
+ /**
466
+ * It removes the node from its parent and deletes its parent property.
467
+ *
468
+ * ```js
469
+ * if (decl.prop.match(/^-webkit-/)) {
470
+ * decl.remove()
471
+ * }
472
+ * ```
473
+ *
474
+ * @return `this` for method chaining.
475
+ */
476
+ remove(): this
477
+
478
+ /**
479
+ * Inserts node(s) before the current node and removes the current node.
480
+ *
481
+ * ```js
482
+ * AtRule: {
483
+ * mixin: atrule => {
484
+ * atrule.replaceWith(mixinRules[atrule.params])
485
+ * }
486
+ * }
487
+ * ```
488
+ *
489
+ * @param nodes Mode(s) to replace current one.
490
+ * @return Current node to methods chain.
491
+ */
492
+ replaceWith(...nodes: NewChild[]): this
493
+
494
+ /**
495
+ * Finds the Root instance of the node’s tree.
496
+ *
497
+ * ```js
498
+ * root.nodes[0].nodes[0].root() === root
499
+ * ```
500
+ *
501
+ * @return Root parent.
502
+ */
503
+ root(): Root
504
+
505
+ /**
506
+ * Fix circular links on `JSON.stringify()`.
507
+ *
508
+ * @return Cleaned object.
509
+ */
510
+ toJSON(): object
511
+
512
+ /**
513
+ * It compiles the node to browser readable cascading style sheets string
514
+ * depending on it's type.
515
+ *
516
+ * ```js
517
+ * new Rule({ selector: 'a' }).toString() //=> "a {}"
518
+ * ```
519
+ *
520
+ * @param stringifier A syntax to use in string generation.
521
+ * @return CSS string of this node.
522
+ */
523
+ toString(stringifier?: Stringifier | Syntax): string
524
+
525
+ /**
526
+ * It is a wrapper for {@link Result#warn}, providing convenient
527
+ * way of generating warnings.
528
+ *
529
+ * ```js
530
+ * Declaration: {
531
+ * bad: (decl, { result }) => {
532
+ * decl.warn(result, 'Deprecated property: bad')
533
+ * }
534
+ * }
535
+ * ```
536
+ *
537
+ * @param result The `Result` instance that will receive the warning.
538
+ * @param message Description for the warning.
539
+ * @param options Options for the warning.
540
+ *
541
+ * @return `Warning` instance is returned
542
+ */
543
+ warn(result: Result, message: string, options?: WarningOptions): Warning
544
+
545
+ /**
546
+ * If this node isn't already dirty, marks it and its ancestors as such. This
547
+ * indicates to the LazyResult processor that the {@link Root} has been
548
+ * modified by the current plugin and may need to be processed again by other
549
+ * plugins.
550
+ */
551
+ protected markDirty(): void
552
+ }
553
+
554
+ declare class Node extends Node_ {}
555
+
556
+ export = Node