Sanity Library Reference Docs
    Preparing search index...

    Type Alias InferImageValue<T>Alpha

    InferImageValue: ImageUrlInferImageValue<StegaAware<T>>

    Collects every image shape found anywhere in T, which can be a TypeGen query result, a union of query results, or a schema type. File fields are skipped. null and undefined are dropped.

    Stega-aware version of InferImageValue from @sanity/image-url: the inferred image type accepts both clean query results and stega-branded results. Don't stegaClean() the image before passing it to <Image>; the component strips stega from the asset id and URL itself, and cleaning the whole value would drop the characters Visual Editing needs elsewhere on the page.

    Type Parameters

    • T
    import type {SanityQueries} from 'next-sanity'
    import type {InferImageValue} from 'next-sanity/image'

    type ImageValue = InferImageValue<SanityQueries[keyof SanityQueries]>