API documentation of Agoric SDK / Exports / @agoric/store / types / WeakMapStore
Interface: WeakMapStore<K, V>
@agoric/store.types.WeakMapStore
Type parameters
Name | Type |
---|---|
K | extends Key & object = Key |
V | extends Passable = Passable |
Table of contents
Properties
Properties
addAll
• addAll: (entries
: CopyMap
<K
, V
> | Iterable
<[K
, V
]>) => void
Type declaration
▸ (entries
): void
Parameters
Name | Type |
---|---|
entries | CopyMap <K , V > | Iterable <[K , V ]> |
Returns
void
Defined in
packages/store/src/types.js:106
delete
• delete: (key
: K
) => void
Remove the key. Throws if not found.
Type declaration
▸ (key
): void
Parameters
Name | Type |
---|---|
key | K |
Returns
void
Defined in
packages/store/src/types.js:105
get
• get: (key
: K
) => V
Return a value for the key. Throws if not found.
Type declaration
▸ (key
): V
Parameters
Name | Type |
---|---|
key | K |
Returns
V
Defined in
packages/store/src/types.js:99
has
• has: (key
: K
) => boolean
Check if a key exists. The key can be any JavaScript value, though the answer will always be false for keys that cannot be found in this store.
Type declaration
▸ (key
): boolean
Parameters
Name | Type |
---|---|
key | K |
Returns
boolean
Defined in
packages/store/src/types.js:96
init
• init: (key
: K
, value
: V
) => void
Initialize the key only if it doesn't already exist. The key must be one allowed by this store. For example a scalar store only allows primitives and remotables.
Type declaration
▸ (key
, value
): void
Parameters
Name | Type |
---|---|
key | K |
value | V |
Returns
void
Defined in
packages/store/src/types.js:101
set
• set: (key
: K
, value
: V
) => void
Set the key. Throws if not found.
Type declaration
▸ (key
, value
): void
Parameters
Name | Type |
---|---|
key | K |
value | V |
Returns
void