This repository was archived by the owner on Sep 3, 2021. It is now read-only.
File tree 1 file changed +12
-9
lines changed 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -29,39 +29,39 @@ declare class CID {
29
29
* new CID(<cid>)
30
30
*/
31
31
constructor (
32
- version : 0 | 1 ,
32
+ version : CIDVersion ,
33
33
codec : string | number ,
34
34
multhash : Uint8Array ,
35
35
multibaseName ?: string
36
36
) ;
37
- constructor ( cid : CID ) ;
38
- constructor ( str : string ) ;
39
- constructor ( buf : Uint8Array ) ;
37
+ constructor ( cid : CID | string | Uint8Array ) ;
40
38
41
39
/**
42
40
* The version of the CID.
43
41
*/
44
- version : number ;
42
+ readonly version : CIDVersion ;
45
43
46
44
/**
47
45
* The codec of the CID.
46
+ * @deprecated
48
47
*/
49
- codec : string ;
48
+ readonly codec : string ;
50
49
51
50
/**
52
51
* The codec of the CID in its number form.
53
52
*/
54
- code : number ;
53
+ readonly code : number ;
55
54
56
55
/**
57
56
* The multihash of the CID.
58
57
*/
59
- multihash : Uint8Array ;
58
+ readonly multihash : Uint8Array ;
60
59
61
60
/**
62
61
* Multibase name as string.
62
+ * @deprecated
63
63
*/
64
- multibaseName : string ;
64
+ readonly multibaseName : string ;
65
65
66
66
/**
67
67
* The CID as a `Uint8Array`
@@ -70,6 +70,7 @@ declare class CID {
70
70
71
71
/**
72
72
* The prefix of the CID.
73
+ * @deprecated
73
74
*/
74
75
readonly prefix : Uint8Array ;
75
76
@@ -120,4 +121,6 @@ declare class CID {
120
121
static codecs : Record < string , number > ;
121
122
}
122
123
124
+ type CIDVersion = 0 | 1
125
+
123
126
export = CID
You can’t perform that action at this time.
0 commit comments