@xylabs/storage 4.13.19 → 4.13.21
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 +188 -3
- package/package.json +9 -6
- package/xy.config.ts +0 -10
package/README.md
CHANGED
|
@@ -12,13 +12,198 @@
|
|
|
12
12
|
[![snyk-badge][]][snyk-link]
|
|
13
13
|
[![socket-badge][]][socket-link]
|
|
14
14
|
|
|
15
|
-
Version: 4.13.15
|
|
16
15
|
|
|
17
16
|
Base functionality used throughout XY Labs TypeScript/JavaScript libraries
|
|
18
17
|
|
|
19
|
-
## Documentation
|
|
18
|
+
## API Documentation
|
|
19
|
+
|
|
20
|
+
**@xylabs/storage**
|
|
21
|
+
|
|
22
|
+
***
|
|
23
|
+
|
|
24
|
+
## Interfaces
|
|
25
|
+
|
|
26
|
+
- [ReadonlyKeyValueStore](#interfaces/ReadonlyKeyValueStore)
|
|
27
|
+
- [KeyValueStore](#interfaces/KeyValueStore)
|
|
28
|
+
|
|
29
|
+
### interfaces
|
|
30
|
+
|
|
31
|
+
### <a id="KeyValueStore"></a>KeyValueStore
|
|
32
|
+
|
|
33
|
+
[**@xylabs/storage**](#../README)
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
A read/write storage device.
|
|
38
|
+
|
|
39
|
+
## Extends
|
|
40
|
+
|
|
41
|
+
- [`ReadonlyKeyValueStore`](#ReadonlyKeyValueStore)\<`TValue`, `TKey`\>
|
|
42
|
+
|
|
43
|
+
## Type Parameters
|
|
44
|
+
|
|
45
|
+
### TValue
|
|
46
|
+
|
|
47
|
+
`TValue`
|
|
48
|
+
|
|
49
|
+
### TKey
|
|
50
|
+
|
|
51
|
+
`TKey` = `string`
|
|
52
|
+
|
|
53
|
+
## Methods
|
|
54
|
+
|
|
55
|
+
### get()
|
|
56
|
+
|
|
57
|
+
```ts
|
|
58
|
+
get(key): Promisable<undefined | TValue>;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Returns a promise that resolves to the value for the given key.
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
#### key
|
|
66
|
+
|
|
67
|
+
`TKey`
|
|
68
|
+
|
|
69
|
+
The key to get the value for.
|
|
70
|
+
|
|
71
|
+
### Returns
|
|
72
|
+
|
|
73
|
+
`Promisable`\<`undefined` \| `TValue`\>
|
|
74
|
+
|
|
75
|
+
### Inherited from
|
|
76
|
+
|
|
77
|
+
[`ReadonlyKeyValueStore`](#ReadonlyKeyValueStore).[`get`](ReadonlyKeyValueStore.md#get)
|
|
78
|
+
|
|
79
|
+
***
|
|
80
|
+
|
|
81
|
+
### keys()?
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
optional keys(): Promisable<TKey[]>;
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The keys an array of keys.
|
|
88
|
+
|
|
89
|
+
### Returns
|
|
90
|
+
|
|
91
|
+
`Promisable`\<`TKey`[]\>
|
|
92
|
+
|
|
93
|
+
### Inherited from
|
|
94
|
+
|
|
95
|
+
[`ReadonlyKeyValueStore`](#ReadonlyKeyValueStore).[`keys`](ReadonlyKeyValueStore.md#keys)
|
|
96
|
+
|
|
97
|
+
***
|
|
98
|
+
|
|
99
|
+
### clear()?
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
optional clear(): Promisable<void>;
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Returns
|
|
106
|
+
|
|
107
|
+
`Promisable`\<`void`\>
|
|
108
|
+
|
|
109
|
+
***
|
|
110
|
+
|
|
111
|
+
### delete()
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
delete(key): Promisable<void>;
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Parameters
|
|
118
|
+
|
|
119
|
+
#### key
|
|
120
|
+
|
|
121
|
+
`TKey`
|
|
122
|
+
|
|
123
|
+
### Returns
|
|
124
|
+
|
|
125
|
+
`Promisable`\<`void`\>
|
|
126
|
+
|
|
127
|
+
***
|
|
128
|
+
|
|
129
|
+
### set()
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
set(key, value): Promisable<void>;
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Parameters
|
|
136
|
+
|
|
137
|
+
#### key
|
|
138
|
+
|
|
139
|
+
`TKey`
|
|
140
|
+
|
|
141
|
+
#### value
|
|
142
|
+
|
|
143
|
+
`TValue`
|
|
144
|
+
|
|
145
|
+
### Returns
|
|
146
|
+
|
|
147
|
+
`Promisable`\<`void`\>
|
|
148
|
+
|
|
149
|
+
### <a id="ReadonlyKeyValueStore"></a>ReadonlyKeyValueStore
|
|
150
|
+
|
|
151
|
+
[**@xylabs/storage**](#../README)
|
|
152
|
+
|
|
153
|
+
***
|
|
154
|
+
|
|
155
|
+
A readonly storage device.
|
|
156
|
+
|
|
157
|
+
## Extended by
|
|
158
|
+
|
|
159
|
+
- [`KeyValueStore`](#KeyValueStore)
|
|
160
|
+
|
|
161
|
+
## Type Parameters
|
|
162
|
+
|
|
163
|
+
### TValue
|
|
164
|
+
|
|
165
|
+
`TValue`
|
|
166
|
+
|
|
167
|
+
### TKey
|
|
168
|
+
|
|
169
|
+
`TKey` = `string`
|
|
170
|
+
|
|
171
|
+
## Methods
|
|
172
|
+
|
|
173
|
+
### get()
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
get(key): Promisable<undefined | TValue>;
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Returns a promise that resolves to the value for the given key.
|
|
180
|
+
|
|
181
|
+
### Parameters
|
|
182
|
+
|
|
183
|
+
#### key
|
|
184
|
+
|
|
185
|
+
`TKey`
|
|
186
|
+
|
|
187
|
+
The key to get the value for.
|
|
188
|
+
|
|
189
|
+
### Returns
|
|
190
|
+
|
|
191
|
+
`Promisable`\<`undefined` \| `TValue`\>
|
|
192
|
+
|
|
193
|
+
***
|
|
194
|
+
|
|
195
|
+
### keys()?
|
|
196
|
+
|
|
197
|
+
```ts
|
|
198
|
+
optional keys(): Promisable<TKey[]>;
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The keys an array of keys.
|
|
202
|
+
|
|
203
|
+
### Returns
|
|
204
|
+
|
|
205
|
+
`Promisable`\<`TKey`[]\>
|
|
20
206
|
|
|
21
|
-
Coming Soon!
|
|
22
207
|
|
|
23
208
|
Part of [sdk-js](https://www.npmjs.com/package/@xyo-network/sdk-js)
|
|
24
209
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xylabs/storage",
|
|
3
|
-
"version": "4.13.
|
|
3
|
+
"version": "4.13.21",
|
|
4
4
|
"description": "Base functionality used throughout XY Labs TypeScript/JavaScript libraries",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"hex",
|
|
@@ -29,21 +29,24 @@
|
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
31
|
"types": "./dist/neutral/index.d.ts",
|
|
32
|
+
"source": "./src/index.ts",
|
|
32
33
|
"default": "./dist/neutral/index.mjs"
|
|
33
34
|
},
|
|
34
35
|
"./package.json": "./package.json"
|
|
35
36
|
},
|
|
36
37
|
"module": "./dist/neutral/index.mjs",
|
|
38
|
+
"source": "./src/index.ts",
|
|
37
39
|
"types": "./dist/neutral/index.d.ts",
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"src"
|
|
40
43
|
],
|
|
41
44
|
"dependencies": {
|
|
42
|
-
"@xylabs/promise": "^4.13.
|
|
45
|
+
"@xylabs/promise": "^4.13.21"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
45
|
-
"@xylabs/ts-scripts-yarn3": "^7.0.0
|
|
46
|
-
"@xylabs/tsconfig": "^7.0.0
|
|
48
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0",
|
|
49
|
+
"@xylabs/tsconfig": "^7.0.0",
|
|
47
50
|
"typescript": "^5.8.3"
|
|
48
51
|
},
|
|
49
52
|
"engines": {
|