@atproto/common 0.1.1 → 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.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
1
  # ATP Common Library
2
2
 
3
- A library containing code which is shared between ATP packages.
3
+ A library containing code which is shared between ATP packages.
@@ -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 {};
package/dist/fs.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare const fileExists: (location: string) => Promise<boolean>;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,6 @@
1
- export * as check from './check';
2
- export * as util from './util';
3
- export * from './async';
4
- export * from './util';
5
- export * from './tid';
1
+ export * from '@atproto/common-web';
2
+ export * from './fs';
6
3
  export * from './ipld';
4
+ export * from './ipld-multi';
7
5
  export * from './logger';
8
- export * from './types';
9
6
  export * from './streams';
10
- export * from './times';