commandkit 1.0.0-dev.20250611020404 → 1.0.0-dev.20250611155146
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/ai.cjs +21 -0
- package/ai.d.ts +1 -0
- package/dist/ActionRow-CmTHbo2t.js.map +1 -1
- package/dist/{ActionRow-D0wafJhZ.d.ts → ActionRow-DKnFVDME.d.ts} +6 -2
- package/dist/{Button-Bl5nbwTS.d.ts → Button-4ZUXdA56.d.ts} +11 -4
- package/dist/{ButtonKit-BSI7lCI0.d.ts → ButtonKit-C7r7RPNf.d.ts} +21 -2
- package/dist/{ChannelSelectMenuKit-L15A2jpT.d.ts → ChannelSelectMenuKit-BrXvBYNH.d.ts} +19 -3
- package/dist/{CommandKit-CnLBu_7m.js → CommandKit-BqZBlSaB.js} +636 -23
- package/dist/CommandKit-BqZBlSaB.js.map +1 -0
- package/dist/{CommandKit-B-mjdP5x.d.ts → CommandKit-g7NqIdUD.d.ts} +826 -12
- package/dist/CommandKit.d.ts +25 -25
- package/dist/CommandKit.js +26 -26
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js +87 -0
- package/dist/CommandKitEventsChannel-BL_YN3Rm.js.map +1 -0
- package/dist/CommandsRouter-CoOA7hkf.d.ts +146 -0
- package/dist/{CommandsRouter-BHaPno8o.js → CommandsRouter-DFRh47qD.js} +87 -1
- package/dist/CommandsRouter-DFRh47qD.js.map +1 -0
- package/dist/{CompilerPlugin-DrnhOC1c.js → CompilerPlugin-Bmy4izKz.js} +13 -2
- package/dist/CompilerPlugin-Bmy4izKz.js.map +1 -0
- package/dist/{CompilerPluginRuntime-C9wmPMQf.js → CompilerPluginRuntime-CgVU_gU0.js} +59 -1
- package/dist/CompilerPluginRuntime-CgVU_gU0.js.map +1 -0
- package/dist/DefaultLogger-pWzrSxMd.d.ts +60 -0
- package/dist/{EventInterceptor-Bvh05z7n.js → EventInterceptor-DWCHCGRh.js} +5 -1
- package/dist/EventInterceptor-DWCHCGRh.js.map +1 -0
- package/dist/{EventInterceptor-D_oEWSnF.d.ts → EventInterceptor-x-R2qshQ.d.ts} +8 -1
- package/dist/{EventWorkerContext-BYXamZ_4.d.ts → EventWorkerContext-BcXmutAi.d.ts} +25 -2
- package/dist/{EventWorkerContext-BAKiTqJz.js → EventWorkerContext-DxfS_0fJ.js} +24 -1
- package/dist/EventWorkerContext-DxfS_0fJ.js.map +1 -0
- package/dist/ILogger-Cs5SFzqd.d.ts +34 -0
- package/dist/Logger-5ew_YS4P.d.ts +37 -0
- package/dist/{MentionableSelectMenuKit-BiUSKUtZ.d.ts → MentionableSelectMenuKit-CPTKqx-O.d.ts} +14 -3
- package/dist/{MessageCommandParser-D02-wpZN.js → MessageCommandParser-Cz-3I-wL.js} +70 -2
- package/dist/MessageCommandParser-Cz-3I-wL.js.map +1 -0
- package/dist/MessageCommandParser-ROLibZPX.d.ts +195 -0
- package/dist/{Modal-Cxm6cs5c.d.ts → Modal-C6UTRdYQ.d.ts} +8 -4
- package/dist/{ModalKit-CKtQ8eXW.d.ts → ModalKit-Btz58KYn.d.ts} +23 -2
- package/dist/{PluginCommon-DPqnQngK.js → PluginCommon-D_Z8Oiic.js} +23 -1
- package/dist/PluginCommon-D_Z8Oiic.js.map +1 -0
- package/dist/{RoleSelectMenuKit-BSMKkru2.d.ts → RoleSelectMenuKit-C26lU3sN.d.ts} +19 -3
- package/dist/{RuntimePlugin-BJoDa8ZR.js → RuntimePlugin-CehKbceZ.js} +5 -2
- package/dist/RuntimePlugin-CehKbceZ.js.map +1 -0
- package/dist/SelectMenu-Diy87_ba.d.ts +137 -0
- package/dist/{StringSelectMenuKit-B9FHTe48.d.ts → StringSelectMenuKit-Bhs8U6WI.d.ts} +19 -3
- package/dist/{UserSelectMenuKit-DiP0imyo.d.ts → UserSelectMenuKit-CfqFJdxz.d.ts} +19 -3
- package/dist/analytics/analytics-engine.d.ts +25 -25
- package/dist/analytics/analytics-engine.js +26 -26
- package/dist/analytics/analytics-provider.d.ts +25 -25
- package/dist/analytics/constants.d.ts +13 -0
- package/dist/analytics/constants.js +1 -1
- package/dist/analytics/utils.d.ts +13 -0
- package/dist/analytics/utils.js +26 -26
- package/dist/app/commands/AppCommandRunner.d.ts +26 -26
- package/dist/app/commands/AppCommandRunner.js +26 -26
- package/dist/app/commands/Context.d.ts +25 -25
- package/dist/app/commands/Context.js +26 -26
- package/dist/app/commands/MessageCommandParser.d.ts +1 -1
- package/dist/app/commands/MessageCommandParser.js +2 -2
- package/dist/app/commands/helpers.d.ts +1 -1
- package/dist/app/commands/helpers.js +1 -1
- package/dist/app/events/EventWorkerContext.d.ts +26 -26
- package/dist/app/events/EventWorkerContext.js +1 -1
- package/dist/app/handlers/AppCommandHandler.d.ts +26 -26
- package/dist/app/handlers/AppCommandHandler.js +26 -26
- package/dist/app/handlers/AppEventsHandler.d.ts +25 -25
- package/dist/app/handlers/AppEventsHandler.js +26 -26
- package/dist/app/index.d.ts +26 -26
- package/dist/app/index.js +27 -27
- package/dist/app/middleware/signals.js +2 -2
- package/dist/app/register/CommandRegistrar.d.ts +25 -25
- package/dist/app/register/CommandRegistrar.js +26 -26
- package/dist/app/router/CommandsRouter.d.ts +1 -1
- package/dist/app/router/CommandsRouter.js +1 -1
- package/dist/app/router/index.d.ts +1 -1
- package/dist/app/router/index.js +1 -1
- package/dist/{app-process-YbSHvqf-.js → app-process-Bo-LedP8.js} +11 -3
- package/dist/app-process-Bo-LedP8.js.map +1 -0
- package/dist/{build-BejatFZX.js → build-B-Ae1hqg.js} +14 -6
- package/dist/build-B-Ae1hqg.js.map +1 -0
- package/dist/cli/app-process.d.ts +5 -0
- package/dist/cli/app-process.js +5 -5
- package/dist/cli/build.d.ts +33 -25
- package/dist/cli/build.js +29 -29
- package/dist/cli/common.d.ts +57 -27
- package/dist/cli/common.js +3 -3
- package/dist/cli/development.d.ts +4 -0
- package/dist/cli/development.js +46 -30
- package/dist/cli/development.js.map +1 -1
- package/dist/cli/env.d.ts +32 -0
- package/dist/cli/env.js +1 -1
- package/dist/cli/generators.d.ts +8 -0
- package/dist/cli/generators.js +27 -3
- package/dist/cli/generators.js.map +1 -1
- package/dist/cli/information.d.ts +4 -0
- package/dist/cli/information.js +17 -1
- package/dist/cli/information.js.map +1 -1
- package/dist/cli/init.js +27 -27
- package/dist/cli/production.d.ts +9 -0
- package/dist/cli/production.js +39 -31
- package/dist/cli/production.js.map +1 -1
- package/dist/cli/type-checker.d.ts +2 -0
- package/dist/cli/type-checker.js +4 -4
- package/dist/cli/utils.d.ts +5 -0
- package/dist/cli/utils.js +1 -1
- package/dist/{common-pvPJVTfe.d.ts → common-DOCvOVC4.d.ts} +7 -2
- package/dist/{common-CW8v7gAn.js → common-Dasi9oKU.js} +44 -2
- package/dist/common-Dasi9oKU.js.map +1 -0
- package/dist/{common-CeO-vn8Y.js → common-vnMIelAE.js} +4 -1
- package/dist/common-vnMIelAE.js.map +1 -0
- package/dist/components/common/EventInterceptor.d.ts +1 -1
- package/dist/components/common/EventInterceptor.js +1 -1
- package/dist/components/common/element.d.ts +4 -4
- package/dist/components/common/element.js +2 -2
- package/dist/components/index.d.ts +20 -20
- package/dist/components/index.js +26 -26
- package/dist/components/v1/action-row/ActionRow.d.ts +5 -5
- package/dist/components/v1/button/Button.d.ts +5 -5
- package/dist/components/v1/button/Button.js +26 -26
- package/dist/components/v1/button/ButtonKit.d.ts +2 -2
- package/dist/components/v1/button/ButtonKit.js +26 -26
- package/dist/components/v1/modal/Modal.d.ts +5 -5
- package/dist/components/v1/modal/Modal.js +26 -26
- package/dist/components/v1/modal/ModalKit.d.ts +2 -2
- package/dist/components/v1/modal/ModalKit.js +26 -26
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/ChannelSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/MentionableSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/RoleSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/RoleSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/SelectMenu.d.ts +8 -8
- package/dist/components/v1/select-menu/SelectMenu.js +26 -26
- package/dist/components/v1/select-menu/StringSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/StringSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/UserSelectMenuKit.d.ts +3 -3
- package/dist/components/v1/select-menu/UserSelectMenuKit.js +26 -26
- package/dist/components/v1/select-menu/common.d.ts +2 -2
- package/dist/components/v2/common.d.ts +4 -0
- package/dist/components/v2/common.js +1 -1
- package/dist/components/v2/container.d.ts +1 -1
- package/dist/components/v2/container.js +2 -2
- package/dist/components/v2/file.d.ts +1 -1
- package/dist/components/v2/file.js +1 -1
- package/dist/components/v2/index.d.ts +6 -6
- package/dist/components/v2/index.js +7 -7
- package/dist/components/v2/media-gallery.d.ts +1 -1
- package/dist/components/v2/media-gallery.js +2 -2
- package/dist/components/v2/section.d.ts +1 -1
- package/dist/components/v2/section.js +2 -2
- package/dist/components/v2/separator.d.ts +1 -1
- package/dist/components/v2/separator.js +1 -1
- package/dist/components/v2/text-display.d.ts +1 -1
- package/dist/components/v2/text-display.js +1 -1
- package/dist/config/config.d.ts +28 -28
- package/dist/config/config.js +26 -26
- package/dist/config/default.d.ts +30 -27
- package/dist/config/default.js +26 -26
- package/dist/config/loader.d.ts +33 -27
- package/dist/config/loader.js +26 -26
- package/dist/config/types.d.ts +26 -26
- package/dist/config/utils.d.ts +27 -27
- package/dist/config/utils.js +3 -0
- package/dist/config/utils.js.map +1 -1
- package/dist/{config-BjmEZYpx.d.ts → config-CGECBFwj.d.ts} +3 -3
- package/dist/constants-BTttfrm3.d.ts +42 -0
- package/dist/{constants-DWe181uQ.js → constants-CXwjhIYH.js} +9 -1
- package/dist/constants-CXwjhIYH.js.map +1 -0
- package/dist/{constants-CCqS_v55.js → constants-DDRctWlU.js} +14 -8
- package/dist/constants-DDRctWlU.js.map +1 -0
- package/dist/{container-CpuiLsZM.js → container-DCjIgp-B.js} +12 -2
- package/dist/container-DCjIgp-B.js.map +1 -0
- package/dist/container-DaUKKPm-.d.ts +24 -0
- package/dist/context/async-context.d.ts +25 -25
- package/dist/context/async-context.js +26 -26
- package/dist/context/environment.d.ts +25 -25
- package/dist/context/environment.js +26 -26
- package/dist/element-CAXu1XtK.d.ts +72 -0
- package/dist/{element-DcqNz1dV.js → element-Cq-LoDjk.js} +27 -2
- package/dist/element-Cq-LoDjk.js.map +1 -0
- package/dist/{env-ERkaRfQO.js → env-DemeP-uq.js} +33 -1
- package/dist/env-DemeP-uq.js.map +1 -0
- package/dist/{error-codes-C_UO39jz.js → error-codes-CxlUBdF6.js} +20 -1
- package/dist/error-codes-CxlUBdF6.js.map +1 -0
- package/dist/events/CommandKitEventsChannel.d.ts +25 -25
- package/dist/events/CommandKitEventsChannel.js +1 -1
- package/dist/{feature-flags-BFiGn38a.js → feature-flags-CvHcOB7L.js} +4 -4
- package/dist/feature-flags-CvHcOB7L.js.map +1 -0
- package/dist/file-DTrr-p09.d.ts +24 -0
- package/dist/{file-DE69SSOP.js → file-DVZC0QXI.js} +11 -1
- package/dist/file-DVZC0QXI.js.map +1 -0
- package/dist/flags/FlagProvider.d.ts +25 -25
- package/dist/flags/feature-flags.d.ts +25 -25
- package/dist/flags/feature-flags.js +27 -27
- package/dist/flags/store.d.ts +25 -25
- package/dist/flags/store.js +1 -1
- package/dist/{helpers-CswC9gKF.js → helpers-CnfXqF_k.js} +11 -1
- package/dist/helpers-CnfXqF_k.js.map +1 -0
- package/dist/helpers-Wg6P5fRQ.d.ts +23 -0
- package/dist/index.d.ts +34 -34
- package/dist/index.js +30 -31
- package/dist/{init-BDgyvx9E.js → init-BQgLOfl_.js} +6 -6
- package/dist/{init-BDgyvx9E.js.map → init-BQgLOfl_.js.map} +1 -1
- package/dist/logger/DefaultLogger.d.ts +2 -2
- package/dist/logger/DefaultLogger.js +26 -26
- package/dist/logger/ILogger.d.ts +1 -1
- package/dist/logger/Logger.d.ts +2 -2
- package/dist/logger/Logger.js +26 -26
- package/dist/media-gallery-BMsXSot3.d.ts +49 -0
- package/dist/{media-gallery-nUEHqKVF.js → media-gallery-CIKypjbJ.js} +27 -2
- package/dist/media-gallery-CIKypjbJ.js.map +1 -0
- package/dist/plugins/CompilerPlugin.d.ts +25 -25
- package/dist/plugins/CompilerPlugin.js +2 -2
- package/dist/plugins/PluginCommon.d.ts +25 -25
- package/dist/plugins/PluginCommon.js +1 -1
- package/dist/plugins/RuntimePlugin.d.ts +25 -25
- package/dist/plugins/RuntimePlugin.js +2 -2
- package/dist/plugins/index.d.ts +25 -25
- package/dist/plugins/index.js +26 -26
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CommandKitPluginRuntime.js +26 -26
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.d.ts +25 -25
- package/dist/plugins/plugin-runtime/CompilerPluginRuntime.js +1 -1
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts +25 -25
- package/dist/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.js +26 -26
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.d.ts +37 -25
- package/dist/plugins/plugin-runtime/builtin/MacroPlugin.js +26 -26
- package/dist/plugins/plugin-runtime/runtime.d.ts +25 -25
- package/dist/plugins/types.d.ts +25 -25
- package/dist/{section-D6t7tyEZ.js → section-CuYr0Inu.js} +22 -2
- package/dist/section-CuYr0Inu.js.map +1 -0
- package/dist/section-Dh_FhPeC.d.ts +45 -0
- package/dist/separator-CMf6Cyy5.d.ts +22 -0
- package/dist/{separator-DYAFK-Jj.js → separator-DLdWBjSN.js} +11 -1
- package/dist/separator-DLdWBjSN.js.map +1 -0
- package/dist/{signals-scJdEbly.js → signals-CSSSZAZ6.js} +2 -2
- package/dist/{signals-scJdEbly.js.map → signals-CSSSZAZ6.js.map} +1 -1
- package/dist/{store-Ci6ib2C9.js → store-x93NXUy_.js} +5 -1
- package/dist/store-x93NXUy_.js.map +1 -0
- package/dist/{text-display-Dy6JHB5X.js → text-display--p2-BoUa.js} +13 -1
- package/dist/text-display--p2-BoUa.js.map +1 -0
- package/dist/text-display-DRw3r_lK.d.ts +33 -0
- package/dist/{type-checker-CXVdS7qc.js → type-checker-P8oyY259.js} +6 -2
- package/dist/type-checker-P8oyY259.js.map +1 -0
- package/dist/{types-package-CTSNSM93.js → types-package-BpY3acyl.js} +8 -2
- package/dist/types-package-BpY3acyl.js.map +1 -0
- package/dist/{types-DjL43eQS.d.ts → types-uBjT82V4.d.ts} +2 -2
- package/dist/types.d.ts +25 -25
- package/dist/{utilities-DQT4lzAB.d.ts → utilities-D_MFPmTe.d.ts} +45 -2
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -2
- package/dist/utils/dev-hooks.d.ts +26 -26
- package/dist/utils/dev-hooks.js +26 -26
- package/dist/utils/error-codes.d.ts +34 -0
- package/dist/utils/error-codes.js +1 -1
- package/dist/utils/types-package.d.ts +6 -0
- package/dist/utils/types-package.js +2 -2
- package/dist/utils/utilities.d.ts +1 -1
- package/dist/utils/utilities.js +26 -26
- package/dist/utils/warn-unstable.d.ts +10 -0
- package/dist/utils/warn-unstable.js +1 -1
- package/dist/{utils-VCdd7XhD.d.ts → utils-Bz_BoOnV.d.ts} +12 -2
- package/dist/{utils-IYtoeTur.js → utils-C8a_hMvn.js} +5 -1
- package/dist/utils-C8a_hMvn.js.map +1 -0
- package/dist/{version-CS1EiTrw.js → version-AMyvJ7I3.js} +5 -2
- package/dist/version-AMyvJ7I3.js.map +1 -0
- package/dist/version.js +1 -1
- package/dist/{warn-unstable-DHLaxPC8.js → warn-unstable-CttBdmlS.js} +11 -1
- package/dist/warn-unstable-CttBdmlS.js.map +1 -0
- package/package.json +10 -3
- package/dist/CommandKit-CnLBu_7m.js.map +0 -1
- package/dist/CommandKitEventsChannel-B6LKgxmv.js +0 -44
- package/dist/CommandKitEventsChannel-B6LKgxmv.js.map +0 -1
- package/dist/CommandsRouter-BHaPno8o.js.map +0 -1
- package/dist/CommandsRouter-C7X-eXE2.d.ts +0 -67
- package/dist/CompilerPlugin-DrnhOC1c.js.map +0 -1
- package/dist/CompilerPluginRuntime-C9wmPMQf.js.map +0 -1
- package/dist/DefaultLogger-CcW-Fuq5.d.ts +0 -30
- package/dist/EventInterceptor-Bvh05z7n.js.map +0 -1
- package/dist/EventWorkerContext-BAKiTqJz.js.map +0 -1
- package/dist/ILogger-kqwb2kUu.d.ts +0 -11
- package/dist/Logger-B4B_URL-.d.ts +0 -17
- package/dist/MessageCommandParser-D02-wpZN.js.map +0 -1
- package/dist/MessageCommandParser-tzroBwij.d.ts +0 -62
- package/dist/PluginCommon-DPqnQngK.js.map +0 -1
- package/dist/RuntimePlugin-BJoDa8ZR.js.map +0 -1
- package/dist/SelectMenu-b7jgrkjO.d.ts +0 -36
- package/dist/app-process-YbSHvqf-.js.map +0 -1
- package/dist/build-BejatFZX.js.map +0 -1
- package/dist/common-CW8v7gAn.js.map +0 -1
- package/dist/common-CeO-vn8Y.js.map +0 -1
- package/dist/constants-BPWSrMkn.d.ts +0 -18
- package/dist/constants-CCqS_v55.js.map +0 -1
- package/dist/constants-DWe181uQ.js.map +0 -1
- package/dist/container-CpuiLsZM.js.map +0 -1
- package/dist/container-CwEATQy2.d.ts +0 -10
- package/dist/element-D_nyVwgB.d.ts +0 -30
- package/dist/element-DcqNz1dV.js.map +0 -1
- package/dist/env-ERkaRfQO.js.map +0 -1
- package/dist/error-codes-C_UO39jz.js.map +0 -1
- package/dist/feature-flags-BFiGn38a.js.map +0 -1
- package/dist/file-BdyYwkaI.d.ts +0 -10
- package/dist/file-DE69SSOP.js.map +0 -1
- package/dist/helpers-CswC9gKF.js.map +0 -1
- package/dist/helpers-DAmE106r.d.ts +0 -9
- package/dist/media-gallery-DCu02VXc.d.ts +0 -17
- package/dist/media-gallery-nUEHqKVF.js.map +0 -1
- package/dist/section-D6t7tyEZ.js.map +0 -1
- package/dist/section-fktaECHL.d.ts +0 -18
- package/dist/separator-CuesaLrC.d.ts +0 -8
- package/dist/separator-DYAFK-Jj.js.map +0 -1
- package/dist/store-Ci6ib2C9.js.map +0 -1
- package/dist/text-display-DNMwmGHJ.d.ts +0 -12
- package/dist/text-display-Dy6JHB5X.js.map +0 -1
- package/dist/type-checker-CXVdS7qc.js.map +0 -1
- package/dist/types-package-CTSNSM93.js.map +0 -1
- package/dist/utils/clone.d.ts +0 -5
- package/dist/utils/clone.js +0 -9
- package/dist/utils/clone.js.map +0 -1
- package/dist/utils/get-paths.d.ts +0 -6
- package/dist/utils/get-paths.js +0 -34
- package/dist/utils/get-paths.js.map +0 -1
- package/dist/utils-IYtoeTur.js.map +0 -1
- package/dist/version-CS1EiTrw.js.map +0 -1
- package/dist/warn-unstable-DHLaxPC8.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventInterceptor } from "./EventInterceptor-
|
|
2
|
-
import { Fragment, createElement } from "./element-
|
|
3
|
-
import { MessageCommandOptions, MessageCommandParser } from "./MessageCommandParser-
|
|
4
|
-
import { Command, CommandsRouter, Middleware } from "./CommandsRouter-
|
|
1
|
+
import { EventInterceptor } from "./EventInterceptor-x-R2qshQ.js";
|
|
2
|
+
import { Fragment, createElement } from "./element-CAXu1XtK.js";
|
|
3
|
+
import { MessageCommandOptions, MessageCommandParser } from "./MessageCommandParser-ROLibZPX.js";
|
|
4
|
+
import { Command, CommandsRouter, Middleware } from "./CommandsRouter-CoOA7hkf.js";
|
|
5
5
|
import { EventsRouter, ParsedEvent } from "./EventsRouter-BacqK6z3.js";
|
|
6
|
-
import { HMREventType } from "./constants-
|
|
6
|
+
import { HMREventType } from "./constants-BTttfrm3.js";
|
|
7
7
|
import EventEmitter from "node:events";
|
|
8
|
-
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
8
|
+
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, Constructable, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
9
9
|
import { DirectiveTransformerOptions } from "directive-to-hof";
|
|
10
10
|
|
|
11
11
|
//#region src/types.d.ts
|
|
@@ -35,12 +35,23 @@ interface CommandContext<T extends Interaction, Cached extends CacheType> {
|
|
|
35
35
|
*/
|
|
36
36
|
handler: CommandKit;
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Represents a command that can be executed by CommandKit.
|
|
40
|
+
*/
|
|
38
41
|
type CommandData = RESTPostAPIApplicationCommandsJSONBody & {
|
|
39
42
|
guilds?: string[];
|
|
40
43
|
};
|
|
41
44
|
//#endregion
|
|
42
45
|
//#region src/context/async-context.d.ts
|
|
46
|
+
/**
|
|
47
|
+
* Represents a generic function type that can accept any number of arguments.
|
|
48
|
+
*/
|
|
43
49
|
type GenericFunction<A extends any[] = any[]> = (...args: A) => any;
|
|
50
|
+
/**
|
|
51
|
+
* Checks if the given worker is a CommandKit worker context.
|
|
52
|
+
* @param worker The worker to check.
|
|
53
|
+
* @returns True if the worker is a CommandKit worker context, false otherwise.
|
|
54
|
+
*/
|
|
44
55
|
declare function isCommandWorkerContext(worker: any): worker is CommandKitEnvironment;
|
|
45
56
|
/**
|
|
46
57
|
* Represents an async function that can be cached
|
|
@@ -49,6 +60,12 @@ declare function isCommandWorkerContext(worker: any): worker is CommandKitEnviro
|
|
|
49
60
|
*/
|
|
50
61
|
type AsyncFunction<R extends any[] = any[], T = any> = (...args: R) => Promise<T>;
|
|
51
62
|
declare function exitContext<T>(fn: () => T): T;
|
|
63
|
+
/**
|
|
64
|
+
* Executes the provided function within a CommandKit context.
|
|
65
|
+
* @param value The CommandKit environment to use for the context.
|
|
66
|
+
* @param receiver The function to execute within the context.
|
|
67
|
+
* @returns The result of the receiver function.
|
|
68
|
+
*/
|
|
52
69
|
declare function provideContext<R>(value: CommandKitEnvironment, receiver: () => R): R;
|
|
53
70
|
/**
|
|
54
71
|
* Returns a context-aware version of the given function.
|
|
@@ -77,12 +94,22 @@ declare function getContext(): CommandKitEnvironment | undefined;
|
|
|
77
94
|
declare function useEnvironment(): CommandKitEnvironment;
|
|
78
95
|
//#endregion
|
|
79
96
|
//#region src/app/register/CommandRegistrar.d.ts
|
|
97
|
+
/**
|
|
98
|
+
* Event object passed to plugins before command registration.
|
|
99
|
+
*/
|
|
80
100
|
interface PreRegisterCommandsEvent {
|
|
81
101
|
preventDefault(): void;
|
|
82
102
|
commands: CommandData[];
|
|
83
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Handles registration of Discord application commands (slash commands, context menus).
|
|
106
|
+
*/
|
|
84
107
|
declare class CommandRegistrar {
|
|
85
108
|
readonly commandkit: CommandKit;
|
|
109
|
+
/**
|
|
110
|
+
* @private
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
86
113
|
private api;
|
|
87
114
|
/**
|
|
88
115
|
* Creates an instance of CommandRegistrar.
|
|
@@ -108,16 +135,52 @@ declare class CommandRegistrar {
|
|
|
108
135
|
}
|
|
109
136
|
//#endregion
|
|
110
137
|
//#region src/context/environment.d.ts
|
|
138
|
+
/**
|
|
139
|
+
* Represents the internal data structure for the CommandKit environment.
|
|
140
|
+
*/
|
|
111
141
|
interface CommandKitEnvironmentInternalData {
|
|
142
|
+
/**
|
|
143
|
+
* The error that occurred during command execution, if any.
|
|
144
|
+
* This is set when an error occurs during the execution of a command.
|
|
145
|
+
*/
|
|
112
146
|
executionError: Error | null;
|
|
147
|
+
/**
|
|
148
|
+
* The type of the environment, which can be used to differentiate between
|
|
149
|
+
* different execution contexts (e.g., command handler, event handler, etc.).
|
|
150
|
+
*/
|
|
113
151
|
type: CommandKitEnvironmentType | null;
|
|
152
|
+
/**
|
|
153
|
+
* A map of variables that can be used to store and retrieve data during command execution.
|
|
154
|
+
* This allows for sharing data between different parts of the command execution process.
|
|
155
|
+
*/
|
|
114
156
|
variables: Map<string, any>;
|
|
157
|
+
/**
|
|
158
|
+
* A map of deferred functions that will be executed after the command has finished executing.
|
|
159
|
+
* This is useful for running cleanup tasks or additional processing after the main command logic.
|
|
160
|
+
*/
|
|
115
161
|
deferredFunctions: Map<string, GenericFunction<[CommandKitEnvironment]>>;
|
|
162
|
+
/**
|
|
163
|
+
* A marker string that can be used to identify the command execution.
|
|
164
|
+
* This is useful for logging and debugging purposes.
|
|
165
|
+
*/
|
|
116
166
|
marker: string;
|
|
167
|
+
/**
|
|
168
|
+
* The start time of the command execution.
|
|
169
|
+
*/
|
|
117
170
|
markStart: number;
|
|
171
|
+
/**
|
|
172
|
+
* The end time of the command execution.
|
|
173
|
+
*/
|
|
118
174
|
markEnd: number;
|
|
175
|
+
/**
|
|
176
|
+
* The context associated with the command execution.
|
|
177
|
+
* This can be used to access request-specific data or application state.
|
|
178
|
+
*/
|
|
119
179
|
context: Context | null;
|
|
120
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Represents the execution environment for CommandKit commands.
|
|
183
|
+
*/
|
|
121
184
|
declare class CommandKitEnvironment {
|
|
122
185
|
#private;
|
|
123
186
|
readonly commandkit: CommandKit;
|
|
@@ -210,18 +273,41 @@ declare enum CommandKitEnvironmentType {
|
|
|
210
273
|
CommandHandler = "COMMAND_HANDLER",
|
|
211
274
|
}
|
|
212
275
|
/**
|
|
213
|
-
*
|
|
276
|
+
* Schedules the given function to run after the current command has finished executing.
|
|
214
277
|
* @param fn The function to run after the current command.
|
|
215
278
|
* @returns The deferred function id. This can be used to cancel the deferred function.
|
|
279
|
+
* @example import { after } from 'commandkit';
|
|
280
|
+
*
|
|
281
|
+
* // inside a command
|
|
282
|
+
* export const chatInput: ChatInputCommand = async (ctx) => {
|
|
283
|
+
* after(() => {
|
|
284
|
+
* console.log('This will run after the command has finished executing.');
|
|
285
|
+
* });
|
|
286
|
+
*
|
|
287
|
+
* // ... command logic
|
|
288
|
+
* }
|
|
216
289
|
*/
|
|
217
290
|
declare function after(fn: GenericFunction<[CommandKitEnvironment]>): string;
|
|
218
291
|
/**
|
|
219
292
|
* Cancels a deferred function registered with `after`.
|
|
220
293
|
* @param id The deferred function id to cancel.
|
|
294
|
+
* @example import { cancelAfter } from 'commandkit';
|
|
295
|
+
* // inside a command
|
|
296
|
+
* export const chatInput: ChatInputCommand = async (ctx) => {
|
|
297
|
+
* const id = after(() => {
|
|
298
|
+
* console.log('This will run after the command has finished executing.');
|
|
299
|
+
* });
|
|
300
|
+
*
|
|
301
|
+
* // cancel the deferred function if needed
|
|
302
|
+
* if (something) cancelAfter(id);
|
|
303
|
+
* }
|
|
221
304
|
*/
|
|
222
305
|
declare function cancelAfter(id: string): void;
|
|
223
306
|
//#endregion
|
|
224
307
|
//#region src/app/commands/Context.d.ts
|
|
308
|
+
/**
|
|
309
|
+
* Enumeration of different command execution modes supported by CommandKit.
|
|
310
|
+
*/
|
|
225
311
|
declare const CommandExecutionMode: {
|
|
226
312
|
readonly ChatInputCommand: "chatInput";
|
|
227
313
|
readonly MessageContextMenu: "messageContextMenu";
|
|
@@ -229,7 +315,13 @@ declare const CommandExecutionMode: {
|
|
|
229
315
|
readonly Autocomplete: "autocomplete";
|
|
230
316
|
readonly Message: "message";
|
|
231
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* Type representing the possible command execution modes.
|
|
320
|
+
*/
|
|
232
321
|
type CommandExecutionMode = (typeof CommandExecutionMode)[keyof typeof CommandExecutionMode];
|
|
322
|
+
/**
|
|
323
|
+
* Parameters required to create a command context.
|
|
324
|
+
*/
|
|
233
325
|
interface ContextParameters<T extends CommandExecutionMode, Args = Record<string, any>> {
|
|
234
326
|
command: LoadedCommand;
|
|
235
327
|
environment?: CommandKitEnvironment;
|
|
@@ -241,28 +333,92 @@ interface ContextParameters<T extends CommandExecutionMode, Args = Record<string
|
|
|
241
333
|
store?: Map<string, any>;
|
|
242
334
|
customArgs?: Args;
|
|
243
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* Context for message-based commands.
|
|
338
|
+
*/
|
|
244
339
|
type MessageCommandContext = Context<'message'>;
|
|
340
|
+
/**
|
|
341
|
+
* Context for interaction-based commands.
|
|
342
|
+
*/
|
|
245
343
|
type InteractionCommandContext = Context<'autocomplete' | 'chatInput' | 'messageContextMenu' | 'userContextMenu'>;
|
|
344
|
+
/**
|
|
345
|
+
* Middleware context for message-based commands.
|
|
346
|
+
*/
|
|
246
347
|
type MessageCommandMiddlewareContext = MiddlewareContext<'message'>;
|
|
348
|
+
/**
|
|
349
|
+
* Middleware context for interaction-based commands.
|
|
350
|
+
*/
|
|
247
351
|
type InteractionCommandMiddlewareContext = MiddlewareContext<'autocomplete' | 'chatInput' | 'messageContextMenu' | 'userContextMenu'>;
|
|
352
|
+
/**
|
|
353
|
+
* Context for chat input (slash) commands.
|
|
354
|
+
*/
|
|
248
355
|
type ChatInputCommandContext = Context<'chatInput'>;
|
|
356
|
+
/**
|
|
357
|
+
* Middleware context for slash commands.
|
|
358
|
+
*/
|
|
249
359
|
type SlashCommandMiddlewareContext = MiddlewareContext<'chatInput'>;
|
|
360
|
+
/**
|
|
361
|
+
* Context for autocomplete interactions.
|
|
362
|
+
*/
|
|
250
363
|
type AutocompleteCommandContext = Context<'autocomplete'>;
|
|
364
|
+
/**
|
|
365
|
+
* Middleware context for autocomplete interactions.
|
|
366
|
+
*/
|
|
251
367
|
type AutocompleteCommandMiddlewareContext = MiddlewareContext<'autocomplete'>;
|
|
368
|
+
/**
|
|
369
|
+
* Context for message context menu commands.
|
|
370
|
+
*/
|
|
252
371
|
type MessageContextMenuCommandContext = Context<'messageContextMenu'>;
|
|
372
|
+
/**
|
|
373
|
+
* Middleware context for message context menu commands.
|
|
374
|
+
*/
|
|
253
375
|
type MessageContextMenuCommandMiddlewareContext = MiddlewareContext<'messageContextMenu'>;
|
|
376
|
+
/**
|
|
377
|
+
* Context for user context menu commands.
|
|
378
|
+
*/
|
|
254
379
|
type UserContextMenuCommandContext = Context<'userContextMenu'>;
|
|
380
|
+
/**
|
|
381
|
+
* Middleware context for user context menu commands.
|
|
382
|
+
*/
|
|
255
383
|
type UserContextMenuCommandMiddlewareContext = MiddlewareContext<'userContextMenu'>;
|
|
384
|
+
/**
|
|
385
|
+
* Type representing command context options based on execution mode.
|
|
386
|
+
*/
|
|
256
387
|
type CommandContextOptions<T extends CommandExecutionMode> = T extends 'message' ? MessageCommandOptions : T extends 'chatInput' ? ChatInputCommandInteraction['options'] : T extends 'autocomplete' ? AutocompleteInteraction['options'] : T extends 'messageContextMenu' ? MessageContextMenuCommandInteraction['options'] : T extends 'userContextMenu' ? UserContextMenuCommandInteraction['options'] : never;
|
|
388
|
+
/**
|
|
389
|
+
* Generic type for command execution functions.
|
|
390
|
+
*/
|
|
257
391
|
type AnyCommandExecute<ContextType extends Context = Context> = (ctx: ContextType) => Awaitable<unknown>;
|
|
392
|
+
/**
|
|
393
|
+
* Type for chat input command execution functions.
|
|
394
|
+
*/
|
|
258
395
|
type ChatInputCommand = AnyCommandExecute<ChatInputCommandContext>;
|
|
396
|
+
/**
|
|
397
|
+
* Type for autocomplete command execution functions.
|
|
398
|
+
*/
|
|
259
399
|
type AutocompleteCommand = AnyCommandExecute<AutocompleteCommandContext>;
|
|
400
|
+
/**
|
|
401
|
+
* Type for message context menu command execution functions.
|
|
402
|
+
*/
|
|
260
403
|
type MessageContextMenuCommand = AnyCommandExecute<MessageContextMenuCommandContext>;
|
|
404
|
+
/**
|
|
405
|
+
* Type for user context menu command execution functions.
|
|
406
|
+
*/
|
|
261
407
|
type UserContextMenuCommand = AnyCommandExecute<UserContextMenuCommandContext>;
|
|
408
|
+
/**
|
|
409
|
+
* Type for message command execution functions.
|
|
410
|
+
*/
|
|
262
411
|
type MessageCommand = AnyCommandExecute<MessageCommandContext>;
|
|
412
|
+
/**
|
|
413
|
+
* Arguments for middleware context.
|
|
414
|
+
*/
|
|
263
415
|
interface MiddlewareContextArgs {
|
|
264
416
|
setCommandRunner?: GenericFunction<[RunCommand]>;
|
|
265
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Represents the execution context for a command, providing access to Discord.js objects,
|
|
420
|
+
* command metadata, and various utility methods for command execution.
|
|
421
|
+
*/
|
|
266
422
|
declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecutionMode, Args extends Record<string, any> = Record<string, any>> {
|
|
267
423
|
#private;
|
|
268
424
|
readonly commandkit: CommandKit;
|
|
@@ -299,6 +455,10 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
299
455
|
* The command that this context belongs to.
|
|
300
456
|
*/
|
|
301
457
|
readonly command: LoadedCommand;
|
|
458
|
+
/**
|
|
459
|
+
* @private
|
|
460
|
+
* @internal
|
|
461
|
+
*/
|
|
302
462
|
private _locale;
|
|
303
463
|
/**
|
|
304
464
|
* Creates a new command context.
|
|
@@ -311,7 +471,13 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
311
471
|
* This store is shared across all contexts in the same command execution, including the cloned contexts and middleware contexts.
|
|
312
472
|
*/
|
|
313
473
|
get store(): Map<string, any>;
|
|
474
|
+
/**
|
|
475
|
+
* Gets the name of the current command.
|
|
476
|
+
*/
|
|
314
477
|
get commandName(): string;
|
|
478
|
+
/**
|
|
479
|
+
* Gets the command options based on the execution mode.
|
|
480
|
+
*/
|
|
315
481
|
get options(): CommandContextOptions<ExecutionMode>;
|
|
316
482
|
/**
|
|
317
483
|
* Whether this context was forwarded from another context. This happens when a command forwards its context to another command.
|
|
@@ -375,9 +541,17 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
375
541
|
setLocale(locale: Locale | null): void;
|
|
376
542
|
/**
|
|
377
543
|
* Creates a clone of this context
|
|
544
|
+
* @param config - Optional partial config to override in the clone
|
|
378
545
|
*/
|
|
379
546
|
clone(config?: Partial<ContextParameters<ExecutionMode>>): Context<ExecutionMode>;
|
|
547
|
+
/**
|
|
548
|
+
* Checks if this context is a middleware context.
|
|
549
|
+
*/
|
|
380
550
|
isMiddleware(): this is MiddlewareContext<ExecutionMode>;
|
|
551
|
+
/**
|
|
552
|
+
* Gets the command arguments (only available for message commands).
|
|
553
|
+
* @returns Array of command arguments
|
|
554
|
+
*/
|
|
381
555
|
args(): string[];
|
|
382
556
|
/**
|
|
383
557
|
* Stops upcoming middleware or current command execution.
|
|
@@ -387,6 +561,9 @@ declare class Context<ExecutionMode extends CommandExecutionMode = CommandExecut
|
|
|
387
561
|
*/
|
|
388
562
|
exit(): never;
|
|
389
563
|
}
|
|
564
|
+
/**
|
|
565
|
+
* Extended context class for middleware execution with additional control methods.
|
|
566
|
+
*/
|
|
390
567
|
declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutionMode> extends Context<T, MiddlewareContextArgs> {
|
|
391
568
|
#private;
|
|
392
569
|
/**
|
|
@@ -410,16 +587,46 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
|
|
|
410
587
|
}
|
|
411
588
|
//#endregion
|
|
412
589
|
//#region src/app/commands/AppCommandRunner.d.ts
|
|
590
|
+
interface RunCommandOptions {
|
|
591
|
+
handler?: string;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Handles the execution of application commands for CommandKit.
|
|
595
|
+
* Manages middleware execution, environment setup, and command invocation.
|
|
596
|
+
*/
|
|
413
597
|
declare class AppCommandRunner {
|
|
414
598
|
#private;
|
|
415
599
|
private handler;
|
|
600
|
+
/**
|
|
601
|
+
* Creates a new AppCommandRunner instance.
|
|
602
|
+
* @param handler - The app command handler instance to use for command execution
|
|
603
|
+
*/
|
|
416
604
|
constructor(handler: AppCommandHandler);
|
|
417
|
-
|
|
605
|
+
/**
|
|
606
|
+
* Executes a prepared command with middleware support and environment setup.
|
|
607
|
+
* Handles the complete command lifecycle including before/after middleware execution.
|
|
608
|
+
* @param prepared - The prepared command execution data
|
|
609
|
+
* @param source - The source interaction or message that triggered the command
|
|
610
|
+
*/
|
|
611
|
+
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message, options?: RunCommandOptions): Promise<any>;
|
|
612
|
+
/**
|
|
613
|
+
* Determines the execution mode based on the source of the command.
|
|
614
|
+
* @param source - The interaction or message that triggered the command
|
|
615
|
+
* @returns The appropriate command execution mode
|
|
616
|
+
*/
|
|
418
617
|
getExecutionMode(source: Interaction | Message): CommandExecutionMode;
|
|
419
618
|
}
|
|
420
619
|
//#endregion
|
|
421
620
|
//#region src/app/handlers/AppCommandHandler.d.ts
|
|
621
|
+
/**
|
|
622
|
+
* Function type for wrapping command execution with custom logic.
|
|
623
|
+
*/
|
|
422
624
|
type RunCommand = <T extends AsyncFunction>(fn: T) => T;
|
|
625
|
+
/**
|
|
626
|
+
* Represents a native command structure used in CommandKit.
|
|
627
|
+
* This structure includes the command definition and various handlers for different interaction types.
|
|
628
|
+
* It can be used to define slash commands, context menu commands, and message commands.
|
|
629
|
+
*/
|
|
423
630
|
interface AppCommandNative {
|
|
424
631
|
command: SlashCommandBuilder | Record<string, any>;
|
|
425
632
|
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
@@ -428,61 +635,205 @@ interface AppCommandNative {
|
|
|
428
635
|
messageContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
429
636
|
userContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
430
637
|
}
|
|
431
|
-
|
|
638
|
+
/**
|
|
639
|
+
* Custom properties that can be added to an AppCommand.
|
|
640
|
+
* This allows for additional metadata or configuration to be associated with a command.
|
|
641
|
+
*/
|
|
642
|
+
interface CustomAppCommandProps {
|
|
643
|
+
[key: string]: any;
|
|
644
|
+
}
|
|
645
|
+
/**
|
|
646
|
+
* Represents a command in the CommandKit application, including its metadata and handlers.
|
|
647
|
+
* This type extends the native command structure with additional properties.
|
|
648
|
+
*/
|
|
649
|
+
type AppCommand = AppCommandNative & CustomAppCommandProps;
|
|
650
|
+
/**
|
|
651
|
+
* @private
|
|
652
|
+
* @internal
|
|
653
|
+
*/
|
|
432
654
|
interface AppCommandMiddleware {
|
|
433
655
|
beforeExecute: (ctx: Context) => Awaitable<unknown>;
|
|
434
656
|
afterExecute: (ctx: Context) => Awaitable<unknown>;
|
|
435
657
|
}
|
|
658
|
+
/**
|
|
659
|
+
* Represents a loaded command with its metadata and configuration.
|
|
660
|
+
*/
|
|
436
661
|
interface LoadedCommand {
|
|
437
662
|
command: Command;
|
|
438
663
|
data: AppCommand;
|
|
439
664
|
guilds?: string[];
|
|
440
665
|
}
|
|
666
|
+
/**
|
|
667
|
+
* Type representing command data identifier.
|
|
668
|
+
*/
|
|
441
669
|
type CommandTypeData = string;
|
|
670
|
+
/**
|
|
671
|
+
* Type for commands that can be resolved by the handler.
|
|
672
|
+
*/
|
|
442
673
|
type ResolvableCommand = CommandTypeData | (string & {});
|
|
674
|
+
/**
|
|
675
|
+
* @private
|
|
676
|
+
* @internal
|
|
677
|
+
*/
|
|
443
678
|
interface LoadedMiddleware {
|
|
444
679
|
middleware: Middleware;
|
|
445
680
|
data: AppCommandMiddleware;
|
|
446
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Represents a prepared command execution with all necessary data and middleware.
|
|
684
|
+
*/
|
|
447
685
|
interface PreparedAppCommandExecution {
|
|
448
686
|
command: LoadedCommand;
|
|
449
687
|
middlewares: LoadedMiddleware[];
|
|
450
688
|
messageCommandParser?: MessageCommandParser;
|
|
451
689
|
}
|
|
690
|
+
/**
|
|
691
|
+
* Type representing command builder objects supported by CommandKit.
|
|
692
|
+
*/
|
|
452
693
|
type CommandBuilderLike = SlashCommandBuilder | ContextMenuCommandBuilder | Record<string, any>;
|
|
694
|
+
/**
|
|
695
|
+
* Handles application commands for CommandKit, including loading, registration, and execution.
|
|
696
|
+
* Manages both slash commands and message commands with middleware support.
|
|
697
|
+
*/
|
|
453
698
|
declare class AppCommandHandler {
|
|
454
699
|
readonly commandkit: CommandKit;
|
|
700
|
+
/**
|
|
701
|
+
* @private
|
|
702
|
+
* @internal
|
|
703
|
+
*/
|
|
455
704
|
private loadedCommands;
|
|
705
|
+
/**
|
|
706
|
+
* @private
|
|
707
|
+
* @internal
|
|
708
|
+
*/
|
|
456
709
|
private loadedMiddlewares;
|
|
710
|
+
/**
|
|
711
|
+
* @private
|
|
712
|
+
* @internal
|
|
713
|
+
*/
|
|
457
714
|
private commandNameToId;
|
|
715
|
+
/**
|
|
716
|
+
* @private
|
|
717
|
+
* @internal
|
|
718
|
+
*/
|
|
458
719
|
private subcommandPathToId;
|
|
720
|
+
/**
|
|
721
|
+
* Command registrar for handling Discord API registration.
|
|
722
|
+
*/
|
|
459
723
|
readonly registrar: CommandRegistrar;
|
|
724
|
+
/**
|
|
725
|
+
* @private
|
|
726
|
+
* @internal
|
|
727
|
+
*/
|
|
460
728
|
private onInteraction;
|
|
729
|
+
/**
|
|
730
|
+
* @private
|
|
731
|
+
* @internal
|
|
732
|
+
*/
|
|
461
733
|
private onMessageCreate;
|
|
734
|
+
/**
|
|
735
|
+
* Command runner instance for executing commands.
|
|
736
|
+
*/
|
|
462
737
|
readonly commandRunner: AppCommandRunner;
|
|
738
|
+
/**
|
|
739
|
+
* External command data storage.
|
|
740
|
+
*/
|
|
463
741
|
readonly externalCommandData: Collection<string, Command>;
|
|
742
|
+
/**
|
|
743
|
+
* External middleware data storage.
|
|
744
|
+
*/
|
|
464
745
|
readonly externalMiddlewareData: Collection<string, Middleware>;
|
|
746
|
+
/**
|
|
747
|
+
* Creates a new AppCommandHandler instance.
|
|
748
|
+
* @param commandkit - The CommandKit instance
|
|
749
|
+
*/
|
|
465
750
|
constructor(commandkit: CommandKit);
|
|
751
|
+
/**
|
|
752
|
+
* Prints a formatted banner showing all loaded commands organized by category.
|
|
753
|
+
*/
|
|
466
754
|
printBanner(): void;
|
|
755
|
+
/**
|
|
756
|
+
* Gets an array of all loaded commands.
|
|
757
|
+
* @returns Array of loaded commands
|
|
758
|
+
*/
|
|
467
759
|
getCommandsArray(): LoadedCommand[];
|
|
760
|
+
/**
|
|
761
|
+
* Registers event handlers for Discord interactions and messages.
|
|
762
|
+
*/
|
|
468
763
|
registerCommandHandler(): void;
|
|
764
|
+
/**
|
|
765
|
+
* Prepares a command for execution by resolving the command and its middleware.
|
|
766
|
+
* @param source - The interaction or message that triggered the command
|
|
767
|
+
* @param cmdName - Optional command name override
|
|
768
|
+
* @returns Prepared command execution data or null if command not found
|
|
769
|
+
*/
|
|
469
770
|
prepareCommandRun(source: Interaction | Message, cmdName?: string): Promise<PreparedAppCommandExecution | null>;
|
|
771
|
+
/**
|
|
772
|
+
* Reloads all commands and middleware from scratch.
|
|
773
|
+
*/
|
|
470
774
|
reloadCommands(): Promise<void>;
|
|
775
|
+
/**
|
|
776
|
+
* Adds external middleware data to be loaded.
|
|
777
|
+
* @param data - Array of middleware data to add
|
|
778
|
+
*/
|
|
471
779
|
addExternalMiddleware(data: Middleware[]): Promise<void>;
|
|
780
|
+
/**
|
|
781
|
+
* Adds external command data to be loaded.
|
|
782
|
+
* @param data - Array of command data to add
|
|
783
|
+
*/
|
|
472
784
|
addExternalCommands(data: Command[]): Promise<void>;
|
|
785
|
+
/**
|
|
786
|
+
* Registers externally loaded middleware.
|
|
787
|
+
* @param data - Array of loaded middleware to register
|
|
788
|
+
*/
|
|
473
789
|
registerExternalLoadedMiddleware(data: LoadedMiddleware[]): Promise<void>;
|
|
790
|
+
/**
|
|
791
|
+
* Registers externally loaded commands.
|
|
792
|
+
* @param data - Array of loaded commands to register
|
|
793
|
+
*/
|
|
474
794
|
registerExternalLoadedCommands(data: LoadedCommand[]): Promise<void>;
|
|
795
|
+
/**
|
|
796
|
+
* Loads all commands and middleware from the router.
|
|
797
|
+
*/
|
|
475
798
|
loadCommands(): Promise<void>;
|
|
799
|
+
/**
|
|
800
|
+
* @private
|
|
801
|
+
* @internal
|
|
802
|
+
*/
|
|
476
803
|
private loadMiddleware;
|
|
804
|
+
/**
|
|
805
|
+
* @private
|
|
806
|
+
* @internal
|
|
807
|
+
*/
|
|
477
808
|
private loadCommand;
|
|
478
809
|
}
|
|
479
810
|
//#endregion
|
|
480
811
|
//#region src/events/CommandKitEventsChannel.d.ts
|
|
812
|
+
/**
|
|
813
|
+
* The function type for event listeners.
|
|
814
|
+
*/
|
|
481
815
|
type ListenerFunction = GenericFunction | AsyncFunction;
|
|
816
|
+
/**
|
|
817
|
+
* Represents a channel for emitting and listening to events in CommandKit.
|
|
818
|
+
* This class provides methods to manage event listeners and emit events
|
|
819
|
+
* within a specific namespace.
|
|
820
|
+
*/
|
|
482
821
|
declare class CommandKitEventsChannel {
|
|
483
822
|
readonly commandkit: CommandKit;
|
|
484
823
|
private emitter;
|
|
824
|
+
/**
|
|
825
|
+
* Creates a new instance of CommandKitEventsChannel.
|
|
826
|
+
* @param commandkit The CommandKit instance that this channel belongs to.
|
|
827
|
+
*/
|
|
485
828
|
constructor(commandkit: CommandKit);
|
|
829
|
+
/**
|
|
830
|
+
* Creates a namespaced event channel. This allows you to manage events
|
|
831
|
+
* within a specific namespace, preventing conflicts with other event channels.
|
|
832
|
+
* This is useful for organizing events related to different parts of your application.
|
|
833
|
+
* @param namespace The namespace for the event channel.
|
|
834
|
+
* @returns An object containing methods for managing events within the namespace.
|
|
835
|
+
* @example commandkit.events.to('customNamespace').emit('eventName', data);
|
|
836
|
+
*/
|
|
486
837
|
to(namespace: string): {
|
|
487
838
|
on: (event: string, listener: ListenerFunction) => void;
|
|
488
839
|
off: (event: string, listener: ListenerFunction) => void;
|
|
@@ -490,19 +841,56 @@ declare class CommandKitEventsChannel {
|
|
|
490
841
|
emit: (event: string, ...args: any[]) => boolean;
|
|
491
842
|
removeAllListeners: (event: string) => void;
|
|
492
843
|
};
|
|
844
|
+
/**
|
|
845
|
+
* Register an event listener for a specific event within the namespace.
|
|
846
|
+
* @param namespace The namespace for the event channel.
|
|
847
|
+
* @param event The name of the event to listen for.
|
|
848
|
+
* @param listener The function to call when the event is emitted.
|
|
849
|
+
*/
|
|
493
850
|
on(namespace: string, event: string, listener: ListenerFunction): void;
|
|
851
|
+
/**
|
|
852
|
+
* Unregister an event listener for a specific event within the namespace.
|
|
853
|
+
* @param namespace The namespace for the event channel.
|
|
854
|
+
* @param event The name of the event to stop listening for.
|
|
855
|
+
* @param listener The function that was registered as the listener.
|
|
856
|
+
*/
|
|
494
857
|
off(namespace: string, event: string, listener: ListenerFunction): void;
|
|
858
|
+
/**
|
|
859
|
+
* Register an event listener that will be called only once for a specific event
|
|
860
|
+
* within the namespace.
|
|
861
|
+
* @param namespace The namespace for the event channel.
|
|
862
|
+
* @param event The name of the event to listen for.
|
|
863
|
+
* @param listener The function to call when the event is emitted.
|
|
864
|
+
*/
|
|
495
865
|
once(namespace: string, event: string, listener: ListenerFunction): void;
|
|
866
|
+
/**
|
|
867
|
+
* Emit an event within the specified namespace, calling all registered listeners.
|
|
868
|
+
* @param namespace The namespace for the event channel.
|
|
869
|
+
* @param event The name of the event to emit.
|
|
870
|
+
* @param args The arguments to pass to the listeners.
|
|
871
|
+
* @returns A boolean indicating whether any listeners were called.
|
|
872
|
+
*/
|
|
496
873
|
emit(namespace: string, event: string, ...args: any[]): boolean;
|
|
874
|
+
/**
|
|
875
|
+
* Remove all listeners for a specific event or all events within the namespace.
|
|
876
|
+
* @param namespace The namespace for the event channel.
|
|
877
|
+
* @param event The name of the event to remove listeners for. If not provided, all listeners for all events in the namespace will be removed.
|
|
878
|
+
*/
|
|
497
879
|
removeAllListeners(namespace: string): void;
|
|
498
880
|
removeAllListeners(namespace: string, event: string): void;
|
|
499
881
|
}
|
|
500
882
|
//#endregion
|
|
501
883
|
//#region src/app/handlers/AppEventsHandler.d.ts
|
|
884
|
+
/**
|
|
885
|
+
* Represents an event listener with its configuration.
|
|
886
|
+
*/
|
|
502
887
|
type EventListener = {
|
|
503
888
|
handler: ListenerFunction;
|
|
504
889
|
once: boolean;
|
|
505
890
|
};
|
|
891
|
+
/**
|
|
892
|
+
* Represents a loaded event with all its listeners.
|
|
893
|
+
*/
|
|
506
894
|
interface LoadedEvent {
|
|
507
895
|
name: string;
|
|
508
896
|
namespace: string | null;
|
|
@@ -511,6 +899,9 @@ interface LoadedEvent {
|
|
|
511
899
|
mainListener?: EventListener;
|
|
512
900
|
executedOnceListeners?: Set<ListenerFunction>;
|
|
513
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* Data structure representing loaded event information for external consumption.
|
|
904
|
+
*/
|
|
514
905
|
interface AppEventsHandlerLoadedData {
|
|
515
906
|
name: string;
|
|
516
907
|
namespace: string | null;
|
|
@@ -518,28 +909,99 @@ interface AppEventsHandlerLoadedData {
|
|
|
518
909
|
regularListeners: number;
|
|
519
910
|
metadata: ParsedEvent;
|
|
520
911
|
}
|
|
912
|
+
/**
|
|
913
|
+
* Handles Discord.js events and CommandKit custom events with support for namespacing and middleware.
|
|
914
|
+
*/
|
|
521
915
|
declare class AppEventsHandler {
|
|
522
916
|
readonly commandkit: CommandKit;
|
|
917
|
+
/**
|
|
918
|
+
* @private
|
|
919
|
+
* @internal
|
|
920
|
+
*/
|
|
523
921
|
private loadedEvents;
|
|
922
|
+
/**
|
|
923
|
+
* Creates a new AppEventsHandler instance.
|
|
924
|
+
* @param commandkit - The CommandKit instance
|
|
925
|
+
*/
|
|
524
926
|
constructor(commandkit: CommandKit);
|
|
927
|
+
/**
|
|
928
|
+
* Gets information about all loaded events.
|
|
929
|
+
* @returns Array of loaded event data
|
|
930
|
+
*/
|
|
525
931
|
getEvents(): AppEventsHandlerLoadedData[];
|
|
932
|
+
/**
|
|
933
|
+
* Reloads all events by unregistering existing ones and loading them again.
|
|
934
|
+
*/
|
|
526
935
|
reloadEvents(): Promise<void>;
|
|
936
|
+
/**
|
|
937
|
+
* Loads all events from the events router and registers them with Discord.js client.
|
|
938
|
+
*/
|
|
527
939
|
loadEvents(): Promise<void>;
|
|
940
|
+
/**
|
|
941
|
+
* Unregisters all event listeners and clears loaded events.
|
|
942
|
+
*/
|
|
528
943
|
unregisterAll(): void;
|
|
944
|
+
/**
|
|
945
|
+
* Registers all loaded events with the Discord.js client and CommandKit event system.
|
|
946
|
+
*/
|
|
529
947
|
registerAllClientEvents(): void;
|
|
948
|
+
/**
|
|
949
|
+
* Unregisters all client event listeners and cleans up loaded events.
|
|
950
|
+
*/
|
|
530
951
|
unregisterAllClientListeners(): void;
|
|
531
952
|
}
|
|
532
953
|
//#endregion
|
|
533
954
|
//#region src/utils/dev-hooks.d.ts
|
|
955
|
+
/**
|
|
956
|
+
* Represents HMR inter-process communication messages.
|
|
957
|
+
*/
|
|
958
|
+
interface IpcMessageCommand {
|
|
959
|
+
/**
|
|
960
|
+
* The type of HMR event being communicated.
|
|
961
|
+
*/
|
|
962
|
+
event: HMREventType;
|
|
963
|
+
/**
|
|
964
|
+
* The path associated with the HMR event.
|
|
965
|
+
*/
|
|
966
|
+
path: string;
|
|
967
|
+
/**
|
|
968
|
+
* An optional identifier for the HMR event, used for acknowledgment.
|
|
969
|
+
*/
|
|
970
|
+
id?: string;
|
|
971
|
+
}
|
|
972
|
+
/**
|
|
973
|
+
* Represents an HMR event in CommandKit.
|
|
974
|
+
*/
|
|
534
975
|
interface CommandKitHMREvent {
|
|
976
|
+
/**
|
|
977
|
+
* The type of HMR event.
|
|
978
|
+
*/
|
|
535
979
|
event: HMREventType;
|
|
980
|
+
/**
|
|
981
|
+
* The path associated with the HMR event.
|
|
982
|
+
*/
|
|
536
983
|
path: string;
|
|
984
|
+
/**
|
|
985
|
+
* Accepts the HMR event, indicating that it has been handled.
|
|
986
|
+
* This prevents further processing of the event.
|
|
987
|
+
*/
|
|
537
988
|
accept: () => void;
|
|
989
|
+
/**
|
|
990
|
+
* Prevents the default action for the HMR event.
|
|
991
|
+
* This can be used to stop further processing of the event.
|
|
992
|
+
*/
|
|
538
993
|
preventDefault: () => void;
|
|
539
994
|
}
|
|
995
|
+
/**
|
|
996
|
+
* Registers development hooks for CommandKit to handle HMR (Hot Module Replacement) events.
|
|
997
|
+
* @param commandkit - The CommandKit instance to register hooks for.
|
|
998
|
+
*/
|
|
540
999
|
declare function registerDevHooks(commandkit: CommandKit): void;
|
|
541
1000
|
//#endregion
|
|
542
1001
|
//#region src/plugins/RuntimePlugin.d.ts
|
|
1002
|
+
/**
|
|
1003
|
+
* CommandKit plugin that runs at the runtime.
|
|
1004
|
+
*/
|
|
543
1005
|
declare abstract class RuntimePlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CommandKitPluginRuntime> {
|
|
544
1006
|
readonly type = PluginType.Runtime;
|
|
545
1007
|
/**
|
|
@@ -648,28 +1110,80 @@ declare abstract class RuntimePlugin<T extends PluginOptions = PluginOptions> ex
|
|
|
648
1110
|
declare function isRuntimePlugin(plugin: unknown): plugin is RuntimePlugin;
|
|
649
1111
|
//#endregion
|
|
650
1112
|
//#region src/plugins/types.d.ts
|
|
1113
|
+
/**
|
|
1114
|
+
* Represents a CommandKit plugin that can be either a runtime or compiler plugin.
|
|
1115
|
+
*/
|
|
651
1116
|
type CommandKitPlugin = RuntimePlugin | CompilerPlugin;
|
|
1117
|
+
/**
|
|
1118
|
+
* @private
|
|
1119
|
+
*/
|
|
652
1120
|
type MaybeFalsey<T> = T | false | null | undefined;
|
|
1121
|
+
/**
|
|
1122
|
+
* Represents an event dispatched to the plugins.
|
|
1123
|
+
*/
|
|
653
1124
|
interface CommandKitEventDispatch {
|
|
1125
|
+
/**
|
|
1126
|
+
* The name of the event.
|
|
1127
|
+
*/
|
|
654
1128
|
name: string;
|
|
1129
|
+
/**
|
|
1130
|
+
* The arguments passed to the event.
|
|
1131
|
+
*/
|
|
655
1132
|
args: unknown[];
|
|
1133
|
+
/**
|
|
1134
|
+
* The namespace of the event, if any.
|
|
1135
|
+
*/
|
|
656
1136
|
namespace: string | null;
|
|
1137
|
+
/**
|
|
1138
|
+
* If this event runs only once, it will be set to true.
|
|
1139
|
+
*/
|
|
657
1140
|
once: boolean;
|
|
1141
|
+
/**
|
|
1142
|
+
* The additional metadata associated with the event.
|
|
1143
|
+
*/
|
|
658
1144
|
metadata: ParsedEvent;
|
|
1145
|
+
/**
|
|
1146
|
+
* Captures the owner of the event, preventing other plugins from handling it.
|
|
1147
|
+
*/
|
|
659
1148
|
accept(): void;
|
|
660
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Represents a template handler function that can be used to handle templates using `commandkit create` command.
|
|
1152
|
+
* @param args - The arguments passed to the template handler.
|
|
1153
|
+
*/
|
|
661
1154
|
type TemplateHandler = (args: string[]) => Promise<void> | void;
|
|
662
1155
|
//#endregion
|
|
663
1156
|
//#region src/plugins/CompilerPlugin.d.ts
|
|
1157
|
+
/**
|
|
1158
|
+
* The parameters for the transformation function of a compiler plugin.
|
|
1159
|
+
*/
|
|
664
1160
|
interface PluginTransformParameters {
|
|
1161
|
+
/**
|
|
1162
|
+
* The code to be transformed.
|
|
1163
|
+
*/
|
|
665
1164
|
code: string;
|
|
1165
|
+
/**
|
|
1166
|
+
* The filename of the code being transformed.
|
|
1167
|
+
*/
|
|
666
1168
|
id: string;
|
|
667
1169
|
}
|
|
668
1170
|
interface TransformedResult {
|
|
1171
|
+
/**
|
|
1172
|
+
* The transformed code.
|
|
1173
|
+
*/
|
|
669
1174
|
code?: string;
|
|
1175
|
+
/**
|
|
1176
|
+
* The source map for the transformed code, if applicable.
|
|
1177
|
+
*/
|
|
670
1178
|
map?: string | null;
|
|
671
1179
|
}
|
|
1180
|
+
/**
|
|
1181
|
+
* CommandKit plugin that runs at compile time.
|
|
1182
|
+
*/
|
|
672
1183
|
declare abstract class CompilerPlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CompilerPluginRuntime> {
|
|
1184
|
+
/**
|
|
1185
|
+
* The type of the plugin, which is Compiler.
|
|
1186
|
+
*/
|
|
673
1187
|
readonly type = PluginType.Compiler;
|
|
674
1188
|
/**
|
|
675
1189
|
* Called when transformation is requested to this plugin
|
|
@@ -678,12 +1192,27 @@ declare abstract class CompilerPlugin<T extends PluginOptions = PluginOptions> e
|
|
|
678
1192
|
*/
|
|
679
1193
|
transform(params: PluginTransformParameters): Promise<MaybeFalsey<TransformedResult>>;
|
|
680
1194
|
}
|
|
1195
|
+
/**
|
|
1196
|
+
* Type guard to check if the given object is a CompilerPlugin.
|
|
1197
|
+
* @param plugin The object to check.
|
|
1198
|
+
* @returns Boolean indicating whether the object is a CompilerPlugin.
|
|
1199
|
+
*/
|
|
681
1200
|
declare function isCompilerPlugin(plugin: unknown): plugin is CompilerPlugin;
|
|
682
1201
|
//#endregion
|
|
683
1202
|
//#region src/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts
|
|
1203
|
+
/**
|
|
1204
|
+
* Directive transformer plugin options
|
|
1205
|
+
*/
|
|
684
1206
|
type CommonDirectiveTransformerOptions = DirectiveTransformerOptions & {
|
|
1207
|
+
/**
|
|
1208
|
+
* Whether the directive transformer is enabled.
|
|
1209
|
+
* Defaults to true.
|
|
1210
|
+
*/
|
|
685
1211
|
enabled?: boolean;
|
|
686
1212
|
};
|
|
1213
|
+
/**
|
|
1214
|
+
* Common directive transformer plugin is a compiler plugin that transforms directives to higher-order functions.
|
|
1215
|
+
*/
|
|
687
1216
|
declare abstract class CommonDirectiveTransformer extends CompilerPlugin<CommonDirectiveTransformerOptions> {
|
|
688
1217
|
private transformer;
|
|
689
1218
|
activate(ctx: CompilerPluginRuntime): Promise<void>;
|
|
@@ -692,25 +1221,78 @@ declare abstract class CommonDirectiveTransformer extends CompilerPlugin<CommonD
|
|
|
692
1221
|
}
|
|
693
1222
|
//#endregion
|
|
694
1223
|
//#region src/plugins/plugin-runtime/CompilerPluginRuntime.d.ts
|
|
1224
|
+
/**
|
|
1225
|
+
* CompilerPluginRuntime is a runtime for managing compiler plugins in CommandKit.
|
|
1226
|
+
*/
|
|
695
1227
|
declare class CompilerPluginRuntime {
|
|
696
1228
|
#private;
|
|
697
1229
|
private readonly plugins;
|
|
698
1230
|
readonly name = "CompilerPluginRuntime";
|
|
699
1231
|
private initialized;
|
|
700
1232
|
private templates;
|
|
1233
|
+
/**
|
|
1234
|
+
* Creates a new instance of CompilerPluginRuntime.
|
|
1235
|
+
* @param plugins An array of compiler plugins to be managed by this runtime.
|
|
1236
|
+
*/
|
|
701
1237
|
constructor(plugins: CompilerPlugin[]);
|
|
1238
|
+
/**
|
|
1239
|
+
* Returns the plugins managed by this runtime.
|
|
1240
|
+
*/
|
|
702
1241
|
getPlugins(): CompilerPlugin<PluginOptions>[];
|
|
1242
|
+
/**
|
|
1243
|
+
* Checks if there are no plugins registered in this runtime.
|
|
1244
|
+
*/
|
|
703
1245
|
isEmpty(): boolean;
|
|
1246
|
+
/**
|
|
1247
|
+
* Registers a template handler for a given name.
|
|
1248
|
+
* This method must be called inside the activate() method of a plugin.
|
|
1249
|
+
* @param name - The name of the template to register.
|
|
1250
|
+
* @param handler - The handler function for the template.
|
|
1251
|
+
*/
|
|
704
1252
|
registerTemplate(name: string, handler: TemplateHandler): void;
|
|
1253
|
+
/**
|
|
1254
|
+
* Unregisters a template handler for a given name.
|
|
1255
|
+
* This method must be called inside the deactivate() method of a plugin.
|
|
1256
|
+
* @param name - The name of the template to unregister.
|
|
1257
|
+
*/
|
|
705
1258
|
unregisterTemplate(name: string): void;
|
|
1259
|
+
/**
|
|
1260
|
+
* Retrieves a template handler by its name.
|
|
1261
|
+
* @param name - The name of the template to retrieve.
|
|
1262
|
+
* @returns The template handler if found, otherwise undefined.
|
|
1263
|
+
*/
|
|
706
1264
|
getTemplate(name: string): TemplateHandler | undefined;
|
|
1265
|
+
/**
|
|
1266
|
+
* Returns a map of all registered templates with their handlers.
|
|
1267
|
+
* The keys are the template names and the values are the template handlers.
|
|
1268
|
+
*/
|
|
707
1269
|
getTemplates(): Map<string, TemplateHandler>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Transforms the given code using all registered plugins.
|
|
1272
|
+
* Each plugin's transform method is called in sequence, allowing them to modify the code.
|
|
1273
|
+
* @param code - The code to be transformed.
|
|
1274
|
+
* @param id - The identifier for the code being transformed (e.g., filename).
|
|
1275
|
+
* @returns An object containing the transformed code and an optional source map.
|
|
1276
|
+
*/
|
|
708
1277
|
transform(code: string, id: string): Promise<{
|
|
709
1278
|
code: string;
|
|
710
1279
|
map: string | null;
|
|
711
1280
|
}>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Initializes the plugin runtime by activating all registered plugins.
|
|
1283
|
+
* This method should be called once to set up the plugins.
|
|
1284
|
+
*/
|
|
712
1285
|
init(): Promise<void>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Destroys the plugin runtime by deactivating all registered plugins.
|
|
1288
|
+
* This method should be called when the runtime is no longer needed.
|
|
1289
|
+
*/
|
|
713
1290
|
destroy(): Promise<void>;
|
|
1291
|
+
/**
|
|
1292
|
+
* Converts the plugin runtime to a JSON representation.
|
|
1293
|
+
* This is useful for serialization or debugging purposes.
|
|
1294
|
+
* @returns An object containing the name of the runtime and the transform method.
|
|
1295
|
+
*/
|
|
714
1296
|
toJSON(): {
|
|
715
1297
|
name: string;
|
|
716
1298
|
transform: (code: string, id: string) => Promise<{
|
|
@@ -721,20 +1303,49 @@ declare class CompilerPluginRuntime {
|
|
|
721
1303
|
}
|
|
722
1304
|
//#endregion
|
|
723
1305
|
//#region src/plugins/plugin-runtime/runtime.d.ts
|
|
1306
|
+
/**
|
|
1307
|
+
* Common plugin runtime type that can be used in both command and compiler plugins.
|
|
1308
|
+
*/
|
|
724
1309
|
type CommonPluginRuntime = CommandKitPluginRuntime | CompilerPluginRuntime;
|
|
725
1310
|
//#endregion
|
|
726
1311
|
//#region src/plugins/PluginCommon.d.ts
|
|
1312
|
+
/**
|
|
1313
|
+
* The options for a CommandKit plugin.
|
|
1314
|
+
*/
|
|
727
1315
|
type PluginOptions = Record<string, any>;
|
|
1316
|
+
/**
|
|
1317
|
+
* Enum representing the type of plugin.
|
|
1318
|
+
* - Compiler: A plugin that runs at compile time.
|
|
1319
|
+
* - Runtime: A plugin that runs at runtime.
|
|
1320
|
+
*/
|
|
728
1321
|
declare enum PluginType {
|
|
729
1322
|
Compiler = "compiler",
|
|
730
1323
|
Runtime = "runtime",
|
|
731
1324
|
}
|
|
1325
|
+
/**
|
|
1326
|
+
* Base class for CommandKit plugins.
|
|
1327
|
+
*/
|
|
732
1328
|
declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C extends CommonPluginRuntime = CommonPluginRuntime> {
|
|
733
1329
|
protected readonly options: T;
|
|
1330
|
+
/**
|
|
1331
|
+
* The type of the plugin, either Compiler or Runtime.
|
|
1332
|
+
*/
|
|
734
1333
|
abstract readonly type: PluginType;
|
|
1334
|
+
/**
|
|
1335
|
+
* Unique identifier for the plugin instance.
|
|
1336
|
+
*/
|
|
735
1337
|
readonly id: `${string}-${string}-${string}-${string}-${string}`;
|
|
1338
|
+
/**
|
|
1339
|
+
* The time when the plugin was loaded, in milliseconds since the Unix epoch.
|
|
1340
|
+
*/
|
|
736
1341
|
readonly loadedAt: number;
|
|
1342
|
+
/**
|
|
1343
|
+
* The name of the plugin.
|
|
1344
|
+
*/
|
|
737
1345
|
abstract readonly name: string;
|
|
1346
|
+
/**
|
|
1347
|
+
* Creates a new instance of the plugin.
|
|
1348
|
+
*/
|
|
738
1349
|
constructor(options: T);
|
|
739
1350
|
/**
|
|
740
1351
|
* Called when this plugin is activated
|
|
@@ -745,20 +1356,71 @@ declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C e
|
|
|
745
1356
|
*/
|
|
746
1357
|
deactivate(ctx: C): Promise<void>;
|
|
747
1358
|
}
|
|
1359
|
+
/**
|
|
1360
|
+
* Whether the given object is a CommandKit plugin.
|
|
1361
|
+
* @param plugin The object to check.
|
|
1362
|
+
* @returns Boolean indicating whether the object is a plugin.
|
|
1363
|
+
*/
|
|
748
1364
|
declare function isPlugin(plugin: unknown): plugin is PluginCommon<PluginOptions>;
|
|
749
1365
|
//#endregion
|
|
750
1366
|
//#region src/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts
|
|
1367
|
+
/**
|
|
1368
|
+
* Represents the runtime environment for CommandKit plugins.
|
|
1369
|
+
*/
|
|
751
1370
|
declare class CommandKitPluginRuntime {
|
|
752
1371
|
readonly commandkit: CommandKit;
|
|
753
1372
|
private plugins;
|
|
1373
|
+
/**
|
|
1374
|
+
* Creates a new instance of CommandKitPluginRuntime.
|
|
1375
|
+
* @param commandkit The CommandKit instance associated with this runtime.
|
|
1376
|
+
*/
|
|
754
1377
|
constructor(commandkit: CommandKit);
|
|
1378
|
+
/**
|
|
1379
|
+
* Returns the plugins registered in this runtime.
|
|
1380
|
+
* @returns A collection of plugins.
|
|
1381
|
+
*/
|
|
755
1382
|
getPlugins(): Collection<string, RuntimePlugin<PluginOptions>>;
|
|
1383
|
+
/**
|
|
1384
|
+
* Checks if there are no plugins registered in this runtime.
|
|
1385
|
+
* @param pluginName The name of the plugin to check.
|
|
1386
|
+
* @returns Boolean indicating whether the runtime is empty.
|
|
1387
|
+
*/
|
|
756
1388
|
getPlugin(pluginName: string): RuntimePlugin | null;
|
|
1389
|
+
/**
|
|
1390
|
+
* Fetches the given plugin
|
|
1391
|
+
* @param plugin The plugin to be fetched.
|
|
1392
|
+
*/
|
|
1393
|
+
get<T extends Constructable<any>>(plugin: T): InstanceType<T> | null;
|
|
1394
|
+
/**
|
|
1395
|
+
* Soft registers a plugin in the runtime.
|
|
1396
|
+
* @param plugin The plugin to be registered.
|
|
1397
|
+
*/
|
|
757
1398
|
softRegisterPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1399
|
+
/**
|
|
1400
|
+
* Registers a plugin in the runtime.
|
|
1401
|
+
* @param plugin The plugin to be registered.
|
|
1402
|
+
* @throws If a plugin with the same name already exists.
|
|
1403
|
+
*/
|
|
758
1404
|
registerPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1405
|
+
/**
|
|
1406
|
+
* Unregisters a plugin from the runtime.
|
|
1407
|
+
* @param plugin The plugin to be unregistered.
|
|
1408
|
+
* @throws If the plugin does not exist.
|
|
1409
|
+
*/
|
|
759
1410
|
unregisterPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1411
|
+
/**
|
|
1412
|
+
* Unregisters all plugins from the runtime.
|
|
1413
|
+
*/
|
|
760
1414
|
unregisterAllPlugins(): Promise<void>;
|
|
1415
|
+
/**
|
|
1416
|
+
* Signals the runtime to allow the current plugin take ownership of the execution context.
|
|
1417
|
+
*/
|
|
761
1418
|
capture(): void;
|
|
1419
|
+
/**
|
|
1420
|
+
* Executes a function for each plugin in the runtime.
|
|
1421
|
+
* @param f The function to execute for each plugin.
|
|
1422
|
+
* @returns The result of the last executed function, or undefined if no plugins were executed.
|
|
1423
|
+
*/
|
|
762
1424
|
execute<R = any>(f: AsyncFunction<[CommandKitPluginRuntime, RuntimePlugin], R | undefined>): Promise<true | R | undefined>;
|
|
763
1425
|
}
|
|
764
1426
|
//#endregion
|
|
@@ -834,6 +1496,9 @@ declare class JsonFlagProvider implements FlagProvider {
|
|
|
834
1496
|
* Set the global flag provider for all feature flags
|
|
835
1497
|
*/
|
|
836
1498
|
declare function setFlagProvider(provider: FlagProvider): void;
|
|
1499
|
+
/**
|
|
1500
|
+
* @private
|
|
1501
|
+
*/
|
|
837
1502
|
type MaybePromise<T> = T | Promise<T>;
|
|
838
1503
|
/**
|
|
839
1504
|
* Function type for identifying entities in the context of feature flags.
|
|
@@ -887,6 +1552,9 @@ interface FeatureFlagDefinition<R, Entity> {
|
|
|
887
1552
|
*/
|
|
888
1553
|
disableAnalytics?: boolean;
|
|
889
1554
|
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Context for evaluating command flags in CommandKit.
|
|
1557
|
+
*/
|
|
890
1558
|
interface CommandFlagContext {
|
|
891
1559
|
/**
|
|
892
1560
|
* The Discord client instance.
|
|
@@ -934,6 +1602,9 @@ interface CommandFlagContext {
|
|
|
934
1602
|
*/
|
|
935
1603
|
event: null;
|
|
936
1604
|
}
|
|
1605
|
+
/**
|
|
1606
|
+
* Context for evaluating event flags in CommandKit.
|
|
1607
|
+
*/
|
|
937
1608
|
interface EventFlagContext {
|
|
938
1609
|
/**
|
|
939
1610
|
* The Discord client instance.
|
|
@@ -1050,40 +1721,128 @@ declare class FeatureFlag<R, T> {
|
|
|
1050
1721
|
declare function flag<Returns = boolean, Entity = Record<any, any>>(options: FeatureFlagDefinition<Returns, Entity>): FlagRunner<Entity, Returns>;
|
|
1051
1722
|
//#endregion
|
|
1052
1723
|
//#region src/flags/store.d.ts
|
|
1724
|
+
/**
|
|
1725
|
+
* Represents a store for feature flags.
|
|
1726
|
+
* This store extends the Collection class to manage feature flags by their keys.
|
|
1727
|
+
*/
|
|
1053
1728
|
declare class FlagStore extends Collection<string, FeatureFlag<any, any>> {}
|
|
1054
1729
|
//#endregion
|
|
1055
1730
|
//#region src/analytics/analytics-provider.d.ts
|
|
1731
|
+
/**
|
|
1732
|
+
* AnalyticsEvent interface represents an event that can be tracked by an analytics provider.
|
|
1733
|
+
* It includes the event name, an optional unique identifier, and a data object containing event-specific information.
|
|
1734
|
+
*/
|
|
1056
1735
|
interface AnalyticsEvent {
|
|
1057
1736
|
name: string;
|
|
1058
1737
|
id?: string;
|
|
1059
1738
|
data: Record<string, any>;
|
|
1060
1739
|
}
|
|
1740
|
+
/**
|
|
1741
|
+
* IdentifyEvent interface represents an event used to identify a user or entity in the analytics system.
|
|
1742
|
+
*/
|
|
1061
1743
|
type IdentifyEvent = Record<string, any>;
|
|
1744
|
+
/**
|
|
1745
|
+
* AnalyticsProvider interface defines the contract for analytics providers.
|
|
1746
|
+
*/
|
|
1062
1747
|
interface AnalyticsProvider {
|
|
1748
|
+
/**
|
|
1749
|
+
* The name of the analytics provider.
|
|
1750
|
+
* This is used for logging and identification purposes.
|
|
1751
|
+
*/
|
|
1063
1752
|
readonly name: string;
|
|
1753
|
+
/**
|
|
1754
|
+
* Initializes the analytics provider.
|
|
1755
|
+
* This method is called when the provider is registered.
|
|
1756
|
+
*/
|
|
1064
1757
|
track(engine: AnalyticsEngine, event: AnalyticsEvent): Promise<void>;
|
|
1758
|
+
/**
|
|
1759
|
+
* Identifies a user or entity with the analytics provider.
|
|
1760
|
+
* This method is called to associate user data with events.
|
|
1761
|
+
*/
|
|
1065
1762
|
identify?(engine: AnalyticsEngine, event: IdentifyEvent): Promise<void>;
|
|
1066
1763
|
}
|
|
1067
1764
|
//#endregion
|
|
1068
1765
|
//#region src/analytics/analytics-engine.d.ts
|
|
1766
|
+
/**
|
|
1767
|
+
* Filter function type for analytics events.
|
|
1768
|
+
* @param engine The analytics engine instance.
|
|
1769
|
+
* @param event The analytics event to filter.
|
|
1770
|
+
* @returns A boolean indicating whether the event should be tracked.
|
|
1771
|
+
*/
|
|
1069
1772
|
type FilterFunction = (engine: AnalyticsEngine, event: AnalyticsEvent) => boolean;
|
|
1773
|
+
/**
|
|
1774
|
+
* AnalyticsEngine class for managing analytics providers and tracking events.
|
|
1775
|
+
* This class allows you to register a provider, set a filter for events, and track or identify events.
|
|
1776
|
+
*/
|
|
1070
1777
|
declare class AnalyticsEngine {
|
|
1071
1778
|
#private;
|
|
1072
1779
|
readonly commandkit: CommandKit;
|
|
1780
|
+
/**
|
|
1781
|
+
* Creates an instance of the AnalyticsEngine.
|
|
1782
|
+
* @param commandkit The CommandKit instance.
|
|
1783
|
+
*/
|
|
1073
1784
|
constructor(commandkit: CommandKit);
|
|
1785
|
+
/**
|
|
1786
|
+
* Sets a filter function for analytics events.
|
|
1787
|
+
* This function will be called before tracking an event to determine if it should be tracked.
|
|
1788
|
+
* If the filter returns `false`, the event will not be tracked.
|
|
1789
|
+
* If the filter is set to `null`, all events will be tracked unless `doNotTrack` is enabled.
|
|
1790
|
+
* @param filter The filter function to set, or `null` to remove the filter.
|
|
1791
|
+
*/
|
|
1074
1792
|
setFilter(filter: FilterFunction | null): void;
|
|
1793
|
+
/**
|
|
1794
|
+
* Registers an analytics provider.
|
|
1795
|
+
* This provider will be used to track and identify events.
|
|
1796
|
+
* If a provider is already registered, it will be replaced with the new one.
|
|
1797
|
+
* @param provider The analytics provider to register.
|
|
1798
|
+
*/
|
|
1075
1799
|
registerProvider(provider: AnalyticsProvider): void;
|
|
1800
|
+
/**
|
|
1801
|
+
* Removes the currently registered analytics provider.
|
|
1802
|
+
* @param provider The analytics provider to remove.
|
|
1803
|
+
*/
|
|
1076
1804
|
removeProvider(provider: AnalyticsProvider): void;
|
|
1805
|
+
/**
|
|
1806
|
+
* Retrieves the currently registered analytics provider.
|
|
1807
|
+
* @returns The currently registered analytics provider, or `null` if no provider is registered.
|
|
1808
|
+
*/
|
|
1077
1809
|
getProvider(): AnalyticsProvider | null;
|
|
1810
|
+
/**
|
|
1811
|
+
* Identifies a user with the analytics provider.
|
|
1812
|
+
* This method sends an identify event to the provider, which can be used to associate user data with events.
|
|
1813
|
+
* @param event The identify event containing user data to send to the provider.
|
|
1814
|
+
*/
|
|
1078
1815
|
identify(event: IdentifyEvent): Promise<void>;
|
|
1816
|
+
/**
|
|
1817
|
+
* Tracks an analytics event with the registered provider.
|
|
1818
|
+
* This method sends the event to the provider, which can then process it as needed.
|
|
1819
|
+
* If the `doNotTrack` setting is enabled or if the filter function returns `false`, the event will not be tracked.
|
|
1820
|
+
* @param event The analytics event to track.
|
|
1821
|
+
*/
|
|
1079
1822
|
track(event: AnalyticsEvent): Promise<void>;
|
|
1080
1823
|
}
|
|
1081
1824
|
//#endregion
|
|
1082
1825
|
//#region src/CommandKit.d.ts
|
|
1826
|
+
/**
|
|
1827
|
+
* Configurations for the CommandKit instance.
|
|
1828
|
+
*/
|
|
1083
1829
|
interface CommandKitConfiguration {
|
|
1830
|
+
/**
|
|
1831
|
+
* The default locale for the CommandKit instance. This will be used to infer the locale of the guild or user if it has not been set explicitly.
|
|
1832
|
+
* @default Locale.EnglishUS
|
|
1833
|
+
*/
|
|
1084
1834
|
defaultLocale: Locale;
|
|
1835
|
+
/**
|
|
1836
|
+
* A function that returns the command prefix for a given message.
|
|
1837
|
+
* This is used to determine how to parse commands from messages.
|
|
1838
|
+
* @param message The message to get the command prefix for.
|
|
1839
|
+
* @returns The command prefix or an array of prefixes.
|
|
1840
|
+
*/
|
|
1085
1841
|
getMessageCommandPrefix: (message: Message) => Awaitable<string | string[]>;
|
|
1086
1842
|
}
|
|
1843
|
+
/**
|
|
1844
|
+
* Represents the function executed during the bootstrap phase of CommandKit.
|
|
1845
|
+
*/
|
|
1087
1846
|
type BootstrapFunction = GenericFunction<[CommandKit]> | AsyncFunction<[CommandKit]>;
|
|
1088
1847
|
/**
|
|
1089
1848
|
* Registers a bootstrap hook that will be called when the CommandKit instance is created.
|
|
@@ -1113,25 +1872,72 @@ declare function onBootstrap<F extends BootstrapFunction>(fn: F): void;
|
|
|
1113
1872
|
* ```
|
|
1114
1873
|
*/
|
|
1115
1874
|
declare function onApplicationBootstrap<F extends BootstrapFunction>(fn: F): void;
|
|
1875
|
+
/**
|
|
1876
|
+
* The commandkit class that serves as the main entry point for the CommandKit framework.
|
|
1877
|
+
*/
|
|
1116
1878
|
declare class CommandKit extends EventEmitter {
|
|
1117
1879
|
#private;
|
|
1880
|
+
/**
|
|
1881
|
+
* The event interceptor to quickly register temporary event listeners
|
|
1882
|
+
*/
|
|
1118
1883
|
eventInterceptor: EventInterceptor;
|
|
1884
|
+
/**
|
|
1885
|
+
* The static createElement function to create jsx elements
|
|
1886
|
+
*/
|
|
1119
1887
|
static readonly createElement: typeof createElement;
|
|
1888
|
+
/**
|
|
1889
|
+
* The static Fragment component to create jsx fragments
|
|
1890
|
+
*/
|
|
1120
1891
|
static readonly Fragment: typeof Fragment;
|
|
1892
|
+
/**
|
|
1893
|
+
* The configuration for the CommandKit instance.
|
|
1894
|
+
*/
|
|
1121
1895
|
readonly config: CommandKitConfiguration;
|
|
1896
|
+
/**
|
|
1897
|
+
* A key-value store for storing arbitrary data.
|
|
1898
|
+
*/
|
|
1122
1899
|
readonly store: Map<string, any>;
|
|
1900
|
+
/**
|
|
1901
|
+
* A flag store for storing flags that can be used to enable or disable features.
|
|
1902
|
+
*/
|
|
1123
1903
|
readonly flags: FlagStore;
|
|
1904
|
+
/**
|
|
1905
|
+
* The command router for the CommandKit instance.
|
|
1906
|
+
*/
|
|
1124
1907
|
commandsRouter: CommandsRouter;
|
|
1908
|
+
/**
|
|
1909
|
+
* The events router for the CommandKit instance.
|
|
1910
|
+
*/
|
|
1125
1911
|
eventsRouter: EventsRouter;
|
|
1912
|
+
/**
|
|
1913
|
+
* The command handler for the CommandKit instance.
|
|
1914
|
+
* This is responsible for handling commands and their execution.
|
|
1915
|
+
*/
|
|
1126
1916
|
commandHandler: AppCommandHandler;
|
|
1917
|
+
/**
|
|
1918
|
+
* The event handler for the CommandKit instance.
|
|
1919
|
+
* This is responsible for handling events and their execution.
|
|
1920
|
+
*/
|
|
1127
1921
|
eventHandler: AppEventsHandler;
|
|
1922
|
+
/**
|
|
1923
|
+
* The plugins runtime for the CommandKit instance.
|
|
1924
|
+
*/
|
|
1128
1925
|
plugins: CommandKitPluginRuntime;
|
|
1926
|
+
/**
|
|
1927
|
+
* The events channel for the CommandKit instance. This can be used to emit custom events.
|
|
1928
|
+
*/
|
|
1129
1929
|
events: CommandKitEventsChannel;
|
|
1930
|
+
/**
|
|
1931
|
+
* The analytics engine for the CommandKit instance.
|
|
1932
|
+
* This is responsible for tracking events and user interactions.
|
|
1933
|
+
*/
|
|
1130
1934
|
analytics: AnalyticsEngine;
|
|
1935
|
+
/**
|
|
1936
|
+
* The static instance of CommandKit.
|
|
1937
|
+
*/
|
|
1131
1938
|
static instance: CommandKit | undefined;
|
|
1132
1939
|
/**
|
|
1133
1940
|
* Create a new command and event handler with CommandKit.
|
|
1134
|
-
*
|
|
1135
1941
|
* @param options - The default CommandKit configuration.
|
|
1136
1942
|
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
1137
1943
|
*/
|
|
@@ -1191,9 +1997,17 @@ declare class CommandKit extends EventEmitter {
|
|
|
1191
1997
|
* - `./src/app`
|
|
1192
1998
|
*/
|
|
1193
1999
|
getAppDirectory(): string | null;
|
|
2000
|
+
/**
|
|
2001
|
+
* Get the path to the commands or events directory.
|
|
2002
|
+
* @param to The type of path to get, either 'commands' or 'events'.
|
|
2003
|
+
* @returns The path to the commands or events directory
|
|
2004
|
+
*/
|
|
1194
2005
|
getPath(to: 'commands' | 'events'): string | null;
|
|
1195
2006
|
}
|
|
2007
|
+
/**
|
|
2008
|
+
* The singleton instance of CommandKit.
|
|
2009
|
+
*/
|
|
1196
2010
|
declare const commandkit: CommandKit;
|
|
1197
2011
|
//#endregion
|
|
1198
|
-
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommandHandler, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
1199
|
-
//# sourceMappingURL=CommandKit-
|
|
2012
|
+
export { AnalyticsEngine, AnalyticsEvent, AnalyticsProvider, AnyCommandExecute, AppCommand, AppCommandHandler, AppCommandNative, AppCommandRunner, AppEventsHandler, AppEventsHandlerLoadedData, AsyncFunction, AutocompleteCommand, AutocompleteCommandContext, AutocompleteCommandMiddlewareContext, BootstrapFunction, ChatInputCommand, ChatInputCommandContext, CommandBuilderLike, CommandContext, CommandContextOptions, CommandData, CommandExecutionMode, CommandFlagContext, CommandKit, CommandKitConfiguration, CommandKitEnvironment, CommandKitEnvironmentInternalData, CommandKitEnvironmentType, CommandKitEventDispatch, CommandKitEventsChannel, CommandKitHMREvent, CommandKitOptions, CommandKitPlugin, CommandKitPluginRuntime, CommandRegistrar, CommandTypeData, CommonDirectiveTransformer, CommonDirectiveTransformerOptions, CommonPluginRuntime, CompilerPlugin, CompilerPluginRuntime, Context, ContextParameters, CustomAppCommandProps, CustomEvaluationContext, CustomEvaluationFunction, DecideFunction, EvaluationContext, EventFlagContext, EventListener, FeatureFlag, FeatureFlagDefinition, FilterFunction, FlagConfiguration, FlagProvider, FlagRunner, FlagStore, GenericFunction, IdentifyEvent, IdentifyFunction, InteractionCommandContext, InteractionCommandMiddlewareContext, IpcMessageCommand, JsonFlagProvider, ListenerFunction, LoadedCommand, LoadedEvent, MaybeFalsey, MaybePromise, MessageCommand, MessageCommandContext, MessageCommandMiddlewareContext, MessageContextMenuCommand, MessageContextMenuCommandContext, MessageContextMenuCommandMiddlewareContext, MiddlewareContext, MiddlewareContextArgs, PluginCommon, PluginOptions, PluginTransformParameters, PluginType, PreRegisterCommandsEvent, PreparedAppCommandExecution, ResolvableCommand, RunCommand, RunCommandOptions, RuntimePlugin, SlashCommandMiddlewareContext, TemplateHandler, TransformedResult, UserContextMenuCommand, UserContextMenuCommandContext, UserContextMenuCommandMiddlewareContext, after, cancelAfter, commandkit, exitContext, flag, getCommandKit, getContext, isCommandWorkerContext, isCompilerPlugin, isPlugin, isRuntimePlugin, makeContextAwareFunction, onApplicationBootstrap, onBootstrap, provideContext, registerDevHooks, setFlagProvider, useEnvironment };
|
|
2013
|
+
//# sourceMappingURL=CommandKit-g7NqIdUD.d.ts.map
|