@atproto/common 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,37 @@
1
+ import { CID } from 'multiformats/cid';
2
+ import { z } from 'zod';
3
+ declare const blobRefType: z.ZodUnion<[z.ZodLiteral<"blob">, z.ZodLiteral<"image">, z.ZodLiteral<"video">, z.ZodLiteral<"audio">]>;
4
+ declare type BlobRefType = z.infer<typeof blobRefType>;
5
+ declare const jsonBlobRef: z.ZodUnion<[z.ZodObject<{
6
+ $type: z.ZodUnion<[z.ZodLiteral<"blob">, z.ZodLiteral<"image">, z.ZodLiteral<"video">, z.ZodLiteral<"audio">]>;
7
+ ref: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
8
+ mimeType: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ $type: "blob" | "image" | "video" | "audio";
11
+ ref: CID;
12
+ mimeType: string;
13
+ }, {
14
+ ref?: any;
15
+ $type: "blob" | "image" | "video" | "audio";
16
+ mimeType: string;
17
+ }>, z.ZodObject<{
18
+ cid: z.ZodString;
19
+ mimeType: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ mimeType: string;
22
+ cid: string;
23
+ }, {
24
+ mimeType: string;
25
+ cid: string;
26
+ }>]>;
27
+ declare type JsonBlobRef = z.infer<typeof jsonBlobRef>;
28
+ export declare class BlobRef {
29
+ json: JsonBlobRef;
30
+ $type: BlobRefType;
31
+ ref: CID;
32
+ mimeType: string;
33
+ constructor(json: JsonBlobRef, $type: BlobRefType, ref: CID, mimeType: string);
34
+ static asBlobRef(obj: unknown): BlobRef | null;
35
+ static fromJsonRef(json: JsonBlobRef): BlobRef;
36
+ }
37
+ export {};