UNPKG

@sanity/schema

Version:

- **`Schema`** A collection of types - **`Type`** A specification of a data structure. Available through schema lookup. - **`Member type`** A member type is a type contained by a schema type. For example, an array may specify the allowed item types by def

58 lines (51 loc) 1.14 kB
import {RuleClass} from '@sanity/types' /** * @deprecated Use `import {Schema} from "@sanity/schema"` instead */ declare class DeprecatedDefaultSchema extends Schema_2 { static compile(schemaDef: any): Schema_2 constructor(schemaDef: any) } export default DeprecatedDefaultSchema /** * Core Rule implementation without validation logic. * This is the base Rule class that can be extended with validation logic. * * @internal */ export declare const Rule: RuleClass export declare const Schema: typeof Schema_2 /** * @beta */ declare class Schema_2 { #private _original: { name: string types: any[] parent?: Schema_2 } _registry: { [typeName: string]: any } static compile(schemaDef: any): Schema_2 constructor(schemaDef: any) get name(): string /** * Returns the parent schema. */ get parent(): Schema_2 | undefined get(name: string): any has(name: string): boolean getTypeNames(): string[] getLocalTypeNames(): string[] } /** * @internal */ export declare interface SchemaValidationResult { severity: 'warning' | 'error' message: string helpId?: string } export {}