shogun-core 6.9.6 → 6.9.8
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthCallback, EventData, EventListener } from './types';
|
|
1
|
+
import type { AuthCallback, EventData, EventListener, Ack } from './types';
|
|
2
2
|
import type { AuthResult, SignUpResult } from '../interfaces/shogun';
|
|
3
3
|
import type { ISEAPair } from 'gun';
|
|
4
4
|
import { RxJSHolster } from './rxjs-holster';
|
|
@@ -19,6 +19,12 @@ declare class DataBaseHolster {
|
|
|
19
19
|
crypto: typeof crypto;
|
|
20
20
|
/** Holster SEA cryptography context */
|
|
21
21
|
sea: any;
|
|
22
|
+
prefix: string;
|
|
23
|
+
ev: {
|
|
24
|
+
[key: string]: {
|
|
25
|
+
handler: any;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
22
28
|
/** Holster node dedicated to mapping usernames to pubkeys */
|
|
23
29
|
private readonly usernamesNode;
|
|
24
30
|
/** ShogunCore instance for emitting events */
|
|
@@ -186,6 +192,84 @@ declare class DataBaseHolster {
|
|
|
186
192
|
* Emit a custom event.
|
|
187
193
|
*/
|
|
188
194
|
emit(event: string | symbol, data?: EventData): boolean;
|
|
195
|
+
_timeout(ms: number): Promise<void>;
|
|
196
|
+
Off(ev?: string): void;
|
|
197
|
+
Listen(path: string, callback: (result: {
|
|
198
|
+
[key: string]: any;
|
|
199
|
+
} | string | undefined) => void, prefix?: string): void;
|
|
200
|
+
On(path: string, callback: (result: {
|
|
201
|
+
[key: string]: any;
|
|
202
|
+
} | string | undefined) => void, ev?: string, different?: boolean, prefix?: string): void;
|
|
203
|
+
addContentAdressing(key: string, data: string | {}): Promise<Ack>;
|
|
204
|
+
userGet(path: string, repeat?: number, prefix?: string): Promise<string | {
|
|
205
|
+
[key: string]: {};
|
|
206
|
+
} | {
|
|
207
|
+
[key: string]: string;
|
|
208
|
+
} | undefined>;
|
|
209
|
+
userLoad(path: string, async?: boolean, repeat?: number, prefix?: string): Promise<{
|
|
210
|
+
data: {
|
|
211
|
+
[s: string]: any;
|
|
212
|
+
};
|
|
213
|
+
err: {
|
|
214
|
+
path: string;
|
|
215
|
+
err: string;
|
|
216
|
+
}[];
|
|
217
|
+
}>;
|
|
218
|
+
Get(path: string, repeat?: number, prefix?: string): Promise<undefined | string | {
|
|
219
|
+
[key: string]: {};
|
|
220
|
+
} | {
|
|
221
|
+
[key: string]: string;
|
|
222
|
+
}>;
|
|
223
|
+
userPut(path: string, data: string | {
|
|
224
|
+
[key: string]: {};
|
|
225
|
+
}, async?: boolean, prefix?: string): Promise<{
|
|
226
|
+
data: Ack[];
|
|
227
|
+
error: Ack[];
|
|
228
|
+
}>;
|
|
229
|
+
Set(path: string, data: {
|
|
230
|
+
[key: string]: {};
|
|
231
|
+
} | {
|
|
232
|
+
[key: string]: string;
|
|
233
|
+
}, async?: boolean, prefix?: string, opt?: undefined | {
|
|
234
|
+
opt: {
|
|
235
|
+
cert: string;
|
|
236
|
+
};
|
|
237
|
+
}): Promise<{
|
|
238
|
+
data: Ack[];
|
|
239
|
+
error: Ack[];
|
|
240
|
+
}>;
|
|
241
|
+
Put(path: string, data: null | string | {
|
|
242
|
+
[key: string]: {} | string;
|
|
243
|
+
}, async?: boolean, prefix?: string, opt?: undefined | {
|
|
244
|
+
opt: {
|
|
245
|
+
cert: string;
|
|
246
|
+
};
|
|
247
|
+
}): Promise<{
|
|
248
|
+
data: Ack[];
|
|
249
|
+
error: Ack[];
|
|
250
|
+
}>;
|
|
251
|
+
purge(path: string): Promise<any>;
|
|
252
|
+
userDel(path: string, putNull?: boolean): Promise<{
|
|
253
|
+
data: Ack[];
|
|
254
|
+
error: Ack[];
|
|
255
|
+
}>;
|
|
256
|
+
Del(path: string, putNull?: boolean, cert?: string): Promise<{
|
|
257
|
+
data: Ack[];
|
|
258
|
+
error: Ack[];
|
|
259
|
+
}>;
|
|
260
|
+
Load(path: string, async?: boolean, repeat?: number, prefix?: string): Promise<{
|
|
261
|
+
data: {
|
|
262
|
+
[s: string]: any;
|
|
263
|
+
};
|
|
264
|
+
err: {
|
|
265
|
+
path: string;
|
|
266
|
+
err: string;
|
|
267
|
+
}[];
|
|
268
|
+
}>;
|
|
269
|
+
generatePublicCert(): Promise<{
|
|
270
|
+
data: Ack[];
|
|
271
|
+
error: Ack[];
|
|
272
|
+
}>;
|
|
189
273
|
/**
|
|
190
274
|
* Get the Holster instance (for backward compatibility with gun property).
|
|
191
275
|
* Returns a proxy that provides Gun-like API on top of Holster.
|