Sanity Library Reference Docs
    Preparing search index...

    Interface TypeAliasDefinition<TType, TAlias>

    Represents a type definition that is an alias/extension of an existing type in your schema. Creating a type alias will re-register that existing type under a different name. You can also override the default type options with a type alias definition.

    interface TypeAliasDefinition<
        TType extends string,
        TAlias extends IntrinsicTypeName | undefined,
    > {
        components?: {
            annotation?: ComponentType<any>;
            block?: ComponentType<any>;
            diff?: ComponentType<any>;
            field?: ComponentType<any>;
            inlineBlock?: ComponentType<any>;
            input?: ComponentType<any>;
            item?: ComponentType<any>;
            preview?: ComponentType<any>;
        };
        deprecated?: DeprecatedProperty;
        description?: string
        | Element;
        hidden?: ConditionalProperty;
        icon?: ReactNode | ComponentType<{}>;
        initialValue?: any;
        name: string;
        options?: TAlias extends | "string"
        | "number"
        | "boolean"
        | "object"
        | "text"
        | "crossDatasetReference"
        | "reference"
        | "image"
        | "document"
        | "url"
        | "email"
        | "date"
        | "block"
        | "array"
        | "datetime"
        | "file"
        | "geopoint"
        | "globalDocumentReference"
        | "slug"
        | "sanity.video"
            ? IntrinsicDefinitions[TAlias<TAlias>]["options"]
            : unknown;
        preview?: PreviewConfig;
        readOnly?: ConditionalProperty;
        title?: string;
        type: TType;
        validation?: SchemaValidationValue;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    components?: {
        annotation?: ComponentType<any>;
        block?: ComponentType<any>;
        diff?: ComponentType<any>;
        field?: ComponentType<any>;
        inlineBlock?: ComponentType<any>;
        input?: ComponentType<any>;
        item?: ComponentType<any>;
        preview?: ComponentType<any>;
    }
    deprecated?: DeprecatedProperty
    description?: string | Element
    icon?: ReactNode | ComponentType<{}>
    initialValue?: any
    name: string
    options?: TAlias extends | "string"
    | "number"
    | "boolean"
    | "object"
    | "text"
    | "crossDatasetReference"
    | "reference"
    | "image"
    | "document"
    | "url"
    | "email"
    | "date"
    | "block"
    | "array"
    | "datetime"
    | "file"
    | "geopoint"
    | "globalDocumentReference"
    | "slug"
    | "sanity.video"
        ? IntrinsicDefinitions[TAlias<TAlias>]["options"]
        : unknown
    preview?: PreviewConfig
    title?: string
    type: TType