@ohos-ports/rsbuild-core 2.2.9-beta.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 (269) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +27 -0
  3. package/bin/rsbuild.js +20 -0
  4. package/compiled/@rstackjs/load-config/index.d.ts +87 -0
  5. package/compiled/@rstackjs/load-config/license +21 -0
  6. package/compiled/@rstackjs/load-config/package.json +1 -0
  7. package/compiled/chokidar/index.d.ts +385 -0
  8. package/compiled/chokidar/license +21 -0
  9. package/compiled/chokidar/package.json +1 -0
  10. package/compiled/connect-next/index.d.ts +57 -0
  11. package/compiled/connect-next/license +26 -0
  12. package/compiled/connect-next/package.json +1 -0
  13. package/compiled/cors/index.d.ts +56 -0
  14. package/compiled/cors/license +22 -0
  15. package/compiled/cors/package.json +1 -0
  16. package/compiled/css-loader/api.js +85 -0
  17. package/compiled/css-loader/getUrl.js +26 -0
  18. package/compiled/css-loader/index.d.ts +1 -0
  19. package/compiled/css-loader/index.js +2 -0
  20. package/compiled/css-loader/license +20 -0
  21. package/compiled/css-loader/noSourceMaps.js +5 -0
  22. package/compiled/css-loader/package.json +1 -0
  23. package/compiled/css-loader/sourceMaps.js +16 -0
  24. package/compiled/html-rspack-plugin/default_index.ejs +9 -0
  25. package/compiled/html-rspack-plugin/htmlLoader.js +157 -0
  26. package/compiled/html-rspack-plugin/index.d.ts +395 -0
  27. package/compiled/html-rspack-plugin/index.js +2400 -0
  28. package/compiled/html-rspack-plugin/license +20 -0
  29. package/compiled/html-rspack-plugin/package.json +1 -0
  30. package/compiled/http-proxy-middleware/index.d.ts +455 -0
  31. package/compiled/http-proxy-middleware/license +22 -0
  32. package/compiled/http-proxy-middleware/package.json +1 -0
  33. package/compiled/jiti/LICENSE +21 -0
  34. package/compiled/jiti/README.md +258 -0
  35. package/compiled/jiti/dist/babel.cjs +47446 -0
  36. package/compiled/jiti/dist/jiti.cjs +5990 -0
  37. package/compiled/jiti/lib/jiti-cli.mjs +19 -0
  38. package/compiled/jiti/lib/jiti-hooks.mjs +89 -0
  39. package/compiled/jiti/lib/jiti-native.mjs +76 -0
  40. package/compiled/jiti/lib/jiti-register.d.mts +1 -0
  41. package/compiled/jiti/lib/jiti-register.mjs +2 -0
  42. package/compiled/jiti/lib/jiti-static.mjs +19 -0
  43. package/compiled/jiti/lib/jiti.cjs +24 -0
  44. package/compiled/jiti/lib/jiti.d.cts +8 -0
  45. package/compiled/jiti/lib/jiti.d.mts +8 -0
  46. package/compiled/jiti/lib/jiti.mjs +23 -0
  47. package/compiled/jiti/lib/types.d.ts +420 -0
  48. package/compiled/jiti/package.json +146 -0
  49. package/compiled/postcss/index.js +1 -0
  50. package/compiled/postcss/lib/at-rule.d.ts +139 -0
  51. package/compiled/postcss/lib/comment.d.ts +67 -0
  52. package/compiled/postcss/lib/container.d.ts +474 -0
  53. package/compiled/postcss/lib/css-syntax-error.d.ts +247 -0
  54. package/compiled/postcss/lib/declaration.d.ts +150 -0
  55. package/compiled/postcss/lib/document.d.ts +68 -0
  56. package/compiled/postcss/lib/fromJSON.d.ts +9 -0
  57. package/compiled/postcss/lib/input.d.ts +226 -0
  58. package/compiled/postcss/lib/lazy-result.d.ts +189 -0
  59. package/compiled/postcss/lib/list.d.ts +60 -0
  60. package/compiled/postcss/lib/no-work-result.d.ts +45 -0
  61. package/compiled/postcss/lib/node.d.ts +555 -0
  62. package/compiled/postcss/lib/parse.d.ts +9 -0
  63. package/compiled/postcss/lib/postcss.d.ts +464 -0
  64. package/compiled/postcss/lib/previous-map.d.ts +80 -0
  65. package/compiled/postcss/lib/processor.d.ts +114 -0
  66. package/compiled/postcss/lib/result.d.ts +204 -0
  67. package/compiled/postcss/lib/root.d.ts +86 -0
  68. package/compiled/postcss/lib/rule.d.ts +126 -0
  69. package/compiled/postcss/lib/source-map-js.d.ts +4 -0
  70. package/compiled/postcss/lib/stringifier.d.ts +45 -0
  71. package/compiled/postcss/lib/stringify.d.ts +9 -0
  72. package/compiled/postcss/lib/warning.d.ts +146 -0
  73. package/compiled/postcss/license +20 -0
  74. package/compiled/postcss/package.json +1 -0
  75. package/compiled/postcss-loader/index.d.ts +1 -0
  76. package/compiled/postcss-loader/index.js +721 -0
  77. package/compiled/postcss-loader/license +20 -0
  78. package/compiled/postcss-loader/package.json +1 -0
  79. package/compiled/rslog/index.d.ts +98 -0
  80. package/compiled/rslog/license +21 -0
  81. package/compiled/rslog/package.json +1 -0
  82. package/compiled/rspack-chain/license +22 -0
  83. package/compiled/rspack-chain/package.json +1 -0
  84. package/compiled/rspack-chain/types/index.d.ts +515 -0
  85. package/compiled/rspack-manifest-plugin/index.d.ts +52 -0
  86. package/compiled/rspack-manifest-plugin/license +21 -0
  87. package/compiled/rspack-manifest-plugin/package.json +1 -0
  88. package/compiled/style-loader/index.d.ts +1 -0
  89. package/compiled/style-loader/index.js +370 -0
  90. package/compiled/style-loader/license +20 -0
  91. package/compiled/style-loader/package.json +1 -0
  92. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  93. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  94. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  95. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  96. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  97. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  98. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  99. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  100. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  101. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  102. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  103. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  104. package/compiled/ws/index.d.ts +445 -0
  105. package/compiled/ws/license +21 -0
  106. package/compiled/ws/package.json +1 -0
  107. package/dist/build.d.ts +4 -0
  108. package/dist/c.js +10 -0
  109. package/dist/chokidar.js +2 -0
  110. package/dist/chokidar.js.LICENSE.txt +1 -0
  111. package/dist/cli/commands.d.ts +31 -0
  112. package/dist/cli/index.d.ts +7 -0
  113. package/dist/cli/init.d.ts +7 -0
  114. package/dist/client/f~0.js +22 -0
  115. package/dist/client/hmr.js +267 -0
  116. package/dist/client/overlay.js +214 -0
  117. package/dist/configChain.d.ts +84 -0
  118. package/dist/connect-next.js +2 -0
  119. package/dist/connect-next.js.LICENSE.txt +57 -0
  120. package/dist/constants.d.ts +67 -0
  121. package/dist/cors.js +188 -0
  122. package/dist/cors.js.LICENSE.txt +11 -0
  123. package/dist/createCompiler.d.ts +6 -0
  124. package/dist/createContext.d.ts +12 -0
  125. package/dist/createRsbuild.d.ts +4 -0
  126. package/dist/cssUrlLoader.mjs +34 -0
  127. package/dist/defaultConfig.d.ts +23 -0
  128. package/dist/freshImport.js +90 -0
  129. package/dist/helpers/cachedImport.d.ts +2 -0
  130. package/dist/helpers/compiler.d.ts +5 -0
  131. package/dist/helpers/css.d.ts +3 -0
  132. package/dist/helpers/exitHook.d.ts +3 -0
  133. package/dist/helpers/format.d.ts +4 -0
  134. package/dist/helpers/fs.d.ts +16 -0
  135. package/dist/helpers/html.d.ts +2 -0
  136. package/dist/helpers/index.d.ts +29 -0
  137. package/dist/helpers/overlayConfig.d.ts +4 -0
  138. package/dist/helpers/packageJson.d.ts +9 -0
  139. package/dist/helpers/path.d.ts +22 -0
  140. package/dist/helpers/restartManager.d.ts +15 -0
  141. package/dist/helpers/stats.d.ts +17 -0
  142. package/dist/helpers/url.d.ts +11 -0
  143. package/dist/helpers/vendors.d.ts +12 -0
  144. package/dist/helpers/version.d.ts +7 -0
  145. package/dist/hooks.d.ts +41 -0
  146. package/dist/http-proxy-middleware.js +14 -0
  147. package/dist/http-proxy-middleware.js.LICENSE.txt +34 -0
  148. package/dist/ignoreCssLoader.mjs +9 -0
  149. package/dist/index.d.ts +28 -0
  150. package/dist/index.js +1 -0
  151. package/dist/initConfigs.d.ts +18 -0
  152. package/dist/initPlugins.d.ts +7 -0
  153. package/dist/inspectConfig.d.ts +7 -0
  154. package/dist/launch-editor-middleware.js +1 -0
  155. package/dist/loadConfig.d.ts +31 -0
  156. package/dist/loadEnv.d.ts +54 -0
  157. package/dist/loader/cssUrlLoader.d.ts +9 -0
  158. package/dist/loader/ignoreCssLoader.d.ts +10 -0
  159. package/dist/loader/transformLoader.d.ts +8 -0
  160. package/dist/loader/transformRawLoader.d.ts +4 -0
  161. package/dist/loader/workerLoader.d.ts +6 -0
  162. package/dist/logger.d.ts +24 -0
  163. package/dist/m.js +10348 -0
  164. package/dist/m.js.LICENSE.txt +26 -0
  165. package/dist/manifest-plugin.js +1 -0
  166. package/dist/memfs.js +1 -0
  167. package/dist/mergeConfig.d.ts +7 -0
  168. package/dist/open.js +2 -0
  169. package/dist/pluginHelper.d.ts +4 -0
  170. package/dist/pluginManager.d.ts +19 -0
  171. package/dist/plugins/appIcon.d.ts +2 -0
  172. package/dist/plugins/asset.d.ts +3 -0
  173. package/dist/plugins/basic.d.ts +4 -0
  174. package/dist/plugins/cache.d.ts +2 -0
  175. package/dist/plugins/cleanOutput.d.ts +2 -0
  176. package/dist/plugins/css.d.ts +8 -0
  177. package/dist/plugins/define.d.ts +2 -0
  178. package/dist/plugins/entry.d.ts +2 -0
  179. package/dist/plugins/externals.d.ts +9 -0
  180. package/dist/plugins/fileSize.d.ts +7 -0
  181. package/dist/plugins/html.d.ts +9 -0
  182. package/dist/plugins/inlineChunk.d.ts +6 -0
  183. package/dist/plugins/lazyCompilation.d.ts +2 -0
  184. package/dist/plugins/manifest.d.ts +2 -0
  185. package/dist/plugins/minimize.d.ts +10 -0
  186. package/dist/plugins/moduleFederation.d.ts +2 -0
  187. package/dist/plugins/nodeAddons.d.ts +2 -0
  188. package/dist/plugins/nonce.d.ts +2 -0
  189. package/dist/plugins/output.d.ts +2 -0
  190. package/dist/plugins/progress.d.ts +2 -0
  191. package/dist/plugins/resolve.d.ts +2 -0
  192. package/dist/plugins/resourceHints.d.ts +2 -0
  193. package/dist/plugins/rsdoctor.d.ts +2 -0
  194. package/dist/plugins/rspackProfile.d.ts +4 -0
  195. package/dist/plugins/server.d.ts +3 -0
  196. package/dist/plugins/sourceMap.d.ts +2 -0
  197. package/dist/plugins/splitChunks.d.ts +4 -0
  198. package/dist/plugins/sri.d.ts +2 -0
  199. package/dist/plugins/swc.d.ts +4 -0
  200. package/dist/plugins/target.d.ts +2 -0
  201. package/dist/plugins/wasm.d.ts +2 -0
  202. package/dist/plugins/worker.d.ts +2 -0
  203. package/dist/r.js +7 -0
  204. package/dist/range-parser.js +55 -0
  205. package/dist/range-parser.js.LICENSE.txt +6 -0
  206. package/dist/remapping.js +201 -0
  207. package/dist/restart.d.ts +15 -0
  208. package/dist/rslib-runtime.js +49 -0
  209. package/dist/rspack-plugins/RsbuildHtmlPlugin.d.ts +37 -0
  210. package/dist/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +36 -0
  211. package/dist/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +27 -0
  212. package/dist/rspack-plugins/resource-hints/extractChunks.d.ts +22 -0
  213. package/dist/rspack-plugins/resource-hints/getResourceType.d.ts +21 -0
  214. package/dist/rspackConfig.d.ts +8 -0
  215. package/dist/server/ansiHTML.d.ts +3 -0
  216. package/dist/server/assets-middleware/getFileFromUrl.d.ts +11 -0
  217. package/dist/server/assets-middleware/index.d.ts +35 -0
  218. package/dist/server/assets-middleware/memoryFileSystem.d.ts +2 -0
  219. package/dist/server/assets-middleware/middleware.d.ts +7 -0
  220. package/dist/server/assets-middleware/parseTokenList.d.ts +1 -0
  221. package/dist/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
  222. package/dist/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
  223. package/dist/server/browserLogs.d.ts +8 -0
  224. package/dist/server/buildManager.d.ts +32 -0
  225. package/dist/server/cliShortcuts.d.ts +19 -0
  226. package/dist/server/compileState.d.ts +5 -0
  227. package/dist/server/devMiddlewares.d.ts +18 -0
  228. package/dist/server/devServer.d.ts +47 -0
  229. package/dist/server/environment.d.ts +8 -0
  230. package/dist/server/gracefulShutdown.d.ts +8 -0
  231. package/dist/server/gzipMiddleware.d.ts +2 -0
  232. package/dist/server/helper.d.ts +118 -0
  233. package/dist/server/historyApiFallback.d.ts +10 -0
  234. package/dist/server/hmrFallback.d.ts +1 -0
  235. package/dist/server/httpServer.d.ts +7 -0
  236. package/dist/server/middlewares.d.ts +31 -0
  237. package/dist/server/open.d.ts +12 -0
  238. package/dist/server/overlay.d.ts +3 -0
  239. package/dist/server/previewServer.d.ts +4 -0
  240. package/dist/server/proxy.d.ts +7 -0
  241. package/dist/server/publicPathnames.d.ts +2 -0
  242. package/dist/server/runner/asModule.d.ts +2 -0
  243. package/dist/server/runner/basic.d.ts +25 -0
  244. package/dist/server/runner/cjs.d.ts +10 -0
  245. package/dist/server/runner/esm.d.ts +6 -0
  246. package/dist/server/runner/index.d.ts +6 -0
  247. package/dist/server/runner/type.d.ts +42 -0
  248. package/dist/server/serverSetup.d.ts +2 -0
  249. package/dist/server/socketServer.d.ts +113 -0
  250. package/dist/server/watchFiles.d.ts +15 -0
  251. package/dist/sirv.js +122 -0
  252. package/dist/tinyglobby.js +1 -0
  253. package/dist/trace-mapping.js +548 -0
  254. package/dist/transformLoader.mjs +36 -0
  255. package/dist/transformRawLoader.mjs +4 -0
  256. package/dist/types/config.d.ts +1796 -0
  257. package/dist/types/context.d.ts +89 -0
  258. package/dist/types/hooks.d.ts +261 -0
  259. package/dist/types/index.d.ts +8 -0
  260. package/dist/types/plugin.d.ts +479 -0
  261. package/dist/types/rsbuild.d.ts +241 -0
  262. package/dist/types/rspack.d.ts +10 -0
  263. package/dist/types/thirdParty.d.ts +161 -0
  264. package/dist/types/utils.d.ts +16 -0
  265. package/dist/workerLoader.mjs +94 -0
  266. package/dist/ws.js +2 -0
  267. package/package.json +107 -0
  268. package/static/openChrome.applescript +95 -0
  269. package/types.d.ts +422 -0
