Sanity Library Reference Docs
    Preparing search index...

    Interface SanityImageLike

    An image object in any shape Sanity TypeGen generates for it: a raw image field, an image with asset-> dereferenced, or a partial projection such as image{asset, crop, hotspot}. Custom image types with extra fields (alt, caption, ...) and any _type are accepted.

    asset is optional and nullable, matching TypeGen, since an image field can exist before an asset has been uploaded to it. Use isImageWithAsset to narrow a value to one that has an asset.

    interface SanityImageLike {
        asset?:
            | SanityReference
            | { _id?: string
            | null; url?: string | null }
            | null;
        crop?:
            | {
                _type?: string;
                bottom?: number
                | null;
                left?: number | null;
                right?: number | null;
                top?: number | null;
            }
            | null;
        hotspot?: | {
            _type?: string;
            height?: number
            | null;
            width?: number | null;
            x?: number | null;
            y?: number | null;
        }
        | null;
    }
    Index

    Properties

    Properties

    asset?: SanityReference | { _id?: string | null; url?: string | null } | null
    crop?:
        | {
            _type?: string;
            bottom?: number
            | null;
            left?: number | null;
            right?: number | null;
            top?: number | null;
        }
        | null
    hotspot?:
        | {
            _type?: string;
            height?: number
            | null;
            width?: number | null;
            x?: number | null;
            y?: number | null;
        }
        | null