@tenphi/tasty 0.0.0-snapshot.fafcbfe → 0.0.0-snapshot.fdb16ea

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 (309) hide show
  1. package/README.md +397 -185
  2. package/dist/async-storage-DKK-wTD4.js +44 -0
  3. package/dist/async-storage-DKK-wTD4.js.map +1 -0
  4. package/dist/babel-CMYf4JZ2.d.ts +83 -0
  5. package/dist/collector-Ctn5s74s.d.ts +145 -0
  6. package/dist/collector-DMSR6ANK.js +304 -0
  7. package/dist/collector-DMSR6ANK.js.map +1 -0
  8. package/dist/config-B23gZrfP.js +12317 -0
  9. package/dist/config-B23gZrfP.js.map +1 -0
  10. package/dist/config-CZx8_DCu.d.ts +1296 -0
  11. package/dist/context-CA8YKeMn.js +24 -0
  12. package/dist/context-CA8YKeMn.js.map +1 -0
  13. package/dist/core/index.d.ts +5 -33
  14. package/dist/core/index.js +6 -26
  15. package/dist/core-B1tyn69d.js +1573 -0
  16. package/dist/core-B1tyn69d.js.map +1 -0
  17. package/dist/css-writer-CvAxkR6S.js +390 -0
  18. package/dist/css-writer-CvAxkR6S.js.map +1 -0
  19. package/dist/format-global-rules-DklyaXv-.js +22 -0
  20. package/dist/format-global-rules-DklyaXv-.js.map +1 -0
  21. package/dist/format-rules-BCTWVvcS.js +130 -0
  22. package/dist/format-rules-BCTWVvcS.js.map +1 -0
  23. package/dist/hydrate-BCPvkJj3.js +37 -0
  24. package/dist/hydrate-BCPvkJj3.js.map +1 -0
  25. package/dist/index-B3o0aCYV.d.ts +1538 -0
  26. package/dist/index-CsvB0EXZ.d.ts +1909 -0
  27. package/dist/index.d.ts +5 -40
  28. package/dist/index.js +921 -32
  29. package/dist/index.js.map +1 -0
  30. package/dist/keyframes-Dxdx3KOo.js +493 -0
  31. package/dist/keyframes-Dxdx3KOo.js.map +1 -0
  32. package/dist/{utils/merge-styles.js → merge-styles-C-uwpoNW.js} +4 -6
  33. package/dist/merge-styles-C-uwpoNW.js.map +1 -0
  34. package/dist/{utils/merge-styles.d.ts → merge-styles-DJTSfz_M.d.ts} +3 -3
  35. package/dist/{utils/resolve-recipes.js → resolve-recipes-BuOvSEa2.js} +5 -8
  36. package/dist/resolve-recipes-BuOvSEa2.js.map +1 -0
  37. package/dist/ssr/astro-client.d.ts +1 -0
  38. package/dist/ssr/astro-client.js +19 -0
  39. package/dist/ssr/astro-client.js.map +1 -0
  40. package/dist/ssr/astro-middleware-static.d.ts +16 -0
  41. package/dist/ssr/astro-middleware-static.js +18 -0
  42. package/dist/ssr/astro-middleware-static.js.map +1 -0
  43. package/dist/ssr/astro-middleware.d.ts +17 -0
  44. package/dist/ssr/astro-middleware.js +19 -0
  45. package/dist/ssr/astro-middleware.js.map +1 -0
  46. package/dist/ssr/astro.d.ts +93 -0
  47. package/dist/ssr/astro.js +157 -0
  48. package/dist/ssr/astro.js.map +1 -0
  49. package/dist/ssr/index.d.ts +37 -0
  50. package/dist/ssr/index.js +10 -0
  51. package/dist/ssr/index.js.map +1 -0
  52. package/dist/ssr/next.d.ts +45 -0
  53. package/dist/ssr/next.js +74 -0
  54. package/dist/ssr/next.js.map +1 -0
  55. package/dist/static/index.d.ts +91 -5
  56. package/dist/static/index.js +49 -4
  57. package/dist/static/index.js.map +1 -0
  58. package/dist/static/inject.d.ts +5 -0
  59. package/dist/static/inject.js +17 -0
  60. package/dist/static/inject.js.map +1 -0
  61. package/dist/zero/babel.d.ts +2 -108
  62. package/dist/zero/babel.js +235 -39
  63. package/dist/zero/babel.js.map +1 -1
  64. package/dist/zero/index.d.ts +81 -3
  65. package/dist/zero/index.js +2 -4
  66. package/dist/zero/next.d.ts +56 -30
  67. package/dist/zero/next.js +106 -41
  68. package/dist/zero/next.js.map +1 -1
  69. package/docs/README.md +39 -0
  70. package/docs/adoption.md +323 -0
  71. package/docs/ai-agents.md +224 -0
  72. package/docs/comparison.md +448 -0
  73. package/docs/configuration.md +823 -0
  74. package/docs/debug.md +322 -0
  75. package/docs/design-system.md +455 -0
  76. package/docs/dsl.md +1021 -0
  77. package/docs/getting-started.md +238 -0
  78. package/docs/injector.md +614 -0
  79. package/docs/methodology.md +648 -0
  80. package/docs/migration-v3.md +285 -0
  81. package/docs/pipeline.md +741 -0
  82. package/docs/plugins.md +353 -0
  83. package/docs/react-api.md +681 -0
  84. package/docs/runtime-benchmarks.md +216 -0
  85. package/docs/ssr.md +451 -0
  86. package/docs/styles.md +645 -0
  87. package/docs/tasty-static.md +582 -0
  88. package/package.json +149 -40
  89. package/tasty.config.ts +6 -0
  90. package/dist/_virtual/_rolldown/runtime.js +0 -8
  91. package/dist/chunks/cacheKey.js +0 -70
  92. package/dist/chunks/cacheKey.js.map +0 -1
  93. package/dist/chunks/definitions.d.ts +0 -37
  94. package/dist/chunks/definitions.js +0 -260
  95. package/dist/chunks/definitions.js.map +0 -1
  96. package/dist/chunks/renderChunk.js +0 -61
  97. package/dist/chunks/renderChunk.js.map +0 -1
  98. package/dist/config.d.ts +0 -280
  99. package/dist/config.js +0 -403
  100. package/dist/config.js.map +0 -1
  101. package/dist/debug.d.ts +0 -204
  102. package/dist/debug.js +0 -733
  103. package/dist/debug.js.map +0 -1
  104. package/dist/hooks/useGlobalStyles.d.ts +0 -27
  105. package/dist/hooks/useGlobalStyles.js +0 -56
  106. package/dist/hooks/useGlobalStyles.js.map +0 -1
  107. package/dist/hooks/useKeyframes.d.ts +0 -56
  108. package/dist/hooks/useKeyframes.js +0 -54
  109. package/dist/hooks/useKeyframes.js.map +0 -1
  110. package/dist/hooks/useProperty.d.ts +0 -79
  111. package/dist/hooks/useProperty.js +0 -91
  112. package/dist/hooks/useProperty.js.map +0 -1
  113. package/dist/hooks/useRawCSS.d.ts +0 -53
  114. package/dist/hooks/useRawCSS.js +0 -28
  115. package/dist/hooks/useRawCSS.js.map +0 -1
  116. package/dist/hooks/useStyles.d.ts +0 -40
  117. package/dist/hooks/useStyles.js +0 -169
  118. package/dist/hooks/useStyles.js.map +0 -1
  119. package/dist/injector/index.d.ts +0 -157
  120. package/dist/injector/index.js +0 -154
  121. package/dist/injector/index.js.map +0 -1
  122. package/dist/injector/injector.d.ts +0 -139
  123. package/dist/injector/injector.js +0 -404
  124. package/dist/injector/injector.js.map +0 -1
  125. package/dist/injector/sheet-manager.d.ts +0 -127
  126. package/dist/injector/sheet-manager.js +0 -714
  127. package/dist/injector/sheet-manager.js.map +0 -1
  128. package/dist/injector/types.d.ts +0 -135
  129. package/dist/keyframes/index.js +0 -206
  130. package/dist/keyframes/index.js.map +0 -1
  131. package/dist/parser/classify.js +0 -319
  132. package/dist/parser/classify.js.map +0 -1
  133. package/dist/parser/const.js +0 -33
  134. package/dist/parser/const.js.map +0 -1
  135. package/dist/parser/lru.js +0 -109
  136. package/dist/parser/lru.js.map +0 -1
  137. package/dist/parser/parser.d.ts +0 -25
  138. package/dist/parser/parser.js +0 -116
  139. package/dist/parser/parser.js.map +0 -1
  140. package/dist/parser/tokenizer.js +0 -69
  141. package/dist/parser/tokenizer.js.map +0 -1
  142. package/dist/parser/types.d.ts +0 -51
  143. package/dist/parser/types.js +0 -46
  144. package/dist/parser/types.js.map +0 -1
  145. package/dist/pipeline/conditions.d.ts +0 -134
  146. package/dist/pipeline/conditions.js +0 -400
  147. package/dist/pipeline/conditions.js.map +0 -1
  148. package/dist/pipeline/exclusive.js +0 -231
  149. package/dist/pipeline/exclusive.js.map +0 -1
  150. package/dist/pipeline/index.d.ts +0 -53
  151. package/dist/pipeline/index.js +0 -641
  152. package/dist/pipeline/index.js.map +0 -1
  153. package/dist/pipeline/materialize.js +0 -908
  154. package/dist/pipeline/materialize.js.map +0 -1
  155. package/dist/pipeline/parseStateKey.d.ts +0 -15
  156. package/dist/pipeline/parseStateKey.js +0 -430
  157. package/dist/pipeline/parseStateKey.js.map +0 -1
  158. package/dist/pipeline/simplify.js +0 -557
  159. package/dist/pipeline/simplify.js.map +0 -1
  160. package/dist/plugins/okhsl-plugin.d.ts +0 -35
  161. package/dist/plugins/okhsl-plugin.js +0 -371
  162. package/dist/plugins/okhsl-plugin.js.map +0 -1
  163. package/dist/plugins/types.d.ts +0 -69
  164. package/dist/properties/index.js +0 -158
  165. package/dist/properties/index.js.map +0 -1
  166. package/dist/states/index.d.ts +0 -49
  167. package/dist/states/index.js +0 -416
  168. package/dist/states/index.js.map +0 -1
  169. package/dist/static/tastyStatic.d.ts +0 -46
  170. package/dist/static/tastyStatic.js +0 -31
  171. package/dist/static/tastyStatic.js.map +0 -1
  172. package/dist/static/types.d.ts +0 -49
  173. package/dist/static/types.js +0 -24
  174. package/dist/static/types.js.map +0 -1
  175. package/dist/styles/align.d.ts +0 -15
  176. package/dist/styles/align.js +0 -14
  177. package/dist/styles/align.js.map +0 -1
  178. package/dist/styles/border.d.ts +0 -25
  179. package/dist/styles/border.js +0 -114
  180. package/dist/styles/border.js.map +0 -1
  181. package/dist/styles/color.d.ts +0 -14
  182. package/dist/styles/color.js +0 -23
  183. package/dist/styles/color.js.map +0 -1
  184. package/dist/styles/createStyle.js +0 -77
  185. package/dist/styles/createStyle.js.map +0 -1
  186. package/dist/styles/dimension.js +0 -97
  187. package/dist/styles/dimension.js.map +0 -1
  188. package/dist/styles/display.d.ts +0 -37
  189. package/dist/styles/display.js +0 -67
  190. package/dist/styles/display.js.map +0 -1
  191. package/dist/styles/fade.d.ts +0 -15
  192. package/dist/styles/fade.js +0 -58
  193. package/dist/styles/fade.js.map +0 -1
  194. package/dist/styles/fill.d.ts +0 -44
  195. package/dist/styles/fill.js +0 -51
  196. package/dist/styles/fill.js.map +0 -1
  197. package/dist/styles/flow.d.ts +0 -16
  198. package/dist/styles/flow.js +0 -12
  199. package/dist/styles/flow.js.map +0 -1
  200. package/dist/styles/gap.d.ts +0 -31
  201. package/dist/styles/gap.js +0 -37
  202. package/dist/styles/gap.js.map +0 -1
  203. package/dist/styles/height.d.ts +0 -17
  204. package/dist/styles/height.js +0 -20
  205. package/dist/styles/height.js.map +0 -1
  206. package/dist/styles/index.d.ts +0 -2
  207. package/dist/styles/index.js +0 -9
  208. package/dist/styles/index.js.map +0 -1
  209. package/dist/styles/inset.d.ts +0 -52
  210. package/dist/styles/inset.js +0 -150
  211. package/dist/styles/inset.js.map +0 -1
  212. package/dist/styles/justify.d.ts +0 -15
  213. package/dist/styles/justify.js +0 -14
  214. package/dist/styles/justify.js.map +0 -1
  215. package/dist/styles/list.d.ts +0 -16
  216. package/dist/styles/list.js +0 -98
  217. package/dist/styles/list.js.map +0 -1
  218. package/dist/styles/margin.d.ts +0 -24
  219. package/dist/styles/margin.js +0 -104
  220. package/dist/styles/margin.js.map +0 -1
  221. package/dist/styles/outline.d.ts +0 -29
  222. package/dist/styles/outline.js +0 -65
  223. package/dist/styles/outline.js.map +0 -1
  224. package/dist/styles/padding.d.ts +0 -24
  225. package/dist/styles/padding.js +0 -104
  226. package/dist/styles/padding.js.map +0 -1
  227. package/dist/styles/predefined.d.ts +0 -73
  228. package/dist/styles/predefined.js +0 -241
  229. package/dist/styles/predefined.js.map +0 -1
  230. package/dist/styles/preset.d.ts +0 -47
  231. package/dist/styles/preset.js +0 -126
  232. package/dist/styles/preset.js.map +0 -1
  233. package/dist/styles/radius.d.ts +0 -14
  234. package/dist/styles/radius.js +0 -51
  235. package/dist/styles/radius.js.map +0 -1
  236. package/dist/styles/scrollbar.d.ts +0 -21
  237. package/dist/styles/scrollbar.js +0 -105
  238. package/dist/styles/scrollbar.js.map +0 -1
  239. package/dist/styles/shadow.d.ts +0 -14
  240. package/dist/styles/shadow.js +0 -24
  241. package/dist/styles/shadow.js.map +0 -1
  242. package/dist/styles/styledScrollbar.d.ts +0 -47
  243. package/dist/styles/styledScrollbar.js +0 -38
  244. package/dist/styles/styledScrollbar.js.map +0 -1
  245. package/dist/styles/transition.d.ts +0 -14
  246. package/dist/styles/transition.js +0 -158
  247. package/dist/styles/transition.js.map +0 -1
  248. package/dist/styles/types.d.ts +0 -498
  249. package/dist/styles/width.d.ts +0 -17
  250. package/dist/styles/width.js +0 -20
  251. package/dist/styles/width.js.map +0 -1
  252. package/dist/tasty.d.ts +0 -982
  253. package/dist/tasty.js +0 -191
  254. package/dist/tasty.js.map +0 -1
  255. package/dist/tokens/typography.d.ts +0 -19
  256. package/dist/tokens/typography.js +0 -237
  257. package/dist/tokens/typography.js.map +0 -1
  258. package/dist/types.d.ts +0 -184
  259. package/dist/utils/cache-wrapper.js +0 -26
  260. package/dist/utils/cache-wrapper.js.map +0 -1
  261. package/dist/utils/case-converter.js +0 -8
  262. package/dist/utils/case-converter.js.map +0 -1
  263. package/dist/utils/colors.d.ts +0 -5
  264. package/dist/utils/colors.js +0 -9
  265. package/dist/utils/colors.js.map +0 -1
  266. package/dist/utils/css-types.d.ts +0 -7
  267. package/dist/utils/dotize.d.ts +0 -26
  268. package/dist/utils/dotize.js +0 -122
  269. package/dist/utils/dotize.js.map +0 -1
  270. package/dist/utils/filter-base-props.d.ts +0 -15
  271. package/dist/utils/filter-base-props.js +0 -45
  272. package/dist/utils/filter-base-props.js.map +0 -1
  273. package/dist/utils/get-display-name.d.ts +0 -7
  274. package/dist/utils/get-display-name.js +0 -10
  275. package/dist/utils/get-display-name.js.map +0 -1
  276. package/dist/utils/hsl-to-rgb.js +0 -38
  277. package/dist/utils/hsl-to-rgb.js.map +0 -1
  278. package/dist/utils/is-dev-env.js +0 -19
  279. package/dist/utils/is-dev-env.js.map +0 -1
  280. package/dist/utils/is-valid-element-type.js +0 -15
  281. package/dist/utils/is-valid-element-type.js.map +0 -1
  282. package/dist/utils/merge-styles.js.map +0 -1
  283. package/dist/utils/mod-attrs.d.ts +0 -8
  284. package/dist/utils/mod-attrs.js +0 -21
  285. package/dist/utils/mod-attrs.js.map +0 -1
  286. package/dist/utils/okhsl-to-rgb.js +0 -296
  287. package/dist/utils/okhsl-to-rgb.js.map +0 -1
  288. package/dist/utils/process-tokens.d.ts +0 -31
  289. package/dist/utils/process-tokens.js +0 -171
  290. package/dist/utils/process-tokens.js.map +0 -1
  291. package/dist/utils/resolve-recipes.d.ts +0 -17
  292. package/dist/utils/resolve-recipes.js.map +0 -1
  293. package/dist/utils/string.js +0 -8
  294. package/dist/utils/string.js.map +0 -1
  295. package/dist/utils/styles.d.ts +0 -183
  296. package/dist/utils/styles.js +0 -585
  297. package/dist/utils/styles.js.map +0 -1
  298. package/dist/utils/typography.d.ts +0 -36
  299. package/dist/utils/typography.js +0 -53
  300. package/dist/utils/typography.js.map +0 -1
  301. package/dist/utils/warnings.d.ts +0 -16
  302. package/dist/utils/warnings.js +0 -16
  303. package/dist/utils/warnings.js.map +0 -1
  304. package/dist/zero/css-writer.d.ts +0 -45
  305. package/dist/zero/css-writer.js +0 -74
  306. package/dist/zero/css-writer.js.map +0 -1
  307. package/dist/zero/extractor.d.ts +0 -24
  308. package/dist/zero/extractor.js +0 -150
  309. package/dist/zero/extractor.js.map +0 -1
