Class: Store

Store

The common interface for all stores

Methods


<static> applyToClass(structure [, skips])

Applies this interface to a class
Parameters:
Name Type Argument Default Description
structure Object The structure to apply this interface to
skips Array.<string> <optional>
[] The methods to skip when applying this interface
Since:
  • 0.1.1
Source:
lib/structures/interfaces/Store.js#L88

init()

Initializes all pieces in this store.
Since:
  • 0.0.1
Source:
lib/structures/interfaces/Store.js#L22
Returns:
Type
Array

load(dir, file)

Loads a piece into Klasa so it can be saved in this store.
Parameters:
Name Type Description
dir string The user directory or core directory where this file is saved.
file string | Array.<string> A string or array of strings showing where the file is located.
Since:
  • 0.0.1
Source:
lib/structures/interfaces/Store.js#L33
Returns:
Type
Piece

<async> loadAll()

Loads all of our pieces from both the user and core directories.
Since:
  • 0.0.1
Source:
lib/structures/interfaces/Store.js#L51
Returns:
The number of pieces loaded.
Type
number

resolve(name)

Resolve a string or piece into a piece object.
Parameters:
Name Type Description
name Piece | string The piece object or a string representing a piece's name
Since:
  • 0.0.1
Source:
lib/structures/interfaces/Store.js#L68
Returns:
Type
Piece

toString()

Defines toString behavior for stores
Since:
  • 0.3.0
Source:
lib/structures/interfaces/Store.js#L78
Returns:
This store name
Type
string