sanity-plugin-cloudinary

2.1.02.1.1
dist/index.d.ts
~dist/index.d.tsModified
+106−37
Index: package/dist/index.d.ts
===================================================================
--- package/dist/index.d.ts
+++ package/dist/index.d.ts
@@ -1,33 +1,65 @@
-import { AssetSource } from "sanity";
+import "@sanity/ui/styles.css";
+import { AssetSource, ObjectInputProps } from "sanity";
 declare const cloudinaryAssetSchema: {
   type: "object";
   name: "cloudinary.asset";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<{
-    url: string;
-    resource_type: string;
-    derived: string;
-  }, Record<"derived" | "resource_type" | "url", any>> | undefined;
+  fields: ({
+    type: "array";
+    name: string;
+    of: {
+      type: "string";
+    }[];
+  } | {
+    type: "array";
+    name: string;
+    of: {
+      type: string;
+      name: string;
+    }[];
+  } | {
+    of?: undefined;
+    type: string;
+    name: string;
+  })[];
+  preview: {
+    select: {
+      url: string;
+      resource_type: string;
+      derived: string;
+    };
+    prepare({ url, derived, resource_type }: Record<"derived" | "resource_type" | "url", any>): {
+      title: any;
+      value: {
+        title: any;
+        resource_type: any;
+        url: any;
+      };
+    };
+  };
 };
 interface CloudinaryAssetContext {
   custom: object;
 }
 declare const cloudinaryAssetContext: {
   type: "object";
   name: "cloudinary.assetContext";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
+  fields: {
+    type: string;
+    name: string;
+  }[];
 };
 type CloudinaryAssetContextCustom = {
   alt: string;
   caption: string;
 };
 declare const cloudinaryAssetContextCustom: {
   type: "object";
   name: "cloudinary.assetContextCustom";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
+  fields: {
+    type: "string";
+    name: string;
+  }[];
 };
 type CloudinaryAssetDerived = {
   raw_transformation: string;
   url: string;
@@ -35,40 +67,77 @@
 };
 declare const cloudinaryAssetDerivedSchema: {
   type: "object";
   name: "cloudinary.assetDerived";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<Record<string, string>, Record<never, any>> | undefined;
+  fields: ({
+    type: "string";
+    name: string;
+  } | {
+    type: "url";
+    name: string;
+  })[];
 };
 declare const cloudinaryAssetDocument: {
-  type: "document";
   name: "cloudinaryAssetDocument";
-} & Omit<import("sanity").DocumentDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<{
-    caption: string;
-    alt: string;
-    publicId: string;
-    resourceType: string;
-    format: string;
-    secureUrl: string;
-    url: string;
-    derivedUrl: string;
-  }, Record<"alt" | "caption" | "derivedUrl" | "format" | "publicId" | "resourceType" | "secureUrl" | "url", any>> | undefined;
+  title: string;
+  type: "document";
+  liveEdit: true;
+  fields: {
+    name: string;
+    type: "cloudinary.asset";
+    title: string;
+  }[];
+  preview: {
+    select: {
+      caption: string;
+      alt: string;
+      publicId: string;
+      resourceType: string;
+      format: string;
+      secureUrl: string;
+      url: string;
+      derivedUrl: string;
+    };
+    prepare(selection: Record<"alt" | "caption" | "derivedUrl" | "format" | "publicId" | "resourceType" | "secureUrl" | "url", any>): {
+      title: string;
+      subtitle: string;
+      media: string | undefined;
+    };
+  };
 };
+declare const CloudinaryReferenceInput: (props: ObjectInputProps) => import("react").JSX.Element;
 declare const cloudinaryAssetReference: {
-  type: "object";
   name: "cloudinaryAssetReference";
-} & Omit<import("sanity").ObjectDefinition, "preview"> & {
-  preview?: import("sanity").PreviewConfig<{
-    caption: string;
-    alt: string;
-    publicId: string;
-    resourceType: string;
-    format: string;
-    secureUrl: string;
-    url: string;
-    derivedUrl: string;
-  }, Record<"alt" | "caption" | "derivedUrl" | "format" | "publicId" | "resourceType" | "secureUrl" | "url", any>> | undefined;
+  title: string;
+  type: "object";
+  fields: {
+    name: string;
+    type: "reference";
+    to: {
+      type: string;
+    }[];
+    weak: true;
+  }[];
+  components: {
+    input: typeof CloudinaryReferenceInput;
+  };
+  preview: {
+    select: {
+      caption: string;
+      alt: string;
+      publicId: string;
+      resourceType: string;
+      format: string;
+      secureUrl: string;
+      url: string;
+      derivedUrl: string;
+    };
+    prepare(selection: Record<"alt" | "caption" | "derivedUrl" | "format" | "publicId" | "resourceType" | "secureUrl" | "url", any>): {
+      title: string;
+      subtitle: string;
+      media: string | undefined;
+    };
+  };
 };
 interface CloudinaryMediaLibrary {
   show: (config?: {
     asset: any;