@sanity/types 6.11.0 → 6.12.0-next.112
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/lib/index.d.ts +17 -1
- package/package.json +7 -7
package/lib/index.d.ts
CHANGED
|
@@ -174,6 +174,15 @@ interface User {
|
|
|
174
174
|
/** @public */
|
|
175
175
|
interface ValidationMarker {
|
|
176
176
|
level: 'error' | 'warning' | 'info';
|
|
177
|
+
/**
|
|
178
|
+
* A machine-readable identifier for the validation failure.
|
|
179
|
+
*
|
|
180
|
+
* Built-in validators use stable codes exported by `@sanity/validation`.
|
|
181
|
+
* Custom validators may provide their own code.
|
|
182
|
+
*/
|
|
183
|
+
code?: string;
|
|
184
|
+
/** Structured information about the validation failure. */
|
|
185
|
+
details?: Record<string, unknown>;
|
|
177
186
|
/**
|
|
178
187
|
* The validation message for this marker. E.g. "Must be greater than 0"
|
|
179
188
|
*/
|
|
@@ -533,7 +542,7 @@ interface ValidationContext {
|
|
|
533
542
|
* `RuleSpec`'s constraint, the value to check, an optional override message,
|
|
534
543
|
* and the validation context.
|
|
535
544
|
*
|
|
536
|
-
* @see Rule.validate from
|
|
545
|
+
* @see Rule.validate from `@sanity/validation`
|
|
537
546
|
*
|
|
538
547
|
* @internal
|
|
539
548
|
*/
|
|
@@ -586,6 +595,13 @@ interface ValidationErrorClass {
|
|
|
586
595
|
* @public
|
|
587
596
|
*/
|
|
588
597
|
interface ValidationError {
|
|
598
|
+
/**
|
|
599
|
+
* A machine-readable identifier for the validation failure.
|
|
600
|
+
* Custom validators should namespace custom codes, for example `custom.seo-title`.
|
|
601
|
+
*/
|
|
602
|
+
code?: string;
|
|
603
|
+
/** Structured information about the validation failure. */
|
|
604
|
+
details?: Record<string, unknown>;
|
|
589
605
|
/**
|
|
590
606
|
* The message describing why the value is not valid. This message will be
|
|
591
607
|
* included in the validation markers after validation has finished running.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/types",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.12.0-next.112",
|
|
4
4
|
"description": "Type definitions for common Sanity data structures",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sanity/client": "^8.
|
|
36
|
+
"@sanity/client": "^8.4.0",
|
|
37
37
|
"@sanity/media-library-types": "^1.6.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
+
"@repo/test-config": "6.9.2",
|
|
41
|
+
"@repo/tsconfig": "6.9.2",
|
|
42
|
+
"@repo/tsdown.config": "6.9.2",
|
|
40
43
|
"@types/react": "^19.2.18",
|
|
41
|
-
"@vitejs/plugin-react": "^6.1.
|
|
44
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
42
45
|
"react": "^19.2.8",
|
|
43
46
|
"tsdown": "^0.22.14",
|
|
44
47
|
"typescript": "^7.0.2",
|
|
45
48
|
"vite": "^8.2.2",
|
|
46
|
-
"vitest": "^4.1.11"
|
|
47
|
-
"@repo/tsconfig": "6.9.2",
|
|
48
|
-
"@repo/tsdown.config": "6.9.2",
|
|
49
|
-
"@repo/test-config": "6.9.2"
|
|
49
|
+
"vitest": "^4.1.11"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@types/react": "*"
|