-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathStore.d.ts
53 lines (44 loc) · 1.67 KB
/
Store.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
declare module "orbit-db-store" {
import IPFS = require("ipfs");
import { Identity } from "orbit-db-identity-provider";
import { EventEmitter } from 'events';
import * as elliptic from "elliptic";
export default class Store {
/**
* The identity is used to sign the database entries.
*/
readonly identity: Identity;
address: { root: string, path: string };
/**
* Contains all entries of this Store
*/
all: any[];
type: string;
/**
* Returns an instance of `elliptic.ec.KeyPair`.
* The keypair is used to sign the database entries.
* The key can also be accessed from the OrbitDB instance: `orbitdb.key.getPublic('hex')`.
*/
key: elliptic.ec.KeyPair;
replicationStatus: IReplicationStatus;
events: EventEmitter;
/**
* Apparently not meant for outside usage
* @param ipfs
* @param identity
* @param address
* @param options
*/
protected constructor (ipfs: IPFS, identity: Identity, address: string, options: IStoreOptions);
close(): Promise<void>;
drop(): Promise<void>;
setIdentity(identity: Identity): void;
/**
* Load the locally persisted database state to memory.
* @param amount Amount of entries loaded into memory
* @returns a `Promise` that resolves once complete
*/
load(amount?: number): Promise<void>;
protected _addOperation(data: any, options: { onProgressCallback?: (entry: any) => any, pin?: boolean }): Promise<string>;
}
}