@atproto/lexicon 0.0.4 → 0.1.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,67 @@
1
+ import { CID } from 'multiformats/cid';
2
+ import { z } from 'zod';
3
+ export declare const typedJsonBlobRef: z.ZodObject<{
4
+ $type: z.ZodLiteral<"blob">;
5
+ ref: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
6
+ mimeType: z.ZodString;
7
+ size: z.ZodNumber;
8
+ }, "strict", z.ZodTypeAny, {
9
+ $type: "blob";
10
+ ref: CID;
11
+ mimeType: string;
12
+ size: number;
13
+ }, {
14
+ ref?: any;
15
+ $type: "blob";
16
+ mimeType: string;
17
+ size: number;
18
+ }>;
19
+ export declare type TypedJsonBlobRef = z.infer<typeof typedJsonBlobRef>;
20
+ export declare const untypedJsonBlobRef: z.ZodObject<{
21
+ cid: z.ZodString;
22
+ mimeType: z.ZodString;
23
+ }, "strict", z.ZodTypeAny, {
24
+ mimeType: string;
25
+ cid: string;
26
+ }, {
27
+ mimeType: string;
28
+ cid: string;
29
+ }>;
30
+ export declare type UntypedJsonBlobRef = z.infer<typeof untypedJsonBlobRef>;
31
+ export declare const jsonBlobRef: z.ZodUnion<[z.ZodObject<{
32
+ $type: z.ZodLiteral<"blob">;
33
+ ref: z.ZodEffects<z.ZodEffects<z.ZodAny, any, any>, CID, any>;
34
+ mimeType: z.ZodString;
35
+ size: z.ZodNumber;
36
+ }, "strict", z.ZodTypeAny, {
37
+ $type: "blob";
38
+ ref: CID;
39
+ mimeType: string;
40
+ size: number;
41
+ }, {
42
+ ref?: any;
43
+ $type: "blob";
44
+ mimeType: string;
45
+ size: number;
46
+ }>, z.ZodObject<{
47
+ cid: z.ZodString;
48
+ mimeType: z.ZodString;
49
+ }, "strict", z.ZodTypeAny, {
50
+ mimeType: string;
51
+ cid: string;
52
+ }, {
53
+ mimeType: string;
54
+ cid: string;
55
+ }>]>;
56
+ export declare type JsonBlobRef = z.infer<typeof jsonBlobRef>;
57
+ export declare class BlobRef {
58
+ ref: CID;
59
+ mimeType: string;
60
+ size: number;
61
+ original: JsonBlobRef;
62
+ constructor(ref: CID, mimeType: string, size: number, original?: JsonBlobRef);
63
+ static asBlobRef(obj: unknown): BlobRef | null;
64
+ static fromJsonRef(json: JsonBlobRef): BlobRef;
65
+ ipld(): TypedJsonBlobRef;
66
+ toJSON(): unknown;
67
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export * from './types';
2
2
  export * from './lexicons';
3
+ export * from './blob-refs';
4
+ export * from './serialize';