client.d.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. /// <reference path="./types/importMeta.d.ts" />
  2. // CSS modules
  3. type CSSModuleClasses = { readonly [key: string]: string }
  4. declare module '*.module.css' {
  5. const classes: CSSModuleClasses
  6. export default classes
  7. }
  8. declare module '*.module.scss' {
  9. const classes: CSSModuleClasses
  10. export default classes
  11. }
  12. declare module '*.module.sass' {
  13. const classes: CSSModuleClasses
  14. export default classes
  15. }
  16. declare module '*.module.less' {
  17. const classes: CSSModuleClasses
  18. export default classes
  19. }
  20. declare module '*.module.styl' {
  21. const classes: CSSModuleClasses
  22. export default classes
  23. }
  24. declare module '*.module.stylus' {
  25. const classes: CSSModuleClasses
  26. export default classes
  27. }
  28. declare module '*.module.pcss' {
  29. const classes: CSSModuleClasses
  30. export default classes
  31. }
  32. declare module '*.module.sss' {
  33. const classes: CSSModuleClasses
  34. export default classes
  35. }
  36. // CSS
  37. declare module '*.css' {
  38. /**
  39. * @deprecated Use `import style from './style.css?inline'` instead.
  40. */
  41. const css: string
  42. export default css
  43. }
  44. declare module '*.scss' {
  45. /**
  46. * @deprecated Use `import style from './style.scss?inline'` instead.
  47. */
  48. const css: string
  49. export default css
  50. }
  51. declare module '*.sass' {
  52. /**
  53. * @deprecated Use `import style from './style.sass?inline'` instead.
  54. */
  55. const css: string
  56. export default css
  57. }
  58. declare module '*.less' {
  59. /**
  60. * @deprecated Use `import style from './style.less?inline'` instead.
  61. */
  62. const css: string
  63. export default css
  64. }
  65. declare module '*.styl' {
  66. /**
  67. * @deprecated Use `import style from './style.styl?inline'` instead.
  68. */
  69. const css: string
  70. export default css
  71. }
  72. declare module '*.stylus' {
  73. /**
  74. * @deprecated Use `import style from './style.stylus?inline'` instead.
  75. */
  76. const css: string
  77. export default css
  78. }
  79. declare module '*.pcss' {
  80. /**
  81. * @deprecated Use `import style from './style.pcss?inline'` instead.
  82. */
  83. const css: string
  84. export default css
  85. }
  86. declare module '*.sss' {
  87. /**
  88. * @deprecated Use `import style from './style.sss?inline'` instead.
  89. */
  90. const css: string
  91. export default css
  92. }
  93. // Built-in asset types
  94. // see `src/node/constants.ts`
  95. // images
  96. declare module '*.apng' {
  97. const src: string
  98. export default src
  99. }
  100. declare module '*.png' {
  101. const src: string
  102. export default src
  103. }
  104. declare module '*.jpg' {
  105. const src: string
  106. export default src
  107. }
  108. declare module '*.jpeg' {
  109. const src: string
  110. export default src
  111. }
  112. declare module '*.jfif' {
  113. const src: string
  114. export default src
  115. }
  116. declare module '*.pjpeg' {
  117. const src: string
  118. export default src
  119. }
  120. declare module '*.pjp' {
  121. const src: string
  122. export default src
  123. }
  124. declare module '*.gif' {
  125. const src: string
  126. export default src
  127. }
  128. declare module '*.svg' {
  129. const src: string
  130. export default src
  131. }
  132. declare module '*.ico' {
  133. const src: string
  134. export default src
  135. }
  136. declare module '*.webp' {
  137. const src: string
  138. export default src
  139. }
  140. declare module '*.avif' {
  141. const src: string
  142. export default src
  143. }
  144. // media
  145. declare module '*.mp4' {
  146. const src: string
  147. export default src
  148. }
  149. declare module '*.webm' {
  150. const src: string
  151. export default src
  152. }
  153. declare module '*.ogg' {
  154. const src: string
  155. export default src
  156. }
  157. declare module '*.mp3' {
  158. const src: string
  159. export default src
  160. }
  161. declare module '*.wav' {
  162. const src: string
  163. export default src
  164. }
  165. declare module '*.flac' {
  166. const src: string
  167. export default src
  168. }
  169. declare module '*.aac' {
  170. const src: string
  171. export default src
  172. }
  173. declare module '*.opus' {
  174. const src: string
  175. export default src
  176. }
  177. // fonts
  178. declare module '*.woff' {
  179. const src: string
  180. export default src
  181. }
  182. declare module '*.woff2' {
  183. const src: string
  184. export default src
  185. }
  186. declare module '*.eot' {
  187. const src: string
  188. export default src
  189. }
  190. declare module '*.ttf' {
  191. const src: string
  192. export default src
  193. }
  194. declare module '*.otf' {
  195. const src: string
  196. export default src
  197. }
  198. // other
  199. declare module '*.webmanifest' {
  200. const src: string
  201. export default src
  202. }
  203. declare module '*.pdf' {
  204. const src: string
  205. export default src
  206. }
  207. declare module '*.txt' {
  208. const src: string
  209. export default src
  210. }
  211. // wasm?init
  212. declare module '*.wasm?init' {
  213. const initWasm: (
  214. options: WebAssembly.Imports,
  215. ) => Promise<WebAssembly.Instance>
  216. export default initWasm
  217. }
  218. // web worker
  219. declare module '*?worker' {
  220. const workerConstructor: {
  221. new (): Worker
  222. }
  223. export default workerConstructor
  224. }
  225. declare module '*?worker&inline' {
  226. const workerConstructor: {
  227. new (): Worker
  228. }
  229. export default workerConstructor
  230. }
  231. declare module '*?worker&url' {
  232. const src: string
  233. export default src
  234. }
  235. declare module '*?sharedworker' {
  236. const sharedWorkerConstructor: {
  237. new (): SharedWorker
  238. }
  239. export default sharedWorkerConstructor
  240. }
  241. declare module '*?sharedworker&inline' {
  242. const sharedWorkerConstructor: {
  243. new (): SharedWorker
  244. }
  245. export default sharedWorkerConstructor
  246. }
  247. declare module '*?sharedworker&url' {
  248. const src: string
  249. export default src
  250. }
  251. declare module '*?raw' {
  252. const src: string
  253. export default src
  254. }
  255. declare module '*?url' {
  256. const src: string
  257. export default src
  258. }
  259. declare module '*?inline' {
  260. const src: string
  261. export default src
  262. }