@sanity/validation 3.1.5-next.44 → 3.1.5-next.45
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/dts/src/index.d.ts +36 -0
- package/lib/index.cjs.mjs +7 -0
- package/lib/index.esm.js +1288 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +1308 -0
- package/lib/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {Observable} from 'rxjs'
|
|
2
|
+
import {RuleClass} from '@sanity/types'
|
|
3
|
+
import type {SanityClient} from '@sanity/client'
|
|
4
|
+
import {SanityDocument} from '@sanity/types'
|
|
5
|
+
import {Schema} from '@sanity/types'
|
|
6
|
+
import {SchemaType} from '@sanity/types'
|
|
7
|
+
import {ValidationContext} from '@sanity/types'
|
|
8
|
+
import {ValidationMarker} from '@sanity/types'
|
|
9
|
+
|
|
10
|
+
export declare function inferFromSchema(schema: Schema): Schema
|
|
11
|
+
|
|
12
|
+
export declare function inferFromSchemaType(
|
|
13
|
+
typeDef: SchemaType,
|
|
14
|
+
_schema: Schema,
|
|
15
|
+
_visited?: Set<SchemaType>
|
|
16
|
+
): SchemaType
|
|
17
|
+
|
|
18
|
+
export declare function inferFromSchemaType(typeDef: SchemaType): SchemaType
|
|
19
|
+
|
|
20
|
+
export declare const Rule: RuleClass
|
|
21
|
+
|
|
22
|
+
export declare function validateDocument(
|
|
23
|
+
getClient: (options: {apiVersion: string}) => SanityClient,
|
|
24
|
+
doc: SanityDocument,
|
|
25
|
+
schema: Schema,
|
|
26
|
+
context?: Pick<ValidationContext, 'getDocumentExists'>
|
|
27
|
+
): Promise<ValidationMarker[]>
|
|
28
|
+
|
|
29
|
+
export declare function validateDocumentObservable(
|
|
30
|
+
getClient: (options: {apiVersion: string}) => SanityClient,
|
|
31
|
+
doc: SanityDocument,
|
|
32
|
+
schema: Schema,
|
|
33
|
+
context?: Pick<ValidationContext, 'getDocumentExists'>
|
|
34
|
+
): Observable<ValidationMarker[]>
|
|
35
|
+
|
|
36
|
+
export {}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import cjs from './index.js';
|
|
2
|
+
|
|
3
|
+
export const Rule = cjs.Rule;
|
|
4
|
+
export const inferFromSchema = cjs.inferFromSchema;
|
|
5
|
+
export const inferFromSchemaType = cjs.inferFromSchemaType;
|
|
6
|
+
export const validateDocument = cjs.validateDocument;
|
|
7
|
+
export const validateDocumentObservable = cjs.validateDocumentObservable;
|