Sanity Library Reference Docs
    Preparing search index...

    Interface DefineSchemaOptions<TStrict, TAlias>Beta

    interface DefineSchemaOptions<
        TStrict extends StrictDefinition,
        TAlias extends IntrinsicTypeName | undefined,
    > {
        aliasFor?: TAlias extends | "string"
        | "number"
        | "boolean"
        | "object"
        | "text"
        | "crossDatasetReference"
        | "reference"
        | "image"
        | "document"
        | "url"
        | "email"
        | "date"
        | "block"
        | "array"
        | "datetime"
        | "file"
        | "geopoint"
        | "globalDocumentReference"
        | "slug"
        | "sanity.video"
            ? TAlias<TAlias>
            : never;
        strict?: TStrict;
    }

    Type Parameters

    Index

    Properties

    Properties

    aliasFor?: TAlias extends | "string"
    | "number"
    | "boolean"
    | "object"
    | "text"
    | "crossDatasetReference"
    | "reference"
    | "image"
    | "document"
    | "url"
    | "email"
    | "date"
    | "block"
    | "array"
    | "datetime"
    | "file"
    | "geopoint"
    | "globalDocumentReference"
    | "slug"
    | "sanity.video"
        ? TAlias<TAlias>
        : never

    Should be provided when type is a non-intrinsic type, ie type is a type alias

    strict?: TStrict

    strict: false allows unknown properties in the schema. Use this when adding customizations to the schema that are not part of sanity core.

    If you want to extend the Sanity Schema types with your own properties or options to make them typesafe, you can use TypeScript declaration merging.

    See defineType for more.

    defineType