Sanity Library Reference Docs
    Preparing search index...

    Type Alias EncodeDataAttribute<QueryResponseResult>

    EncodeDataAttribute: (
        result: QueryResponseResult,
        sourceMap: ContentSourceMap | undefined,
        studioUrl: Exclude<StegaConfig["studioUrl"], undefined> | undefined,
        path: StudioPathLike,
    ) => string | undefined

    Creates a encoded payload suitable for passing to a data-sanity attribute, which are used by @sanity/visual-editing

    Type Parameters

    • QueryResponseResult = unknown

    Type declaration

      • (
            result: QueryResponseResult,
            sourceMap: ContentSourceMap | undefined,
            studioUrl: Exclude<StegaConfig["studioUrl"], undefined> | undefined,
            path: StudioPathLike,
        ): string | undefined
      • Parameters

        • result: QueryResponseResult
        • sourceMap: ContentSourceMap | undefined
        • studioUrl: Exclude<StegaConfig["studioUrl"], undefined> | undefined
        • path: StudioPathLike

        Returns string | undefined