@csszyx/types 0.5.0 → 0.6.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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
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
2
  export { AuditLogEntry, ComponentPropsWithSz, CsszyxWindow, HydrationError, HydrationErrorType, MangleMap, MangleMapMetadata, PerformanceMetrics, RecoveryManifest, RecoveryMode, RuntimeState, SzProp, TokenData, VerificationResult, isCsszyxWindow } from './runtime.js';
3
3
  export { BuildPhase, BuildPhaseResult, BuildPhaseStatus, BuildResult, BuildStatistics, CacheEntry, CacheManager, CollisionResult, CompilerContext, CompilerOptions, CompilerPlugin, FileCompilationResult, GeneratedToken, MangleMapEntry, NodeLocation, TokenMetadata, TransformOptions, ValidationError, ValidationResult } from './compiler.js';
4
- import { SzPropValue } from '@csszyx/compiler';
4
+ import { SzPropValue, RecoveryMode } from '@csszyx/compiler';
5
5
  export { SzPropValue, SzProps } from '@csszyx/compiler';
6
6
 
7
7
  /**
@@ -75,6 +75,22 @@ declare module 'react' {
75
75
  * ```
76
76
  */
77
77
  sz?: SzPropValue;
78
+ /**
79
+ * Hydration recovery mode for the element. The csszyx unplugin
80
+ * compiles this attribute into a `data-sz-recovery-token` and
81
+ * registers the element in the SSR recovery manifest read by
82
+ * `@csszyx/runtime/verify` at hydration time.
83
+ *
84
+ * - `'csr'` — recovery permitted in both dev and production
85
+ * - `'dev-only'` — recovery permitted in development only;
86
+ * stripped from the production manifest at build time.
87
+ *
88
+ * @example
89
+ * ```tsx
90
+ * <section szRecover="csr">…</section>
91
+ * ```
92
+ */
93
+ szRecover?: RecoveryMode;
78
94
  }
79
95
 
80
96
  /**
package/dist/jsx.d.ts CHANGED
@@ -10,9 +10,9 @@
10
10
 
11
11
  import 'react';
12
12
 
13
- import type { SzProps, SzPropValue } from '@csszyx/compiler';
13
+ import type { RecoveryMode, SzProps, SzPropValue } from '@csszyx/compiler';
14
14
 
15
- export type { SzProps, SzPropValue };
15
+ export type { RecoveryMode, SzProps, SzPropValue };
16
16
 
17
17
  declare module 'react' {
18
18
  /**
@@ -30,6 +30,22 @@ declare module 'react' {
30
30
  * ```
31
31
  */
32
32
  sz?: SzPropValue;
33
+ /**
34
+ * Hydration recovery mode for the element. The csszyx unplugin
35
+ * compiles this attribute into a `data-sz-recovery-token` and
36
+ * registers the element in the SSR recovery manifest read by
37
+ * `@csszyx/runtime/verify` at hydration time.
38
+ *
39
+ * - `'csr'` — recovery permitted in both dev and production
40
+ * - `'dev-only'` — recovery permitted in development only;
41
+ * stripped from the production manifest at build time.
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * <section szRecover="csr">…</section>
46
+ * ```
47
+ */
48
+ szRecover?: RecoveryMode;
33
49
  }
34
50
 
35
51
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/types",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "TypeScript definitions for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -50,7 +50,7 @@
50
50
  "@types/node": "^20.11.0",
51
51
  "tsup": "^8.0.0",
52
52
  "typescript": "^5.3.3",
53
- "@csszyx/compiler": "0.5.0"
53
+ "@csszyx/compiler": "0.6.0"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsup src/index.ts src/config.ts src/runtime.ts src/compiler.ts --format esm --dts && cp src/jsx.d.ts dist/jsx.d.ts",