@sapphire/pieces 3.9.0 → 3.10.0-next.7b0ae1d.0
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/dist/index.d.ts
CHANGED
|
@@ -489,11 +489,11 @@ interface PieceJSON {
|
|
|
489
489
|
/**
|
|
490
490
|
* The piece to be stored in {@link Store} instances.
|
|
491
491
|
*/
|
|
492
|
-
declare class Piece<
|
|
492
|
+
declare class Piece<Options extends PieceOptions = PieceOptions, StoreName extends keyof StoreRegistryEntries = keyof StoreRegistryEntries> {
|
|
493
493
|
/**
|
|
494
494
|
* The store that contains the piece.
|
|
495
495
|
*/
|
|
496
|
-
readonly store:
|
|
496
|
+
readonly store: StoreOf<StoreName>;
|
|
497
497
|
/**
|
|
498
498
|
* The location metadata for the piece's file.
|
|
499
499
|
*/
|
|
@@ -509,7 +509,7 @@ declare class Piece<O extends PieceOptions = PieceOptions> {
|
|
|
509
509
|
/**
|
|
510
510
|
* The raw options passed to this {@link Piece}
|
|
511
511
|
*/
|
|
512
|
-
readonly options:
|
|
512
|
+
readonly options: Options;
|
|
513
513
|
constructor(context: PieceContext, options?: PieceOptions);
|
|
514
514
|
/**
|
|
515
515
|
* A reference to the {@link Container} object for ease of use.
|
|
@@ -691,6 +691,14 @@ interface StoreRegistryEntries {
|
|
|
691
691
|
interface StoreManagerManuallyRegisteredPiece<StoreName extends keyof StoreRegistryEntries> extends StoreManuallyRegisteredPiece<StoreName> {
|
|
692
692
|
store: StoreName;
|
|
693
693
|
}
|
|
694
|
+
/**
|
|
695
|
+
* Type utility to get the {@linkcode Store} given its name.
|
|
696
|
+
*/
|
|
697
|
+
type StoreOf<StoreName extends keyof StoreRegistryEntries> = keyof StoreRegistryEntries extends never ? Store<Piece<Piece.Options, StoreName>> : StoreRegistryEntries[StoreName];
|
|
698
|
+
/**
|
|
699
|
+
* Type utility to get the {@linkcode Piece} given its {@linkcode Store}'s name.
|
|
700
|
+
*/
|
|
701
|
+
type PieceOf<StoreName extends keyof StoreRegistryEntries> = keyof StoreRegistryEntries extends never ? Piece<Piece.Options, StoreName> : StoreRegistryEntries[StoreName] extends Store<infer PieceType> ? PieceType : Piece<Piece.Options, StoreName>;
|
|
694
702
|
|
|
695
703
|
/**
|
|
696
704
|
* Represents the type of the properties injected into the container, which is available at {@link container}.
|
|
@@ -804,7 +812,7 @@ interface AliasPieceJSON extends Piece.JSON {
|
|
|
804
812
|
/**
|
|
805
813
|
* The piece to be stored in {@link AliasStore} instances.
|
|
806
814
|
*/
|
|
807
|
-
declare class AliasPiece<
|
|
815
|
+
declare class AliasPiece<Options extends AliasPieceOptions = AliasPieceOptions, StoreName extends keyof StoreRegistryEntries = keyof StoreRegistryEntries> extends Piece<Options, StoreName> {
|
|
808
816
|
/**
|
|
809
817
|
* The aliases for the piece.
|
|
810
818
|
*/
|
|
@@ -855,4 +863,4 @@ declare class AliasStore<T extends AliasPiece, StoreName extends keyof StoreRegi
|
|
|
855
863
|
insert(piece: T): Promise<T>;
|
|
856
864
|
}
|
|
857
865
|
|
|
858
|
-
export { AliasPiece, AliasPieceJSON, AliasPieceOptions, AliasStore, AsyncPreloadResult, Container, FilterResult, HydratedModuleData, ILoaderResult, ILoaderResultEntry, ILoaderStrategy, LoaderError, LoaderErrorType, LoaderStrategy, MissingExportsError, ModuleData, Piece, PieceContext, PieceJSON, PieceLocation, PieceLocationJSON, PieceOptions, PreloadResult, RootData, Store, StoreLogger, StoreManagerManuallyRegisteredPiece, StoreManuallyRegisteredPiece, StoreOptions, StoreRegistry, StoreRegistryEntries, VirtualPath, container, getRootData };
|
|
866
|
+
export { AliasPiece, AliasPieceJSON, AliasPieceOptions, AliasStore, AsyncPreloadResult, Container, FilterResult, HydratedModuleData, ILoaderResult, ILoaderResultEntry, ILoaderStrategy, LoaderError, LoaderErrorType, LoaderStrategy, MissingExportsError, ModuleData, Piece, PieceContext, PieceJSON, PieceLocation, PieceLocationJSON, PieceOf, PieceOptions, PreloadResult, RootData, Store, StoreLogger, StoreManagerManuallyRegisteredPiece, StoreManuallyRegisteredPiece, StoreOf, StoreOptions, StoreRegistry, StoreRegistryEntries, VirtualPath, container, getRootData };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AliasPiece.js","sourceRoot":"","sources":["../../../src/lib/structures/AliasPiece.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;
|
|
1
|
+
{"version":3,"file":"AliasPiece.js","sourceRoot":"","sources":["../../../src/lib/structures/AliasPiece.ts"],"names":[],"mappings":";;;AAAA,mCAAgC;AAWhC;;GAEG;AACH,MAAa,UAGX,SAAQ,aAAyB;IAMlC,YAAmB,OAAsB,EAAE,UAA6B,EAAE;QACzE,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QANzB;;WAEG;QACI;;;;;WAA2B;QAIjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,MAAM;QACrB,OAAO;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE;SAC7B,CAAC;IACH,CAAC;CACD;AAvBD,gCAuBC;AAUD,WAAiB,UAAU;IACX,mBAAQ,GAAK,aAAK,SAAV,CAAW;AAKnC,CAAC,EANgB,UAAU,0BAAV,UAAU,QAM1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Piece.js","sourceRoot":"","sources":["../../../src/lib/structures/Piece.ts"],"names":[],"mappings":";;;AACA,mDAAgE;AAChE,mDAAwE;
|
|
1
|
+
{"version":3,"file":"Piece.js","sourceRoot":"","sources":["../../../src/lib/structures/Piece.ts"],"names":[],"mappings":";;;AACA,mDAAgE;AAChE,mDAAwE;AA+CxE;;GAEG;AACH,MAAa,KAAK;IA0BjB,YAAmB,OAAqB,EAAE,UAAwB,EAAE;QAzBpE;;WAEG;QACa;;;;;WAA0B;QAE1C;;WAE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D,sBAoFC;AAYD,WAAiB,KAAK;IACR,cAAQ,GAAG,6BAAa,CAAC;AAKvC,CAAC,EANgB,KAAK,qBAAL,KAAK,QAMrB"}
|
|
@@ -8,11 +8,11 @@ var _StoreRegistry_pendingManuallyRegisteredPieces;
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.StoreRegistry = void 0;
|
|
10
10
|
const collection_1 = require("@discordjs/collection");
|
|
11
|
+
const utilities_1 = require("@sapphire/utilities");
|
|
11
12
|
const path_1 = require("path");
|
|
12
13
|
const Path_1 = require("../internal/Path");
|
|
13
14
|
const RootScan_1 = require("../internal/RootScan");
|
|
14
15
|
const constants_1 = require("../internal/constants");
|
|
15
|
-
const utilities_1 = require("@sapphire/utilities");
|
|
16
16
|
/**
|
|
17
17
|
* A strict-typed store registry. This is available in {@link container}.
|
|
18
18
|
* @since 2.1.0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreRegistry.js","sourceRoot":"","sources":["../../../src/lib/structures/StoreRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sDAAmD;AACnD,+BAA4B;AAE5B,2CAA0D;AAC1D,mDAAmD;AACnD,qDAAoF;
|
|
1
|
+
{"version":3,"file":"StoreRegistry.js","sourceRoot":"","sources":["../../../src/lib/structures/StoreRegistry.ts"],"names":[],"mappings":";;;;;;;;;AAAA,sDAAmD;AACnD,mDAA8C;AAC9C,+BAA4B;AAE5B,2CAA0D;AAC1D,mDAAmD;AACnD,qDAAoF;AAOpF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,aAAc,SAAQ,uBAAsB;IAAzD;;QACC;;WAEG;QACM,yDAAmC,IAAI,uBAAU,EAGvD,EAAC;IA+IL,CAAC;IA7IA;;;OAGG;IACI,KAAK,CAAC,IAAI;QAChB,MAAM,QAAQ,GAAuB,EAAE,CAAC;QACxC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAoC,EAAE;YACp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