Sanity Library Reference Docs
    Preparing search index...

    Type Alias GenerateTargetDocument<T>Beta

    GenerateTargetDocument:
        | { _id: string; operation: "edit" }
        | { _id?: string; _type: string; initialValues?: T; operation: "create" }
        | {
            _id: string;
            _type: string;
            initialValues?: T;
            operation: "createIfNotExists";
        }
        | {
            _id: string;
            _type: string;
            initialValues?: T;
            operation: "createOrReplace";
        }

    Type Parameters

    • T extends Record<string, Any> = Record<string, Any>

    Type declaration

    • { _id: string; operation: "edit" }
      • _id: string

        #AgentActionSchema.forcePublishedWrite

      • operation: "edit"
    • { _id?: string; _type: string; initialValues?: T; operation: "create" }
      • Optional_id?: string

        #AgentActionSchema.forcePublishedWrite

      • _type: string
      • OptionalinitialValues?: T
      • operation: "create"
    • {
          _id: string;
          _type: string;
          initialValues?: T;
          operation: "createIfNotExists";
      }
      • _id: string

        #AgentActionSchema.forcePublishedWrite

      • _type: string
      • OptionalinitialValues?: T
      • operation: "createIfNotExists"
    • { _id: string; _type: string; initialValues?: T; operation: "createOrReplace" }
      • _id: string

        #AgentActionSchema.forcePublishedWrite

      • _type: string
      • OptionalinitialValues?: T
      • operation: "createOrReplace"