Sanity Library Reference Docs
    Preparing search index...

    The client slice the ensure matrix needs — structurally satisfied by @sanity/client, kept structural so this package doesn't take the client as a dependency (the adapters supply theirs). Members use method syntax on purpose: method parameters check bivariantly, so the real client's narrower signatures still satisfy the slice; property-style signatures would not.

    interface EnsureDocumentClient {
        createVersion(
            args: {
                baseId?: string;
                document?: { _type: string } & Record<string, unknown>;
                publishedId: string;
                releaseId?: string;
            },
        ): Promise<unknown>;
        fetch<T>(
            query: string,
            params?: Record<string, unknown>,
            options?: { perspective?: "raw" },
        ): Promise<T>;
    }
    Index

    Methods

    • Parameters

      • args: {
            baseId?: string;
            document?: { _type: string } & Record<string, unknown>;
            publishedId: string;
            releaseId?: string;
        }

      Returns Promise<unknown>

    • Type Parameters

      • T

      Parameters

      • query: string
      • Optionalparams: Record<string, unknown>
      • Optionaloptions: { perspective?: "raw" }

      Returns Promise<T>