@holochain/client 0.20.0-rc.0 → 0.20.1
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/lib/api/admin/types.d.ts +51 -3
- package/lib/api/admin/websocket.d.ts +1 -1
- package/lib/api/app/types.d.ts +2 -2
- package/lib/api/app/websocket.d.ts +2 -2
- package/lib/api/client.d.ts +0 -1
- package/lib/api/common.d.ts +0 -1
- package/lib/api/zome-call-signing.d.ts +1 -1
- package/lib/hdk/details.d.ts +19 -0
- package/lib/hdk/details.js +8 -0
- package/lib/hdk/entry.d.ts +19 -0
- package/lib/hdk/entry.js +8 -1
- package/lib/hdk/index.d.ts +2 -0
- package/lib/hdk/index.js +2 -0
- package/lib/hdk/record.d.ts +10 -0
- package/lib/hdk/validation-receipts.d.ts +18 -0
- package/lib/hdk/validation-receipts.js +9 -0
- package/lib/tsdoc-metadata.json +1 -1
- package/lib/types.d.ts +34 -0
- package/lib/types.js +15 -1
- package/lib/utils/dna-holo-hash-map.d.ts +162 -0
- package/lib/utils/dna-holo-hash-map.js +235 -0
- package/lib/utils/hash-parts.d.ts +37 -11
- package/lib/utils/hash-parts.js +60 -6
- package/lib/utils/holo-hash-map.d.ts +247 -0
- package/lib/utils/holo-hash-map.js +312 -0
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +3 -1
- package/package.json +29 -27
package/lib/api/admin/types.d.ts
CHANGED
|
@@ -266,13 +266,19 @@ export type CoordinatorZome = ZomeDefinition;
|
|
|
266
266
|
/**
|
|
267
267
|
* @public
|
|
268
268
|
*/
|
|
269
|
-
export type
|
|
269
|
+
export type DnaDef = {
|
|
270
270
|
name: string;
|
|
271
271
|
modifiers: DnaModifiers;
|
|
272
272
|
lineage: DnaHashB64[];
|
|
273
273
|
integrity_zomes: IntegrityZome[];
|
|
274
274
|
coordinator_zomes: CoordinatorZome[];
|
|
275
275
|
};
|
|
276
|
+
/**
|
|
277
|
+
* @public
|
|
278
|
+
*
|
|
279
|
+
* @deprecated Renamed to DnaDef. This alias will be removed in 0.22.0
|
|
280
|
+
*/
|
|
281
|
+
export type DnaDefinition = DnaDef;
|
|
276
282
|
/**
|
|
277
283
|
* @public
|
|
278
284
|
*/
|
|
@@ -280,7 +286,7 @@ export type GetDnaDefinitionRequest = CellId;
|
|
|
280
286
|
/**
|
|
281
287
|
* @public
|
|
282
288
|
*/
|
|
283
|
-
export type GetDnaDefinitionResponse =
|
|
289
|
+
export type GetDnaDefinitionResponse = DnaDef;
|
|
284
290
|
/**
|
|
285
291
|
* @public
|
|
286
292
|
*/
|
|
@@ -878,6 +884,44 @@ export interface IssueAppAuthenticationTokenResponse {
|
|
|
878
884
|
* @public
|
|
879
885
|
*/
|
|
880
886
|
export type DumpNetworkStatsRequest = void;
|
|
887
|
+
/**
|
|
888
|
+
* @public
|
|
889
|
+
*/
|
|
890
|
+
export interface ApiTransportStats {
|
|
891
|
+
/**
|
|
892
|
+
* Stats from the configured transport implementation.
|
|
893
|
+
*/
|
|
894
|
+
transport_stats: TransportStats;
|
|
895
|
+
/**
|
|
896
|
+
* Blocked message counts.
|
|
897
|
+
*/
|
|
898
|
+
blocked_message_counts: Record<PeerUrl, Record<SpaceId, MessageBlockCount>>;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Peer Url
|
|
902
|
+
*
|
|
903
|
+
* @public
|
|
904
|
+
*/
|
|
905
|
+
export type PeerUrl = string;
|
|
906
|
+
/**
|
|
907
|
+
* kitsune2 space id
|
|
908
|
+
*
|
|
909
|
+
* @public
|
|
910
|
+
*/
|
|
911
|
+
export type SpaceId = string;
|
|
912
|
+
/**
|
|
913
|
+
* @public
|
|
914
|
+
*/
|
|
915
|
+
export interface MessageBlockCount {
|
|
916
|
+
/**
|
|
917
|
+
* Count of incoming messages that have been blocked and dropped.
|
|
918
|
+
*/
|
|
919
|
+
incoming: number;
|
|
920
|
+
/**
|
|
921
|
+
* Count of outgoing messages that have been blocked and dropped.
|
|
922
|
+
*/
|
|
923
|
+
outgoing: number;
|
|
924
|
+
}
|
|
881
925
|
/**
|
|
882
926
|
* Stats for a transport connection.
|
|
883
927
|
*
|
|
@@ -939,7 +983,11 @@ export interface TransportConnectionStats {
|
|
|
939
983
|
/**
|
|
940
984
|
* @public
|
|
941
985
|
*/
|
|
942
|
-
export type DumpNetworkStatsResponse =
|
|
986
|
+
export type DumpNetworkStatsResponse = ApiTransportStats;
|
|
987
|
+
/**
|
|
988
|
+
* @public
|
|
989
|
+
*/
|
|
990
|
+
export type AppDumpNetworkStatsResponse = TransportStats;
|
|
943
991
|
/**
|
|
944
992
|
* Arguments for dumping network metrics.
|
|
945
993
|
*
|
|
@@ -25,7 +25,7 @@ export declare class AdminWebsocket implements AdminApi {
|
|
|
25
25
|
* @returns A promise for a new connected instance.
|
|
26
26
|
*/
|
|
27
27
|
static connect(options?: WebsocketConnectionOptions): Promise<AdminWebsocket>;
|
|
28
|
-
_requester<ReqI, ReqO, ResI, ResO>(tag: string, transformer?: Transformer<ReqI, ReqO, ResI, ResO>): (req: ReqI, timeout?: number
|
|
28
|
+
_requester<ReqI, ReqO, ResI, ResO>(tag: string, transformer?: Transformer<ReqI, ReqO, ResI, ResO>): (req: ReqI, timeout?: number) => Promise<ResO>;
|
|
29
29
|
/**
|
|
30
30
|
* Send a request to open the given port for {@link AppWebsocket} connections.
|
|
31
31
|
*/
|
package/lib/api/app/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnsubscribeFunction } from "emittery";
|
|
2
|
-
import { AgentPubKey, AppAuthenticationToken, AppInfo, CapSecret, CellId, ClonedCell, DnaHash, DnaProperties, EntryHash, FunctionName, InstalledAppId, MembraneProof, MemproofMap, NetworkSeed, Nonce256Bit, RoleName, Timestamp, Transformer, WebsocketConnectionOptions, ZomeName, PreflightRequest, SignedAction, SignedActionHashed,
|
|
2
|
+
import { AgentPubKey, AppAuthenticationToken, AppInfo, CapSecret, CellId, ClonedCell, DnaHash, DnaProperties, EntryHash, FunctionName, InstalledAppId, MembraneProof, MemproofMap, NetworkSeed, Nonce256Bit, RoleName, Timestamp, Transformer, WebsocketConnectionOptions, ZomeName, PreflightRequest, SignedAction, SignedActionHashed, AppDumpNetworkStatsResponse, DumpNetworkMetricsResponse, DumpNetworkMetricsRequest } from "../../index.js";
|
|
3
3
|
/**
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
@@ -407,7 +407,7 @@ export interface AppClient {
|
|
|
407
407
|
appInfo(): Promise<AppInfoResponse>;
|
|
408
408
|
myPubKey: AgentPubKey;
|
|
409
409
|
installedAppId: InstalledAppId;
|
|
410
|
-
dumpNetworkStats(): Promise<
|
|
410
|
+
dumpNetworkStats(): Promise<AppDumpNetworkStatsResponse>;
|
|
411
411
|
dumpNetworkMetrics(args: DumpNetworkMetricsRequest): Promise<DumpNetworkMetricsResponse>;
|
|
412
412
|
createCloneCell(args: CreateCloneCellRequest): Promise<CreateCloneCellResponse>;
|
|
413
413
|
enableCloneCell(args: EnableCloneCellRequest): Promise<EnableCloneCellResponse>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UnsubscribeFunction } from "emittery";
|
|
2
2
|
import { AgentPubKey, InstalledAppId, RoleName } from "../../types.js";
|
|
3
|
-
import { AgentInfoRequest, AgentInfoResponse, PeerMetaInfoRequest, PeerMetaInfoResponse, AppInfo, DumpNetworkMetricsRequest, DumpNetworkMetricsResponse,
|
|
3
|
+
import { AgentInfoRequest, AgentInfoResponse, PeerMetaInfoRequest, PeerMetaInfoResponse, AppInfo, DumpNetworkMetricsRequest, DumpNetworkMetricsResponse, AppDumpNetworkStatsResponse, MemproofMap } from "../admin/index.js";
|
|
4
4
|
import { WsClient } from "../client.js";
|
|
5
5
|
import { AbandonCountersigningSessionStateRequest, AppClient, AppEvents, AppWebsocketConnectionOptions, CallZomeRequest, CallZomeRequestSigned, CreateCloneCellRequest, DisableCloneCellRequest, EnableCloneCellRequest, GetCountersigningSessionStateRequest, GetCountersigningSessionStateResponse, PublishCountersigningSessionStateRequest, RoleNameCallZomeRequest, SignalCb } from "./types.js";
|
|
6
6
|
/**
|
|
@@ -67,7 +67,7 @@ export declare class AppWebsocket implements AppClient {
|
|
|
67
67
|
*
|
|
68
68
|
* @returns The conductor's {@link TransportStats}.
|
|
69
69
|
*/
|
|
70
|
-
dumpNetworkStats(timeout?: number): Promise<
|
|
70
|
+
dumpNetworkStats(timeout?: number): Promise<AppDumpNetworkStatsResponse>;
|
|
71
71
|
/**
|
|
72
72
|
* Request network metrics.
|
|
73
73
|
*
|
package/lib/api/client.d.ts
CHANGED
package/lib/api/common.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export declare const randomNonce: () => Promise<Nonce256Bit>;
|
|
|
51
51
|
/**
|
|
52
52
|
* @public
|
|
53
53
|
*/
|
|
54
|
-
export declare const randomByteArray: (length: number) => Promise<Uint8Array
|
|
54
|
+
export declare const randomByteArray: (length: number) => Promise<Uint8Array<ArrayBufferLike>>;
|
|
55
55
|
/**
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EntryDetails } from "./entry.js";
|
|
2
|
+
import { RecordDetails } from "./record.js";
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export declare enum DetailsType {
|
|
7
|
+
Entry = "entry",
|
|
8
|
+
Record = "record"
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export type Details = {
|
|
14
|
+
type: DetailsType.Record;
|
|
15
|
+
content: RecordDetails;
|
|
16
|
+
} | {
|
|
17
|
+
type: DetailsType.Entry;
|
|
18
|
+
content: EntryDetails;
|
|
19
|
+
};
|
package/lib/hdk/entry.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CapClaim, ZomeCallCapGrant } from "./capabilities.js";
|
|
2
2
|
import { AgentPubKey } from "../types.js";
|
|
3
3
|
import { CounterSigningSessionData } from "./countersigning.js";
|
|
4
|
+
import { SignedActionHashed } from "./action.js";
|
|
4
5
|
/**
|
|
5
6
|
* @public
|
|
6
7
|
*/
|
|
@@ -30,3 +31,21 @@ export interface EntryContent<E extends string, C> {
|
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
33
|
export type Entry = EntryContent<"Agent", AgentPubKey> | EntryContent<"App", Uint8Array> | EntryContent<"CounterSign", [CounterSigningSessionData, Uint8Array]> | EntryContent<"CapGrant", ZomeCallCapGrant> | EntryContent<"CapClaim", CapClaim>;
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export declare enum EntryDhtStatus {
|
|
38
|
+
Live = "live",
|
|
39
|
+
Dead = "dead"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export interface EntryDetails {
|
|
45
|
+
entry: Entry;
|
|
46
|
+
actions: Array<SignedActionHashed>;
|
|
47
|
+
rejected_actions: Array<SignedActionHashed>;
|
|
48
|
+
deletes: Array<SignedActionHashed>;
|
|
49
|
+
updates: Array<SignedActionHashed>;
|
|
50
|
+
entry_dht_status: EntryDhtStatus;
|
|
51
|
+
}
|
package/lib/hdk/entry.js
CHANGED
package/lib/hdk/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./action.js";
|
|
2
2
|
export * from "./capabilities.js";
|
|
3
3
|
export * from "./countersigning.js";
|
|
4
|
+
export * from "./details.js";
|
|
4
5
|
export * from "./dht-ops.js";
|
|
5
6
|
export * from "./entry.js";
|
|
6
7
|
export * from "./link.js";
|
|
7
8
|
export * from "./record.js";
|
|
9
|
+
export * from "./validation-receipts.js";
|
package/lib/hdk/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./action.js";
|
|
2
2
|
export * from "./capabilities.js";
|
|
3
3
|
export * from "./countersigning.js";
|
|
4
|
+
export * from "./details.js";
|
|
4
5
|
export * from "./dht-ops.js";
|
|
5
6
|
export * from "./entry.js";
|
|
6
7
|
export * from "./link.js";
|
|
7
8
|
export * from "./record.js";
|
|
9
|
+
export * from "./validation-receipts.js";
|
package/lib/hdk/record.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SignedActionHashed } from "./action.js";
|
|
2
2
|
import { Entry } from "./entry.js";
|
|
3
|
+
import { ValidationStatus } from "./validation-receipts.js";
|
|
3
4
|
/**
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
@@ -19,3 +20,12 @@ export type RecordEntry = {
|
|
|
19
20
|
} | {
|
|
20
21
|
NotStored: void;
|
|
21
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export interface RecordDetails {
|
|
27
|
+
record: Record;
|
|
28
|
+
validation_status: ValidationStatus;
|
|
29
|
+
deletes: Array<SignedActionHashed>;
|
|
30
|
+
updates: Array<SignedActionHashed>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AgentPubKey, DhtOpHash, Timestamp } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ValidationStatus {
|
|
6
|
+
Valid = 0,
|
|
7
|
+
Rejected = 1,
|
|
8
|
+
Abandoned = 2
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export interface ValidationReceipt {
|
|
14
|
+
dht_op_hash: DhtOpHash;
|
|
15
|
+
validation_status: ValidationStatus;
|
|
16
|
+
validator: AgentPubKey;
|
|
17
|
+
when_integrated: Timestamp;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @public
|
|
3
|
+
*/
|
|
4
|
+
export var ValidationStatus;
|
|
5
|
+
(function (ValidationStatus) {
|
|
6
|
+
ValidationStatus[ValidationStatus["Valid"] = 0] = "Valid";
|
|
7
|
+
ValidationStatus[ValidationStatus["Rejected"] = 1] = "Rejected";
|
|
8
|
+
ValidationStatus[ValidationStatus["Abandoned"] = 2] = "Abandoned";
|
|
9
|
+
})(ValidationStatus || (ValidationStatus = {}));
|
package/lib/tsdoc-metadata.json
CHANGED
package/lib/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** HoloHash Types */
|
|
1
2
|
/**
|
|
2
3
|
* @public
|
|
3
4
|
*/
|
|
@@ -30,6 +31,27 @@ export type AnyDhtHash = HoloHash;
|
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
33
|
export type ExternalHash = HoloHash;
|
|
34
|
+
/**
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export type DhtOpHash = HoloHash;
|
|
38
|
+
/**
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export type WarrantHash = HoloHash;
|
|
42
|
+
/**
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare enum HoloHashType {
|
|
46
|
+
Agent = "agent",
|
|
47
|
+
Entry = "entry",
|
|
48
|
+
DhtOp = "dhtop",
|
|
49
|
+
Warrant = "warrant",
|
|
50
|
+
Dna = "dna",
|
|
51
|
+
Action = "action",
|
|
52
|
+
Wasm = "wasm",
|
|
53
|
+
External = "external"
|
|
54
|
+
}
|
|
33
55
|
/**
|
|
34
56
|
* @public
|
|
35
57
|
*/
|
|
@@ -67,6 +89,18 @@ export type ActionHashB64 = HoloHashB64;
|
|
|
67
89
|
* @public
|
|
68
90
|
*/
|
|
69
91
|
export type AnyDhtHashB64 = HoloHashB64;
|
|
92
|
+
/**
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export type ExternalHashB64 = HoloHashB64;
|
|
96
|
+
/**
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
99
|
+
export type DhtOpHashB64 = HoloHashB64;
|
|
100
|
+
/**
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
export type WarrantHashB64 = HoloHashB64;
|
|
70
104
|
/**
|
|
71
105
|
* @public
|
|
72
106
|
*/
|
package/lib/types.js
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
/** HoloHash Types */
|
|
2
|
+
/**
|
|
3
|
+
* @public
|
|
4
|
+
*/
|
|
5
|
+
export var HoloHashType;
|
|
6
|
+
(function (HoloHashType) {
|
|
7
|
+
HoloHashType["Agent"] = "agent";
|
|
8
|
+
HoloHashType["Entry"] = "entry";
|
|
9
|
+
HoloHashType["DhtOp"] = "dhtop";
|
|
10
|
+
HoloHashType["Warrant"] = "warrant";
|
|
11
|
+
HoloHashType["Dna"] = "dna";
|
|
12
|
+
HoloHashType["Action"] = "action";
|
|
13
|
+
HoloHashType["Wasm"] = "wasm";
|
|
14
|
+
HoloHashType["External"] = "external";
|
|
15
|
+
})(HoloHashType || (HoloHashType = {}));
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { HoloHash, DnaHash, ActionHash, AgentPubKey, AnyDhtHash, DhtOpHash, EntryHash, ExternalHash, WarrantHash, WasmHash } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* A Map of DnaHash to HoloHashMap.
|
|
4
|
+
*
|
|
5
|
+
* i.e. A Map of DnaHash to a Map of HoloHash to a value.
|
|
6
|
+
*
|
|
7
|
+
* @param initialEntries - Optional array of `[[DnaHash, HoloHash], value]` to insert into the map.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare class DnaHoloHashMap<K extends HoloHash, T> {
|
|
12
|
+
private _dnaMap;
|
|
13
|
+
constructor(initialEntries?: Array<[[DnaHash, K], T]>);
|
|
14
|
+
/**
|
|
15
|
+
* Gets the value associated with a [DnaHash, HoloHash] key pair.
|
|
16
|
+
*
|
|
17
|
+
* @param key - Array of [DnaHash, HoloHash]
|
|
18
|
+
* @returns The value if found, undefined otherwise
|
|
19
|
+
*/
|
|
20
|
+
get([dnaHash, key]: [DnaHash, K]): T | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a [DnaHash, HoloHash] key pair exists in the map.
|
|
23
|
+
*
|
|
24
|
+
* @param cellKey - Array of [DnaHash, HoloHash] to check
|
|
25
|
+
* @returns True if the key exists, false otherwise
|
|
26
|
+
*/
|
|
27
|
+
has([dnaHash, key]: [DnaHash, K]): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Sets a value for a [DnaHash, HoloHash] key pair.
|
|
30
|
+
*
|
|
31
|
+
* @param key - Tuple of [DnaHash, HoloHash]
|
|
32
|
+
* @param value - The value to store
|
|
33
|
+
* @returns This map instance for chaining
|
|
34
|
+
*/
|
|
35
|
+
set([dnaHash, key]: [DnaHash, K], value: T): this;
|
|
36
|
+
/**
|
|
37
|
+
* Removes all entries from the map.
|
|
38
|
+
*/
|
|
39
|
+
clear(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Deletes an entry from the map. If this was the last entry for a DNA, the DNA entry is also removed.
|
|
42
|
+
*
|
|
43
|
+
* @param key - Array of [DnaHash, HoloHash] to delete
|
|
44
|
+
* @returns True if the DNA entry was deleted (last entry for that DNA), false otherwise
|
|
45
|
+
*/
|
|
46
|
+
delete([dnaHash, key]: [DnaHash, K]): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Returns all [DnaHash, HoloHash] key pairs in the map.
|
|
49
|
+
*
|
|
50
|
+
* @returns Array of all key tuples
|
|
51
|
+
*/
|
|
52
|
+
keys(): Array<[DnaHash, K]>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns all values in the map.
|
|
55
|
+
*
|
|
56
|
+
* @returns Array of all values
|
|
57
|
+
*/
|
|
58
|
+
values(): Array<T>;
|
|
59
|
+
/**
|
|
60
|
+
* Returns all entries as [[DnaHash, HoloHash], value] Arrays.
|
|
61
|
+
*
|
|
62
|
+
* @returns Array of all entries
|
|
63
|
+
*/
|
|
64
|
+
entries(): Array<[[DnaHash, K], T]>;
|
|
65
|
+
/**
|
|
66
|
+
* Creates a new DnaHoloHashMap containing only entries that match the filter predicate.
|
|
67
|
+
*
|
|
68
|
+
* @param fn - Predicate function to test each value
|
|
69
|
+
* @returns A new filtered map
|
|
70
|
+
*/
|
|
71
|
+
filter(fn: (value: T) => boolean): DnaHoloHashMap<K, T>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new DnaHoloHashMap with values transformed by the mapping function.
|
|
74
|
+
*
|
|
75
|
+
* @param fn - Function to transform each value
|
|
76
|
+
* @returns A new mapped map
|
|
77
|
+
*/
|
|
78
|
+
map<R>(fn: (value: T) => R): DnaHoloHashMap<K, R>;
|
|
79
|
+
/**
|
|
80
|
+
* Returns all HoloHash keys for a specific DNA.
|
|
81
|
+
*
|
|
82
|
+
* @param dnaHash - The DNA hash to query
|
|
83
|
+
* @returns Array of HoloHash keys for this DNA
|
|
84
|
+
*/
|
|
85
|
+
keysForDna(dnaHash: DnaHash): Array<K>;
|
|
86
|
+
/**
|
|
87
|
+
* Returns all values for a specific DNA.
|
|
88
|
+
*
|
|
89
|
+
* @param dnaHash - The DNA hash to query
|
|
90
|
+
* @returns Array of values for this DNA
|
|
91
|
+
*/
|
|
92
|
+
valuesForDna(dnaHash: DnaHash): Array<T>;
|
|
93
|
+
/**
|
|
94
|
+
* Returns all [HoloHash, value] entries for a specific DNA.
|
|
95
|
+
*
|
|
96
|
+
* @param dnaHash - The DNA hash to query
|
|
97
|
+
* @returns Array of entries for this DNA
|
|
98
|
+
*/
|
|
99
|
+
entriesForDna(dnaHash: DnaHash): Array<[K, T]>;
|
|
100
|
+
/**
|
|
101
|
+
* Removes all entries for a specific DNA.
|
|
102
|
+
*
|
|
103
|
+
* @param dnaHash - The DNA hash to clear
|
|
104
|
+
*/
|
|
105
|
+
clearForDna(dnaHash: DnaHash): void;
|
|
106
|
+
/**
|
|
107
|
+
* The number of DNA entries in the map.
|
|
108
|
+
*
|
|
109
|
+
* @returns The number of unique DNAs
|
|
110
|
+
*/
|
|
111
|
+
get size(): number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
export declare class DnaAgentPubKeyMap<V> extends DnaHoloHashMap<AgentPubKey, V> {
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @public
|
|
120
|
+
*/
|
|
121
|
+
export declare class DnaDnaHashMap<V> extends DnaHoloHashMap<DnaHash, V> {
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
export declare class DnaWasmHashMap<V> extends DnaHoloHashMap<WasmHash, V> {
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export declare class DnaEntryHashMap<V> extends DnaHoloHashMap<EntryHash, V> {
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export declare class DnaActionHashMap<V> extends DnaHoloHashMap<ActionHash, V> {
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
export declare class DnaAnyDhtHashMap<V> extends DnaHoloHashMap<AnyDhtHash, V> {
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
export declare class DnaExternalHashMap<V> extends DnaHoloHashMap<ExternalHash, V> {
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
export declare class DnaDhtOpHashMap<V> extends DnaHoloHashMap<DhtOpHash, V> {
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export declare class DnaWarrantHashMap<V> extends DnaHoloHashMap<WarrantHash, V> {
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @public
|
|
160
|
+
*/
|
|
161
|
+
export declare class CellMap<V> extends DnaAgentPubKeyMap<V> {
|
|
162
|
+
}
|