|
1 | 1 | import CID from 'cids'
|
2 | 2 | import { Mtime, MtimeLike } from 'ipfs-unixfs'
|
| 3 | +import { Options as DatastoreOptions, Query, KeyQuery } from 'interface-datastore' |
| 4 | +import Block from 'ipld-block' |
3 | 5 |
|
4 | 6 | export type Entry<Content extends AsyncIterable<Uint8Array>|Blob> =
|
5 | 7 | | FileEntry<Content>
|
@@ -131,57 +133,3 @@ export interface BufferStore {
|
131 | 133 | get: (key: Uint8Array) => Promise<Uint8Array>
|
132 | 134 | stores: any[]
|
133 | 135 | }
|
134 |
| - |
135 |
| -export interface Blockstore { |
136 |
| - open: () => Promise<Void> |
137 |
| - |
138 |
| - /** |
139 |
| - * Query the store |
140 |
| - */ |
141 |
| - query: (Query, options?: DatastoreOptions) => AsyncIterable<Block> |
142 |
| - |
143 |
| - /** |
144 |
| - * Query the store, returning only keys |
145 |
| - */ |
146 |
| - queryKeys: (query: KeyQuery, options?: DatastoreOptions) => AsyncIterable<CID> |
147 |
| - |
148 |
| - /** |
149 |
| - * Get a single block by CID |
150 |
| - */ |
151 |
| - get: (cid: CID, options?: DatastoreOptions) => Promise<Block> |
152 |
| - |
153 |
| - /** |
154 |
| - * Like get, but for more |
155 |
| - */ |
156 |
| - getMany: (cids: AwaitIterable<CID>, options?: DatastoreOptions) => AsyncIterable<Block> |
157 |
| - |
158 |
| - /** |
159 |
| - * Write a single block to the store |
160 |
| - */ |
161 |
| - put: (block: Block, options?: DatastoreOptions) => Promise<Block> |
162 |
| - |
163 |
| - /** |
164 |
| - * Like put, but for more |
165 |
| - */ |
166 |
| - putMany: (blocks: AwaitIterable<Block>, options?: DatastoreOptions) => AsyncIterable<Block> |
167 |
| - |
168 |
| - /** |
169 |
| - * Does the store contain block with this CID? |
170 |
| - */ |
171 |
| - has: (cid: CID, options?: DatastoreOptions) => Promise<boolean> |
172 |
| - |
173 |
| - /** |
174 |
| - * Delete a block from the store |
175 |
| - */ |
176 |
| - delete: (cid: CID, options?: DatastoreOptions) => Promise<Void> |
177 |
| - |
178 |
| - /** |
179 |
| - * Delete a block from the store |
180 |
| - */ |
181 |
| - deleteMany: (cids: AwaitIterable<any>, options?: DatastoreOptions) => AsyncIterable<Key> |
182 |
| - |
183 |
| - /** |
184 |
| - * Close the store |
185 |
| - */ |
186 |
| - close: () => Promise<Void> |
187 |
| -} |
0 commit comments