Skip to main content

Class: AliasPiece<Options, StoreName>

Defined in: projects/pieces/src/lib/structures/AliasPiece.ts:15

The piece to be stored in AliasStore instances.

Extends​

  • Piece<Options, StoreName>

Type Parameters​

Type ParameterDefault type
Options extends AliasPieceOptionsAliasPieceOptions
StoreName extends StoreRegistryKeyStoreRegistryKey

Constructors​

Constructor​

new AliasPiece<Options, StoreName>(context: LoaderContext<StoreName>, options: AliasPieceOptions): AliasPiece<Options, StoreName>

Defined in: projects/pieces/src/lib/structures/AliasPiece.ts:24

Parameters​

ParameterType
contextLoaderContext<StoreName>
optionsAliasPieceOptions

Returns​

AliasPiece<Options, StoreName>

Overrides​

Piece.constructor

Properties​

aliases​

aliases: readonly string[]

Defined in: projects/pieces/src/lib/structures/AliasPiece.ts:22

The aliases for the piece.


enabled​

enabled: boolean

Defined in: projects/pieces/src/lib/structures/Piece.ts:75

Whether or not the piece is enabled.

Inherited from​

Piece.enabled


location​

readonly location: PieceLocation

Defined in: projects/pieces/src/lib/structures/Piece.ts:65

The location metadata for the piece's file.

Inherited from​

Piece.location


name​

readonly name: string

Defined in: projects/pieces/src/lib/structures/Piece.ts:70

The name of the piece.

Inherited from​

Piece.name


options​

readonly options: Options

Defined in: projects/pieces/src/lib/structures/Piece.ts:80

The raw options passed to this Piece

Inherited from​

Piece.options


store​

readonly store: StoreOf<StoreName>

Defined in: projects/pieces/src/lib/structures/Piece.ts:60

The store that contains the piece.

Inherited from​

Piece.store

Accessors​

container​

Get Signature​

get container(): Container

Defined in: projects/pieces/src/lib/structures/Piece.ts:94

A reference to the Container object for ease of use.

See​

container

Returns​

Container

Inherited from​

Piece.container

Methods​

onLoad()​

onLoad(): unknown

Defined in: projects/pieces/src/lib/structures/Piece.ts:102

Per-piece listener that is called when the piece is loaded into the store. Useful to set-up asynchronous initialization tasks.

Returns​

unknown

Inherited from​

Piece.onLoad


onUnload()​

onUnload(): unknown

Defined in: projects/pieces/src/lib/structures/Piece.ts:110

Per-piece listener that is called when the piece is unloaded from the store. Useful to set-up clean-up tasks.

Returns​

unknown

Inherited from​

Piece.onUnload


reload()​

reload(): Promise<void>

Defined in: projects/pieces/src/lib/structures/Piece.ts:125

Reloads the piece by loading the same path in the store.

Returns​

Promise<void>

Inherited from​

Piece.reload


toJSON()​

toJSON(): AliasPieceJSON

Defined in: projects/pieces/src/lib/structures/AliasPiece.ts:32

Defines the JSON.stringify behavior of this alias piece.

Returns​

AliasPieceJSON

Overrides​

Piece.toJSON


unload()​

unload(): Promise<void>

Defined in: projects/pieces/src/lib/structures/Piece.ts:117

Unloads and disables the piece.

Returns​

Promise<void>

Inherited from​

Piece.unload