create-automatic-runtime.d.ts 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. /**
  2. * Create an automatic runtime.
  3. *
  4. * @param {ReturnType<CreateH>} f
  5. * `h` function.
  6. * @returns
  7. * Automatic JSX runtime.
  8. */
  9. export function createAutomaticRuntime(f: ReturnType<typeof CreateH>): {
  10. Fragment: null;
  11. jsxDEV: {
  12. /**
  13. * @overload
  14. * @param {null} type
  15. * @param {{children?: Child}} properties
  16. * @param {string | null | undefined} [key]
  17. * @returns {Root}
  18. *
  19. * @overload
  20. * @param {string} type
  21. * @param {JSXProps} properties
  22. * @param {string | null | undefined} [key]
  23. * @returns {Element}
  24. *
  25. * @param {string | null} type
  26. * Element name or `null` to get a root.
  27. * @param {Properties & {children?: Child}} properties
  28. * Properties.
  29. * @returns {Result}
  30. * Result.
  31. */
  32. (type: null, properties: {
  33. children?: Child;
  34. }, key?: string | null | undefined): Root;
  35. /**
  36. * @overload
  37. * @param {null} type
  38. * @param {{children?: Child}} properties
  39. * @param {string | null | undefined} [key]
  40. * @returns {Root}
  41. *
  42. * @overload
  43. * @param {string} type
  44. * @param {JSXProps} properties
  45. * @param {string | null | undefined} [key]
  46. * @returns {Element}
  47. *
  48. * @param {string | null} type
  49. * Element name or `null` to get a root.
  50. * @param {Properties & {children?: Child}} properties
  51. * Properties.
  52. * @returns {Result}
  53. * Result.
  54. */
  55. (type: string, properties: JSXProps, key?: string | null | undefined): Element;
  56. };
  57. jsxs: {
  58. /**
  59. * @overload
  60. * @param {null} type
  61. * @param {{children?: Child}} properties
  62. * @param {string | null | undefined} [key]
  63. * @returns {Root}
  64. *
  65. * @overload
  66. * @param {string} type
  67. * @param {JSXProps} properties
  68. * @param {string | null | undefined} [key]
  69. * @returns {Element}
  70. *
  71. * @param {string | null} type
  72. * Element name or `null` to get a root.
  73. * @param {Properties & {children?: Child}} properties
  74. * Properties.
  75. * @returns {Result}
  76. * Result.
  77. */
  78. /**
  79. * @overload
  80. * @param {null} type
  81. * @param {{children?: Child}} properties
  82. * @param {string | null | undefined} [key]
  83. * @returns {Root}
  84. *
  85. * @overload
  86. * @param {string} type
  87. * @param {JSXProps} properties
  88. * @param {string | null | undefined} [key]
  89. * @returns {Element}
  90. *
  91. * @param {string | null} type
  92. * Element name or `null` to get a root.
  93. * @param {Properties & {children?: Child}} properties
  94. * Properties.
  95. * @returns {Result}
  96. * Result.
  97. */
  98. (type: null, properties: {
  99. children?: Child;
  100. }, key?: string | null | undefined): Root;
  101. /**
  102. * @overload
  103. * @param {null} type
  104. * @param {{children?: Child}} properties
  105. * @param {string | null | undefined} [key]
  106. * @returns {Root}
  107. *
  108. * @overload
  109. * @param {string} type
  110. * @param {JSXProps} properties
  111. * @param {string | null | undefined} [key]
  112. * @returns {Element}
  113. *
  114. * @param {string | null} type
  115. * Element name or `null` to get a root.
  116. * @param {Properties & {children?: Child}} properties
  117. * Properties.
  118. * @returns {Result}
  119. * Result.
  120. */
  121. /**
  122. * @overload
  123. * @param {null} type
  124. * @param {{children?: Child}} properties
  125. * @param {string | null | undefined} [key]
  126. * @returns {Root}
  127. *
  128. * @overload
  129. * @param {string} type
  130. * @param {JSXProps} properties
  131. * @param {string | null | undefined} [key]
  132. * @returns {Element}
  133. *
  134. * @param {string | null} type
  135. * Element name or `null` to get a root.
  136. * @param {Properties & {children?: Child}} properties
  137. * Properties.
  138. * @returns {Result}
  139. * Result.
  140. */
  141. (type: string, properties: JSXProps, key?: string | null | undefined): Element;
  142. };
  143. jsx: {
  144. /**
  145. * @overload
  146. * @param {null} type
  147. * @param {{children?: Child}} properties
  148. * @param {string | null | undefined} [key]
  149. * @returns {Root}
  150. *
  151. * @overload
  152. * @param {string} type
  153. * @param {JSXProps} properties
  154. * @param {string | null | undefined} [key]
  155. * @returns {Element}
  156. *
  157. * @param {string | null} type
  158. * Element name or `null` to get a root.
  159. * @param {Properties & {children?: Child}} properties
  160. * Properties.
  161. * @returns {Result}
  162. * Result.
  163. */
  164. /**
  165. * @overload
  166. * @param {null} type
  167. * @param {{children?: Child}} properties
  168. * @param {string | null | undefined} [key]
  169. * @returns {Root}
  170. *
  171. * @overload
  172. * @param {string} type
  173. * @param {JSXProps} properties
  174. * @param {string | null | undefined} [key]
  175. * @returns {Element}
  176. *
  177. * @param {string | null} type
  178. * Element name or `null` to get a root.
  179. * @param {Properties & {children?: Child}} properties
  180. * Properties.
  181. * @returns {Result}
  182. * Result.
  183. */
  184. (type: null, properties: {
  185. children?: Child;
  186. }, key?: string | null | undefined): Root;
  187. /**
  188. * @overload
  189. * @param {null} type
  190. * @param {{children?: Child}} properties
  191. * @param {string | null | undefined} [key]
  192. * @returns {Root}
  193. *
  194. * @overload
  195. * @param {string} type
  196. * @param {JSXProps} properties
  197. * @param {string | null | undefined} [key]
  198. * @returns {Element}
  199. *
  200. * @param {string | null} type
  201. * Element name or `null` to get a root.
  202. * @param {Properties & {children?: Child}} properties
  203. * Properties.
  204. * @returns {Result}
  205. * Result.
  206. */
  207. /**
  208. * @overload
  209. * @param {null} type
  210. * @param {{children?: Child}} properties
  211. * @param {string | null | undefined} [key]
  212. * @returns {Root}
  213. *
  214. * @overload
  215. * @param {string} type
  216. * @param {JSXProps} properties
  217. * @param {string | null | undefined} [key]
  218. * @returns {Element}
  219. *
  220. * @param {string | null} type
  221. * Element name or `null` to get a root.
  222. * @param {Properties & {children?: Child}} properties
  223. * Properties.
  224. * @returns {Result}
  225. * Result.
  226. */
  227. (type: string, properties: JSXProps, key?: string | null | undefined): Element;
  228. };
  229. };
  230. export type JSXProps = Record<string, Child | PropertyValue | Style>;
  231. import type { createH as CreateH } from './create-h.js';
  232. import type { Child } from './create-h.js';
  233. import type { Root } from 'hast';
  234. import type { Element } from 'hast';
  235. import type { PropertyValue } from './create-h.js';
  236. import type { Style } from './create-h.js';
  237. //# sourceMappingURL=create-automatic-runtime.d.ts.map