package/types.d.ts ADDED
@@ -0,0 +1,422 @@
1
+ /// <reference types="@rspack/core/module" />
2
+
3
+ /**
4
+ * This is a placeholder for extending the type options.
5
+ * You can augment this interface to enable stricter type checking.
6
+ * @example
7
+ * ```ts
8
+ * interface RsbuildTypeOptions {
9
+ * // This will enable strict type checking for `import.meta.env`.
10
+ * strictImportMetaEnv: true;
11
+ * }
12
+ * ```
13
+ */
14
+ // rslint-disable-next-line @typescript-eslint/no-empty-object-type
15
+ interface RsbuildTypeOptions {}
16
+
17
+ /**
18
+ * import.meta
19
+ */
20
+ type ImportMetaEnvFallbackKey =
21
+ 'strictImportMetaEnv' extends keyof RsbuildTypeOptions ? never : string;
22
+
23
+ interface ImportMetaEnv extends Record<ImportMetaEnvFallbackKey, any> {
24
+ /**
25
+ * The value of the `mode` configuration.
26
+ * @example
27
+ * if (import.meta.env.MODE === 'development') {
28
+ * console.log('development mode');
29
+ * }
30
+ */
31
+ MODE: 'development' | 'production' | 'none';
32
+ /**
33
+ * If `mode` is `'development'`, the value is `true`; otherwise, it is `false`.
34
+ * @example
35
+ * if (import.meta.env.DEV) {
36
+ * console.log('development mode');
37
+ * }
38
+ */
39
+ DEV: boolean;
40
+ /**
41
+ * If `mode` is `'production'`, the value is `true`; otherwise, it is `false`.
42
+ * @example
43
+ * if (import.meta.env.PROD) {
44
+ * console.log('production mode');
45
+ * }
46
+ */
47
+ PROD: boolean;
48
+ /**
49
+ * Whether the current build is for the server (SSR).
50
+ * If `output.target` is `'node'`, the value is `true`; otherwise, it is `false`.
51
+ * @example
52
+ * if (import.meta.env.SSR) {
53
+ * console.log('SSR build');
54
+ * }
55
+ */
56
+ SSR: boolean;
57
+ /**
58
+ * The value of the `server.base` configuration.
59
+ * @example
60
+ * const image = new Image();
61
+ * // Equivalent to "/foo/favicon.ico"
62
+ * image.src = `${import.meta.env.BASE_URL}/favicon.ico`;
63
+ */
64
+ BASE_URL: string;
65
+ /**
66
+ * The URL prefix of static assets
67
+ * - In development, it is equivalent to the value set by `dev.assetPrefix`.
68
+ * - In production, it is equivalent to the value set by `output.assetPrefix`.
69
+ * - Rsbuild will automatically remove the trailing slash from `assetPrefix`
70
+ * to make string concatenation easier.
71
+ * @example
72
+ * const image = new Image();
73
+ * image.src = `${import.meta.env.ASSET_PREFIX}/favicon.ico`;
74
+ */
75
+ ASSET_PREFIX: string;
76
+ }
77
+ interface ImportMeta {
78
+ readonly env: ImportMetaEnv;
79
+ }
80
+
81
+ declare namespace Rspack {
82
+ interface Hot {
83
+ on: <Data = any>(event: string, cb: (data: Data) => void) => void;
84
+ }
85
+ }
86
+
87
+ /**
88
+ * Image assets
89
+ */
90
+ declare module '*.bmp' {
91
+ const src: string;
92
+ export default src;
93
+ }
94
+ declare module '*.gif' {
95
+ const src: string;
96
+ export default src;
97
+ }
98
+ declare module '*.jpg' {
99
+ const src: string;
100
+ export default src;
101
+ }
102
+ declare module '*.jpeg' {
103
+ const src: string;
104
+ export default src;
105
+ }
106
+ declare module '*.pjpeg' {
107
+ const src: string;
108
+ export default src;
109
+ }
110
+ declare module '*.pjp' {
111
+ const src: string;
112
+ export default src;
113
+ }
114
+ declare module '*.png' {
115
+ const src: string;
116
+ export default src;
117
+ }
118
+ declare module '*.ico' {
119
+ const src: string;
120
+ export default src;
121
+ }
122
+ declare module '*.webp' {
123
+ const src: string;
124
+ export default src;
125
+ }
126
+ declare module '*.svg' {
127
+ const src: string;
128
+ export default src;
129
+ }
130
+ declare module '*.apng' {
131
+ const src: string;
132
+ export default src;
133
+ }
134
+ declare module '*.avif' {
135
+ const src: string;
136
+ export default src;
137
+ }
138
+ declare module '*.tif' {
139
+ const src: string;
140
+ export default src;
141
+ }
142
+ declare module '*.tiff' {
143
+ const src: string;
144
+ export default src;
145
+ }
146
+ declare module '*.jfif' {
147
+ const src: string;
148
+ export default src;
149
+ }
150
+ declare module '*.cur' {
151
+ const src: string;
152
+ export default src;
153
+ }
154
+ declare module '*.jxl' {
155
+ const src: string;
156
+ export default src;
157
+ }
158
+
159
+ /**
160
+ * Font assets
161
+ */
162
+ declare module '*.woff' {
163
+ const src: string;
164
+ export default src;
165
+ }
166
+ declare module '*.woff2' {
167
+ const src: string;
168
+ export default src;
169
+ }
170
+ declare module '*.eot' {
171
+ const src: string;
172
+ export default src;
173
+ }
174
+ declare module '*.ttf' {
175
+ const src: string;
176
+ export default src;
177
+ }
178
+ declare module '*.otf' {
179
+ const src: string;
180
+ export default src;
181
+ }
182
+ declare module '*.ttc' {
183
+ const src: string;
184
+ export default src;
185
+ }
186
+
187
+ /**
188
+ * Media assets
189
+ */
190
+ declare module '*.mp4' {
191
+ const src: string;
192
+ export default src;
193
+ }
194
+ declare module '*.webm' {
195
+ const src: string;
196
+ export default src;
197
+ }
198
+ declare module '*.ogg' {
199
+ const src: string;
200
+ export default src;
201
+ }
202
+ declare module '*.mp3' {
203
+ const src: string;
204
+ export default src;
205
+ }
206
+ declare module '*.wav' {
207
+ const src: string;
208
+ export default src;
209
+ }
210
+ declare module '*.flac' {
211
+ const src: string;
212
+ export default src;
213
+ }
214
+ declare module '*.aac' {
215
+ const src: string;
216
+ export default src;
217
+ }
218
+ declare module '*.mov' {
219
+ const src: string;
220
+ export default src;
221
+ }
222
+ declare module '*.m4a' {
223
+ const src: string;
224
+ export default src;
225
+ }
226
+ declare module '*.opus' {
227
+ const src: string;
228
+ export default src;
229
+ }
230
+ declare module '*.vtt' {
231
+ const src: string;
232
+ export default src;
233
+ }
234
+
235
+ /**
236
+ * Other assets
237
+ */
238
+ declare module '*.webmanifest' {
239
+ const src: string;
240
+ export default src;
241
+ }
242
+ declare module '*.pdf' {
243
+ const src: string;
244
+ export default src;
245
+ }
246
+ declare module '*.txt' {
247
+ const src: string;
248
+ export default src;
249
+ }
250
+
251
+ /**
252
+ * @requires [@rsbuild/plugin-yaml](https://npmjs.com/package/@rsbuild/plugin-yaml)
253
+ */
254
+ declare module '*.yaml' {
255
+ const content: Record<string, any>;
256
+ export default content;
257
+ }
258
+ /**
259
+ * @requires [@rsbuild/plugin-yaml](https://npmjs.com/package/@rsbuild/plugin-yaml)
260
+ */
261
+ declare module '*.yml' {
262
+ const content: Record<string, any>;
263
+ export default content;
264
+ }
265
+ /**
266
+ * @requires [@rsbuild/plugin-toml](https://npmjs.com/package/@rsbuild/plugin-toml)
267
+ */
268
+ declare module '*.toml' {
269
+ const content: Record<string, any>;
270
+ export default content;
271
+ }
272
+
273
+ /**
274
+ * Imports the file as a URL string.
275
+ * @note Only works for static assets and CSS files by default.
276
+ * @example
277
+ * import logoUrl from './logo.png?url'
278
+ * console.log(logoUrl) // 'http://example.com/logo.123456.png'
279
+ *
280
+ * import cssUrl from './style.css?url'
281
+ * console.log(cssUrl) // 'http://example.com/style.123456.css'
282
+ */
283
+ declare module '*?url' {
284
+ const content: string;
285
+ export default content;
286
+ }
287
+
288
+ /**
289
+ * Imports the file as a Web Worker constructor.
290
+ * @example
291
+ * import MyWorker from './worker.ts?worker';
292
+ * const worker = new MyWorker();
293
+ */
294
+ declare module '*?worker' {
295
+ const WorkerConstructor: {
296
+ new (options?: { name?: string }): Worker;
297
+ };
298
+ export default WorkerConstructor;
299
+ }
300
+
301
+ /**
302
+ * Imports the file as an inline Web Worker constructor.
303
+ * @example
304
+ * import MyWorker from './worker.ts?worker&inline';
305
+ * const worker = new MyWorker();
306
+ */
307
+ declare module '*?worker&inline' {
308
+ const WorkerConstructor: {
309
+ new (options?: { name?: string }): Worker;
310
+ };
311
+ export default WorkerConstructor;
312
+ }
313
+
314
+ declare module '*?inline&worker' {
315
+ const WorkerConstructor: {
316
+ new (options?: { name?: string }): Worker;
317
+ };
318
+ export default WorkerConstructor;
319
+ }
320
+
321
+ /**
322
+ * Imports the file content as a base64 encoded string.
323
+ * @note Only works for static assets and CSS files by default.
324
+ * @example
325
+ * import logo from './logo.svg?inline'
326
+ * console.log(logo) // 'data:image/svg+xml;base64,...'
327
+ *
328
+ * import inlineCss from './style.css?inline';
329
+ * console.log(inlineCss); // Compiled CSS content
330
+ */
331
+ declare module '*?inline' {
332
+ const content: string;
333
+ export default content;
334
+ }
335
+
336
+ /**
337
+ * Imports the raw content of the file as a string.
338
+ * @note Only works for static assets, CSS files, and scripts
339
+ * (JS, TS, JSX, TSX) by default.
340
+ * @example
341
+ * import raw from './logo.svg?raw'
342
+ * console.log(raw) // '<svg viewBox="0 0 24 24">...</svg>'
343
+ *
344
+ * import rawJs from './script.js?raw'
345
+ * console.log(rawJs) // 'console.log("Hello world");'
346
+ *
347
+ * import rawCss from './style.css?raw'
348
+ * console.log(rawCss) // 'body { background: red; }'
349
+ */
350
+ declare module '*?raw' {
351
+ const content: string;
352
+ export default content;
353
+ }
354
+
355
+ /**
356
+ * CSS Modules
357
+ */
358
+ type CSSModuleClasses = Readonly<Record<string, string>>;
359
+ declare module '*.module.css' {
360
+ const classes: CSSModuleClasses;
361
+ export default classes;
362
+ }
363
+ /**
364
+ * @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
365
+ */
366
+ declare module '*.module.scss' {
367
+ const classes: CSSModuleClasses;
368
+ export default classes;
369
+ }
370
+ /**
371
+ * @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
372
+ */
373
+ declare module '*.module.sass' {
374
+ const classes: CSSModuleClasses;
375
+ export default classes;
376
+ }
377
+ /**
378
+ * @requires [@rsbuild/plugin-less](https://npmjs.com/package/@rsbuild/plugin-less)
379
+ */
380
+ declare module '*.module.less' {
381
+ const classes: CSSModuleClasses;
382
+ export default classes;
383
+ }
384
+ /**
385
+ * @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
386
+ */
387
+ declare module '*.module.styl' {
388
+ const classes: CSSModuleClasses;
389
+ export default classes;
390
+ }
391
+ /**
392
+ * @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
393
+ */
394
+ declare module '*.module.stylus' {
395
+ const classes: CSSModuleClasses;
396
+ export default classes;
397
+ }
398
+
399
+ /**
400
+ * CSS
401
+ */
402
+ declare module '*.css' {}
403
+ /**
404
+ * @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
405
+ */
406
+ declare module '*.scss' {}
407
+ /**
408
+ * @requires [@rsbuild/plugin-sass](https://npmjs.com/package/@rsbuild/plugin-sass)
409
+ */
410
+ declare module '*.sass' {}
411
+ /**
412
+ * @requires [@rsbuild/plugin-less](https://npmjs.com/package/@rsbuild/plugin-less)
413
+ */
414
+ declare module '*.less' {}
415
+ /**
416
+ * @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
417
+ */
418
+ declare module '*.styl' {}
419
+ /**
420
+ * @requires [@rsbuild/plugin-stylus](https://npmjs.com/package/@rsbuild/plugin-stylus)
421
+ */
422
+ declare module '*.stylus' {}