commandkit 1.0.0-dev.20250611020404 → 1.0.0-dev.20250611125312
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/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-B-mjdP5x.d.ts → CommandKit-BkMUDbou.d.ts} +806 -9
- package/dist/{CommandKit-CnLBu_7m.js → CommandKit-C0W3U6jh.js} +621 -20
- package/dist/CommandKit-C0W3U6jh.js.map +1 -0
- 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-DoFZMT8u.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 +25 -25
- 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 +25 -25
- 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 +25 -25
- 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-CWrpkal-.js} +14 -6
- package/dist/build-CWrpkal-.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-aCpqqs1C.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-CLZLGnAs.js} +4 -4
- package/dist/feature-flags-CLZLGnAs.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-_FwacDcI.js} +6 -6
- package/dist/{init-BDgyvx9E.js.map → init-_FwacDcI.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-DjL43eQS.d.ts → types-DwmPE0nY.d.ts} +2 -2
- package/dist/{types-package-CTSNSM93.js → types-package-BpY3acyl.js} +8 -2
- package/dist/types-package-BpY3acyl.js.map +1 -0
- package/dist/types.d.ts +25 -25
- package/dist/{utilities-DQT4lzAB.d.ts → utilities-D_MFPmTe.d.ts} +45 -2
- package/dist/utils/colors.d.ts +2 -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-IYtoeTur.js → utils-C8a_hMvn.js} +5 -1
- package/dist/utils-C8a_hMvn.js.map +1 -0
- package/dist/{utils-VCdd7XhD.d.ts → utils-DS6OiGvg.d.ts} +12 -2
- package/dist/{version-CS1EiTrw.js → version-IoXx-oYe.js} +5 -2
- package/dist/version-IoXx-oYe.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 +2 -2
- 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,9 +1,9 @@
|
|
|
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
8
|
import { AutocompleteInteraction, Awaitable, CacheType, ChatInputCommandInteraction, Client, ClientEvents, Collection, ContextMenuCommandBuilder, ContextMenuCommandInteraction, Guild, Interaction, Locale, Message, MessageContextMenuCommandInteraction, RESTPostAPIApplicationCommandsJSONBody, SlashCommandBuilder, TextBasedChannel, UserContextMenuCommandInteraction } from "discord.js";
|
|
9
9
|
import { DirectiveTransformerOptions } from "directive-to-hof";
|
|
@@ -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,42 @@ declare class MiddlewareContext<T extends CommandExecutionMode = CommandExecutio
|
|
|
410
587
|
}
|
|
411
588
|
//#endregion
|
|
412
589
|
//#region src/app/commands/AppCommandRunner.d.ts
|
|
590
|
+
/**
|
|
591
|
+
* Handles the execution of application commands for CommandKit.
|
|
592
|
+
* Manages middleware execution, environment setup, and command invocation.
|
|
593
|
+
*/
|
|
413
594
|
declare class AppCommandRunner {
|
|
414
595
|
#private;
|
|
415
596
|
private handler;
|
|
597
|
+
/**
|
|
598
|
+
* Creates a new AppCommandRunner instance.
|
|
599
|
+
* @param handler - The app command handler instance to use for command execution
|
|
600
|
+
*/
|
|
416
601
|
constructor(handler: AppCommandHandler);
|
|
602
|
+
/**
|
|
603
|
+
* Executes a prepared command with middleware support and environment setup.
|
|
604
|
+
* Handles the complete command lifecycle including before/after middleware execution.
|
|
605
|
+
* @param prepared - The prepared command execution data
|
|
606
|
+
* @param source - The source interaction or message that triggered the command
|
|
607
|
+
*/
|
|
417
608
|
runCommand(prepared: PreparedAppCommandExecution, source: Interaction | Message): Promise<void>;
|
|
609
|
+
/**
|
|
610
|
+
* Determines the execution mode based on the source of the command.
|
|
611
|
+
* @param source - The interaction or message that triggered the command
|
|
612
|
+
* @returns The appropriate command execution mode
|
|
613
|
+
*/
|
|
418
614
|
getExecutionMode(source: Interaction | Message): CommandExecutionMode;
|
|
419
615
|
}
|
|
420
616
|
//#endregion
|
|
421
617
|
//#region src/app/handlers/AppCommandHandler.d.ts
|
|
618
|
+
/**
|
|
619
|
+
* Function type for wrapping command execution with custom logic.
|
|
620
|
+
*/
|
|
422
621
|
type RunCommand = <T extends AsyncFunction>(fn: T) => T;
|
|
622
|
+
/**
|
|
623
|
+
* @private
|
|
624
|
+
* @internal
|
|
625
|
+
*/
|
|
423
626
|
interface AppCommandNative {
|
|
424
627
|
command: SlashCommandBuilder | Record<string, any>;
|
|
425
628
|
chatInput?: (ctx: Context) => Awaitable<unknown>;
|
|
@@ -428,61 +631,198 @@ interface AppCommandNative {
|
|
|
428
631
|
messageContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
429
632
|
userContextMenu?: (ctx: Context) => Awaitable<unknown>;
|
|
430
633
|
}
|
|
634
|
+
/**
|
|
635
|
+
* @private
|
|
636
|
+
* @internal
|
|
637
|
+
*/
|
|
431
638
|
type AppCommand = AppCommandNative & Record<string, any>;
|
|
639
|
+
/**
|
|
640
|
+
* @private
|
|
641
|
+
* @internal
|
|
642
|
+
*/
|
|
432
643
|
interface AppCommandMiddleware {
|
|
433
644
|
beforeExecute: (ctx: Context) => Awaitable<unknown>;
|
|
434
645
|
afterExecute: (ctx: Context) => Awaitable<unknown>;
|
|
435
646
|
}
|
|
647
|
+
/**
|
|
648
|
+
* Represents a loaded command with its metadata and configuration.
|
|
649
|
+
*/
|
|
436
650
|
interface LoadedCommand {
|
|
437
651
|
command: Command;
|
|
438
652
|
data: AppCommand;
|
|
439
653
|
guilds?: string[];
|
|
440
654
|
}
|
|
655
|
+
/**
|
|
656
|
+
* Type representing command data identifier.
|
|
657
|
+
*/
|
|
441
658
|
type CommandTypeData = string;
|
|
659
|
+
/**
|
|
660
|
+
* Type for commands that can be resolved by the handler.
|
|
661
|
+
*/
|
|
442
662
|
type ResolvableCommand = CommandTypeData | (string & {});
|
|
663
|
+
/**
|
|
664
|
+
* @private
|
|
665
|
+
* @internal
|
|
666
|
+
*/
|
|
443
667
|
interface LoadedMiddleware {
|
|
444
668
|
middleware: Middleware;
|
|
445
669
|
data: AppCommandMiddleware;
|
|
446
670
|
}
|
|
671
|
+
/**
|
|
672
|
+
* Represents a prepared command execution with all necessary data and middleware.
|
|
673
|
+
*/
|
|
447
674
|
interface PreparedAppCommandExecution {
|
|
448
675
|
command: LoadedCommand;
|
|
449
676
|
middlewares: LoadedMiddleware[];
|
|
450
677
|
messageCommandParser?: MessageCommandParser;
|
|
451
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* Type representing command builder objects supported by CommandKit.
|
|
681
|
+
*/
|
|
452
682
|
type CommandBuilderLike = SlashCommandBuilder | ContextMenuCommandBuilder | Record<string, any>;
|
|
683
|
+
/**
|
|
684
|
+
* Handles application commands for CommandKit, including loading, registration, and execution.
|
|
685
|
+
* Manages both slash commands and message commands with middleware support.
|
|
686
|
+
*/
|
|
453
687
|
declare class AppCommandHandler {
|
|
454
688
|
readonly commandkit: CommandKit;
|
|
689
|
+
/**
|
|
690
|
+
* @private
|
|
691
|
+
* @internal
|
|
692
|
+
*/
|
|
455
693
|
private loadedCommands;
|
|
694
|
+
/**
|
|
695
|
+
* @private
|
|
696
|
+
* @internal
|
|
697
|
+
*/
|
|
456
698
|
private loadedMiddlewares;
|
|
699
|
+
/**
|
|
700
|
+
* @private
|
|
701
|
+
* @internal
|
|
702
|
+
*/
|
|
457
703
|
private commandNameToId;
|
|
704
|
+
/**
|
|
705
|
+
* @private
|
|
706
|
+
* @internal
|
|
707
|
+
*/
|
|
458
708
|
private subcommandPathToId;
|
|
709
|
+
/**
|
|
710
|
+
* Command registrar for handling Discord API registration.
|
|
711
|
+
*/
|
|
459
712
|
readonly registrar: CommandRegistrar;
|
|
713
|
+
/**
|
|
714
|
+
* @private
|
|
715
|
+
* @internal
|
|
716
|
+
*/
|
|
460
717
|
private onInteraction;
|
|
718
|
+
/**
|
|
719
|
+
* @private
|
|
720
|
+
* @internal
|
|
721
|
+
*/
|
|
461
722
|
private onMessageCreate;
|
|
723
|
+
/**
|
|
724
|
+
* Command runner instance for executing commands.
|
|
725
|
+
*/
|
|
462
726
|
readonly commandRunner: AppCommandRunner;
|
|
727
|
+
/**
|
|
728
|
+
* External command data storage.
|
|
729
|
+
*/
|
|
463
730
|
readonly externalCommandData: Collection<string, Command>;
|
|
731
|
+
/**
|
|
732
|
+
* External middleware data storage.
|
|
733
|
+
*/
|
|
464
734
|
readonly externalMiddlewareData: Collection<string, Middleware>;
|
|
735
|
+
/**
|
|
736
|
+
* Creates a new AppCommandHandler instance.
|
|
737
|
+
* @param commandkit - The CommandKit instance
|
|
738
|
+
*/
|
|
465
739
|
constructor(commandkit: CommandKit);
|
|
740
|
+
/**
|
|
741
|
+
* Prints a formatted banner showing all loaded commands organized by category.
|
|
742
|
+
*/
|
|
466
743
|
printBanner(): void;
|
|
744
|
+
/**
|
|
745
|
+
* Gets an array of all loaded commands.
|
|
746
|
+
* @returns Array of loaded commands
|
|
747
|
+
*/
|
|
467
748
|
getCommandsArray(): LoadedCommand[];
|
|
749
|
+
/**
|
|
750
|
+
* Registers event handlers for Discord interactions and messages.
|
|
751
|
+
*/
|
|
468
752
|
registerCommandHandler(): void;
|
|
753
|
+
/**
|
|
754
|
+
* Prepares a command for execution by resolving the command and its middleware.
|
|
755
|
+
* @param source - The interaction or message that triggered the command
|
|
756
|
+
* @param cmdName - Optional command name override
|
|
757
|
+
* @returns Prepared command execution data or null if command not found
|
|
758
|
+
*/
|
|
469
759
|
prepareCommandRun(source: Interaction | Message, cmdName?: string): Promise<PreparedAppCommandExecution | null>;
|
|
760
|
+
/**
|
|
761
|
+
* Reloads all commands and middleware from scratch.
|
|
762
|
+
*/
|
|
470
763
|
reloadCommands(): Promise<void>;
|
|
764
|
+
/**
|
|
765
|
+
* Adds external middleware data to be loaded.
|
|
766
|
+
* @param data - Array of middleware data to add
|
|
767
|
+
*/
|
|
471
768
|
addExternalMiddleware(data: Middleware[]): Promise<void>;
|
|
769
|
+
/**
|
|
770
|
+
* Adds external command data to be loaded.
|
|
771
|
+
* @param data - Array of command data to add
|
|
772
|
+
*/
|
|
472
773
|
addExternalCommands(data: Command[]): Promise<void>;
|
|
774
|
+
/**
|
|
775
|
+
* Registers externally loaded middleware.
|
|
776
|
+
* @param data - Array of loaded middleware to register
|
|
777
|
+
*/
|
|
473
778
|
registerExternalLoadedMiddleware(data: LoadedMiddleware[]): Promise<void>;
|
|
779
|
+
/**
|
|
780
|
+
* Registers externally loaded commands.
|
|
781
|
+
* @param data - Array of loaded commands to register
|
|
782
|
+
*/
|
|
474
783
|
registerExternalLoadedCommands(data: LoadedCommand[]): Promise<void>;
|
|
784
|
+
/**
|
|
785
|
+
* Loads all commands and middleware from the router.
|
|
786
|
+
*/
|
|
475
787
|
loadCommands(): Promise<void>;
|
|
788
|
+
/**
|
|
789
|
+
* @private
|
|
790
|
+
* @internal
|
|
791
|
+
*/
|
|
476
792
|
private loadMiddleware;
|
|
793
|
+
/**
|
|
794
|
+
* @private
|
|
795
|
+
* @internal
|
|
796
|
+
*/
|
|
477
797
|
private loadCommand;
|
|
478
798
|
}
|
|
479
799
|
//#endregion
|
|
480
800
|
//#region src/events/CommandKitEventsChannel.d.ts
|
|
801
|
+
/**
|
|
802
|
+
* The function type for event listeners.
|
|
803
|
+
*/
|
|
481
804
|
type ListenerFunction = GenericFunction | AsyncFunction;
|
|
805
|
+
/**
|
|
806
|
+
* Represents a channel for emitting and listening to events in CommandKit.
|
|
807
|
+
* This class provides methods to manage event listeners and emit events
|
|
808
|
+
* within a specific namespace.
|
|
809
|
+
*/
|
|
482
810
|
declare class CommandKitEventsChannel {
|
|
483
811
|
readonly commandkit: CommandKit;
|
|
484
812
|
private emitter;
|
|
813
|
+
/**
|
|
814
|
+
* Creates a new instance of CommandKitEventsChannel.
|
|
815
|
+
* @param commandkit The CommandKit instance that this channel belongs to.
|
|
816
|
+
*/
|
|
485
817
|
constructor(commandkit: CommandKit);
|
|
818
|
+
/**
|
|
819
|
+
* Creates a namespaced event channel. This allows you to manage events
|
|
820
|
+
* within a specific namespace, preventing conflicts with other event channels.
|
|
821
|
+
* This is useful for organizing events related to different parts of your application.
|
|
822
|
+
* @param namespace The namespace for the event channel.
|
|
823
|
+
* @returns An object containing methods for managing events within the namespace.
|
|
824
|
+
* @example commandkit.events.to('customNamespace').emit('eventName', data);
|
|
825
|
+
*/
|
|
486
826
|
to(namespace: string): {
|
|
487
827
|
on: (event: string, listener: ListenerFunction) => void;
|
|
488
828
|
off: (event: string, listener: ListenerFunction) => void;
|
|
@@ -490,19 +830,56 @@ declare class CommandKitEventsChannel {
|
|
|
490
830
|
emit: (event: string, ...args: any[]) => boolean;
|
|
491
831
|
removeAllListeners: (event: string) => void;
|
|
492
832
|
};
|
|
833
|
+
/**
|
|
834
|
+
* Register an event listener for a specific event within the namespace.
|
|
835
|
+
* @param namespace The namespace for the event channel.
|
|
836
|
+
* @param event The name of the event to listen for.
|
|
837
|
+
* @param listener The function to call when the event is emitted.
|
|
838
|
+
*/
|
|
493
839
|
on(namespace: string, event: string, listener: ListenerFunction): void;
|
|
840
|
+
/**
|
|
841
|
+
* Unregister an event listener for a specific event within the namespace.
|
|
842
|
+
* @param namespace The namespace for the event channel.
|
|
843
|
+
* @param event The name of the event to stop listening for.
|
|
844
|
+
* @param listener The function that was registered as the listener.
|
|
845
|
+
*/
|
|
494
846
|
off(namespace: string, event: string, listener: ListenerFunction): void;
|
|
847
|
+
/**
|
|
848
|
+
* Register an event listener that will be called only once for a specific event
|
|
849
|
+
* within the namespace.
|
|
850
|
+
* @param namespace The namespace for the event channel.
|
|
851
|
+
* @param event The name of the event to listen for.
|
|
852
|
+
* @param listener The function to call when the event is emitted.
|
|
853
|
+
*/
|
|
495
854
|
once(namespace: string, event: string, listener: ListenerFunction): void;
|
|
855
|
+
/**
|
|
856
|
+
* Emit an event within the specified namespace, calling all registered listeners.
|
|
857
|
+
* @param namespace The namespace for the event channel.
|
|
858
|
+
* @param event The name of the event to emit.
|
|
859
|
+
* @param args The arguments to pass to the listeners.
|
|
860
|
+
* @returns A boolean indicating whether any listeners were called.
|
|
861
|
+
*/
|
|
496
862
|
emit(namespace: string, event: string, ...args: any[]): boolean;
|
|
863
|
+
/**
|
|
864
|
+
* Remove all listeners for a specific event or all events within the namespace.
|
|
865
|
+
* @param namespace The namespace for the event channel.
|
|
866
|
+
* @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.
|
|
867
|
+
*/
|
|
497
868
|
removeAllListeners(namespace: string): void;
|
|
498
869
|
removeAllListeners(namespace: string, event: string): void;
|
|
499
870
|
}
|
|
500
871
|
//#endregion
|
|
501
872
|
//#region src/app/handlers/AppEventsHandler.d.ts
|
|
873
|
+
/**
|
|
874
|
+
* Represents an event listener with its configuration.
|
|
875
|
+
*/
|
|
502
876
|
type EventListener = {
|
|
503
877
|
handler: ListenerFunction;
|
|
504
878
|
once: boolean;
|
|
505
879
|
};
|
|
880
|
+
/**
|
|
881
|
+
* Represents a loaded event with all its listeners.
|
|
882
|
+
*/
|
|
506
883
|
interface LoadedEvent {
|
|
507
884
|
name: string;
|
|
508
885
|
namespace: string | null;
|
|
@@ -511,6 +888,9 @@ interface LoadedEvent {
|
|
|
511
888
|
mainListener?: EventListener;
|
|
512
889
|
executedOnceListeners?: Set<ListenerFunction>;
|
|
513
890
|
}
|
|
891
|
+
/**
|
|
892
|
+
* Data structure representing loaded event information for external consumption.
|
|
893
|
+
*/
|
|
514
894
|
interface AppEventsHandlerLoadedData {
|
|
515
895
|
name: string;
|
|
516
896
|
namespace: string | null;
|
|
@@ -518,28 +898,99 @@ interface AppEventsHandlerLoadedData {
|
|
|
518
898
|
regularListeners: number;
|
|
519
899
|
metadata: ParsedEvent;
|
|
520
900
|
}
|
|
901
|
+
/**
|
|
902
|
+
* Handles Discord.js events and CommandKit custom events with support for namespacing and middleware.
|
|
903
|
+
*/
|
|
521
904
|
declare class AppEventsHandler {
|
|
522
905
|
readonly commandkit: CommandKit;
|
|
906
|
+
/**
|
|
907
|
+
* @private
|
|
908
|
+
* @internal
|
|
909
|
+
*/
|
|
523
910
|
private loadedEvents;
|
|
911
|
+
/**
|
|
912
|
+
* Creates a new AppEventsHandler instance.
|
|
913
|
+
* @param commandkit - The CommandKit instance
|
|
914
|
+
*/
|
|
524
915
|
constructor(commandkit: CommandKit);
|
|
916
|
+
/**
|
|
917
|
+
* Gets information about all loaded events.
|
|
918
|
+
* @returns Array of loaded event data
|
|
919
|
+
*/
|
|
525
920
|
getEvents(): AppEventsHandlerLoadedData[];
|
|
921
|
+
/**
|
|
922
|
+
* Reloads all events by unregistering existing ones and loading them again.
|
|
923
|
+
*/
|
|
526
924
|
reloadEvents(): Promise<void>;
|
|
925
|
+
/**
|
|
926
|
+
* Loads all events from the events router and registers them with Discord.js client.
|
|
927
|
+
*/
|
|
527
928
|
loadEvents(): Promise<void>;
|
|
929
|
+
/**
|
|
930
|
+
* Unregisters all event listeners and clears loaded events.
|
|
931
|
+
*/
|
|
528
932
|
unregisterAll(): void;
|
|
933
|
+
/**
|
|
934
|
+
* Registers all loaded events with the Discord.js client and CommandKit event system.
|
|
935
|
+
*/
|
|
529
936
|
registerAllClientEvents(): void;
|
|
937
|
+
/**
|
|
938
|
+
* Unregisters all client event listeners and cleans up loaded events.
|
|
939
|
+
*/
|
|
530
940
|
unregisterAllClientListeners(): void;
|
|
531
941
|
}
|
|
532
942
|
//#endregion
|
|
533
943
|
//#region src/utils/dev-hooks.d.ts
|
|
944
|
+
/**
|
|
945
|
+
* Represents HMR inter-process communication messages.
|
|
946
|
+
*/
|
|
947
|
+
interface IpcMessageCommand {
|
|
948
|
+
/**
|
|
949
|
+
* The type of HMR event being communicated.
|
|
950
|
+
*/
|
|
951
|
+
event: HMREventType;
|
|
952
|
+
/**
|
|
953
|
+
* The path associated with the HMR event.
|
|
954
|
+
*/
|
|
955
|
+
path: string;
|
|
956
|
+
/**
|
|
957
|
+
* An optional identifier for the HMR event, used for acknowledgment.
|
|
958
|
+
*/
|
|
959
|
+
id?: string;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Represents an HMR event in CommandKit.
|
|
963
|
+
*/
|
|
534
964
|
interface CommandKitHMREvent {
|
|
965
|
+
/**
|
|
966
|
+
* The type of HMR event.
|
|
967
|
+
*/
|
|
535
968
|
event: HMREventType;
|
|
969
|
+
/**
|
|
970
|
+
* The path associated with the HMR event.
|
|
971
|
+
*/
|
|
536
972
|
path: string;
|
|
973
|
+
/**
|
|
974
|
+
* Accepts the HMR event, indicating that it has been handled.
|
|
975
|
+
* This prevents further processing of the event.
|
|
976
|
+
*/
|
|
537
977
|
accept: () => void;
|
|
978
|
+
/**
|
|
979
|
+
* Prevents the default action for the HMR event.
|
|
980
|
+
* This can be used to stop further processing of the event.
|
|
981
|
+
*/
|
|
538
982
|
preventDefault: () => void;
|
|
539
983
|
}
|
|
984
|
+
/**
|
|
985
|
+
* Registers development hooks for CommandKit to handle HMR (Hot Module Replacement) events.
|
|
986
|
+
* @param commandkit - The CommandKit instance to register hooks for.
|
|
987
|
+
*/
|
|
540
988
|
declare function registerDevHooks(commandkit: CommandKit): void;
|
|
541
989
|
//#endregion
|
|
542
990
|
//#region src/plugins/RuntimePlugin.d.ts
|
|
991
|
+
/**
|
|
992
|
+
* CommandKit plugin that runs at the runtime.
|
|
993
|
+
*/
|
|
543
994
|
declare abstract class RuntimePlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CommandKitPluginRuntime> {
|
|
544
995
|
readonly type = PluginType.Runtime;
|
|
545
996
|
/**
|
|
@@ -648,28 +1099,80 @@ declare abstract class RuntimePlugin<T extends PluginOptions = PluginOptions> ex
|
|
|
648
1099
|
declare function isRuntimePlugin(plugin: unknown): plugin is RuntimePlugin;
|
|
649
1100
|
//#endregion
|
|
650
1101
|
//#region src/plugins/types.d.ts
|
|
1102
|
+
/**
|
|
1103
|
+
* Represents a CommandKit plugin that can be either a runtime or compiler plugin.
|
|
1104
|
+
*/
|
|
651
1105
|
type CommandKitPlugin = RuntimePlugin | CompilerPlugin;
|
|
1106
|
+
/**
|
|
1107
|
+
* @private
|
|
1108
|
+
*/
|
|
652
1109
|
type MaybeFalsey<T> = T | false | null | undefined;
|
|
1110
|
+
/**
|
|
1111
|
+
* Represents an event dispatched to the plugins.
|
|
1112
|
+
*/
|
|
653
1113
|
interface CommandKitEventDispatch {
|
|
1114
|
+
/**
|
|
1115
|
+
* The name of the event.
|
|
1116
|
+
*/
|
|
654
1117
|
name: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* The arguments passed to the event.
|
|
1120
|
+
*/
|
|
655
1121
|
args: unknown[];
|
|
1122
|
+
/**
|
|
1123
|
+
* The namespace of the event, if any.
|
|
1124
|
+
*/
|
|
656
1125
|
namespace: string | null;
|
|
1126
|
+
/**
|
|
1127
|
+
* If this event runs only once, it will be set to true.
|
|
1128
|
+
*/
|
|
657
1129
|
once: boolean;
|
|
1130
|
+
/**
|
|
1131
|
+
* The additional metadata associated with the event.
|
|
1132
|
+
*/
|
|
658
1133
|
metadata: ParsedEvent;
|
|
1134
|
+
/**
|
|
1135
|
+
* Captures the owner of the event, preventing other plugins from handling it.
|
|
1136
|
+
*/
|
|
659
1137
|
accept(): void;
|
|
660
1138
|
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Represents a template handler function that can be used to handle templates using `commandkit create` command.
|
|
1141
|
+
* @param args - The arguments passed to the template handler.
|
|
1142
|
+
*/
|
|
661
1143
|
type TemplateHandler = (args: string[]) => Promise<void> | void;
|
|
662
1144
|
//#endregion
|
|
663
1145
|
//#region src/plugins/CompilerPlugin.d.ts
|
|
1146
|
+
/**
|
|
1147
|
+
* The parameters for the transformation function of a compiler plugin.
|
|
1148
|
+
*/
|
|
664
1149
|
interface PluginTransformParameters {
|
|
1150
|
+
/**
|
|
1151
|
+
* The code to be transformed.
|
|
1152
|
+
*/
|
|
665
1153
|
code: string;
|
|
1154
|
+
/**
|
|
1155
|
+
* The filename of the code being transformed.
|
|
1156
|
+
*/
|
|
666
1157
|
id: string;
|
|
667
1158
|
}
|
|
668
1159
|
interface TransformedResult {
|
|
1160
|
+
/**
|
|
1161
|
+
* The transformed code.
|
|
1162
|
+
*/
|
|
669
1163
|
code?: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* The source map for the transformed code, if applicable.
|
|
1166
|
+
*/
|
|
670
1167
|
map?: string | null;
|
|
671
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* CommandKit plugin that runs at compile time.
|
|
1171
|
+
*/
|
|
672
1172
|
declare abstract class CompilerPlugin<T extends PluginOptions = PluginOptions> extends PluginCommon<T, CompilerPluginRuntime> {
|
|
1173
|
+
/**
|
|
1174
|
+
* The type of the plugin, which is Compiler.
|
|
1175
|
+
*/
|
|
673
1176
|
readonly type = PluginType.Compiler;
|
|
674
1177
|
/**
|
|
675
1178
|
* Called when transformation is requested to this plugin
|
|
@@ -678,12 +1181,27 @@ declare abstract class CompilerPlugin<T extends PluginOptions = PluginOptions> e
|
|
|
678
1181
|
*/
|
|
679
1182
|
transform(params: PluginTransformParameters): Promise<MaybeFalsey<TransformedResult>>;
|
|
680
1183
|
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Type guard to check if the given object is a CompilerPlugin.
|
|
1186
|
+
* @param plugin The object to check.
|
|
1187
|
+
* @returns Boolean indicating whether the object is a CompilerPlugin.
|
|
1188
|
+
*/
|
|
681
1189
|
declare function isCompilerPlugin(plugin: unknown): plugin is CompilerPlugin;
|
|
682
1190
|
//#endregion
|
|
683
1191
|
//#region src/plugins/plugin-runtime/builtin/CommonDirectiveTransformer.d.ts
|
|
1192
|
+
/**
|
|
1193
|
+
* Directive transformer plugin options
|
|
1194
|
+
*/
|
|
684
1195
|
type CommonDirectiveTransformerOptions = DirectiveTransformerOptions & {
|
|
1196
|
+
/**
|
|
1197
|
+
* Whether the directive transformer is enabled.
|
|
1198
|
+
* Defaults to true.
|
|
1199
|
+
*/
|
|
685
1200
|
enabled?: boolean;
|
|
686
1201
|
};
|
|
1202
|
+
/**
|
|
1203
|
+
* Common directive transformer plugin is a compiler plugin that transforms directives to higher-order functions.
|
|
1204
|
+
*/
|
|
687
1205
|
declare abstract class CommonDirectiveTransformer extends CompilerPlugin<CommonDirectiveTransformerOptions> {
|
|
688
1206
|
private transformer;
|
|
689
1207
|
activate(ctx: CompilerPluginRuntime): Promise<void>;
|
|
@@ -692,25 +1210,78 @@ declare abstract class CommonDirectiveTransformer extends CompilerPlugin<CommonD
|
|
|
692
1210
|
}
|
|
693
1211
|
//#endregion
|
|
694
1212
|
//#region src/plugins/plugin-runtime/CompilerPluginRuntime.d.ts
|
|
1213
|
+
/**
|
|
1214
|
+
* CompilerPluginRuntime is a runtime for managing compiler plugins in CommandKit.
|
|
1215
|
+
*/
|
|
695
1216
|
declare class CompilerPluginRuntime {
|
|
696
1217
|
#private;
|
|
697
1218
|
private readonly plugins;
|
|
698
1219
|
readonly name = "CompilerPluginRuntime";
|
|
699
1220
|
private initialized;
|
|
700
1221
|
private templates;
|
|
1222
|
+
/**
|
|
1223
|
+
* Creates a new instance of CompilerPluginRuntime.
|
|
1224
|
+
* @param plugins An array of compiler plugins to be managed by this runtime.
|
|
1225
|
+
*/
|
|
701
1226
|
constructor(plugins: CompilerPlugin[]);
|
|
1227
|
+
/**
|
|
1228
|
+
* Returns the plugins managed by this runtime.
|
|
1229
|
+
*/
|
|
702
1230
|
getPlugins(): CompilerPlugin<PluginOptions>[];
|
|
1231
|
+
/**
|
|
1232
|
+
* Checks if there are no plugins registered in this runtime.
|
|
1233
|
+
*/
|
|
703
1234
|
isEmpty(): boolean;
|
|
1235
|
+
/**
|
|
1236
|
+
* Registers a template handler for a given name.
|
|
1237
|
+
* This method must be called inside the activate() method of a plugin.
|
|
1238
|
+
* @param name - The name of the template to register.
|
|
1239
|
+
* @param handler - The handler function for the template.
|
|
1240
|
+
*/
|
|
704
1241
|
registerTemplate(name: string, handler: TemplateHandler): void;
|
|
1242
|
+
/**
|
|
1243
|
+
* Unregisters a template handler for a given name.
|
|
1244
|
+
* This method must be called inside the deactivate() method of a plugin.
|
|
1245
|
+
* @param name - The name of the template to unregister.
|
|
1246
|
+
*/
|
|
705
1247
|
unregisterTemplate(name: string): void;
|
|
1248
|
+
/**
|
|
1249
|
+
* Retrieves a template handler by its name.
|
|
1250
|
+
* @param name - The name of the template to retrieve.
|
|
1251
|
+
* @returns The template handler if found, otherwise undefined.
|
|
1252
|
+
*/
|
|
706
1253
|
getTemplate(name: string): TemplateHandler | undefined;
|
|
1254
|
+
/**
|
|
1255
|
+
* Returns a map of all registered templates with their handlers.
|
|
1256
|
+
* The keys are the template names and the values are the template handlers.
|
|
1257
|
+
*/
|
|
707
1258
|
getTemplates(): Map<string, TemplateHandler>;
|
|
1259
|
+
/**
|
|
1260
|
+
* Transforms the given code using all registered plugins.
|
|
1261
|
+
* Each plugin's transform method is called in sequence, allowing them to modify the code.
|
|
1262
|
+
* @param code - The code to be transformed.
|
|
1263
|
+
* @param id - The identifier for the code being transformed (e.g., filename).
|
|
1264
|
+
* @returns An object containing the transformed code and an optional source map.
|
|
1265
|
+
*/
|
|
708
1266
|
transform(code: string, id: string): Promise<{
|
|
709
1267
|
code: string;
|
|
710
1268
|
map: string | null;
|
|
711
1269
|
}>;
|
|
1270
|
+
/**
|
|
1271
|
+
* Initializes the plugin runtime by activating all registered plugins.
|
|
1272
|
+
* This method should be called once to set up the plugins.
|
|
1273
|
+
*/
|
|
712
1274
|
init(): Promise<void>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Destroys the plugin runtime by deactivating all registered plugins.
|
|
1277
|
+
* This method should be called when the runtime is no longer needed.
|
|
1278
|
+
*/
|
|
713
1279
|
destroy(): Promise<void>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Converts the plugin runtime to a JSON representation.
|
|
1282
|
+
* This is useful for serialization or debugging purposes.
|
|
1283
|
+
* @returns An object containing the name of the runtime and the transform method.
|
|
1284
|
+
*/
|
|
714
1285
|
toJSON(): {
|
|
715
1286
|
name: string;
|
|
716
1287
|
transform: (code: string, id: string) => Promise<{
|
|
@@ -721,20 +1292,49 @@ declare class CompilerPluginRuntime {
|
|
|
721
1292
|
}
|
|
722
1293
|
//#endregion
|
|
723
1294
|
//#region src/plugins/plugin-runtime/runtime.d.ts
|
|
1295
|
+
/**
|
|
1296
|
+
* Common plugin runtime type that can be used in both command and compiler plugins.
|
|
1297
|
+
*/
|
|
724
1298
|
type CommonPluginRuntime = CommandKitPluginRuntime | CompilerPluginRuntime;
|
|
725
1299
|
//#endregion
|
|
726
1300
|
//#region src/plugins/PluginCommon.d.ts
|
|
1301
|
+
/**
|
|
1302
|
+
* The options for a CommandKit plugin.
|
|
1303
|
+
*/
|
|
727
1304
|
type PluginOptions = Record<string, any>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Enum representing the type of plugin.
|
|
1307
|
+
* - Compiler: A plugin that runs at compile time.
|
|
1308
|
+
* - Runtime: A plugin that runs at runtime.
|
|
1309
|
+
*/
|
|
728
1310
|
declare enum PluginType {
|
|
729
1311
|
Compiler = "compiler",
|
|
730
1312
|
Runtime = "runtime",
|
|
731
1313
|
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Base class for CommandKit plugins.
|
|
1316
|
+
*/
|
|
732
1317
|
declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C extends CommonPluginRuntime = CommonPluginRuntime> {
|
|
733
1318
|
protected readonly options: T;
|
|
1319
|
+
/**
|
|
1320
|
+
* The type of the plugin, either Compiler or Runtime.
|
|
1321
|
+
*/
|
|
734
1322
|
abstract readonly type: PluginType;
|
|
1323
|
+
/**
|
|
1324
|
+
* Unique identifier for the plugin instance.
|
|
1325
|
+
*/
|
|
735
1326
|
readonly id: `${string}-${string}-${string}-${string}-${string}`;
|
|
1327
|
+
/**
|
|
1328
|
+
* The time when the plugin was loaded, in milliseconds since the Unix epoch.
|
|
1329
|
+
*/
|
|
736
1330
|
readonly loadedAt: number;
|
|
1331
|
+
/**
|
|
1332
|
+
* The name of the plugin.
|
|
1333
|
+
*/
|
|
737
1334
|
abstract readonly name: string;
|
|
1335
|
+
/**
|
|
1336
|
+
* Creates a new instance of the plugin.
|
|
1337
|
+
*/
|
|
738
1338
|
constructor(options: T);
|
|
739
1339
|
/**
|
|
740
1340
|
* Called when this plugin is activated
|
|
@@ -745,20 +1345,65 @@ declare abstract class PluginCommon<T extends PluginOptions = PluginOptions, C e
|
|
|
745
1345
|
*/
|
|
746
1346
|
deactivate(ctx: C): Promise<void>;
|
|
747
1347
|
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Whether the given object is a CommandKit plugin.
|
|
1350
|
+
* @param plugin The object to check.
|
|
1351
|
+
* @returns Boolean indicating whether the object is a plugin.
|
|
1352
|
+
*/
|
|
748
1353
|
declare function isPlugin(plugin: unknown): plugin is PluginCommon<PluginOptions>;
|
|
749
1354
|
//#endregion
|
|
750
1355
|
//#region src/plugins/plugin-runtime/CommandKitPluginRuntime.d.ts
|
|
1356
|
+
/**
|
|
1357
|
+
* Represents the runtime environment for CommandKit plugins.
|
|
1358
|
+
*/
|
|
751
1359
|
declare class CommandKitPluginRuntime {
|
|
752
1360
|
readonly commandkit: CommandKit;
|
|
753
1361
|
private plugins;
|
|
1362
|
+
/**
|
|
1363
|
+
* Creates a new instance of CommandKitPluginRuntime.
|
|
1364
|
+
* @param commandkit The CommandKit instance associated with this runtime.
|
|
1365
|
+
*/
|
|
754
1366
|
constructor(commandkit: CommandKit);
|
|
1367
|
+
/**
|
|
1368
|
+
* Returns the plugins registered in this runtime.
|
|
1369
|
+
* @returns A collection of plugins.
|
|
1370
|
+
*/
|
|
755
1371
|
getPlugins(): Collection<string, RuntimePlugin<PluginOptions>>;
|
|
1372
|
+
/**
|
|
1373
|
+
* Checks if there are no plugins registered in this runtime.
|
|
1374
|
+
* @returns Boolean indicating whether the runtime is empty.
|
|
1375
|
+
*/
|
|
756
1376
|
getPlugin(pluginName: string): RuntimePlugin | null;
|
|
1377
|
+
/**
|
|
1378
|
+
* Soft registers a plugin in the runtime.
|
|
1379
|
+
* @param plugin The plugin to be registered.
|
|
1380
|
+
*/
|
|
757
1381
|
softRegisterPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Registers a plugin in the runtime.
|
|
1384
|
+
* @param plugin The plugin to be registered.
|
|
1385
|
+
* @throws If a plugin with the same name already exists.
|
|
1386
|
+
*/
|
|
758
1387
|
registerPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Unregisters a plugin from the runtime.
|
|
1390
|
+
* @param plugin The plugin to be unregistered.
|
|
1391
|
+
* @throws If the plugin does not exist.
|
|
1392
|
+
*/
|
|
759
1393
|
unregisterPlugin(plugin: RuntimePlugin): Promise<void>;
|
|
1394
|
+
/**
|
|
1395
|
+
* Unregisters all plugins from the runtime.
|
|
1396
|
+
*/
|
|
760
1397
|
unregisterAllPlugins(): Promise<void>;
|
|
1398
|
+
/**
|
|
1399
|
+
* Signals the runtime to allow the current plugin take ownership of the execution context.
|
|
1400
|
+
*/
|
|
761
1401
|
capture(): void;
|
|
1402
|
+
/**
|
|
1403
|
+
* Executes a function for each plugin in the runtime.
|
|
1404
|
+
* @param f The function to execute for each plugin.
|
|
1405
|
+
* @returns The result of the last executed function, or undefined if no plugins were executed.
|
|
1406
|
+
*/
|
|
762
1407
|
execute<R = any>(f: AsyncFunction<[CommandKitPluginRuntime, RuntimePlugin], R | undefined>): Promise<true | R | undefined>;
|
|
763
1408
|
}
|
|
764
1409
|
//#endregion
|
|
@@ -834,6 +1479,9 @@ declare class JsonFlagProvider implements FlagProvider {
|
|
|
834
1479
|
* Set the global flag provider for all feature flags
|
|
835
1480
|
*/
|
|
836
1481
|
declare function setFlagProvider(provider: FlagProvider): void;
|
|
1482
|
+
/**
|
|
1483
|
+
* @private
|
|
1484
|
+
*/
|
|
837
1485
|
type MaybePromise<T> = T | Promise<T>;
|
|
838
1486
|
/**
|
|
839
1487
|
* Function type for identifying entities in the context of feature flags.
|
|
@@ -887,6 +1535,9 @@ interface FeatureFlagDefinition<R, Entity> {
|
|
|
887
1535
|
*/
|
|
888
1536
|
disableAnalytics?: boolean;
|
|
889
1537
|
}
|
|
1538
|
+
/**
|
|
1539
|
+
* Context for evaluating command flags in CommandKit.
|
|
1540
|
+
*/
|
|
890
1541
|
interface CommandFlagContext {
|
|
891
1542
|
/**
|
|
892
1543
|
* The Discord client instance.
|
|
@@ -934,6 +1585,9 @@ interface CommandFlagContext {
|
|
|
934
1585
|
*/
|
|
935
1586
|
event: null;
|
|
936
1587
|
}
|
|
1588
|
+
/**
|
|
1589
|
+
* Context for evaluating event flags in CommandKit.
|
|
1590
|
+
*/
|
|
937
1591
|
interface EventFlagContext {
|
|
938
1592
|
/**
|
|
939
1593
|
* The Discord client instance.
|
|
@@ -1050,40 +1704,128 @@ declare class FeatureFlag<R, T> {
|
|
|
1050
1704
|
declare function flag<Returns = boolean, Entity = Record<any, any>>(options: FeatureFlagDefinition<Returns, Entity>): FlagRunner<Entity, Returns>;
|
|
1051
1705
|
//#endregion
|
|
1052
1706
|
//#region src/flags/store.d.ts
|
|
1707
|
+
/**
|
|
1708
|
+
* Represents a store for feature flags.
|
|
1709
|
+
* This store extends the Collection class to manage feature flags by their keys.
|
|
1710
|
+
*/
|
|
1053
1711
|
declare class FlagStore extends Collection<string, FeatureFlag<any, any>> {}
|
|
1054
1712
|
//#endregion
|
|
1055
1713
|
//#region src/analytics/analytics-provider.d.ts
|
|
1714
|
+
/**
|
|
1715
|
+
* AnalyticsEvent interface represents an event that can be tracked by an analytics provider.
|
|
1716
|
+
* It includes the event name, an optional unique identifier, and a data object containing event-specific information.
|
|
1717
|
+
*/
|
|
1056
1718
|
interface AnalyticsEvent {
|
|
1057
1719
|
name: string;
|
|
1058
1720
|
id?: string;
|
|
1059
1721
|
data: Record<string, any>;
|
|
1060
1722
|
}
|
|
1723
|
+
/**
|
|
1724
|
+
* IdentifyEvent interface represents an event used to identify a user or entity in the analytics system.
|
|
1725
|
+
*/
|
|
1061
1726
|
type IdentifyEvent = Record<string, any>;
|
|
1727
|
+
/**
|
|
1728
|
+
* AnalyticsProvider interface defines the contract for analytics providers.
|
|
1729
|
+
*/
|
|
1062
1730
|
interface AnalyticsProvider {
|
|
1731
|
+
/**
|
|
1732
|
+
* The name of the analytics provider.
|
|
1733
|
+
* This is used for logging and identification purposes.
|
|
1734
|
+
*/
|
|
1063
1735
|
readonly name: string;
|
|
1736
|
+
/**
|
|
1737
|
+
* Initializes the analytics provider.
|
|
1738
|
+
* This method is called when the provider is registered.
|
|
1739
|
+
*/
|
|
1064
1740
|
track(engine: AnalyticsEngine, event: AnalyticsEvent): Promise<void>;
|
|
1741
|
+
/**
|
|
1742
|
+
* Identifies a user or entity with the analytics provider.
|
|
1743
|
+
* This method is called to associate user data with events.
|
|
1744
|
+
*/
|
|
1065
1745
|
identify?(engine: AnalyticsEngine, event: IdentifyEvent): Promise<void>;
|
|
1066
1746
|
}
|
|
1067
1747
|
//#endregion
|
|
1068
1748
|
//#region src/analytics/analytics-engine.d.ts
|
|
1749
|
+
/**
|
|
1750
|
+
* Filter function type for analytics events.
|
|
1751
|
+
* @param engine The analytics engine instance.
|
|
1752
|
+
* @param event The analytics event to filter.
|
|
1753
|
+
* @returns A boolean indicating whether the event should be tracked.
|
|
1754
|
+
*/
|
|
1069
1755
|
type FilterFunction = (engine: AnalyticsEngine, event: AnalyticsEvent) => boolean;
|
|
1756
|
+
/**
|
|
1757
|
+
* AnalyticsEngine class for managing analytics providers and tracking events.
|
|
1758
|
+
* This class allows you to register a provider, set a filter for events, and track or identify events.
|
|
1759
|
+
*/
|
|
1070
1760
|
declare class AnalyticsEngine {
|
|
1071
1761
|
#private;
|
|
1072
1762
|
readonly commandkit: CommandKit;
|
|
1763
|
+
/**
|
|
1764
|
+
* Creates an instance of the AnalyticsEngine.
|
|
1765
|
+
* @param commandkit The CommandKit instance.
|
|
1766
|
+
*/
|
|
1073
1767
|
constructor(commandkit: CommandKit);
|
|
1768
|
+
/**
|
|
1769
|
+
* Sets a filter function for analytics events.
|
|
1770
|
+
* This function will be called before tracking an event to determine if it should be tracked.
|
|
1771
|
+
* If the filter returns `false`, the event will not be tracked.
|
|
1772
|
+
* If the filter is set to `null`, all events will be tracked unless `doNotTrack` is enabled.
|
|
1773
|
+
* @param filter The filter function to set, or `null` to remove the filter.
|
|
1774
|
+
*/
|
|
1074
1775
|
setFilter(filter: FilterFunction | null): void;
|
|
1776
|
+
/**
|
|
1777
|
+
* Registers an analytics provider.
|
|
1778
|
+
* This provider will be used to track and identify events.
|
|
1779
|
+
* If a provider is already registered, it will be replaced with the new one.
|
|
1780
|
+
* @param provider The analytics provider to register.
|
|
1781
|
+
*/
|
|
1075
1782
|
registerProvider(provider: AnalyticsProvider): void;
|
|
1783
|
+
/**
|
|
1784
|
+
* Removes the currently registered analytics provider.
|
|
1785
|
+
* @param provider The analytics provider to remove.
|
|
1786
|
+
*/
|
|
1076
1787
|
removeProvider(provider: AnalyticsProvider): void;
|
|
1788
|
+
/**
|
|
1789
|
+
* Retrieves the currently registered analytics provider.
|
|
1790
|
+
* @returns The currently registered analytics provider, or `null` if no provider is registered.
|
|
1791
|
+
*/
|
|
1077
1792
|
getProvider(): AnalyticsProvider | null;
|
|
1793
|
+
/**
|
|
1794
|
+
* Identifies a user with the analytics provider.
|
|
1795
|
+
* This method sends an identify event to the provider, which can be used to associate user data with events.
|
|
1796
|
+
* @param event The identify event containing user data to send to the provider.
|
|
1797
|
+
*/
|
|
1078
1798
|
identify(event: IdentifyEvent): Promise<void>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Tracks an analytics event with the registered provider.
|
|
1801
|
+
* This method sends the event to the provider, which can then process it as needed.
|
|
1802
|
+
* If the `doNotTrack` setting is enabled or if the filter function returns `false`, the event will not be tracked.
|
|
1803
|
+
* @param event The analytics event to track.
|
|
1804
|
+
*/
|
|
1079
1805
|
track(event: AnalyticsEvent): Promise<void>;
|
|
1080
1806
|
}
|
|
1081
1807
|
//#endregion
|
|
1082
1808
|
//#region src/CommandKit.d.ts
|
|
1809
|
+
/**
|
|
1810
|
+
* Configurations for the CommandKit instance.
|
|
1811
|
+
*/
|
|
1083
1812
|
interface CommandKitConfiguration {
|
|
1813
|
+
/**
|
|
1814
|
+
* 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.
|
|
1815
|
+
* @default Locale.EnglishUS
|
|
1816
|
+
*/
|
|
1084
1817
|
defaultLocale: Locale;
|
|
1818
|
+
/**
|
|
1819
|
+
* A function that returns the command prefix for a given message.
|
|
1820
|
+
* This is used to determine how to parse commands from messages.
|
|
1821
|
+
* @param message The message to get the command prefix for.
|
|
1822
|
+
* @returns The command prefix or an array of prefixes.
|
|
1823
|
+
*/
|
|
1085
1824
|
getMessageCommandPrefix: (message: Message) => Awaitable<string | string[]>;
|
|
1086
1825
|
}
|
|
1826
|
+
/**
|
|
1827
|
+
* Represents the function executed during the bootstrap phase of CommandKit.
|
|
1828
|
+
*/
|
|
1087
1829
|
type BootstrapFunction = GenericFunction<[CommandKit]> | AsyncFunction<[CommandKit]>;
|
|
1088
1830
|
/**
|
|
1089
1831
|
* Registers a bootstrap hook that will be called when the CommandKit instance is created.
|
|
@@ -1113,25 +1855,72 @@ declare function onBootstrap<F extends BootstrapFunction>(fn: F): void;
|
|
|
1113
1855
|
* ```
|
|
1114
1856
|
*/
|
|
1115
1857
|
declare function onApplicationBootstrap<F extends BootstrapFunction>(fn: F): void;
|
|
1858
|
+
/**
|
|
1859
|
+
* The commandkit class that serves as the main entry point for the CommandKit framework.
|
|
1860
|
+
*/
|
|
1116
1861
|
declare class CommandKit extends EventEmitter {
|
|
1117
1862
|
#private;
|
|
1863
|
+
/**
|
|
1864
|
+
* The event interceptor to quickly register temporary event listeners
|
|
1865
|
+
*/
|
|
1118
1866
|
eventInterceptor: EventInterceptor;
|
|
1867
|
+
/**
|
|
1868
|
+
* The static createElement function to create jsx elements
|
|
1869
|
+
*/
|
|
1119
1870
|
static readonly createElement: typeof createElement;
|
|
1871
|
+
/**
|
|
1872
|
+
* The static Fragment component to create jsx fragments
|
|
1873
|
+
*/
|
|
1120
1874
|
static readonly Fragment: typeof Fragment;
|
|
1875
|
+
/**
|
|
1876
|
+
* The configuration for the CommandKit instance.
|
|
1877
|
+
*/
|
|
1121
1878
|
readonly config: CommandKitConfiguration;
|
|
1879
|
+
/**
|
|
1880
|
+
* A key-value store for storing arbitrary data.
|
|
1881
|
+
*/
|
|
1122
1882
|
readonly store: Map<string, any>;
|
|
1883
|
+
/**
|
|
1884
|
+
* A flag store for storing flags that can be used to enable or disable features.
|
|
1885
|
+
*/
|
|
1123
1886
|
readonly flags: FlagStore;
|
|
1887
|
+
/**
|
|
1888
|
+
* The command router for the CommandKit instance.
|
|
1889
|
+
*/
|
|
1124
1890
|
commandsRouter: CommandsRouter;
|
|
1891
|
+
/**
|
|
1892
|
+
* The events router for the CommandKit instance.
|
|
1893
|
+
*/
|
|
1125
1894
|
eventsRouter: EventsRouter;
|
|
1895
|
+
/**
|
|
1896
|
+
* The command handler for the CommandKit instance.
|
|
1897
|
+
* This is responsible for handling commands and their execution.
|
|
1898
|
+
*/
|
|
1126
1899
|
commandHandler: AppCommandHandler;
|
|
1900
|
+
/**
|
|
1901
|
+
* The event handler for the CommandKit instance.
|
|
1902
|
+
* This is responsible for handling events and their execution.
|
|
1903
|
+
*/
|
|
1127
1904
|
eventHandler: AppEventsHandler;
|
|
1905
|
+
/**
|
|
1906
|
+
* The plugins runtime for the CommandKit instance.
|
|
1907
|
+
*/
|
|
1128
1908
|
plugins: CommandKitPluginRuntime;
|
|
1909
|
+
/**
|
|
1910
|
+
* The events channel for the CommandKit instance. This can be used to emit custom events.
|
|
1911
|
+
*/
|
|
1129
1912
|
events: CommandKitEventsChannel;
|
|
1913
|
+
/**
|
|
1914
|
+
* The analytics engine for the CommandKit instance.
|
|
1915
|
+
* This is responsible for tracking events and user interactions.
|
|
1916
|
+
*/
|
|
1130
1917
|
analytics: AnalyticsEngine;
|
|
1918
|
+
/**
|
|
1919
|
+
* The static instance of CommandKit.
|
|
1920
|
+
*/
|
|
1131
1921
|
static instance: CommandKit | undefined;
|
|
1132
1922
|
/**
|
|
1133
1923
|
* Create a new command and event handler with CommandKit.
|
|
1134
|
-
*
|
|
1135
1924
|
* @param options - The default CommandKit configuration.
|
|
1136
1925
|
* @see {@link https://commandkit.js.org/docs/guide/commandkit-setup}
|
|
1137
1926
|
*/
|
|
@@ -1191,9 +1980,17 @@ declare class CommandKit extends EventEmitter {
|
|
|
1191
1980
|
* - `./src/app`
|
|
1192
1981
|
*/
|
|
1193
1982
|
getAppDirectory(): string | null;
|
|
1983
|
+
/**
|
|
1984
|
+
* Get the path to the commands or events directory.
|
|
1985
|
+
* @param to The type of path to get, either 'commands' or 'events'.
|
|
1986
|
+
* @returns The path to the commands or events directory
|
|
1987
|
+
*/
|
|
1194
1988
|
getPath(to: 'commands' | 'events'): string | null;
|
|
1195
1989
|
}
|
|
1990
|
+
/**
|
|
1991
|
+
* The singleton instance of CommandKit.
|
|
1992
|
+
*/
|
|
1196
1993
|
declare const commandkit: CommandKit;
|
|
1197
1994
|
//#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-
|
|
1995
|
+
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, IpcMessageCommand, 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 };
|
|
1996
|
+
//# sourceMappingURL=CommandKit-BkMUDbou.d.ts.map
|