Sanity Library Reference Docs
    Preparing search index...

    Type Alias DocumentLocationResolver

    DocumentLocationResolver: (
        params: {
            id: string;
            perspectiveStack: StackablePerspective[];
            type: string;
            version: string | undefined;
        },
        context: { documentStore: DocumentStore },
    ) =>
        | DocumentLocationsState
        | null
        | undefined
        | Observable<DocumentLocationsState | null | undefined>

    Function used for advanced document location resolution

    Type declaration

      • (
            params: {
                id: string;
                perspectiveStack: StackablePerspective[];
                type: string;
                version: string | undefined;
            },
            context: { documentStore: DocumentStore },
        ):
            | DocumentLocationsState
            | null
            | undefined
            | Observable<DocumentLocationsState | null | undefined>
      • Parameters

        • params: {
              id: string;
              perspectiveStack: StackablePerspective[];
              type: string;
              version: string | undefined;
          }

          Object with document id and document type properties

        • context: { documentStore: DocumentStore }

          Object with documentStore property for creating listenQuery subscriptions

        Returns
            | DocumentLocationsState
            | null
            | undefined
            | Observable<DocumentLocationsState | null | undefined>

        Document location state, optionally as an Observable, or null/undefined if no locations are available