@@ -0,0 +1,1296 @@
1
+ import { At as StyleRule, Ct as PropertyDefinition, Dt as RuleInfo, Et as RootRegistry, Ot as SheetInfo, P as StyleHandlerDefinition, St as KeyframesSteps, Tt as RawCSSResult, _t as InjectResult, b as Styles, bt as KeyframesInfo, dt as FunctionDefinition, gt as InjectOptions, h as ConfigTokens, ht as GlobalInjectResult, it as UnitHandler, kt as StyleInjectorConfig, lt as FontFaceDescriptors, mt as GCOptions, n as StyleResult, nt as StyleDetails, ot as CacheMetrics, pt as GCConfig, st as CounterStyleDescriptors, ut as FontFaceInput, v as RecipeStyles, xt as KeyframesResult } from "./index-B3o0aCYV.js";
2
+
3
+ //#region src/prop-handlers.d.ts
4
+ /**
5
+ * Props middleware for tasty components.
6
+ *
7
+ * A prop handler receives a component's props and returns them, changed or not.
8
+ * That makes it the extension point for props that are *not* style properties:
9
+ * it can read a custom prop, strip it so it never reaches the DOM, and fold its
10
+ * meaning into `styles`, `mods`, `tokens`, `variant`, or `as`.
11
+ *
12
+ * ```ts
13
+ * configure({
14
+ * propHandlers: {
15
+ * glaze: (props) => {
16
+ * const { glaze, ...rest } = props;
17
+ * if (!glaze) return rest;
18
+ * return { ...rest, styles: mergeStyles(glazeStyles(glaze), rest.styles) };
19
+ * },
20
+ * },
21
+ * });
22
+ * ```
23
+ *
24
+ * Handlers run on every render of every tasty component, so the registry is a
25
+ * pre-composed chain that is `null` while nothing is registered — the cost when
26
+ * unused is one property load and one branch.
27
+ */
28
+ /** Props object handed to a prop handler. Deliberately untyped: handlers see everything. */
29
+ type PropHandlerProps = Record<string, unknown>;
30
+ /**
31
+ * Props middleware: props in, props out. Returning nothing means "unchanged".
32
+ *
33
+ * Must be a **pure function** and must not mutate its input. Style values are
34
+ * cached by object identity, so mutating a value object in place produces a stale
35
+ * class name and stale CSS. Return fresh (ideally frozen, ideally memoized)
36
+ * objects instead.
37
+ */
38
+ type PropHandler = (props: PropHandlerProps) => PropHandlerProps | void | null;
39
+ /**
40
+ * How a prop handler is declared. The map key is both its name and, by default,
41
+ * the prop that triggers it.
42
+ *
43
+ * - `fn` — triggered when a prop matching the key is present
44
+ * - `['glaze', fn]` — triggered by the named prop
45
+ * - `[['glaze', 'tone'], fn]` — triggered by any of them
46
+ * - `['*', fn]` — unconditional; runs on every render of every component
47
+ */
48
+ type PropHandlerDefinition = PropHandler | [string, PropHandler] | [string[], PropHandler];
49
+ //#endregion
50
+ //#region src/injector/sheet-manager.d.ts
51
+ declare class SheetManager {
52
+ private rootRegistries;
53
+ /** Strong set of active roots so background GC can iterate them all */
54
+ private activeRoots;
55
+ private config;
56
+ /** Dedicated style elements for raw CSS per root */
57
+ private rawStyleElements;
58
+ /** Constructable sheets for raw CSS in adopted mode */
59
+ private rawConstructableSheets;
60
+ /** Tracking for raw CSS blocks per root */
61
+ private rawCSSBlocks;
62
+ /** Counter for generating unique raw CSS IDs */
63
+ private rawCSSCounter;
64
+ constructor(config: StyleInjectorConfig);
65
+ /**
66
+ * Resolve the underlying CSSStyleSheet from a SheetInfo,
67
+ * abstracting away adopted vs style-element modes.
68
+ */
69
+ getCSSSheet(sheetInfo: SheetInfo): CSSStyleSheet | null;
70
+ /**
71
+ * Record an inserted rule text at its rule index (text mode only).
72
+ *
73
+ * `textRules` mirrors the sheet's rule order. `textContent` cannot be edited
74
+ * rule-by-rule the way CSSOM can, so keeping the texts is what makes
75
+ * deletion possible at all in this mode.
76
+ */
77
+ private trackTextRule;
78
+ /**
79
+ * Remove rule indices from a text-mode sheet and rewrite the element's text.
80
+ * Returns the indices that were actually removed.
81
+ */
82
+ private deleteTextRules;
83
+ /**
84
+ * Determine the injection mode for a root.
85
+ * ShadowRoot uses adopted stylesheets when supported; Document uses <style> elements.
86
+ */
87
+ private detectInjectionMode;
88
+ /**
89
+ * Get or create registry for a root (Document or ShadowRoot)
90
+ */
91
+ getRegistry(root: Document | ShadowRoot): RootRegistry;
92
+ /** Return all roots with active registries (for background GC sweep). */
93
+ getActiveRoots(): Iterable<Document | ShadowRoot>;
94
+ /** Check whether any roots have active registries. */
95
+ hasActiveRoots(): boolean;
96
+ /** Remove registries for ShadowRoots whose host has been detached from the DOM. */
97
+ pruneDisconnectedRoots(): void;
98
+ /**
99
+ * Create a new stylesheet for the registry.
100
+ * In adopted mode (ShadowRoot), creates a constructable CSSStyleSheet and
101
+ * pushes it to adoptedStyleSheets. Otherwise creates a <style> element.
102
+ */
103
+ createSheet(registry: RootRegistry, root: Document | ShadowRoot): SheetInfo;
104
+ /**
105
+ * Create a style element and append to document
106
+ */
107
+ private createStyleElement;
108
+ /**
109
+ * Insert CSS rules as a single block
110
+ */
111
+ insertRule(registry: RootRegistry, flattenedRules: StyleRule[], className: string, root: Document | ShadowRoot): RuleInfo | null;
112
+ /**
113
+ * Insert global CSS rules
114
+ */
115
+ insertGlobalRule(registry: RootRegistry, flattenedRules: StyleRule[], globalKey: string, root: Document | ShadowRoot): RuleInfo | null;
116
+ /**
117
+ * Delete a global CSS rule by key
118
+ */
119
+ deleteGlobalRule(registry: RootRegistry, globalKey: string): void;
120
+ /**
121
+ * Adjust rule indices after deletion to account for shifting
122
+ */
123
+ private adjustIndicesAfterDeletion;
124
+ /**
125
+ * Delete a CSS rule from the sheet
126
+ */
127
+ deleteRule(registry: RootRegistry, ruleInfo: RuleInfo): void;
128
+ /**
129
+ * Find a sheet with available space or return null
130
+ */
131
+ private findAvailableSheet;
132
+ /**
133
+ * Find an available rule index in the sheet
134
+ */
135
+ findAvailableRuleIndex(sheet: SheetInfo): number;
136
+ /**
137
+ * Probe whether the underlying CSS engine supports `@property` at-rules.
138
+ * Result is cached per registry on `registry.atPropertySupported`.
139
+ *
140
+ * The probe inserts and immediately deletes a minimal known-valid rule
141
+ * (`@property --__tasty_probe__ { syntax: "*"; inherits: true; }`).
142
+ * Engines that lack `@property` support (jsdom, happy-dom) reject any
143
+ * `@property` rule including this one, so a probe failure is a reliable
144
+ * signal that further `@property` rejections are environmental noise and
145
+ * not user-authored bugs.
146
+ *
147
+ * The probe is intentionally a separate operation from the user's failing
148
+ * insertion: we don't want to leak `--__tasty_probe__` into the sheet, so
149
+ * on success we delete the probe rule immediately, leaving `ruleCount`
150
+ * and `cssRules.length` unchanged.
151
+ */
152
+ private engineSupportsAtProperty;
153
+ /**
154
+ * Delete the given classes: their rules leave the sheets and every registry
155
+ * entry pointing at them is dropped.
156
+ *
157
+ * Deciding *what* is unused belongs to `StyleInjector.gc()`, which owns the
158
+ * DOM scan and the capacity policy. This only re-checks that each class is
159
+ * still safe to delete, and reports how many were.
160
+ *
161
+ * @returns Number of classes actually deleted.
162
+ */
163
+ deleteClasses(registry: RootRegistry, classNames: Iterable<string>): number;
164
+ /**
165
+ * Get total number of rules across all sheets
166
+ */
167
+ getTotalRuleCount(registry: RootRegistry): number;
168
+ /**
169
+ * Get CSS text from all sheets (for SSR)
170
+ */
171
+ getCSSText(registry: RootRegistry): string;
172
+ /**
173
+ * Get cache performance metrics
174
+ */
175
+ getMetrics(registry: RootRegistry): CacheMetrics | null;
176
+ /**
177
+ * Reset cache performance metrics
178
+ */
179
+ resetMetrics(registry: RootRegistry): void;
180
+ /**
181
+ * Convert keyframes steps to CSS string.
182
+ * Public so the SSR collector can format keyframes without DOM access.
183
+ * Returns both the CSS text and a combined declarations string for property type scanning.
184
+ */
185
+ stepsToCSS(steps: KeyframesSteps): {
186
+ css: string;
187
+ declarations: string;
188
+ };
189
+ /**
190
+ * Insert keyframes rule.
191
+ * Returns the KeyframesInfo and the raw declarations string for property type scanning.
192
+ */
193
+ insertKeyframes(registry: RootRegistry, steps: KeyframesSteps, name: string, root: Document | ShadowRoot): {
194
+ info: KeyframesInfo;
195
+ declarations: string;
196
+ } | null;
197
+ /**
198
+ * Delete keyframes rule
199
+ */
200
+ deleteKeyframes(registry: RootRegistry, info: KeyframesInfo): void;
201
+ /**
202
+ * Clean up resources for a root
203
+ */
204
+ cleanup(root: Document | ShadowRoot): void;
205
+ /**
206
+ * Check if a root uses adopted injection mode.
207
+ */
208
+ private isAdoptedMode;
209
+ /**
210
+ * Get or create a constructable CSSStyleSheet for raw CSS in adopted mode.
211
+ * The raw sheet is prepended to adoptedStyleSheets so it precedes tasty rules.
212
+ */
213
+ private getOrCreateRawAdoptedSheet;
214
+ /**
215
+ * Get or create a dedicated style element for raw CSS
216
+ * Raw CSS is kept separate from tasty-managed sheets to avoid index conflicts
217
+ */
218
+ private getOrCreateRawStyleElement;
219
+ /**
220
+ * Inject raw CSS text directly without parsing
221
+ * Returns a dispose function to remove the injected CSS
222
+ */
223
+ injectRawCSS(css: string, root: Document | ShadowRoot): RawCSSResult;
224
+ /**
225
+ * Rebuild the raw CSS constructable sheet from all tracked blocks.
226
+ */
227
+ private rebuildRawAdoptedSheet;
228
+ /**
229
+ * Remove a raw CSS block by ID
230
+ */
231
+ private disposeRawCSS;
232
+ /**
233
+ * Get the raw CSS content
234
+ */
235
+ getRawCSSText(root: Document | ShadowRoot): string;
236
+ }
237
+ //#endregion
238
+ //#region src/injector/injector.d.ts
239
+ declare class StyleInjector {
240
+ private sheetManager;
241
+ private config;
242
+ private globalRuleCounter;
243
+ /** Cancels the scheduled GC, whatever scheduled it. Null when none is pending. */
244
+ private cancelPendingGC;
245
+ private namePrefix;
246
+ private classRegex;
247
+ private rscClassRegex;
248
+ /** @internal — exposed for debug utilities only */
249
+ get _sheetManager(): SheetManager;
250
+ /**
251
+ * Whether sheet writes should be queued instead of applied immediately.
252
+ *
253
+ * Only ever true on the client: SSR collects CSS as text and the RSC path
254
+ * returns it as strings, so neither has a live sheet to batch writes against.
255
+ *
256
+ * In the default `true` mode a write is only queued inside an open batch
257
+ * window — a commit in which `<TastyBatchProvider>` rendered and will
258
+ * therefore flush in its insertion effect, before any layout effect can
259
+ * measure. Everything else falls through to a synchronous write, so enabling
260
+ * the flag cannot make a `useLayoutEffect` read an unstyled element.
261
+ * `'always'` drops the gate and accepts that trade for wider coverage.
262
+ */
263
+ private get batching();
264
+ /**
265
+ * Apply a sheet write now, or queue it when batching is on.
266
+ * Returns the queue handle when deferred, so the caller can cancel it if it
267
+ * disposes before the flush.
268
+ */
269
+ private writeSheet;
270
+ /**
271
+ * Insert a global (non-class) rule, honouring batching.
272
+ *
273
+ * `onApplied` records the caller's dedupe bookkeeping. When the write is
274
+ * queued it runs eagerly, so a repeat call before the flush bails out instead
275
+ * of queueing the same rule twice — the same reasoning as
276
+ * `insertPropertyRule`'s eager marking. When written synchronously it runs
277
+ * only on success, preserving the existing retry-on-failure behaviour.
278
+ */
279
+ private writeGlobalRule;
280
+ constructor(config?: StyleInjectorConfig);
281
+ /**
282
+ * Generate a deterministic class name from a cache key using content hash.
283
+ * The same cache key always produces the same class name across environments
284
+ * with the same `namePrefix`.
285
+ */
286
+ private generateClassName;
287
+ /**
288
+ * Check if `className` was hydrated from server-rendered styles and,
289
+ * if so, wire the cacheKey mapping. Returns true on hit.
290
+ */
291
+ private tryHydratedHit;
292
+ /**
293
+ * Allocate a className for a cacheKey without injecting styles yet.
294
+ * This allows separating className allocation (render phase) from style injection (insertion phase).
295
+ */
296
+ allocateClassName(cacheKey: string, options?: {
297
+ root?: Document | ShadowRoot;
298
+ }): {
299
+ className: string;
300
+ isNewAllocation: boolean;
301
+ };
302
+ /**
303
+ * Inject styles from StyleResult objects
304
+ */
305
+ inject(rules: StyleResult[], options?: InjectOptions): InjectResult;
306
+ /**
307
+ * Inject global styles (rules without a generated tasty class selector)
308
+ * This ensures we don't reserve a tasty class name (t{number}) for global rules,
309
+ * which could otherwise collide with element-level styles and break lookups.
310
+ */
311
+ injectGlobal(rules: StyleResult[], options?: {
312
+ root?: Document | ShadowRoot;
313
+ }): GlobalInjectResult;
314
+ /**
315
+ * Inject raw CSS text directly without parsing
316
+ * This is a low-overhead alternative to createGlobalStyle for raw CSS
317
+ * The CSS is inserted into a separate style element to avoid conflicts with tasty's chunking
318
+ */
319
+ injectRawCSS(css: string, options?: {
320
+ root?: Document | ShadowRoot;
321
+ }): RawCSSResult;
322
+ /**
323
+ * Get raw CSS text for SSR
324
+ */
325
+ getRawCSSText(options?: {
326
+ root?: Document | ShadowRoot;
327
+ }): string;
328
+ /**
329
+ * Pin an already-injected cacheKey and return the handle that releases it.
330
+ * For callers that skipped the pipeline on a cache hit but still need the
331
+ * class held. Returns null if the cacheKey is not found.
332
+ */
333
+ trackRef(cacheKey: string, options?: {
334
+ root?: Document | ShadowRoot;
335
+ }): InjectResult | null;
336
+ /**
337
+ * Seed the LRU stamp for a newly injected class.
338
+ *
339
+ * Without it a class injected during a render but not yet touched would carry
340
+ * no timestamp at all and sort as the oldest candidate, so `gc()` could evict
341
+ * the very rule the current render just wrote.
342
+ */
343
+ private markUsage;
344
+ /**
345
+ * Release one pin on a className. At zero pins the class is not deleted — it
346
+ * stays cached and collectible, and `gc()` decides when it actually goes.
347
+ */
348
+ private unpin;
349
+ /**
350
+ * Remove every style that is neither in the DOM nor referenced by an
351
+ * outstanding `inject()` handle, ignoring the GC capacity threshold.
352
+ */
353
+ cleanup(root?: Document | ShadowRoot): void;
354
+ /**
355
+ * Get CSS text from all sheets (for SSR)
356
+ */
357
+ getCSSText(options?: {
358
+ root?: Document | ShadowRoot;
359
+ }): string;
360
+ /**
361
+ * Get CSS only for the provided tasty classNames (e.g., ["t0","t3"])
362
+ */
363
+ getCSSTextForClasses(classNames: Iterable<string>, options?: {
364
+ root?: Document | ShadowRoot;
365
+ }): string;
366
+ /**
367
+ * Get cache performance metrics
368
+ */
369
+ getMetrics(options?: {
370
+ root?: Document | ShadowRoot;
371
+ }): CacheMetrics | null;
372
+ /**
373
+ * Reset cache performance metrics
374
+ */
375
+ resetMetrics(options?: {
376
+ root?: Document | ShadowRoot;
377
+ }): void;
378
+ /**
379
+ * Define a CSS @property custom property.
380
+ *
381
+ * Accepts tasty token syntax for the property name:
382
+ * - `$name` → defines `--name`
383
+ * - `#name` → defines `--name-color` (auto-sets syntax: '<color>', defaults initialValue: 'transparent')
384
+ * - `--name` → defines `--name` (legacy format)
385
+ *
386
+ * Example:
387
+ * @property --rotation { syntax: "<angle>"; inherits: false; initial-value: 45deg; }
388
+ *
389
+ * Note: No caching or dispose — this defines a global property.
390
+ *
391
+ * If the same property is registered with different options, a warning is emitted
392
+ * but the original definition is preserved (CSS @property cannot be redefined).
393
+ */
394
+ property(name: string, options?: PropertyDefinition & {
395
+ root?: Document | ShadowRoot;
396
+ }): void;
397
+ /**
398
+ * Build and insert a single `@property` rule into the given registry.
399
+ * No-op if the property was already injected.
400
+ */
401
+ private insertPropertyRule;
402
+ /**
403
+ * Check whether a given @property name was already injected by this injector.
404
+ *
405
+ * Accepts tasty token syntax:
406
+ * - `$name` → checks `--name`
407
+ * - `#name` → checks `--name-color`
408
+ * - `--name` → checks `--name` (legacy format)
409
+ */
410
+ isPropertyDefined(name: string, options?: {
411
+ root?: Document | ShadowRoot;
412
+ }): boolean;
413
+ /**
414
+ * Inject a CSS @font-face rule.
415
+ *
416
+ * Permanent and global — no dispose or ref-counting.
417
+ * Deduplicates by content hash (family + descriptors).
418
+ */
419
+ fontFace(family: string, descriptors: FontFaceDescriptors, options?: {
420
+ root?: Document | ShadowRoot;
421
+ }): void;
422
+ /**
423
+ * Inject a CSS @counter-style rule.
424
+ *
425
+ * Permanent and global — no dispose or ref-counting. Deduplicates by name.
426
+ * By default a definition overrides a previously injected one of the same
427
+ * name. Pass `weak: true` for global `configure()` definitions, which must
428
+ * never clobber an existing rule (so component-local definitions win
429
+ * regardless of injection order).
430
+ */
431
+ counterStyle(name: string, descriptors: CounterStyleDescriptors, options?: {
432
+ root?: Document | ShadowRoot;
433
+ weak?: boolean;
434
+ }): void;
435
+ /**
436
+ * Inject a CSS @function rule (custom function).
437
+ *
438
+ * Permanent and global — no dispose or ref-counting. Deduplicates by function
439
+ * name. By default a definition overrides a previously injected one of the
440
+ * same name. Pass `weak: true` for global `configure()` definitions, which
441
+ * must never clobber an existing rule (so component-local definitions win
442
+ * regardless of injection order).
443
+ */
444
+ func(name: string, definition: FunctionDefinition, options?: {
445
+ root?: Document | ShadowRoot;
446
+ weak?: boolean;
447
+ }): void;
448
+ /**
449
+ * Inject keyframes and return object with toString() and dispose()
450
+ *
451
+ * Keyframes are cached by content (steps). If the same content is injected
452
+ * multiple times with different provided names, the first injected name is reused.
453
+ *
454
+ * If the same name is provided with different content (collision), a unique
455
+ * name is generated to avoid overwriting the existing keyframes.
456
+ */
457
+ keyframes(steps: KeyframesSteps, nameOrOptions?: string | {
458
+ root?: Document | ShadowRoot;
459
+ name?: string;
460
+ }): KeyframesResult;
461
+ /**
462
+ * Dispose keyframes
463
+ */
464
+ private disposeKeyframes;
465
+ /**
466
+ * Record a render-time usage hit for one or more classNames.
467
+ * Handles space-separated multi-chunk classNames.
468
+ * When the global touch counter reaches `touchInterval`, schedules a GC
469
+ * via `requestIdleCallback`.
470
+ * No-op on the server.
471
+ */
472
+ touch(className: string, options?: {
473
+ root?: Document | ShadowRoot;
474
+ }): void;
475
+ /**
476
+ * Schedule a GC via `requestIdleCallback`, falling back to a timeout.
477
+ * Runs GC on all active roots. Avoids double-scheduling.
478
+ *
479
+ * The fallback is deliberately asynchronous: `touch()` runs during React's
480
+ * render phase, when a class is already injected but its element has not been
481
+ * committed yet, and a GC there would judge it unused.
482
+ */
483
+ private scheduleGC;
484
+ /**
485
+ * The one definition of "unused": this injector owns the class's rules, no
486
+ * element in `root` carries it, and nobody pinned it.
487
+ *
488
+ * `gc()` evicts from this set, `getMetrics()` counts it, and `tastyDebug`
489
+ * reports it — all through here, so the three can never disagree about what
490
+ * "unused" means. Entries carry their last `touch()` so callers can drop the
491
+ * oldest first; a class that was never touched sorts as oldest.
492
+ */
493
+ private collectUnused;
494
+ /**
495
+ * Class names this injector holds CSS for that nothing renders and nobody
496
+ * pinned — exactly what `gc({ force: true })` would delete. Unordered.
497
+ */
498
+ getUnusedClasses(options?: {
499
+ root?: Document | ShadowRoot;
500
+ }): string[];
501
+ /**
502
+ * Synchronous garbage collection.
503
+ *
504
+ * 1. Quick upper-bound check: skip if the registry is smaller than capacity.
505
+ * 2. Scans the DOM for live tasty classNames — the DOM, not a ref count, is
506
+ * what says a class rendered by a component is still in use.
507
+ * 3. With `force: true`: deletes every unused class.
508
+ * Without `force`: keeps the `capacity` most recently touched and deletes
509
+ * the rest, oldest first.
510
+ *
511
+ * @returns Number of styles evicted.
512
+ */
513
+ gc(options?: GCOptions): number;
514
+ /**
515
+ * Destroy all resources for a root
516
+ */
517
+ destroy(root?: Document | ShadowRoot): void;
518
+ }
519
+ //#endregion
520
+ //#region src/functions/index.d.ts
521
+ /**
522
+ * A parse-time function: receives the parsed (comma-separated) argument groups
523
+ * and returns a CSS value string. This is the JS flavor of the unified
524
+ * `functions` config (bare-name keys), distinct from declarative `@function`
525
+ * definitions (`$$`-prefixed keys).
526
+ */
527
+ type ParseFunction = (groups: StyleDetails[]) => string;
528
+ /**
529
+ * The unified `functions` map: keys are either bare names (parse functions,
530
+ * value is a function) or `$$name`/`$name`/`--name` (declarative CSS functions,
531
+ * value is a {@link FunctionDefinition} object).
532
+ */
533
+ type FunctionsConfig = Record<string, FunctionDefinition | ParseFunction>;
534
+ //#endregion
535
+ //#region src/utils/color-space.d.ts
536
+ /**
537
+ * Color handling that survives into the emitted CSS.
538
+ *
539
+ * Tasty does not rewrite a color into a particular color space: opacity is
540
+ * applied with CSS relative color syntax, which reads the channels off whatever
541
+ * the browser resolves a value to, so a color is emitted exactly as authored.
542
+ * What is left here is how an alpha gets applied, and the one distinction that
543
+ * matters — replacing a token's alpha versus composing onto an inherited one.
544
+ */
545
+ /**
546
+ * The color space a `#name` token's value used to be rewritten into.
547
+ *
548
+ * @deprecated Kept for the `colorSpace` config option, which no longer has any
549
+ * effect. Colors are emitted as authored and opacity is always applied in
550
+ * `oklch` through relative color syntax.
551
+ */
552
+ type ColorSpace = 'rgb' | 'hsl' | 'oklch';
553
+ //#endregion
554
+ //#region src/utils/typography.d.ts
555
+ /**
556
+ * A typography token value: plain value or a state map for responsive/theme-aware presets.
557
+ *
558
+ * @example
559
+ * // Plain value
560
+ * fontWeight: '400'
561
+ * // State map
562
+ * fontWeight: { '': '400', '@dark': '300' }
563
+ */
564
+ type TypographyTokenValue = string | number | Record<string, string | number | undefined | null | '@inherit'>;
565
+ /**
566
+ * Typography preset configuration.
567
+ * Each preset defines font properties that get expanded into CSS custom properties.
568
+ * All fields accept plain values or state maps for responsive/theme-aware tokens.
569
+ *
570
+ * Use with `generateTypographyTokens()` to create typography tokens for your design system.
571
+ */
572
+ interface TypographyPreset {
573
+ fontSize: TypographyTokenValue;
574
+ lineHeight: TypographyTokenValue;
575
+ letterSpacing?: TypographyTokenValue;
576
+ fontWeight: TypographyTokenValue;
577
+ boldFontWeight?: TypographyTokenValue;
578
+ iconSize?: TypographyTokenValue;
579
+ textTransform?: TypographyTokenValue;
580
+ fontFamily?: TypographyTokenValue;
581
+ fontStyle?: TypographyTokenValue;
582
+ }
583
+ /**
584
+ * Generate typography tokens with $ prefix for CSS custom properties.
585
+ *
586
+ * Each preset generates the following CSS custom properties:
587
+ * - `${name}-font-size`
588
+ * - `${name}-line-height`
589
+ * - `${name}-letter-spacing`
590
+ * - `${name}-font-weight`
591
+ * - `${name}-bold-font-weight` (if defined)
592
+ * - `${name}-icon-size` (if defined)
593
+ * - `${name}-text-transform` (if defined)
594
+ * - `${name}-font-family` (if defined)
595
+ * - `${name}-font-style` (if defined)
596
+ *
597
+ * @param presets - Typography presets object
598
+ * @returns ConfigTokens object with $ prefixed keys
599
+ *
600
+ * @example
601
+ * const customTokens = generateTypographyTokens({
602
+ * myHeading: { fontSize: '24px', lineHeight: '32px', fontWeight: '700' },
603
+ * body: { fontSize: '16px', lineHeight: '24px', fontWeight: '400' },
604
+ * });
605
+ */
606
+ declare function generateTypographyTokens(presets: Record<string, TypographyPreset>): ConfigTokens;
607
+ //#endregion
608
+ //#region src/plugins/types.d.ts
609
+ /**
610
+ * A tasty plugin that extends the style system with custom functions, units, states, or handlers.
611
+ */
612
+ interface TastyPlugin {
613
+ /** Unique name for the plugin (used for debugging and conflict detection) */
614
+ name: string;
615
+ /**
616
+ * Custom functions (unified map). Bare keys map to parse functions
617
+ * `(groups) => string`; `$$name` keys map to declarative CSS `@function`
618
+ * definitions. See {@link FunctionsConfig}.
619
+ */
620
+ functions?: FunctionsConfig;
621
+ /** Custom units that transform numeric values (e.g., `2x` → `calc(2 * var(--gap))`) */
622
+ units?: Record<string, string | UnitHandler>;
623
+ /** Custom state aliases (e.g., `'@mobile': '@media(w < 768px)'`) */
624
+ states?: Record<string, string>;
625
+ /**
626
+ * Custom style handlers that transform style properties into CSS declarations.
627
+ * Handlers replace built-in handlers for the same style name.
628
+ * @example
629
+ * ```ts
630
+ * handlers: {
631
+ * // Simple handler - lookup style inferred from key
632
+ * fill: ({ fill }) => fill ? { 'background-color': fill } : undefined,
633
+ * // Multi-property handler
634
+ * spacing: [['gap', 'padding'], ({ gap, padding }) => ({ ... })],
635
+ * }
636
+ * ```
637
+ */
638
+ handlers?: Record<string, StyleHandlerDefinition>;
639
+ /**
640
+ * Props middleware for every tasty component — props in, props out. The
641
+ * extension point for props that are not style properties: read a custom prop,
642
+ * strip it so it never reaches the DOM, and fold its meaning into `styles`,
643
+ * `mods`, `tokens`, `variant`, or `as`.
644
+ *
645
+ * Must be pure and must not mutate its input.
646
+ * See {@link TastyConfig.propHandlers}.
647
+ * @example
648
+ * ```ts
649
+ * propHandlers: {
650
+ * glaze: (props) => {
651
+ * const { glaze, ...rest } = props;
652
+ * if (!glaze) return rest;
653
+ * return { ...rest, styles: mergeStyles(glazeStyles(glaze), rest.styles) };
654
+ * },
655
+ * }
656
+ * ```
657
+ */
658
+ propHandlers?: Record<string, PropHandlerDefinition>;
659
+ /**
660
+ * Style properties exposed as top-level props on every tasty component, in
661
+ * addition to the built-in base styles.
662
+ * See {@link TastyConfig.baseStyleProps}.
663
+ */
664
+ baseStyleProps?: readonly string[];
665
+ /**
666
+ * Design tokens injected as CSS custom properties on `:root`.
667
+ * Values are parsed through the Tasty DSL. Supports state maps.
668
+ * - `$name` → `--name` CSS custom property
669
+ * - `#name` → `--name-color`
670
+ */
671
+ tokens?: ConfigTokens;
672
+ /** Predefined tokens replaced during style parsing (`$name` or `#name`) */
673
+ replaceTokens?: Record<`$${string}` | `#${string}`, string | number>;
674
+ /**
675
+ * Predefined style recipes -- named style bundles that can be applied via `recipe` style property.
676
+ * Recipe values are flat tasty styles (no sub-element keys).
677
+ * @example
678
+ * ```ts
679
+ * recipes: {
680
+ * card: { padding: '4x', fill: '#surface', radius: '1r', border: true },
681
+ * elevated: { shadow: '2x 2x 4x #shadow' },
682
+ * }
683
+ * ```
684
+ */
685
+ recipes?: Record<string, RecipeStyles>;
686
+ /**
687
+ * Typography presets — shorthand for `generateTypographyTokens()`.
688
+ * Generated tokens are merged under explicit `tokens` (tokens win on conflict).
689
+ */
690
+ presets?: Record<string, TypographyPreset>;
691
+ /**
692
+ * Global Tasty styles keyed by CSS selector.
693
+ * Supports the full Tasty style syntax.
694
+ */
695
+ globalStyles?: Record<string, Styles>;
696
+ /**
697
+ * Global CSS `@property` definitions. A plugin whose handler or prop handler
698
+ * emits a custom property usually wants one, so the property animates and
699
+ * inherits correctly instead of being treated as an untyped string.
700
+ * See {@link TastyConfig.properties}.
701
+ */
702
+ properties?: Record<string, PropertyDefinition>;
703
+ /** Global keyframes, injected only when referenced. See {@link TastyConfig.keyframes}. */
704
+ keyframes?: Record<string, KeyframesSteps>;
705
+ /** Global `@font-face` definitions. See {@link TastyConfig.fontFaces}. */
706
+ fontFaces?: Record<string, FontFaceInput>;
707
+ /** Global `@counter-style` definitions. See {@link TastyConfig.counterStyles}. */
708
+ counterStyles?: Record<string, CounterStyleDescriptors>;
709
+ }
710
+ /**
711
+ * A factory function that creates a TastyPlugin.
712
+ * Can optionally accept configuration options.
713
+ *
714
+ * @example
715
+ * ```ts
716
+ * // Plugin without options
717
+ * const okhslPlugin: TastyPluginFactory = () => ({
718
+ * name: 'okhsl',
719
+ * functions: { okhsl: okhslFunction },
720
+ * });
721
+ *
722
+ * // Plugin with options
723
+ * const debugPlugin: TastyPluginFactory<{ verbose: boolean }> = (options) => ({
724
+ * name: 'debug',
725
+ * functions: { debug: createDebugFunc(options.verbose) },
726
+ * });
727
+ * ```
728
+ */
729
+ type TastyPluginFactory<TOptions = void> = TOptions extends void ? () => TastyPlugin : (options: TOptions) => TastyPlugin;
730
+ //#endregion
731
+ //#region src/config.d.ts
732
+ /**
733
+ * Configuration options for the Tasty style system
734
+ */
735
+ interface TastyConfig {
736
+ /** CSP nonce for style elements */
737
+ nonce?: string;
738
+ /** Maximum rules per stylesheet (default: 8192) */
739
+ maxRulesPerSheet?: number;
740
+ /** Force text injection mode, auto-detected in test environments (default: auto) */
741
+ forceTextInjection?: boolean;
742
+ /** Enable development mode features: performance metrics and debug info (default: auto) */
743
+ devMode?: boolean;
744
+ /**
745
+ * Global predefined states for advanced state mapping.
746
+ * These are state aliases that can be used in any component.
747
+ * Example: { '@mobile': '@media(w < 920px)', '@dark': '@root(theme=dark)' }
748
+ */
749
+ states?: Record<string, string>;
750
+ /**
751
+ * Parser LRU cache size (default: 1000).
752
+ * Larger values improve performance for apps with many unique style values.
753
+ */
754
+ parserCacheSize?: number;
755
+ /**
756
+ * Custom units for the style parser (merged with built-in units).
757
+ * Units transform numeric values like `2x` → `calc(2 * var(--gap))`.
758
+ * @example { em: 'em', vw: 'vw', custom: (n) => `${n * 10}px` }
759
+ */
760
+ units?: Record<string, string | UnitHandler>;
761
+ /**
762
+ * Custom functions (merged with existing). A single map holds both flavors,
763
+ * discriminated by value type:
764
+ *
765
+ * - **Bare key + function value** — a parse-time function that processes the
766
+ * parsed argument groups and returns a CSS value. Called as `name(...)`.
767
+ * - **`$$name` key + object value** — a declarative CSS `@function`
768
+ * definition. Called as `$$name(...)` (→ native `--name(...)`).
769
+ *
770
+ * A key whose prefix does not match its value type (object under a bare key,
771
+ * or function under a `$$` key) is ignored with a dev warning.
772
+ *
773
+ * @example
774
+ * ```ts
775
+ * configure({
776
+ * functions: {
777
+ * double: (groups) => `calc(2 * ${groups[0].output})`, // parse function
778
+ * $$negative: { args: ['$value'], result: '(-1 * $value)' }, // CSS function
779
+ * },
780
+ * });
781
+ * ```
782
+ */
783
+ functions?: FunctionsConfig;
784
+ /**
785
+ * @deprecated No longer has any effect; will be removed in the next major.
786
+ * Setting it warns in development.
787
+ *
788
+ * A `#name` token's value used to be rewritten into this color space so an
789
+ * opacity suffix had numeric channels to write an alpha into. Opacity now uses
790
+ * relative color syntax — `oklch(from var(--name-color) l c h / .5)` — which
791
+ * has the browser read the channels, so a color is emitted exactly as
792
+ * authored and there is nothing left for the setting to decide.
793
+ *
794
+ * To address a token's channels yourself, write relative color syntax against
795
+ * the token: `oklch(from var(--brand-color) calc(l * 1.2) c h)`. It works on
796
+ * every `<color>`, including the ones no conversion could evaluate.
797
+ */
798
+ colorSpace?: ColorSpace;
799
+ /**
800
+ * Automatically infer and register CSS @property declarations
801
+ * from custom property values found in styles, keyframes, and global config.
802
+ * Covers all types: \<color\>, \<number\>, \<length\>, \<angle\>, \<percentage\>, \<time\>.
803
+ * When false, only explicitly declared @property are registered.
804
+ * @default true
805
+ */
806
+ autoPropertyTypes?: boolean;
807
+ /**
808
+ * Defer stylesheet writes and apply them in one batch instead of performing
809
+ * one `insertRule()` per component during render.
810
+ *
811
+ * Each `insertRule()` on a live sheet invalidates style for that sheet's
812
+ * scope. When components inject during React's render phase while other
813
+ * components read layout in the same pass, the two interleave and the browser
814
+ * is forced to recalculate style between every injection. Batching collapses
815
+ * that into one invalidation per flush.
816
+ *
817
+ * - `false` (default) — inject synchronously, one write per component.
818
+ * - `true` — batch, but only inside a *batch window*: a commit in which
819
+ * `<TastyBatchProvider>` rendered and will therefore flush in its
820
+ * `useInsertionEffect`, before any `useLayoutEffect` runs. Any injection
821
+ * outside a window — a deep update the provider did not re-render for, an
822
+ * injection from a layout effect, an event handler, an async callback — is
823
+ * written straight through. Enabling this can never make a layout effect
824
+ * measure an unstyled element. Requires `<TastyBatchProvider>`; without it
825
+ * nothing is batched (and dev mode says so once).
826
+ * - `'always'` — batch every injection, flushing on a microtask when no
827
+ * window is open. Wins on more commits, but a `useLayoutEffect` that
828
+ * measures a freshly mounted element can read its unstyled box, because
829
+ * microtasks run after the layout phase. Paint is unaffected: microtasks
830
+ * always drain before the browser paints.
831
+ *
832
+ * No effect during SSR or RSC: styles are collected as text there, the
833
+ * runtime injector never runs, and the provider is inert without a
834
+ * `document`. No effect on zero-runtime `tastyStatic` styles either — those
835
+ * are extracted at build time and never reach the injector.
836
+ *
837
+ * @default false
838
+ * @example
839
+ * ```tsx
840
+ * configure({ batchInjection: true });
841
+ *
842
+ * <TastyBatchProvider>
843
+ * <App />
844
+ * </TastyBatchProvider>
845
+ * ```
846
+ */
847
+ batchInjection?: boolean | 'always';
848
+ /**
849
+ * Garbage collection configuration for unused styles.
850
+ * GC is triggered by touch count: every `touchInterval` touches, the
851
+ * oldest unused styles are evicted when their count exceeds `capacity`.
852
+ * @example
853
+ * ```ts
854
+ * configure({
855
+ * gc: { touchInterval: 1000, capacity: 1000 },
856
+ * });
857
+ * ```
858
+ */
859
+ gc?: GCConfig;
860
+ /**
861
+ * Prefix prepended to every generated identifier (class names,
862
+ * keyframe names, counter-style names). The hash is appended verbatim,
863
+ * so include any separator inside the prefix itself (e.g. `'myapp-'`).
864
+ *
865
+ * Discriminator letters are inserted between the prefix and the hash
866
+ * for non-class names so the three kinds stay visually distinct:
867
+ * - class: `${namePrefix}${hash}` — e.g. `t1a2b3`
868
+ * - keyframe: `${namePrefix}k${hash}` — e.g. `tk1a2b3`
869
+ * - counter-style: `${namePrefix}c${hash}` — e.g. `tc1a2b3`
870
+ *
871
+ * The runtime, SSR, and RSC paths must agree on this value or
872
+ * hydration will mismatch. The zero-runtime build path defaults to
873
+ * `'ts'` (overridable via the same option) so its classes can't
874
+ * collide with runtime classes when both are loaded on the same page.
875
+ *
876
+ * Must match `^[a-zA-Z_][a-zA-Z0-9_-]{0,31}$`. Locked once styles
877
+ * have been generated.
878
+ *
879
+ * @default 't'
880
+ */
881
+ namePrefix?: string;
882
+ /**
883
+ * Plugins that extend tasty with custom functions, units, or states.
884
+ * Plugins are processed in order, with later plugins overriding earlier ones.
885
+ * @example
886
+ * ```ts
887
+ * import { okhslPlugin } from '@tenphi/tasty';
888
+ *
889
+ * configure({
890
+ * plugins: [okhslPlugin()],
891
+ * });
892
+ * ```
893
+ */
894
+ plugins?: TastyPlugin[];
895
+ /**
896
+ * Global keyframes definitions that can be referenced by animation names in styles.
897
+ * Keys are animation names, values are keyframes step definitions.
898
+ * Keyframes are only injected when actually used in styles.
899
+ * @example
900
+ * ```ts
901
+ * configure({
902
+ * keyframes: {
903
+ * fadeIn: { from: { opacity: 0 }, to: { opacity: 1 } },
904
+ * pulse: { '0%, 100%': { transform: 'scale(1)' }, '50%': { transform: 'scale(1.05)' } },
905
+ * },
906
+ * });
907
+ * ```
908
+ */
909
+ keyframes?: Record<string, KeyframesSteps>;
910
+ /**
911
+ * Global CSS @property definitions for custom properties.
912
+ * Keys use tasty token syntax ($name for properties, #name for colors).
913
+ *
914
+ * Tasty ships with `DEFAULT_PROPERTIES` (e.g. `$gap`, `$radius`, `#white`,
915
+ * `#black`, `#clear`, `#border`, etc.) that are always included.
916
+ * Properties you specify here are merged on top, so you can override any
917
+ * default by using the same key.
918
+ *
919
+ * For color tokens (#name), `syntax: '<color>'` is auto-set and
920
+ * `initialValue` defaults to `'transparent'` if not specified.
921
+ *
922
+ * @example
923
+ * ```ts
924
+ * configure({
925
+ * properties: {
926
+ * '$rotation': { syntax: '<angle>', initialValue: '0deg' },
927
+ * '$scale': { syntax: '<number>', inherits: false, initialValue: 1 },
928
+ * '#accent': { initialValue: 'purple' }, // syntax: '<color>' auto-set
929
+ * // Override a default property:
930
+ * '$gap': { syntax: '<length>', inherits: true, initialValue: '8px' },
931
+ * },
932
+ * });
933
+ *
934
+ * // Now use in styles - properties are registered when component renders:
935
+ * const Spinner = tasty({
936
+ * styles: {
937
+ * transform: 'rotate($rotation)',
938
+ * transition: '$$rotation 0.3s', // outputs: --rotation 0.3s
939
+ * },
940
+ * });
941
+ * ```
942
+ */
943
+ properties?: Record<string, PropertyDefinition>;
944
+ /**
945
+ * Global @font-face definitions.
946
+ * Keys are font-family names, values are descriptors or arrays of descriptors
947
+ * (for multiple weights/styles of the same family).
948
+ * Injected eagerly when styles are first generated.
949
+ * @example
950
+ * ```ts
951
+ * configure({
952
+ * fontFaces: {
953
+ * 'Brand Sans': [
954
+ * { src: 'url("/fonts/brand-regular.woff2") format("woff2")', fontWeight: 400, fontDisplay: 'swap' },
955
+ * { src: 'url("/fonts/brand-bold.woff2") format("woff2")', fontWeight: 700, fontDisplay: 'swap' },
956
+ * ],
957
+ * Icons: { src: 'url("/fonts/icons.woff2") format("woff2")', fontDisplay: 'block' },
958
+ * },
959
+ * });
960
+ * ```
961
+ */
962
+ fontFaces?: Record<string, FontFaceInput>;
963
+ /**
964
+ * Global @counter-style definitions.
965
+ * Keys are counter-style names, values are descriptor objects.
966
+ * Injected eagerly when styles are first generated.
967
+ * @example
968
+ * ```ts
969
+ * configure({
970
+ * counterStyles: {
971
+ * thumbs: { system: 'cyclic', symbols: '"👍"', suffix: '" "' },
972
+ * },
973
+ * });
974
+ * ```
975
+ */
976
+ counterStyles?: Record<string, CounterStyleDescriptors>;
977
+ /**
978
+ * Opt-in polyfills for not-yet-baseline CSS features. Each key toggles a
979
+ * feature polyfill; all default to `false`.
980
+ *
981
+ * - `functions` — polyfill CSS `@function` by inlining every `$$name(...)`
982
+ * call into plain CSS (calc/var/color-mix) at parse time instead of
983
+ * emitting the native `@function` at-rule. Enables `@function` usage in
984
+ * browsers that don't support it yet (Firefox/Safari). Note this is the
985
+ * `functions` *feature toggle*, distinct from the top-level `functions`
986
+ * definitions map.
987
+ *
988
+ * @example
989
+ * ```ts
990
+ * configure({ polyfills: { functions: true } });
991
+ * ```
992
+ */
993
+ polyfills?: {
994
+ functions?: boolean;
995
+ };
996
+ /**
997
+ * Custom style handlers that transform style properties into CSS declarations.
998
+ * Handlers replace built-in handlers for the same style name.
999
+ * @example
1000
+ * ```ts
1001
+ * import { styleHandlers } from '@tenphi/tasty';
1002
+ *
1003
+ * configure({
1004
+ * handlers: {
1005
+ * // Override fill with custom behavior
1006
+ * fill: ({ fill }) => {
1007
+ * if (fill?.startsWith('gradient:')) {
1008
+ * return { background: fill.slice(9) };
1009
+ * }
1010
+ * return styleHandlers.fill({ fill });
1011
+ * },
1012
+ * // Add new custom style
1013
+ * elevation: ({ elevation }) => {
1014
+ * const level = parseInt(elevation) || 1;
1015
+ * return {
1016
+ * 'box-shadow': `0 ${level * 2}px ${level * 4}px rgba(0,0,0,0.1)`,
1017
+ * 'z-index': String(level * 100),
1018
+ * };
1019
+ * },
1020
+ * },
1021
+ * });
1022
+ * ```
1023
+ */
1024
+ handlers?: Record<string, StyleHandlerDefinition>;
1025
+ /**
1026
+ * Props middleware for every tasty component. A prop handler receives the
1027
+ * component's props and returns them, changed or not — the extension point for
1028
+ * props that are not style properties.
1029
+ *
1030
+ * The map key is the handler's name and, by default, the prop that triggers it.
1031
+ * Use `['*', fn]` for an unconditional handler, or `[['a', 'b'], fn]` to trigger
1032
+ * on any of several props.
1033
+ *
1034
+ * Handlers must be pure and must not mutate their input: style values are cached
1035
+ * by object identity, so mutating one in place yields stale CSS. Memoize the
1036
+ * styles you build per input value.
1037
+ *
1038
+ * Not applicable to zero-runtime mode — `tastyStatic()` takes styles objects, not
1039
+ * props, so there is nothing for middleware to run on. Components rendered
1040
+ * through `tasty()` are unaffected and keep the runtime injector.
1041
+ *
1042
+ * @example
1043
+ * ```ts
1044
+ * configure({
1045
+ * propHandlers: {
1046
+ * glaze: (props) => {
1047
+ * const { glaze, ...rest } = props;
1048
+ * if (!glaze) return rest;
1049
+ * return { ...rest, styles: mergeStyles(glazeStyles(glaze), rest.styles) };
1050
+ * },
1051
+ * },
1052
+ * });
1053
+ *
1054
+ * <Element glaze="purple" />
1055
+ * ```
1056
+ */
1057
+ propHandlers?: Record<string, PropHandlerDefinition>;
1058
+ /**
1059
+ * Style properties exposed as top-level props on **every** tasty component, in
1060
+ * addition to the built-in base styles, without each component listing them in
1061
+ * `styleProps`.
1062
+ *
1063
+ * Augment `TastyBaseStylePropNames` to type them. Each name costs one property
1064
+ * check per render of every component, so keep the list short; the effect is
1065
+ * app-global and cannot be scoped to a subtree.
1066
+ *
1067
+ * @example
1068
+ * ```ts
1069
+ * configure({ baseStyleProps: ['radius', 'shadow'] });
1070
+ *
1071
+ * <Card radius="1r" shadow />
1072
+ * ```
1073
+ */
1074
+ baseStyleProps?: readonly string[];
1075
+ /**
1076
+ * Design tokens injected as CSS custom properties on `:root`.
1077
+ * Values are parsed through the Tasty DSL. Supports state maps
1078
+ * for responsive/theme-aware tokens.
1079
+ *
1080
+ * - `$name` keys become `--name` CSS custom properties
1081
+ * - `#name` keys become `--name-color` properties
1082
+ *
1083
+ * Tokens are injected once when the first style is rendered.
1084
+ *
1085
+ * @example
1086
+ * ```ts
1087
+ * configure({
1088
+ * tokens: {
1089
+ * '$gap': '4px',
1090
+ * '#primary': {
1091
+ * '': '#purple',
1092
+ * '@dark': '#light-purple',
1093
+ * },
1094
+ * },
1095
+ * });
1096
+ * ```
1097
+ */
1098
+ tokens?: ConfigTokens;
1099
+ /**
1100
+ * Predefined tokens that are replaced during style parsing (parse-time substitution).
1101
+ * Use `$name` for custom properties and `#name` for color tokens.
1102
+ * Values are substituted inline before CSS generation, unlike `tokens` which
1103
+ * inject CSS custom properties on `:root`.
1104
+ *
1105
+ * For color tokens (#name), boolean `true` is converted to `transparent`.
1106
+ *
1107
+ * @example
1108
+ * ```ts
1109
+ * configure({
1110
+ * replaceTokens: {
1111
+ * $spacing: '2x',
1112
+ * '#accent': '#purple',
1113
+ * '#overlay': true, // → transparent
1114
+ * },
1115
+ * });
1116
+ *
1117
+ * // Now use in styles - tokens are replaced at parse time:
1118
+ * const Card = tasty({
1119
+ * styles: {
1120
+ * padding: '$spacing', // → calc(2 * var(--gap))
1121
+ * fill: '#accent', // → var(--purple-color)
1122
+ * },
1123
+ * });
1124
+ * ```
1125
+ */
1126
+ replaceTokens?: Record<`$${string}`, string | number | boolean> & Record<`#${string}`, string | number | boolean>;
1127
+ /**
1128
+ * Predefined style recipes -- named style bundles that can be applied via `recipe` style property.
1129
+ * Recipe values are flat tasty styles (no sub-element keys). They may contain base styles,
1130
+ * tokens (`$name`/`#name` definitions), local states, `@keyframes`, and `@property`.
1131
+ *
1132
+ * Components reference recipes via: `recipe: 'name1 name2'` in their styles.
1133
+ * Use `/` to separate base recipes from post recipes: `recipe: 'base1 base2 / post1'`.
1134
+ * Use `none` to skip base recipes: `recipe: 'none / post1'`.
1135
+ * Resolution order: `base_recipes → component styles → post_recipes`.
1136
+ *
1137
+ * Recipes cannot reference other recipes.
1138
+ *
1139
+ * @example
1140
+ * ```ts
1141
+ * configure({
1142
+ * recipes: {
1143
+ * card: { padding: '4x', fill: '#surface', radius: '1r', border: true },
1144
+ * elevated: { shadow: '2x 2x 4x #shadow' },
1145
+ * },
1146
+ * });
1147
+ *
1148
+ * // Usage in styles:
1149
+ * const Card = tasty({
1150
+ * styles: {
1151
+ * recipe: 'card elevated',
1152
+ * color: '#text', // Overrides recipe values
1153
+ * },
1154
+ * });
1155
+ * ```
1156
+ */
1157
+ recipes?: Record<string, RecipeStyles>;
1158
+ /**
1159
+ * Typography presets — shorthand for `generateTypographyTokens()`.
1160
+ * Accepts the same input and internally generates typography tokens
1161
+ * that are merged into `tokens`. Explicit `tokens` override preset-generated ones.
1162
+ *
1163
+ * @example
1164
+ * ```ts
1165
+ * configure({
1166
+ * presets: {
1167
+ * h1: { fontSize: '32px', lineHeight: '1.2', fontWeight: '700' },
1168
+ * t2: { fontSize: '16px', lineHeight: '1.5', fontWeight: '400' },
1169
+ * },
1170
+ * tokens: {
1171
+ * // Overrides the preset-generated $t2-font-weight
1172
+ * '$t2-font-weight': { '': '400', '@dark': '300' },
1173
+ * },
1174
+ * });
1175
+ * ```
1176
+ */
1177
+ presets?: Record<string, TypographyPreset>;
1178
+ /**
1179
+ * Global Tasty styles keyed by CSS selector.
1180
+ * Each entry applies the full Tasty style syntax (style properties,
1181
+ * tokens, state maps, selector-based sub-styling) to the given selector.
1182
+ * Injected alongside `:root` tokens when the first style is rendered.
1183
+ *
1184
+ * @example
1185
+ * ```ts
1186
+ * configure({
1187
+ * globalStyles: {
1188
+ * body: { fill: '#surface', color: '#text', preset: 't2', margin: 0 },
1189
+ * html: { overflow: 'hidden' },
1190
+ * },
1191
+ * });
1192
+ * ```
1193
+ */
1194
+ globalStyles?: Record<string, Styles>;
1195
+ }
1196
+ declare const GLOBAL_INJECTOR_KEY = "__TASTY_GLOBAL_INJECTOR__";
1197
+ declare global {
1198
+ interface Window {
1199
+ [GLOBAL_INJECTOR_KEY]?: StyleInjector;
1200
+ }
1201
+ var __TASTY_GLOBAL_INJECTOR__: StyleInjector | undefined;
1202
+ }
1203
+ /**
1204
+ * Detect if we're running in a test environment
1205
+ */
1206
+ declare function isTestEnvironment(): boolean;
1207
+ /**
1208
+ * Check if styles have been generated (configuration is locked)
1209
+ */
1210
+ declare function hasStylesGenerated(): boolean;
1211
+ /**
1212
+ * Check if any global keyframes are configured.
1213
+ * Uses a pre-computed flag to avoid Object.keys() allocation on every call.
1214
+ */
1215
+ declare function hasGlobalKeyframes(): boolean;
1216
+ /**
1217
+ * Get global keyframes configuration.
1218
+ * Returns null if no keyframes configured (fast path for zero-overhead).
1219
+ */
1220
+ declare function getGlobalKeyframes(): Record<string, KeyframesSteps> | null;
1221
+ /**
1222
+ * Get global font-face configuration.
1223
+ * Returns null if no font faces configured.
1224
+ * Reads from globalThis first for cross-module SSR support.
1225
+ */
1226
+ declare function getGlobalFontFaces(): Record<string, FontFaceInput> | null;
1227
+ /**
1228
+ * Get global counter-style configuration.
1229
+ * Returns null if no counter styles configured.
1230
+ * Reads from globalThis first for cross-module SSR support.
1231
+ */
1232
+ declare function getGlobalCounterStyles(): Record<string, CounterStyleDescriptors> | null;
1233
+ /**
1234
+ * Get global @function configuration.
1235
+ * Returns null if no functions configured.
1236
+ * Reads from globalThis first for cross-module SSR support.
1237
+ */
1238
+ declare function getGlobalFunctions(): Record<string, FunctionDefinition> | null;
1239
+ /**
1240
+ * Check if any global recipes are configured.
1241
+ * Fast path: returns false if no recipes were ever set.
1242
+ */
1243
+ declare function hasGlobalRecipes(): boolean;
1244
+ /**
1245
+ * Get global recipes configuration.
1246
+ * Returns null if no recipes configured (fast path for zero-overhead).
1247
+ */
1248
+ declare function getGlobalRecipes(): Record<string, RecipeStyles> | null;
1249
+ /**
1250
+ * Check if configuration is locked (styles have been generated)
1251
+ */
1252
+ declare function isConfigLocked(): boolean;
1253
+ /**
1254
+ * Configure the Tasty style system.
1255
+ *
1256
+ * Must be called BEFORE any styles are generated (before first render that uses tasty).
1257
+ * After styles are generated, configuration is locked and calls to configure() will
1258
+ * emit a warning and be ignored.
1259
+ *
1260
+ * @example
1261
+ * ```ts
1262
+ * import { configure } from '@tenphi/tasty';
1263
+ *
1264
+ * // Configure before app renders
1265
+ * configure({
1266
+ * nonce: 'abc123',
1267
+ * states: {
1268
+ * '@mobile': '@media(w < 768px)',
1269
+ * '@dark': '@root(theme=dark)',
1270
+ * },
1271
+ * });
1272
+ * ```
1273
+ */
1274
+ declare function configure(config?: Partial<TastyConfig>): void;
1275
+ /**
1276
+ * Get the current configuration.
1277
+ * If not configured, returns default configuration.
1278
+ */
1279
+ declare function getConfig(): TastyConfig;
1280
+ /**
1281
+ * Get the configured prefix used for every generated identifier
1282
+ * (class names, keyframe names, counter-style names).
1283
+ *
1284
+ * Falls back to the default prefix (`'t'`) when `configure()` has not
1285
+ * been called yet — this matches the auto-configuration behavior used
1286
+ * by the rest of the system.
1287
+ */
1288
+ declare function getNamePrefix(): string;
1289
+ /**
1290
+ * Reset configuration (for testing only).
1291
+ * Clears the global injector and allows reconfiguration.
1292
+ */
1293
+ declare function resetConfig(): void;
1294
+ //#endregion
1295
+ export { ParseFunction as C, PropHandlerDefinition as D, PropHandler as E, PropHandlerProps as O, FunctionsConfig as S, SheetManager as T, TastyPluginFactory as _, getGlobalFontFaces as a, generateTypographyTokens as b, getGlobalRecipes as c, hasGlobalRecipes as d, hasStylesGenerated as f, TastyPlugin as g, resetConfig as h, getGlobalCounterStyles as i, getNamePrefix as l, isTestEnvironment as m, configure as n, getGlobalFunctions as o, isConfigLocked as p, getConfig as r, getGlobalKeyframes as s, TastyConfig as t, hasGlobalKeyframes as u, TypographyPreset as v, StyleInjector as w, ColorSpace as x, TypographyTokenValue as y };
1296
+ //# sourceMappingURL=config-CZx8_DCu.d.ts.map