Class: StoreRegistry
A strict-typed store registry. This is available in container.
Since
2.1.0
Example
// Adding new stores
// Register the store:
container.stores.register(new RouteStore());
// Augment Sapphire to add the new store, in case of a JavaScript
// project, this can be moved to an `Augments.d.ts` (or any other name)
// file somewhere:
declare module '@sapphire/pieces' {
export interface StoreRegistryEntries {
routes: RouteStore;
}
}
Hierarchy
-
Collection
<StoreRegistryKey
,StoreRegistryValue
>↳
StoreRegistry
Constructors
constructor
• new StoreRegistry(entries?
): StoreRegistry
Parameters
Name | Type |
---|---|
entries? | null | readonly readonly [keyof StoreRegistryEntries , StoreRegistryValue ][] |
Returns
Inherited from
Collection<StoreRegistryKey, StoreRegistryValue>.constructor
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:50
• new StoreRegistry(iterable?
): StoreRegistry
Parameters
Name | Type |
---|---|
iterable? | null | Iterable <readonly [keyof StoreRegistryEntries , StoreRegistryValue ]> |
Returns
Inherited from
Collection<StoreRegistryKey, StoreRegistryValue>.constructor
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:49
node_modules/typescript/lib/lib.es2015.collection.d.ts:50
Properties
#private
• Private
#private: any
Defined in
node_modules/@sapphire/pieces/dist/esm/index.d.mts:618
[toStringTag]
• Readonly
[toStringTag]: string
Inherited from
Collection.[toStringTag]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:137
constructor
• constructor: CollectionConstructor
Inherited from
Collection.constructor
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:21
size
• Readonly
size: number
Inherited from
Collection.size
Defined in
node_modules/typescript/lib/lib.es2015.collection.d.ts:45
[species]
▪ Static
Readonly
[species]: MapConstructor
Inherited from
Collection.[species]
Defined in
node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:319
Methods
[iterator]
▸ [iterator](): IterableIterator
<[keyof StoreRegistryEntries
, StoreRegistryValue
]>
Returns an iterable of entries in the map.
Returns
IterableIterator
<[keyof StoreRegistryEntries
, StoreRegistryValue
]>
Inherited from
Collection.[iterator]
Defined in
node_modules/typescript/lib/lib.es2015.iterable.d.ts:119
at
▸ at(index
): undefined
| StoreRegistryValue
Identical to Array.at(). Returns the item at a given index, allowing for positive and negative integers. Negative integers count back from the last item in the collection.
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the element to obtain |
Returns
undefined
| StoreRegistryValue
Inherited from
Collection.at
Defined in
node_modules/@discordjs/collection/dist/index.d.ts:98