|
1 | 1 | declare module "@orbitdb/core" { |
2 | 2 | import type { HeliaLibp2p } from "helia"; |
3 | | - import type { Libp2p, PeerId, PrivateKey, ServiceMap } from "@libp2p/interface"; |
| 3 | + import type { |
| 4 | + Libp2p, |
| 5 | + PeerId, |
| 6 | + PrivateKey, |
| 7 | + ServiceMap, |
| 8 | + } from "@libp2p/interface"; |
4 | 9 | import type { TypedEmitter } from "tiny-typed-emitter"; |
5 | 10 | import type { ByteView, CID } from "multiformats"; |
6 | 11 |
|
7 | | - export function createOrbitDB< |
8 | | - T extends ServiceMap = ServiceMap, |
9 | | - >(args: { |
| 12 | + export function createOrbitDB<T extends ServiceMap = ServiceMap>(args: { |
10 | 13 | ipfs: HeliaLibp2p<Libp2p<T>>; |
11 | 14 | id?: string; |
12 | 15 | identity?: Identity; |
@@ -36,22 +39,21 @@ declare module "@orbitdb/core" { |
36 | 39 | referencesCount: number; |
37 | 40 | }>; |
38 | 41 |
|
39 | | - type CreateDatabaseOptions<T extends ServiceMap = ServiceMap> = |
40 | | - { |
41 | | - ipfs: HeliaLibp2p<Libp2p<T>>; |
42 | | - identity?: Identity; |
43 | | - address: string; |
44 | | - name?: string; |
45 | | - access?: AccessController; |
46 | | - directory?: string; |
47 | | - meta?: MetaData; |
48 | | - headsStorage?: Storage; |
49 | | - entryStorage?: Storage; |
50 | | - indexStorage?: Storage; |
51 | | - referencesCount?: number; |
52 | | - syncAutomatically?: boolean; |
53 | | - onUpdate?: (log: Log, entry: LogEntry) => void; |
54 | | - }; |
| 42 | + type CreateDatabaseOptions<T extends ServiceMap = ServiceMap> = { |
| 43 | + ipfs: HeliaLibp2p<Libp2p<T>>; |
| 44 | + identity?: Identity; |
| 45 | + address: string; |
| 46 | + name?: string; |
| 47 | + access?: AccessController; |
| 48 | + directory?: string; |
| 49 | + meta?: MetaData; |
| 50 | + headsStorage?: Storage; |
| 51 | + entryStorage?: Storage; |
| 52 | + indexStorage?: Storage; |
| 53 | + referencesCount?: number; |
| 54 | + syncAutomatically?: boolean; |
| 55 | + onUpdate?: (log: Log, entry: LogEntry) => void; |
| 56 | + }; |
55 | 57 |
|
56 | 58 | export type BaseDatabase = { |
57 | 59 | address: string; |
@@ -252,9 +254,7 @@ declare module "@orbitdb/core" { |
252 | 254 | } |
253 | 255 | >; |
254 | 256 |
|
255 | | - export function Identities< |
256 | | - T extends ServiceMap = ServiceMap, |
257 | | - >(args: { |
| 257 | + export function Identities<T extends ServiceMap = ServiceMap>(args: { |
258 | 258 | keystore?: KeyStoreType; |
259 | 259 | path?: string; |
260 | 260 | storage?: Storage; |
@@ -296,9 +296,7 @@ declare module "@orbitdb/core" { |
296 | 296 | put: (hash: string, data: unknown) => Promise<void>; // Todo: check if DagCborEncodable is appropriate here |
297 | 297 | get: (hash: string) => Promise<ByteView<unknown>>; |
298 | 298 | }; |
299 | | - export function IPFSBlockStorage< |
300 | | - T extends ServiceMap = ServiceMap, |
301 | | - >(args: { |
| 299 | + export function IPFSBlockStorage<T extends ServiceMap = ServiceMap>(args: { |
302 | 300 | ipfs: HeliaLibp2p<Libp2p<T>>; |
303 | 301 | pin?: boolean; |
304 | 302 | timeout?: number; |
|
0 commit comments