@csszyx/types 0.7.0 → 0.8.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.
@@ -0,0 +1,261 @@
1
+ /**
2
+ * Configuration types for csszyx.
3
+ *
4
+ * This module defines all configuration interfaces and types used
5
+ * throughout the csszyx framework.
6
+ */
7
+ /**
8
+ * Development mode configuration options.
9
+ */
10
+ interface DevelopmentConfig {
11
+ /**
12
+ * Enable strict mode - fail build on warnings.
13
+ * When enabled, warnings are treated as errors.
14
+ *
15
+ * @default false
16
+ */
17
+ strictMode: boolean;
18
+ /**
19
+ * Enable debug logging during build.
20
+ *
21
+ * @default false
22
+ */
23
+ debug: boolean;
24
+ }
25
+ /**
26
+ * Production mode configuration options.
27
+ */
28
+ interface ProductionConfig {
29
+ /**
30
+ * Enable global class name mangling.
31
+ * Minifies class names to single characters (a, b, c, etc.).
32
+ *
33
+ * @default true
34
+ */
35
+ mangle: boolean;
36
+ /**
37
+ * Enable content hashing for immutable caching.
38
+ *
39
+ * @default true
40
+ */
41
+ contentHashing: boolean;
42
+ /**
43
+ * Inject checksum for SSR hydration validation.
44
+ *
45
+ * @default true
46
+ */
47
+ injectChecksum: boolean;
48
+ /**
49
+ * Enable incremental build caching.
50
+ *
51
+ * @default true
52
+ */
53
+ incrementalBuild: boolean;
54
+ /**
55
+ * Minify output (class names and attributes).
56
+ *
57
+ * @default true in production
58
+ */
59
+ minify: boolean;
60
+ }
61
+ /**
62
+ * Build pipeline configuration.
63
+ */
64
+ interface BuildConfig {
65
+ /**
66
+ * Build ID (git hash or timestamp).
67
+ * Auto-generated if not provided.
68
+ */
69
+ buildId?: string;
70
+ /**
71
+ * Path to Tailwind config file.
72
+ *
73
+ * @default "tailwind.config.js"
74
+ */
75
+ tailwindConfig?: string;
76
+ /**
77
+ * Output directory for generated files.
78
+ *
79
+ * @default ".csszyx"
80
+ */
81
+ outputDir?: string;
82
+ /**
83
+ * Cache directory for incremental builds.
84
+ *
85
+ * @default ".csszyx/cache"
86
+ */
87
+ cacheDir?: string;
88
+ /**
89
+ * Maximum AST nodes per file before warning.
90
+ *
91
+ * @default 50000
92
+ */
93
+ astBudgetLimit?: number;
94
+ /**
95
+ * Source parser used for JSX/TSX sz transforms.
96
+ *
97
+ * `oxc` is the default parser. `babel` remains available as a compatibility
98
+ * fallback while the migration keeps Babel dependencies installed.
99
+ *
100
+ * @default "oxc"
101
+ */
102
+ parser?: 'babel' | 'oxc';
103
+ /**
104
+ * CSS file(s) to scan for Tailwind v4 @theme blocks.
105
+ * When set, the plugin generates .csszyx/theme.d.ts with TypeScript augmentation
106
+ * for custom design tokens, enabling IntelliSense for user-defined colors, spacings, etc.
107
+ *
108
+ * Accepts a single glob/path or an array of globs/paths.
109
+ *
110
+ * @example ['src/styles/theme.css', 'src/styles/tokens.css']
111
+ */
112
+ scanCss?: string | string[];
113
+ }
114
+ /**
115
+ * File patterns accepted by csszyx plugin filters.
116
+ *
117
+ * String patterns may be literal paths (`src/generated/icon-dump.tsx`) or
118
+ * simple globs such as `src/generated/**` or any TSX file. RegExp patterns are matched
119
+ * against both absolute paths and paths relative to the project root.
120
+ */
121
+ type FilePattern = string | RegExp;
122
+ /**
123
+ * Hydration safety configuration.
124
+ */
125
+ interface HydrationConfig {
126
+ /**
127
+ * Enable strict hydration checks.
128
+ * When enabled, hydration mismatches trigger abort protocol.
129
+ *
130
+ * @default true
131
+ */
132
+ strict: boolean;
133
+ /**
134
+ * Default recovery mode for components without explicit szRecover.
135
+ *
136
+ * @default null (no recovery)
137
+ */
138
+ defaultRecoveryMode?: 'csr' | 'dev-only' | null;
139
+ /**
140
+ * Enable hydration audit logging.
141
+ *
142
+ * @default true
143
+ */
144
+ auditLog: boolean;
145
+ }
146
+ /**
147
+ * Performance optimization configuration.
148
+ */
149
+ interface PerformanceConfig {
150
+ /**
151
+ * Enable parallel processing during build.
152
+ *
153
+ * @default true
154
+ */
155
+ parallel: boolean;
156
+ /**
157
+ * Number of worker threads for parallel processing.
158
+ * Auto-detected if not provided.
159
+ */
160
+ workers?: number;
161
+ /**
162
+ * Enable CSS variable optimization.
163
+ *
164
+ * @default true
165
+ */
166
+ optimizeVariables: boolean;
167
+ /**
168
+ * Enable zero-runtime optimization for static cases.
169
+ *
170
+ * @default true
171
+ */
172
+ zeroRuntime: boolean;
173
+ }
174
+ /**
175
+ * Main csszyx configuration.
176
+ */
177
+ interface CsszyxConfig {
178
+ /**
179
+ * Development mode configuration.
180
+ */
181
+ development: DevelopmentConfig;
182
+ /**
183
+ * Production mode configuration.
184
+ */
185
+ production: ProductionConfig;
186
+ /**
187
+ * Build pipeline configuration.
188
+ */
189
+ build: BuildConfig;
190
+ /**
191
+ * Hydration safety configuration.
192
+ */
193
+ hydration: HydrationConfig;
194
+ /**
195
+ * Performance optimization configuration.
196
+ */
197
+ performance: PerformanceConfig;
198
+ }
199
+ /**
200
+ * Partial configuration for user-provided config.
201
+ * All fields are optional and will be merged with defaults.
202
+ */
203
+ type PartialCsszyxConfig = {
204
+ /**
205
+ * Restrict source files that csszyx transforms.
206
+ *
207
+ * CSS files used for Tailwind class discovery are still processed unless
208
+ * excluded explicitly, so narrow source includes do not accidentally disable
209
+ * CSS safelist injection.
210
+ */
211
+ include?: FilePattern | FilePattern[];
212
+ /**
213
+ * Exclude files from csszyx processing before parsing.
214
+ *
215
+ * Use this for large generated source files that happen to contain an `sz`
216
+ * marker and would otherwise hit the AST budget guard.
217
+ */
218
+ exclude?: FilePattern | FilePattern[];
219
+ development?: Partial<DevelopmentConfig>;
220
+ production?: Partial<ProductionConfig>;
221
+ build?: Partial<BuildConfig>;
222
+ hydration?: Partial<HydrationConfig>;
223
+ performance?: Partial<PerformanceConfig>;
224
+ };
225
+ /**
226
+ * Default development configuration.
227
+ */
228
+ declare const DEFAULT_DEVELOPMENT_CONFIG: DevelopmentConfig;
229
+ /**
230
+ * Default production configuration.
231
+ */
232
+ declare const DEFAULT_PRODUCTION_CONFIG: ProductionConfig;
233
+ /**
234
+ * Default build configuration.
235
+ */
236
+ declare const DEFAULT_BUILD_CONFIG: BuildConfig;
237
+ /**
238
+ * Default hydration configuration.
239
+ */
240
+ declare const DEFAULT_HYDRATION_CONFIG: HydrationConfig;
241
+ /**
242
+ * Default performance configuration.
243
+ */
244
+ declare const DEFAULT_PERFORMANCE_CONFIG: PerformanceConfig;
245
+ /**
246
+ * Default csszyx configuration.
247
+ */
248
+ declare const DEFAULT_CSSZYX_CONFIG: CsszyxConfig;
249
+ /**
250
+ * Environment type.
251
+ */
252
+ type Environment = 'development' | 'production' | 'test';
253
+ /**
254
+ * Gets the current environment.
255
+ *
256
+ * @returns {Environment} Current environment
257
+ */
258
+ declare function getCurrentEnvironment(): Environment;
259
+
260
+ export { DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, getCurrentEnvironment };
261
+ export type { BuildConfig, CsszyxConfig, DevelopmentConfig, Environment, FilePattern, HydrationConfig, PartialCsszyxConfig, PerformanceConfig, ProductionConfig };
@@ -1,32 +1,32 @@
1
- // src/config.ts
2
- var DEFAULT_DEVELOPMENT_CONFIG = {
1
+ const DEFAULT_DEVELOPMENT_CONFIG = {
3
2
  strictMode: false,
4
3
  debug: false
5
4
  };
6
- var DEFAULT_PRODUCTION_CONFIG = {
5
+ const DEFAULT_PRODUCTION_CONFIG = {
7
6
  mangle: true,
8
7
  contentHashing: true,
9
8
  injectChecksum: true,
10
9
  incrementalBuild: true,
11
10
  minify: true
12
11
  };
13
- var DEFAULT_BUILD_CONFIG = {
12
+ const DEFAULT_BUILD_CONFIG = {
14
13
  tailwindConfig: "tailwind.config.js",
15
14
  outputDir: ".csszyx",
16
15
  cacheDir: ".csszyx/cache",
17
- astBudgetLimit: 5e4
16
+ astBudgetLimit: 5e4,
17
+ parser: "oxc"
18
18
  };
19
- var DEFAULT_HYDRATION_CONFIG = {
19
+ const DEFAULT_HYDRATION_CONFIG = {
20
20
  strict: true,
21
21
  defaultRecoveryMode: null,
22
22
  auditLog: true
23
23
  };
24
- var DEFAULT_PERFORMANCE_CONFIG = {
24
+ const DEFAULT_PERFORMANCE_CONFIG = {
25
25
  parallel: true,
26
26
  optimizeVariables: true,
27
27
  zeroRuntime: true
28
28
  };
29
- var DEFAULT_CSSZYX_CONFIG = {
29
+ const DEFAULT_CSSZYX_CONFIG = {
30
30
  development: DEFAULT_DEVELOPMENT_CONFIG,
31
31
  production: DEFAULT_PRODUCTION_CONFIG,
32
32
  build: DEFAULT_BUILD_CONFIG,
@@ -44,12 +44,4 @@ function getCurrentEnvironment() {
44
44
  return "development";
45
45
  }
46
46
 
47
- export {
48
- DEFAULT_DEVELOPMENT_CONFIG,
49
- DEFAULT_PRODUCTION_CONFIG,
50
- DEFAULT_BUILD_CONFIG,
51
- DEFAULT_HYDRATION_CONFIG,
52
- DEFAULT_PERFORMANCE_CONFIG,
53
- DEFAULT_CSSZYX_CONFIG,
54
- getCurrentEnvironment
55
- };
47
+ export { DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, getCurrentEnvironment };
package/dist/index.cjs ADDED
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const config = require('./config.cjs');
4
+ const runtime = require('./runtime.cjs');
5
+
6
+ const VERSION = "0.0.0";
7
+
8
+ exports.DEFAULT_BUILD_CONFIG = config.DEFAULT_BUILD_CONFIG;
9
+ exports.DEFAULT_CSSZYX_CONFIG = config.DEFAULT_CSSZYX_CONFIG;
10
+ exports.DEFAULT_DEVELOPMENT_CONFIG = config.DEFAULT_DEVELOPMENT_CONFIG;
11
+ exports.DEFAULT_HYDRATION_CONFIG = config.DEFAULT_HYDRATION_CONFIG;
12
+ exports.DEFAULT_PERFORMANCE_CONFIG = config.DEFAULT_PERFORMANCE_CONFIG;
13
+ exports.DEFAULT_PRODUCTION_CONFIG = config.DEFAULT_PRODUCTION_CONFIG;
14
+ exports.getCurrentEnvironment = config.getCurrentEnvironment;
15
+ exports.isCsszyxWindow = runtime.isCsszyxWindow;
16
+ exports.VERSION = VERSION;
@@ -1,8 +1,8 @@
1
- export { BuildConfig, CsszyxConfig, DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, DevelopmentConfig, Environment, HydrationConfig, PartialCsszyxConfig, PerformanceConfig, ProductionConfig, getCurrentEnvironment } from './config.js';
2
- export { AuditLogEntry, ComponentPropsWithSz, CsszyxWindow, HydrationError, HydrationErrorType, MangleMap, MangleMapMetadata, PerformanceMetrics, RecoveryManifest, RecoveryMode, RuntimeState, SzProp, TokenData, VerificationResult, isCsszyxWindow } from './runtime.js';
3
- export { BuildPhase, BuildPhaseResult, BuildPhaseStatus, BuildResult, BuildStatistics, CacheEntry, CacheManager, CollisionResult, CompilerContext, CompilerOptions, CompilerPlugin, FileCompilationResult, GeneratedToken, MangleMapEntry, NodeLocation, TokenMetadata, TransformOptions, ValidationError, ValidationResult } from './compiler.js';
1
+ export { BuildPhase, BuildPhaseResult, BuildPhaseStatus, BuildResult, BuildStatistics, CacheEntry, CacheManager, CollisionResult, CompilerContext, CompilerOptions, CompilerPlugin, FileCompilationResult, GeneratedToken, MangleMapEntry, NodeLocation, TokenMetadata, TransformOptions, ValidationError, ValidationResult } from './compiler.cjs';
2
+ export { BuildConfig, CsszyxConfig, DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, DevelopmentConfig, Environment, HydrationConfig, PartialCsszyxConfig, PerformanceConfig, ProductionConfig, getCurrentEnvironment } from './config.cjs';
4
3
  import { SzPropValue, RecoveryMode } from '@csszyx/compiler';
5
4
  export { SzPropValue, SzProps } from '@csszyx/compiler';
5
+ export { AuditLogEntry, ComponentPropsWithSz, CsszyxWindow, HydrationError, HydrationErrorType, MangleMap, MangleMapMetadata, PerformanceMetrics, RecoveryManifest, RecoveryMode, RuntimeState, SzProp, TokenData, VerificationResult, isCsszyxWindow } from './runtime.cjs';
6
6
 
7
7
  /**
8
8
  * @csszyx/types - Core WASM Contract
@@ -60,60 +60,60 @@ interface CsszyxCorePkg {
60
60
 
61
61
 
62
62
  declare module 'react' {
63
- /**
64
- *
65
- */
66
-
67
- /**
68
- *
69
- */
70
- interface HTMLAttributes<T> {
71
63
  /**
72
- * csszyx styling prop — Tailwind CSS via object syntax or class string.
73
64
  *
74
- * @example
75
- * ```tsx
76
- * <div sz={{ p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }} />
77
- * <div sz="p-4 bg-blue-500 hover:bg-blue-700" />
78
- * ```
79
65
  */
80
- sz?: SzPropValue;
66
+
81
67
  /**
82
- * Hydration recovery mode for the element. The csszyx unplugin
83
- * compiles this attribute into a `data-sz-recovery-token` and
84
- * registers the element in the SSR recovery manifest read by
85
- * `@csszyx/runtime/verify` at hydration time.
86
- *
87
- * - `'csr'` — recovery permitted in both dev and production
88
- * - `'dev-only'` — recovery permitted in development only;
89
- * stripped from the production manifest at build time.
90
68
  *
91
- * @example
92
- * ```tsx
93
- * <section szRecover="csr">…</section>
94
- * ```
95
69
  */
96
- szRecover?: RecoveryMode;
97
- }
70
+ interface HTMLAttributes<T> {
71
+ /**
72
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
73
+ *
74
+ * @example
75
+ * ```tsx
76
+ * <div sz={{ p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }} />
77
+ * <div sz="p-4 bg-blue-500 hover:bg-blue-700" />
78
+ * ```
79
+ */
80
+ sz?: SzPropValue;
81
+ /**
82
+ * Hydration recovery mode for the element. The csszyx unplugin
83
+ * compiles this attribute into a `data-sz-recovery-token` and
84
+ * registers the element in the SSR recovery manifest read by
85
+ * `@csszyx/runtime/verify` at hydration time.
86
+ *
87
+ * - `'csr'` — recovery permitted in both dev and production
88
+ * - `'dev-only'` — recovery permitted in development only;
89
+ * stripped from the production manifest at build time.
90
+ *
91
+ * @example
92
+ * ```tsx
93
+ * <section szRecover="csr">…</section>
94
+ * ```
95
+ */
96
+ szRecover?: RecoveryMode;
97
+ }
98
98
 
99
- /**
100
- *
101
- */
99
+ /**
100
+ *
101
+ */
102
102
 
103
- /**
104
- *
105
- */
106
- interface SVGAttributes<T> {
107
103
  /**
108
- * csszyx styling prop — Tailwind CSS via object syntax or class string.
109
104
  *
110
- * @example
111
- * ```tsx
112
- * <svg sz={{ fill: 'red-500', stroke: 'current' }} />
113
- * ```
114
105
  */
115
- sz?: SzPropValue;
116
- }
106
+ interface SVGAttributes<T> {
107
+ /**
108
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
109
+ *
110
+ * @example
111
+ * ```tsx
112
+ * <svg sz={{ fill: 'red-500', stroke: 'current' }} />
113
+ * ```
114
+ */
115
+ sz?: SzPropValue;
116
+ }
117
117
  }
118
118
 
119
119
  /**
@@ -129,4 +129,5 @@ declare module 'react' {
129
129
  */
130
130
  declare const VERSION = "0.0.0";
131
131
 
132
- export { type CsszyxCorePkg, type CsszyxCoreWasm, VERSION };
132
+ export { VERSION };
133
+ export type { CsszyxCorePkg, CsszyxCoreWasm };
@@ -0,0 +1,133 @@
1
+ export { BuildPhase, BuildPhaseResult, BuildPhaseStatus, BuildResult, BuildStatistics, CacheEntry, CacheManager, CollisionResult, CompilerContext, CompilerOptions, CompilerPlugin, FileCompilationResult, GeneratedToken, MangleMapEntry, NodeLocation, TokenMetadata, TransformOptions, ValidationError, ValidationResult } from './compiler.mjs';
2
+ export { BuildConfig, CsszyxConfig, DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, DevelopmentConfig, Environment, HydrationConfig, PartialCsszyxConfig, PerformanceConfig, ProductionConfig, getCurrentEnvironment } from './config.mjs';
3
+ import { SzPropValue, RecoveryMode } from '@csszyx/compiler';
4
+ export { SzPropValue, SzProps } from '@csszyx/compiler';
5
+ export { AuditLogEntry, ComponentPropsWithSz, CsszyxWindow, HydrationError, HydrationErrorType, MangleMap, MangleMapMetadata, PerformanceMetrics, RecoveryManifest, RecoveryMode, RuntimeState, SzProp, TokenData, VerificationResult, isCsszyxWindow } from './runtime.mjs';
6
+
7
+ /**
8
+ * @csszyx/types - Core WASM Contract
9
+ *
10
+ * This file defines the strict interface between the Rust/WASM core
11
+ * and the TypeScript world. This is the source of truth for "The Forge" workstream.
12
+ */
13
+ /**
14
+ *
15
+ */
16
+ interface CsszyxCoreWasm {
17
+ /**
18
+ * Encodes a numeric index into a compact tier-based class name (z, y, x...).
19
+ */
20
+ encode(index: number): string;
21
+ /**
22
+ * Generates a unique cryptographic recovery token for SSR hydration safety.
23
+ */
24
+ generate_token(componentName: string, filePath: string, line: number, column: number, recoveryMode: 'csr' | 'dev-only', buildId: string): string;
25
+ /**
26
+ * Verifies if a recovery token is valid for the given context.
27
+ */
28
+ verify_token(token: string, componentName: string, filePath: string, line: number, column: number, recoveryMode: 'csr' | 'dev-only', buildId: string): boolean;
29
+ /**
30
+ * Computes a dual-hash for a CSS class name to prevent collisions.
31
+ */
32
+ compute_dual_hash(className: string): string;
33
+ /**
34
+ * Returns the current version of the core engine.
35
+ */
36
+ version(): string;
37
+ }
38
+ /**
39
+ * The expected structure of the WASM initialization output.
40
+ */
41
+ interface CsszyxCorePkg {
42
+ default: () => Promise<void>;
43
+ encode: (index: number) => string;
44
+ generate_token: (componentName: string, filePath: string, line: number, column: number, recoveryMode: string, buildId: string) => string;
45
+ verify_token: (token: string, componentName: string, filePath: string, line: number, column: number, recoveryMode: string, buildId: string) => boolean;
46
+ compute_dual_hash: (className: string) => string;
47
+ version: () => string;
48
+ }
49
+
50
+ /**
51
+ * JSX type augmentation for csszyx sz prop.
52
+ *
53
+ * This module extends React's JSX namespace to add the `sz` prop
54
+ * to all HTML elements. Types are re-exported from @csszyx/compiler
55
+ * for IntelliSense and autocompletion.
56
+ *
57
+ * @module @csszyx/types/jsx
58
+ */
59
+
60
+
61
+
62
+ declare module 'react' {
63
+ /**
64
+ *
65
+ */
66
+
67
+ /**
68
+ *
69
+ */
70
+ interface HTMLAttributes<T> {
71
+ /**
72
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
73
+ *
74
+ * @example
75
+ * ```tsx
76
+ * <div sz={{ p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }} />
77
+ * <div sz="p-4 bg-blue-500 hover:bg-blue-700" />
78
+ * ```
79
+ */
80
+ sz?: SzPropValue;
81
+ /**
82
+ * Hydration recovery mode for the element. The csszyx unplugin
83
+ * compiles this attribute into a `data-sz-recovery-token` and
84
+ * registers the element in the SSR recovery manifest read by
85
+ * `@csszyx/runtime/verify` at hydration time.
86
+ *
87
+ * - `'csr'` — recovery permitted in both dev and production
88
+ * - `'dev-only'` — recovery permitted in development only;
89
+ * stripped from the production manifest at build time.
90
+ *
91
+ * @example
92
+ * ```tsx
93
+ * <section szRecover="csr">…</section>
94
+ * ```
95
+ */
96
+ szRecover?: RecoveryMode;
97
+ }
98
+
99
+ /**
100
+ *
101
+ */
102
+
103
+ /**
104
+ *
105
+ */
106
+ interface SVGAttributes<T> {
107
+ /**
108
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
109
+ *
110
+ * @example
111
+ * ```tsx
112
+ * <svg sz={{ fill: 'red-500', stroke: 'current' }} />
113
+ * ```
114
+ */
115
+ sz?: SzPropValue;
116
+ }
117
+ }
118
+
119
+ /**
120
+ * @csszyx/types - Shared TypeScript types for csszyx.
121
+ *
122
+ * This package provides comprehensive type definitions used across
123
+ * the csszyx framework, including configuration, runtime, and compiler types.
124
+ *
125
+ * @module @csszyx/types
126
+ */
127
+ /**
128
+ * Package version.
129
+ */
130
+ declare const VERSION = "0.0.0";
131
+
132
+ export { VERSION };
133
+ export type { CsszyxCorePkg, CsszyxCoreWasm };
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ export { DEFAULT_BUILD_CONFIG, DEFAULT_CSSZYX_CONFIG, DEFAULT_DEVELOPMENT_CONFIG, DEFAULT_HYDRATION_CONFIG, DEFAULT_PERFORMANCE_CONFIG, DEFAULT_PRODUCTION_CONFIG, getCurrentEnvironment } from './config.mjs';
2
+ export { isCsszyxWindow } from './runtime.mjs';
3
+
4
+ const VERSION = "0.0.0";
5
+
6
+ export { VERSION };
package/dist/jsx.d.ts CHANGED
@@ -15,58 +15,58 @@ import type { RecoveryMode, SzProps, SzPropValue } from '@csszyx/compiler';
15
15
  export type { RecoveryMode, SzProps, SzPropValue };
16
16
 
17
17
  declare module 'react' {
18
- /**
19
- *
20
- */
21
-
22
- /**
23
- *
24
- */
25
- interface HTMLAttributes<T> {
26
18
  /**
27
- * csszyx styling prop — Tailwind CSS via object syntax or class string.
28
19
  *
29
- * @example
30
- * ```tsx
31
- * <div sz={{ p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }} />
32
- * <div sz="p-4 bg-blue-500 hover:bg-blue-700" />
33
- * ```
34
20
  */
35
- sz?: SzPropValue;
21
+
36
22
  /**
37
- * Hydration recovery mode for the element. The csszyx unplugin
38
- * compiles this attribute into a `data-sz-recovery-token` and
39
- * registers the element in the SSR recovery manifest read by
40
- * `@csszyx/runtime/verify` at hydration time.
41
- *
42
- * - `'csr'` — recovery permitted in both dev and production
43
- * - `'dev-only'` — recovery permitted in development only;
44
- * stripped from the production manifest at build time.
45
23
  *
46
- * @example
47
- * ```tsx
48
- * <section szRecover="csr">…</section>
49
- * ```
50
24
  */
51
- szRecover?: RecoveryMode;
52
- }
25
+ interface HTMLAttributes<T> {
26
+ /**
27
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
28
+ *
29
+ * @example
30
+ * ```tsx
31
+ * <div sz={{ p: 4, bg: 'blue-500', hover: { bg: 'blue-700' } }} />
32
+ * <div sz="p-4 bg-blue-500 hover:bg-blue-700" />
33
+ * ```
34
+ */
35
+ sz?: SzPropValue;
36
+ /**
37
+ * Hydration recovery mode for the element. The csszyx unplugin
38
+ * compiles this attribute into a `data-sz-recovery-token` and
39
+ * registers the element in the SSR recovery manifest read by
40
+ * `@csszyx/runtime/verify` at hydration time.
41
+ *
42
+ * - `'csr'` — recovery permitted in both dev and production
43
+ * - `'dev-only'` — recovery permitted in development only;
44
+ * stripped from the production manifest at build time.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * <section szRecover="csr">…</section>
49
+ * ```
50
+ */
51
+ szRecover?: RecoveryMode;
52
+ }
53
53
 
54
- /**
55
- *
56
- */
54
+ /**
55
+ *
56
+ */
57
57
 
58
- /**
59
- *
60
- */
61
- interface SVGAttributes<T> {
62
58
  /**
63
- * csszyx styling prop — Tailwind CSS via object syntax or class string.
64
59
  *
65
- * @example
66
- * ```tsx
67
- * <svg sz={{ fill: 'red-500', stroke: 'current' }} />
68
- * ```
69
60
  */
70
- sz?: SzPropValue;
71
- }
61
+ interface SVGAttributes<T> {
62
+ /**
63
+ * csszyx styling prop — Tailwind CSS via object syntax or class string.
64
+ *
65
+ * @example
66
+ * ```tsx
67
+ * <svg sz={{ fill: 'red-500', stroke: 'current' }} />
68
+ * ```
69
+ */
70
+ sz?: SzPropValue;
71
+ }
72
72
  }