Sanity Library Reference Docs
    Preparing search index...
    HistoryRefresh:
        | { livePreviewEnabled: boolean; source: "manual" }
        | {
            document: {
                _id: string;
                _rev: string;
                _type: string;
                slug?: { current?: string | null };
            };
            livePreviewEnabled: boolean;
            source: "mutation";
        }

    Preview frame history refresh event, emitted by Presentation Tool

    Type declaration

    • { livePreviewEnabled: boolean; source: "manual" }
      • livePreviewEnabled: boolean

        If true then there's either preview-kit or a loader connected on the page

      • source: "manual"

        source 'manual' means the refresh button were clicked by the user

    • {
          document: {
              _id: string;
              _rev: string;
              _type: string;
              slug?: { current?: string | null };
          };
          livePreviewEnabled: boolean;
          source: "mutation";
      }
      • document: { _id: string; _rev: string; _type: string; slug?: { current?: string | null } }

        Select metadata about the document that were mutated If it's prefixed with drafts. then it's a draft document, otherwise it's a published document.

        • _id: string

          If it's prefixed with drafts. then it's a draft document, otherwise it's a published document.

        • _rev: string

          The document revision, can be used to dedupe requests, as we always send two due to debouncing and handling Content Lake eventual consistency

        • _type: string

          The document type is frequently used in revalidateTag scenarios with Next.js App Router

        • Optionalslug?: { current?: string | null }

          If the document has a top level slug field named slug with the type slug, then it'll be included here

      • livePreviewEnabled: boolean

        If true then there's either preview-kit or a loader connected on the page

      • source: "mutation"

        source 'mutation' means a document were mutated and the preview might need to refresh