oopscord.js 0.0.30 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +674 -201
  2. package/README.md +212 -11
  3. package/dist/index.js +18 -1
  4. package/dist/index.js.map +1 -0
  5. package/dist/structures/Constants.d.ts +2 -2
  6. package/dist/structures/Constants.d.ts.map +1 -1
  7. package/dist/structures/Constants.js +6 -2
  8. package/dist/structures/Constants.js.map +1 -0
  9. package/dist/structures/DiscordApp.d.ts +28 -10
  10. package/dist/structures/DiscordApp.d.ts.map +1 -1
  11. package/dist/structures/DiscordApp.js +695 -316
  12. package/dist/structures/DiscordApp.js.map +1 -0
  13. package/dist/structures/Plugin.d.ts +68 -0
  14. package/dist/structures/Plugin.d.ts.map +1 -1
  15. package/dist/structures/Plugin.js +32 -1
  16. package/dist/structures/Plugin.js.map +1 -0
  17. package/dist/structures/PluginManager.d.ts +122 -0
  18. package/dist/structures/PluginManager.d.ts.map +1 -0
  19. package/dist/structures/PluginManager.js +371 -0
  20. package/dist/structures/PluginManager.js.map +1 -0
  21. package/dist/structures/components/BaseButton.d.ts +2 -5
  22. package/dist/structures/components/BaseButton.d.ts.map +1 -1
  23. package/dist/structures/components/BaseButton.js +21 -22
  24. package/dist/structures/components/BaseButton.js.map +1 -0
  25. package/dist/structures/components/BaseModal.d.ts +13 -21
  26. package/dist/structures/components/BaseModal.d.ts.map +1 -1
  27. package/dist/structures/components/BaseModal.js +98 -137
  28. package/dist/structures/components/BaseModal.js.map +1 -0
  29. package/dist/structures/components/BaseSelectMenu.d.ts +2 -5
  30. package/dist/structures/components/BaseSelectMenu.d.ts.map +1 -1
  31. package/dist/structures/components/BaseSelectMenu.js +35 -35
  32. package/dist/structures/components/BaseSelectMenu.js.map +1 -0
  33. package/dist/structures/components/Listener.js +6 -1
  34. package/dist/structures/components/Listener.js.map +1 -0
  35. package/dist/structures/components/index.js +21 -4
  36. package/dist/structures/components/index.js.map +1 -0
  37. package/dist/structures/decorators/CommandDecorator.d.ts +38 -37
  38. package/dist/structures/decorators/CommandDecorator.d.ts.map +1 -1
  39. package/dist/structures/decorators/CommandDecorator.js +206 -280
  40. package/dist/structures/decorators/CommandDecorator.js.map +1 -0
  41. package/dist/structures/decorators/Constants.d.ts +7 -5
  42. package/dist/structures/decorators/Constants.d.ts.map +1 -1
  43. package/dist/structures/decorators/Constants.js +37 -31
  44. package/dist/structures/decorators/Constants.js.map +1 -0
  45. package/dist/structures/decorators/DiscordModuleDecorator.d.ts +7 -2
  46. package/dist/structures/decorators/DiscordModuleDecorator.d.ts.map +1 -1
  47. package/dist/structures/decorators/DiscordModuleDecorator.js +16 -33
  48. package/dist/structures/decorators/DiscordModuleDecorator.js.map +1 -0
  49. package/dist/structures/decorators/EventDecorator.d.ts +3 -2
  50. package/dist/structures/decorators/EventDecorator.d.ts.map +1 -1
  51. package/dist/structures/decorators/EventDecorator.js +19 -11
  52. package/dist/structures/decorators/EventDecorator.js.map +1 -0
  53. package/dist/structures/decorators/ExecutionDecorator.d.ts +19 -0
  54. package/dist/structures/decorators/ExecutionDecorator.d.ts.map +1 -0
  55. package/dist/structures/decorators/ExecutionDecorator.js +23 -0
  56. package/dist/structures/decorators/ExecutionDecorator.js.map +1 -0
  57. package/dist/structures/decorators/InjectionMetadata.d.ts +35 -0
  58. package/dist/structures/decorators/InjectionMetadata.d.ts.map +1 -0
  59. package/dist/structures/decorators/InjectionMetadata.js +34 -0
  60. package/dist/structures/decorators/InjectionMetadata.js.map +1 -0
  61. package/dist/structures/decorators/InteractionHandlerDecorator.d.ts +17 -2
  62. package/dist/structures/decorators/InteractionHandlerDecorator.d.ts.map +1 -1
  63. package/dist/structures/decorators/InteractionHandlerDecorator.js +53 -8
  64. package/dist/structures/decorators/InteractionHandlerDecorator.js.map +1 -0
  65. package/dist/structures/decorators/MessageComponentDecorator.d.ts +24 -39
  66. package/dist/structures/decorators/MessageComponentDecorator.d.ts.map +1 -1
  67. package/dist/structures/decorators/MessageComponentDecorator.js +128 -122
  68. package/dist/structures/decorators/MessageComponentDecorator.js.map +1 -0
  69. package/dist/structures/decorators/Metadata.d.ts +16 -0
  70. package/dist/structures/decorators/Metadata.d.ts.map +1 -0
  71. package/dist/structures/decorators/Metadata.js +50 -0
  72. package/dist/structures/decorators/Metadata.js.map +1 -0
  73. package/dist/structures/decorators/PluginDecorator.d.ts +41 -0
  74. package/dist/structures/decorators/PluginDecorator.d.ts.map +1 -0
  75. package/dist/structures/decorators/PluginDecorator.js +36 -0
  76. package/dist/structures/decorators/PluginDecorator.js.map +1 -0
  77. package/dist/structures/decorators/UseDecorator.d.ts +44 -0
  78. package/dist/structures/decorators/UseDecorator.d.ts.map +1 -0
  79. package/dist/structures/decorators/UseDecorator.js +49 -0
  80. package/dist/structures/decorators/UseDecorator.js.map +1 -0
  81. package/dist/structures/decorators/index.d.ts +3 -0
  82. package/dist/structures/decorators/index.d.ts.map +1 -1
  83. package/dist/structures/decorators/index.js +26 -6
  84. package/dist/structures/decorators/index.js.map +1 -0
  85. package/dist/structures/index.d.ts +3 -1
  86. package/dist/structures/index.d.ts.map +1 -1
  87. package/dist/structures/index.js +26 -6
  88. package/dist/structures/index.js.map +1 -0
  89. package/dist/utils/Util.d.ts +2 -0
  90. package/dist/utils/Util.d.ts.map +1 -1
  91. package/dist/utils/Util.js +30 -11
  92. package/dist/utils/Util.js.map +1 -0
  93. package/dist/utils/cache.d.ts +4 -0
  94. package/dist/utils/cache.d.ts.map +1 -0
  95. package/dist/utils/cache.js +17 -0
  96. package/dist/utils/cache.js.map +1 -0
  97. package/dist/utils/customId.d.ts +12 -0
  98. package/dist/utils/customId.d.ts.map +1 -0
  99. package/dist/utils/customId.js +49 -0
  100. package/dist/utils/customId.js.map +1 -0
  101. package/package.json +64 -38
  102. package/bun.lock +0 -264
  103. package/tsdown.config.json +0 -3
@@ -1,35 +1,41 @@
1
- export const MODULE_TYPE_KEY = Symbol("type");
2
- export const COMMAND_MODULE_COMMANDS_KEY = Symbol("commands");
3
- export const INTERACTION_INTEGRATION_TYPES_KEY = Symbol("integration_types");
4
- export const INTERACTION_RUN_METHOD_KEY = Symbol("run_method");
5
- export const INTERACTION_PARAMETER_INDEX_KEY = Symbol("interaction_parameter_index");
6
- export const INTERACTION_TYPE_KEY = Symbol("type");
7
- export const COMMAND_NAME_KEY = Symbol("name");
8
- export const COMMAND_DESCRIPTION_KEY = Symbol("description");
9
- export const COMMAND_PRIVATE_KEY = Symbol("private");
10
- export const COMMAND_PRIVATE_GUILD_KEY = Symbol("private_guild");
11
- export const COMMAND_OPTIONS_KEY = Symbol("options");
12
- export const COMMAND_SUBCOMMAND_GROUPS_KEY = Symbol("subcommand_groups");
13
- export const COMMAND_SUBCOMMANDS_KEY = Symbol("subcommands");
14
- export const CONTEXT_MENU_TYPE_KEY = Symbol("context_menu_type");
15
- export const OPTIONS_PARAMETER_INDEX_KEY = Symbol("options_parameter_index");
16
- export const DICSORD_MODULE_OPTIONS_KEY = Symbol("options");
17
- export const EVENT_MODULE_LISTENERS_KEY = Symbol("event_module_listeners");
18
- export const INTERNAL_EVENTS_KEY = Symbol("internal_events");
19
- export const EXTERNAL_EVENTS_KEY = Symbol("external_events");
20
- export const MESSAGE_COMPONENT_MODULE_COMPONENTS_KEY = Symbol("components");
21
- export const BUTTON_OPTIONS_KEY = Symbol("options");
22
- export const SELECT_MENU_TYPE_KEY = Symbol("type");
23
- export const SELECT_MENU_OPTIONS_KEY = Symbol("options");
24
- export const SELECT_MENU_VALUES_INDEX_KEY = Symbol("values_index");
25
- export const MODAL_OPTIONS_KEY = Symbol("options");
26
- export const MODAL_COMPONENTS_KEY = Symbol("components");
27
- export const MODAL_TEXT_INPUT_VALUE_INDEX_KEY = Symbol("field_index");
28
- export const MODAL_SELECT_MENU_VALUE_INDEX_KEY = Symbol("field_index");
29
- export const MODAL_FILE_UPLOAD_VALUE_INDEX_KEY = Symbol("field_index");
30
- export var ModuleType;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ModuleType = exports.MODAL_COMPONENTS_KEY = exports.MODAL_OPTIONS_KEY = exports.SELECT_MENU_VALUES_INDEX_KEY = exports.SELECT_MENU_OPTIONS_KEY = exports.SELECT_MENU_TYPE_KEY = exports.BUTTON_OPTIONS_KEY = exports.MESSAGE_COMPONENT_MODULE_COMPONENTS_KEY = exports.EXTERNAL_EVENTS_KEY = exports.INTERNAL_EVENTS_KEY = exports.PLUGIN_MODULE_OPTIONS_KEY = exports.EVENT_MODULE_LISTENERS_KEY = exports.DICSORD_MODULE_OPTIONS_KEY = exports.CONTEXT_MENU_TYPE_KEY = exports.COMMAND_SUBCOMMANDS_KEY = exports.COMMAND_SUBCOMMAND_GROUPS_KEY = exports.COMMAND_OPTIONS_KEY = exports.COMMAND_PRIVATE_GUILD_KEY = exports.COMMAND_PRIVATE_KEY = exports.COMMAND_DESCRIPTION_KEY = exports.COMMAND_NAME_KEY = exports.INTERACTION_TYPE_KEY = exports.INTERACTION_COOLDOWN_KEY = exports.INTERACTION_GUARDS_KEY = exports.INJECTION_PROPERTIES_KEY = exports.CUSTOM_ID_PATTERN_KEY = exports.AUTOCOMPLETE_METHODS_KEY = exports.INTERACTION_RUN_METHOD_KEY = exports.INTERACTION_INTEGRATION_TYPES_KEY = exports.COMMAND_MODULE_COMMANDS_KEY = exports.MODULE_TYPE_KEY = void 0;
4
+ exports.MODULE_TYPE_KEY = Symbol("type");
5
+ exports.COMMAND_MODULE_COMMANDS_KEY = Symbol("commands");
6
+ exports.INTERACTION_INTEGRATION_TYPES_KEY = Symbol("integration_types");
7
+ exports.INTERACTION_RUN_METHOD_KEY = Symbol("run_method");
8
+ exports.AUTOCOMPLETE_METHODS_KEY = Symbol("autocomplete_methods");
9
+ exports.CUSTOM_ID_PATTERN_KEY = Symbol("custom_id_pattern");
10
+ /** Stores the property bindings populated before an interaction handler is called. */
11
+ exports.INJECTION_PROPERTIES_KEY = Symbol("injection_properties");
12
+ exports.INTERACTION_GUARDS_KEY = Symbol("interaction_guards");
13
+ exports.INTERACTION_COOLDOWN_KEY = Symbol("interaction_cooldown");
14
+ exports.INTERACTION_TYPE_KEY = Symbol("type");
15
+ exports.COMMAND_NAME_KEY = Symbol("name");
16
+ exports.COMMAND_DESCRIPTION_KEY = Symbol("description");
17
+ exports.COMMAND_PRIVATE_KEY = Symbol("private");
18
+ exports.COMMAND_PRIVATE_GUILD_KEY = Symbol("private_guild");
19
+ exports.COMMAND_OPTIONS_KEY = Symbol("options");
20
+ exports.COMMAND_SUBCOMMAND_GROUPS_KEY = Symbol("subcommand_groups");
21
+ exports.COMMAND_SUBCOMMANDS_KEY = Symbol("subcommands");
22
+ exports.CONTEXT_MENU_TYPE_KEY = Symbol("context_menu_type");
23
+ exports.DICSORD_MODULE_OPTIONS_KEY = Symbol("options");
24
+ exports.EVENT_MODULE_LISTENERS_KEY = Symbol("event_module_listeners");
25
+ exports.PLUGIN_MODULE_OPTIONS_KEY = Symbol("plugin_module_options");
26
+ exports.INTERNAL_EVENTS_KEY = Symbol("internal_events");
27
+ exports.EXTERNAL_EVENTS_KEY = Symbol("external_events");
28
+ exports.MESSAGE_COMPONENT_MODULE_COMPONENTS_KEY = Symbol("components");
29
+ exports.BUTTON_OPTIONS_KEY = Symbol("options");
30
+ exports.SELECT_MENU_TYPE_KEY = Symbol("type");
31
+ exports.SELECT_MENU_OPTIONS_KEY = Symbol("options");
32
+ exports.SELECT_MENU_VALUES_INDEX_KEY = Symbol("values_index");
33
+ exports.MODAL_OPTIONS_KEY = Symbol("options");
34
+ exports.MODAL_COMPONENTS_KEY = Symbol("components");
35
+ var ModuleType;
31
36
  (function (ModuleType) {
32
37
  ModuleType[ModuleType["COMMAND"] = 0] = "COMMAND";
33
38
  ModuleType[ModuleType["MESSAGE_COMPONENT"] = 1] = "MESSAGE_COMPONENT";
34
39
  ModuleType[ModuleType["EVENT"] = 2] = "EVENT";
35
- })(ModuleType || (ModuleType = {}));
40
+ })(ModuleType || (exports.ModuleType = ModuleType = {}));
41
+ //# sourceMappingURL=Constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/structures/decorators/Constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAEjC,QAAA,2BAA2B,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAEjD,QAAA,iCAAiC,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEhE,QAAA,0BAA0B,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAClD,QAAA,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC1D,QAAA,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACjE,sFAAsF;AACzE,QAAA,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC1D,QAAA,sBAAsB,GAAG,MAAM,CAAC,oBAAoB,CAAC,CAAC;AACtD,QAAA,wBAAwB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAC1D,QAAA,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtC,QAAA,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AAClC,QAAA,uBAAuB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAChD,QAAA,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACxC,QAAA,yBAAyB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AACpD,QAAA,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACxC,QAAA,6BAA6B,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAC5D,QAAA,uBAAuB,GAAG,MAAM,CAAC,aAAa,CAAC,CAAC;AAEhD,QAAA,qBAAqB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAGpD,QAAA,0BAA0B,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAE/C,QAAA,0BAA0B,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAE9D,QAAA,yBAAyB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AAE5D,QAAA,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAChD,QAAA,mBAAmB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEhD,QAAA,uCAAuC,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAE/D,QAAA,kBAAkB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAEvC,QAAA,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;AACtC,QAAA,uBAAuB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AAC5C,QAAA,4BAA4B,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEtD,QAAA,iBAAiB,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACtC,QAAA,oBAAoB,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAEzD,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,iDAAO,CAAA;IACP,qEAAiB,CAAA;IACjB,6CAAK,CAAA;AACT,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -1,15 +1,20 @@
1
+ import { StandardClassDecorator } from "./Metadata";
1
2
  import { ClientEvents, ClientOptions } from "discord.js";
2
3
  import { Listener } from "../components/Listener";
4
+ import type { SupportSource } from "./UseDecorator";
3
5
  export interface ModuleOptions extends ClientOptions {
4
6
  token: string;
5
7
  imports: (new (...args: any[]) => any)[];
6
8
  commands?: (new (...args: any[]) => any)[];
7
9
  components?: (new (...args: any[]) => any)[];
8
10
  listeners?: typeof Listener[];
11
+ /** Classes or instances that `@Use` injects. Classes are created once with `(client, logger)`. */
12
+ supports?: SupportSource[];
9
13
  test?: {
10
14
  enable: boolean;
11
15
  guild: null | string;
12
16
  };
17
+ /** Disables optional manager caches while preserving caches required by Discord.js. */
13
18
  disableCache?: boolean;
14
19
  }
15
20
  /**
@@ -18,7 +23,7 @@ export interface ModuleOptions extends ClientOptions {
18
23
  export declare const defaultModuleOptions: ModuleOptions;
19
24
  export interface DiscordModuleEvents {
20
25
  eventName: keyof ClientEvents;
21
- methodName: string;
26
+ methodName: string | symbol;
22
27
  }
23
28
  /**
24
29
  * Decorator that marks a class as a Discord module.
@@ -28,5 +33,5 @@ export interface DiscordModuleEvents {
28
33
  *
29
34
  * @throws {TypeError} If any of the imported modules are not valid Discord modules
30
35
  */
31
- export declare function DiscordModule(option1: ModuleOptions): <TFunction extends Function>(constructor: TFunction) => void;
36
+ export declare function DiscordModule(option1: ModuleOptions): StandardClassDecorator;
32
37
  //# sourceMappingURL=DiscordModuleDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DiscordModuleDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/DiscordModuleDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD,MAAM,WAAW,aAAc,SAAQ,aAAa;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC3C,UAAU,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,QAAQ,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QACH,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KACvB,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAYlC,CAAA;AAED,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,YAAY,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;CACtB;AAQD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,IAChC,SAAS,SAAS,QAAQ,EAAE,aAAa,SAAS,UASrE"}
1
+ {"version":3,"file":"DiscordModuleDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/DiscordModuleDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGzD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,WAAW,aAAc,SAAQ,aAAa;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IACzC,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC3C,UAAU,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,OAAO,QAAQ,EAAE,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,EAAE;QACH,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,IAAI,GAAG,MAAM,CAAA;KACvB,CAAC;IACF,uFAAuF;IACvF,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,aAalC,CAAA;AAED,MAAM,WAAW,mBAAmB;IAChC,SAAS,EAAE,MAAM,YAAY,CAAC;IAC9B,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,sBAAsB,CAU5E"}
@@ -1,13 +1,20 @@
1
- import { DICSORD_MODULE_OPTIONS_KEY, MODULE_TYPE_KEY } from "./Constants";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultModuleOptions = void 0;
4
+ exports.DiscordModule = DiscordModule;
5
+ const Metadata_1 = require("./Metadata");
6
+ const Constants_1 = require("./Constants");
7
+ const Util_1 = require("../../utils/Util");
2
8
  /**
3
9
  * Default configuration options for Discord modules.
4
10
  */
5
- export const defaultModuleOptions = {
11
+ exports.defaultModuleOptions = {
6
12
  token: "",
7
13
  imports: [],
8
14
  commands: [],
9
15
  components: [],
10
16
  listeners: [],
17
+ supports: [],
11
18
  test: {
12
19
  enable: false,
13
20
  guild: null,
@@ -15,11 +22,6 @@ export const defaultModuleOptions = {
15
22
  disableCache: false,
16
23
  intents: []
17
24
  };
18
- // export interface ExternalModuleEvents {
19
- // eventName: string;
20
- // methodName: string;
21
- // eventEmitter: EventEmitter;
22
- // }
23
25
  /**
24
26
  * Decorator that marks a class as a Discord module.
25
27
  *
@@ -28,33 +30,14 @@ export const defaultModuleOptions = {
28
30
  *
29
31
  * @throws {TypeError} If any of the imported modules are not valid Discord modules
30
32
  */
31
- export function DiscordModule(option1) {
32
- return function (constructor) {
33
- const options = mergeDefault(defaultModuleOptions, option1);
33
+ function DiscordModule(option1) {
34
+ return (0, Metadata_1.classDecorator)(metadata => {
35
+ const options = Util_1.Util.mergeDefault(exports.defaultModuleOptions, option1);
34
36
  options.imports.forEach(module => {
35
- if (typeof Reflect.getMetadata(MODULE_TYPE_KEY, module) != "number")
37
+ if (typeof (0, Metadata_1.getMetadata)(Constants_1.MODULE_TYPE_KEY, module) != "number")
36
38
  throw new TypeError(`${module.name} is not a module.`);
37
39
  });
38
- Reflect.defineMetadata(DICSORD_MODULE_OPTIONS_KEY, options, constructor);
39
- };
40
- }
41
- // export function ExternalEventHandler(eventName: string, eventEmitter: EventEmitter): MethodDecorator {
42
- // return function<T>(target: Object, propertyKey: string | symbol, propertyDescriptor: TypedPropertyDescriptor<T>) {
43
- // const events: ExternalModuleEvents[] = Reflect.getMetadata(DISCORD_MODULE_EXTERNAL_EVENTS_KEY, target) ?? [];
44
- // events.push({ eventName, methodName: propertyKey as string, eventEmitter });
45
- // Reflect.defineMetadata(DISCORD_MODULE_EXTERNAL_EVENTS_KEY, events, target.constructor);
46
- // }
47
- // }
48
- function mergeDefault(def, given) {
49
- if (!given)
50
- return def;
51
- for (const key in def) {
52
- if (!Object.hasOwn(given, key) || given[key] === undefined) {
53
- given[key] = def[key];
54
- }
55
- else if (given[key] === Object(given[key])) {
56
- given[key] = mergeDefault(def[key], given[key]);
57
- }
58
- }
59
- return given;
40
+ metadata[Constants_1.DICSORD_MODULE_OPTIONS_KEY] = options;
41
+ });
60
42
  }
43
+ //# sourceMappingURL=DiscordModuleDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscordModuleDecorator.js","sourceRoot":"","sources":["../../../src/structures/decorators/DiscordModuleDecorator.ts"],"names":[],"mappings":";;;AAsDA,sCAUC;AAhED,yCAAiF;AAEjF,2CAA0E;AAC1E,2CAAwC;AAoBxC;;GAEG;AACU,QAAA,oBAAoB,GAAkB;IAC/C,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;IACZ,UAAU,EAAE,EAAE;IACd,SAAS,EAAE,EAAE;IACb,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE;QACF,MAAM,EAAE,KAAK;QACb,KAAK,EAAE,IAAI;KACd;IACD,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,EAAE;CACd,CAAA;AAOD;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,OAAsB;IAChD,OAAO,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE;QAC7B,MAAM,OAAO,GAAG,WAAI,CAAC,YAAY,CAAC,4BAAoB,EAAE,OAAO,CAAC,CAAC;QAEjE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC7B,IAAI,OAAO,IAAA,sBAAW,EAAC,2BAAe,EAAE,MAAM,CAAC,IAAI,QAAQ;gBAAE,MAAM,IAAI,SAAS,CAAC,GAAG,MAAM,CAAC,IAAI,mBAAmB,CAAC,CAAC;QACxH,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,sCAA0B,CAAC,GAAG,OAAO,CAAC;IACnD,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { StandardClassDecorator } from "./Metadata";
1
2
  import { ClientEvents } from "discord.js";
2
3
  import { Listener } from "../components/Listener";
3
4
  /**
@@ -23,7 +24,7 @@ export interface EventModuleOptions {
23
24
  * class MyModule {}
24
25
  * ```
25
26
  */
26
- export declare function EventModule(options: EventModuleOptions): ClassDecorator;
27
+ export declare function EventModule(options: EventModuleOptions): StandardClassDecorator;
27
28
  /**
28
29
  * Decorator that registers a method as an event handler for a Discord client event.
29
30
  *
@@ -40,5 +41,5 @@ export declare function EventModule(options: EventModuleOptions): ClassDecorator
40
41
  * }
41
42
  * ```
42
43
  */
43
- export declare function EventHandler(eventName: keyof ClientEvents): MethodDecorator;
44
+ export declare function EventHandler(eventName: keyof ClientEvents): <This, Value extends (this: This, ...args: any[]) => any>(_value: Value, context: ClassMethodDecoratorContext<This, Value>) => void;
44
45
  //# sourceMappingURL=EventDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EventDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/EventDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,OAAO,QAAQ,EAAE,CAAA;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,cAAc,CAKvE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,YAAY,GAAG,eAAe,CAQ3E"}
1
+ {"version":3,"file":"EventDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/EventDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwD,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAG1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAElD;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAC/B,SAAS,CAAC,EAAE,OAAO,QAAQ,EAAE,CAAA;CAChC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,sBAAsB,CAK/E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,YAAY,IAC9C,IAAI,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,KAAK,EAAE,SAAS,2BAA2B,CAAC,IAAI,EAAE,KAAK,CAAC,KAAG,IAAI,CAO3I"}
@@ -1,4 +1,9 @@
1
- import { EVENT_MODULE_LISTENERS_KEY, INTERNAL_EVENTS_KEY, MODULE_TYPE_KEY, ModuleType } from "./Constants";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EventModule = EventModule;
4
+ exports.EventHandler = EventHandler;
5
+ const Metadata_1 = require("./Metadata");
6
+ const Constants_1 = require("./Constants");
2
7
  /**
3
8
  * Class decorator that marks a class as an event module.
4
9
  *
@@ -13,11 +18,11 @@ import { EVENT_MODULE_LISTENERS_KEY, INTERNAL_EVENTS_KEY, MODULE_TYPE_KEY, Modul
13
18
  * class MyModule {}
14
19
  * ```
15
20
  */
16
- export function EventModule(options) {
17
- return function (constructor) {
18
- Reflect.defineMetadata(MODULE_TYPE_KEY, ModuleType.EVENT, constructor);
19
- Reflect.defineMetadata(EVENT_MODULE_LISTENERS_KEY, options.listeners ?? [], constructor);
20
- };
21
+ function EventModule(options) {
22
+ return (0, Metadata_1.classDecorator)(metadata => {
23
+ metadata[Constants_1.MODULE_TYPE_KEY] = Constants_1.ModuleType.EVENT;
24
+ metadata[Constants_1.EVENT_MODULE_LISTENERS_KEY] = options.listeners ?? [];
25
+ });
21
26
  }
22
27
  /**
23
28
  * Decorator that registers a method as an event handler for a Discord client event.
@@ -35,10 +40,13 @@ export function EventModule(options) {
35
40
  * }
36
41
  * ```
37
42
  */
38
- export function EventHandler(eventName) {
39
- return function (target, propertyKey, propertyDescriptor) {
40
- const events = Reflect.getMetadata(INTERNAL_EVENTS_KEY, target.constructor) ?? [];
41
- events.push({ eventName, methodName: propertyKey });
42
- Reflect.defineMetadata(INTERNAL_EVENTS_KEY, events, target.constructor);
43
+ function EventHandler(eventName) {
44
+ return (_value, context) => {
45
+ (0, Metadata_1.assertHandlerMethod)(context);
46
+ const metadata = (0, Metadata_1.requireMetadata)(context);
47
+ const events = [...(metadata[Constants_1.INTERNAL_EVENTS_KEY] ?? [])];
48
+ events.push({ eventName, methodName: context.name });
49
+ metadata[Constants_1.INTERNAL_EVENTS_KEY] = events;
43
50
  };
44
51
  }
52
+ //# sourceMappingURL=EventDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventDecorator.js","sourceRoot":"","sources":["../../../src/structures/decorators/EventDecorator.ts"],"names":[],"mappings":";;AA8BA,kCAKC;AAkBD,oCAQC;AA7DD,yCAA0G;AAE1G,2CAA2G;AAc3G;;;;;;;;;;;;;GAaG;AACH,SAAgB,WAAW,CAAC,OAA2B;IACnD,OAAO,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE;QAC7B,QAAQ,CAAC,2BAAe,CAAC,GAAG,sBAAU,CAAC,KAAK,CAAC;QAC7C,QAAQ,CAAC,sCAA0B,CAAC,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IACnE,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAAY,CAAC,SAA6B;IACtD,OAAO,CAA0D,MAAa,EAAE,OAAiD,EAAQ,EAAE;QACvI,IAAA,8BAAmB,EAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,+BAAmB,CAA0B,IAAI,EAAE,CAAC,CAAC,CAAC;QACnF,MAAM,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QACrD,QAAQ,CAAC,+BAAmB,CAAC,GAAG,MAAM,CAAC;IAC3C,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { Interaction } from "discord.js";
2
+ import type { Logger } from "../DiscordApp";
3
+ import { StandardClassDecorator } from "./Metadata";
4
+ export interface GuardContext {
5
+ interaction: Interaction;
6
+ handler: Function;
7
+ parameters: Readonly<Record<string, string>>;
8
+ logger: Logger;
9
+ }
10
+ export type InteractionGuard = (context: GuardContext) => boolean | Promise<boolean>;
11
+ export interface CooldownOptions {
12
+ duration: number;
13
+ scope: "user" | "guild" | "global";
14
+ }
15
+ /** Runs predicates before constructing a handler; false prevents execution. */
16
+ export declare function Guard(...guards: InteractionGuard[]): StandardClassDecorator;
17
+ /** Limits successful dispatch attempts; storage is local to each application instance. */
18
+ export declare function Cooldown(duration: number, scope?: CooldownOptions["scope"]): StandardClassDecorator;
19
+ //# sourceMappingURL=ExecutionDecorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/ExecutionDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAkB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,YAAY;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC;IAClB,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,YAAY,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AACrF,MAAM,WAAW,eAAe;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACtC;AAED,+EAA+E;AAC/E,wBAAgB,KAAK,CAAC,GAAG,MAAM,EAAE,gBAAgB,EAAE,GAAG,sBAAsB,CAK3E;AAED,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,GAAE,eAAe,CAAC,OAAO,CAAU,GAAG,sBAAsB,CAI3G"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Guard = Guard;
4
+ exports.Cooldown = Cooldown;
5
+ const Constants_1 = require("./Constants");
6
+ const Metadata_1 = require("./Metadata");
7
+ /** Runs predicates before constructing a handler; false prevents execution. */
8
+ function Guard(...guards) {
9
+ if (guards.some(guard => typeof guard !== "function"))
10
+ throw new TypeError("Guards must be functions.");
11
+ return (0, Metadata_1.classDecorator)(metadata => {
12
+ metadata[Constants_1.INTERACTION_GUARDS_KEY] = [...(metadata[Constants_1.INTERACTION_GUARDS_KEY] ?? []), ...guards];
13
+ });
14
+ }
15
+ /** Limits successful dispatch attempts; storage is local to each application instance. */
16
+ function Cooldown(duration, scope = "user") {
17
+ if (!Number.isFinite(duration) || duration <= 0)
18
+ throw new RangeError("Cooldown duration must be positive.");
19
+ if (!["user", "guild", "global"].includes(scope))
20
+ throw new TypeError("Invalid cooldown scope.");
21
+ return (0, Metadata_1.classDecorator)(metadata => { metadata[Constants_1.INTERACTION_COOLDOWN_KEY] = { duration, scope }; });
22
+ }
23
+ //# sourceMappingURL=ExecutionDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExecutionDecorator.js","sourceRoot":"","sources":["../../../src/structures/decorators/ExecutionDecorator.ts"],"names":[],"mappings":";;AAmBA,sBAKC;AAGD,4BAIC;AA7BD,2CAA+E;AAC/E,yCAAoE;AAepE,+EAA+E;AAC/E,SAAgB,KAAK,CAAC,GAAG,MAA0B;IAC/C,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,KAAK,KAAK,UAAU,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,2BAA2B,CAAC,CAAC;IACxG,OAAO,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE;QAC7B,QAAQ,CAAC,kCAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,kCAAsB,CAAuB,IAAI,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC;IACtH,CAAC,CAAC,CAAC;AACP,CAAC;AAED,0FAA0F;AAC1F,SAAgB,QAAQ,CAAC,QAAgB,EAAE,QAAkC,MAAM;IAC/E,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,qCAAqC,CAAC,CAAC;IAC7G,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAC;IACjG,OAAO,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,oCAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACrG,CAAC"}
@@ -0,0 +1,35 @@
1
+ import type { SlashCommandOptions } from "../Constants";
2
+ import type { UseTarget } from "./UseDecorator";
3
+ export type OptionGetter = "getString" | "getInteger" | "getNumber" | "getBoolean" | "getUser" | "getChannel" | "getRole" | "getMentionable" | "getAttachment";
4
+ export type ModalFieldType = "text_input" | "select_menu" | "file_upload" | "radio_group" | "checkbox" | "checkbox_group";
5
+ export type InjectionSource = {
6
+ kind: "interaction";
7
+ } | {
8
+ kind: "context";
9
+ } | {
10
+ kind: "custom_id";
11
+ name: string;
12
+ } | {
13
+ kind: "use";
14
+ use: UseTarget | (() => UseTarget);
15
+ } | {
16
+ kind: "option";
17
+ name: string;
18
+ getMethod: OptionGetter;
19
+ option: SlashCommandOptions;
20
+ } | {
21
+ kind: "modal_field";
22
+ customId: string;
23
+ type: ModalFieldType;
24
+ };
25
+ export type PropertyInjection = InjectionSource & {
26
+ property: string | symbol;
27
+ private: boolean;
28
+ set(instance: any, value: any): void;
29
+ };
30
+ export type InjectionDecorator = <This, Value>(value: undefined, context: ClassFieldDecoratorContext<This, Value>) => void;
31
+ /** Registers a field injection and replaces inherited configuration for that field. */
32
+ export declare function registerInjection<This, Value>(context: ClassFieldDecoratorContext<This, Value>, source: InjectionSource): void;
33
+ /** Creates a field decorator for an explicit injection source. */
34
+ export declare function injectionDecorator(source: InjectionSource): InjectionDecorator;
35
+ //# sourceMappingURL=InjectionMetadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InjectionMetadata.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/InjectionMetadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAIhD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAC/J,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,GAAG,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC1H,MAAM,MAAM,eAAe,GACrB;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GACvB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,SAAS,GAAG,CAAC,MAAM,SAAS,CAAC,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,mBAAmB,CAAA;CAAE,GACtF;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;AACtE,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG;IAC9C,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAC;CACxC,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC;AAI3H,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAiB9H;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,kBAAkB,CAE9E"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerInjection = registerInjection;
4
+ exports.injectionDecorator = injectionDecorator;
5
+ const Constants_1 = require("./Constants");
6
+ const Metadata_1 = require("./Metadata");
7
+ const ownProperties = new WeakMap();
8
+ /** Registers a field injection and replaces inherited configuration for that field. */
9
+ function registerInjection(context, source) {
10
+ if (context.kind !== "field" || context.static)
11
+ throw new TypeError("Injection decorators require an instance field.");
12
+ const metadata = (0, Metadata_1.requireMetadata)(context);
13
+ const own = ownProperties.get(metadata) ?? new Set();
14
+ if (own.has(context.name))
15
+ throw new TypeError("Duplicate injection for " + String(context.name));
16
+ own.add(context.name);
17
+ ownProperties.set(metadata, own);
18
+ const properties = (metadata[Constants_1.INJECTION_PROPERTIES_KEY] ?? []);
19
+ const previous = context.private ? undefined : properties.find(property => !property.private && property.property === context.name);
20
+ const options = (metadata[Constants_1.COMMAND_OPTIONS_KEY] ?? []);
21
+ if (previous?.kind === "option")
22
+ metadata[Constants_1.COMMAND_OPTIONS_KEY] = options.filter(option => option !== previous.option);
23
+ if (source.kind === "option")
24
+ metadata[Constants_1.COMMAND_OPTIONS_KEY] = [...(metadata[Constants_1.COMMAND_OPTIONS_KEY] ?? []), source.option];
25
+ metadata[Constants_1.INJECTION_PROPERTIES_KEY] = [
26
+ ...properties.filter(property => property !== previous),
27
+ { ...source, property: context.name, private: context.private, set: context.access.set }
28
+ ];
29
+ }
30
+ /** Creates a field decorator for an explicit injection source. */
31
+ function injectionDecorator(source) {
32
+ return (_value, context) => registerInjection(context, source);
33
+ }
34
+ //# sourceMappingURL=InjectionMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InjectionMetadata.js","sourceRoot":"","sources":["../../../src/structures/decorators/InjectionMetadata.ts"],"names":[],"mappings":";;AAwBA,8CAiBC;AAGD,gDAEC;AA5CD,2CAA4E;AAC5E,yCAA6C;AAkB7C,MAAM,aAAa,GAAG,IAAI,OAAO,EAAiD,CAAC;AAEnF,uFAAuF;AACvF,SAAgB,iBAAiB,CAAc,OAAgD,EAAE,MAAuB;IACpH,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,CAAC,MAAM;QAAE,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAC;IACvH,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;IAC1C,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,EAAmB,CAAC;IACtE,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,0BAA0B,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAClG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,aAAa,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEjC,MAAM,UAAU,GAAG,CAAC,QAAQ,CAAC,oCAAwB,CAAC,IAAI,EAAE,CAAwB,CAAC;IACrF,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,QAAQ,CAAC,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpI,MAAM,OAAO,GAAG,CAAC,QAAQ,CAAC,+BAAmB,CAAC,IAAI,EAAE,CAA0B,CAAC;IAC/E,IAAI,QAAQ,EAAE,IAAI,KAAK,QAAQ;QAAE,QAAQ,CAAC,+BAAmB,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM,CAAC,CAAC;IACtH,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;QAAE,QAAQ,CAAC,+BAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,+BAAmB,CAA0B,IAAI,EAAE,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACjJ,QAAQ,CAAC,oCAAwB,CAAC,GAAG;QACjC,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,KAAK,QAAQ,CAAC;QACvD,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;KAC3F,CAAC;AACN,CAAC;AAED,kEAAkE;AAClE,SAAgB,kBAAkB,CAAC,MAAuB;IACtD,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AACnE,CAAC"}
@@ -1,3 +1,18 @@
1
- export declare function Run<T>(target: Object, propertyKey: string | symbol, propertyDescriptor: TypedPropertyDescriptor<T>): void;
2
- export declare function Interaction(target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number): void;
1
+ import { InjectionDecorator } from "./InjectionMetadata";
2
+ import { StandardClassDecorator } from "./Metadata";
3
+ /**
4
+ * Injects a huruhuru CommandContext into an instance field.
5
+ * Autocomplete receives undefined; use @Interaction for its raw interaction.
6
+ */
7
+ export declare function Context<This, Value>(_value: undefined, context: ClassFieldDecoratorContext<This, Value>): void;
8
+ /** Matches colon-separated IDs such as ticket:close:{ticketId}. Exact routes take precedence. */
9
+ export declare function CustomId(pattern: string): StandardClassDecorator;
10
+ /** Injects a named parameter captured by @CustomId into an instance field. */
11
+ export declare function CustomIdInjection(name: string): InjectionDecorator;
12
+ /** Registers a method that returns autocomplete choices for the named option. */
13
+ export declare function Autocomplete(optionName: string): <This, Value extends (this: This, ...args: any[]) => any>(_value: Value, context: ClassMethodDecoratorContext<This, Value>) => void;
14
+ /** Registers the instance method invoked after property injection. */
15
+ export declare function Run<This, Value extends (this: This, ...args: any[]) => any>(_value: Value, context: ClassMethodDecoratorContext<This, Value>): void;
16
+ /** Injects the raw Discord interaction into an instance field. */
17
+ export declare function Interaction<This, Value>(_value: undefined, context: ClassFieldDecoratorContext<This, Value>): void;
3
18
  //# sourceMappingURL=InteractionHandlerDecorator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionHandlerDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/InteractionHandlerDecorator.ts"],"names":[],"mappings":"AAGA,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,CAAC,CAAC,QAElH;AAGD,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,EAAE,cAAc,EAAE,MAAM,QAI5G"}
1
+ {"version":3,"file":"InteractionHandlerDecorator.d.ts","sourceRoot":"","sources":["../../../src/structures/decorators/InteractionHandlerDecorator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAyC,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAwD,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAI1G;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAE9G;AAED,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,sBAAsB,CAEhE;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAElE;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,IACnC,IAAI,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,KAAK,EAAE,SAAS,2BAA2B,CAAC,IAAI,EAAE,KAAK,CAAC,KAAG,IAAI,CAW3I;AAED,sEAAsE;AACtE,wBAAgB,GAAG,CAAC,IAAI,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,2BAA2B,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAKnJ;AAED,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,IAAI,CAElH"}
@@ -1,10 +1,55 @@
1
- import { INTERACTION_PARAMETER_INDEX_KEY, INTERACTION_RUN_METHOD_KEY } from "./Constants";
2
- // Method
3
- export function Run(target, propertyKey, propertyDescriptor) {
4
- Reflect.defineMetadata(INTERACTION_RUN_METHOD_KEY, propertyKey, target.constructor);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Context = Context;
4
+ exports.CustomId = CustomId;
5
+ exports.CustomIdInjection = CustomIdInjection;
6
+ exports.Autocomplete = Autocomplete;
7
+ exports.Run = Run;
8
+ exports.Interaction = Interaction;
9
+ const Constants_1 = require("./Constants");
10
+ const InjectionMetadata_1 = require("./InjectionMetadata");
11
+ const Metadata_1 = require("./Metadata");
12
+ const ownAutocompleteHandlers = new WeakMap();
13
+ /**
14
+ * Injects a huruhuru CommandContext into an instance field.
15
+ * Autocomplete receives undefined; use @Interaction for its raw interaction.
16
+ */
17
+ function Context(_value, context) {
18
+ (0, InjectionMetadata_1.registerInjection)(context, { kind: "context" });
5
19
  }
6
- // Injection
7
- export function Interaction(target, _propertyKey, parameterIndex) {
8
- const constructor = target;
9
- Reflect.defineMetadata(INTERACTION_PARAMETER_INDEX_KEY, parameterIndex, constructor);
20
+ /** Matches colon-separated IDs such as ticket:close:{ticketId}. Exact routes take precedence. */
21
+ function CustomId(pattern) {
22
+ return (0, Metadata_1.classDecorator)(metadata => { metadata[Constants_1.CUSTOM_ID_PATTERN_KEY] = pattern; });
10
23
  }
24
+ /** Injects a named parameter captured by @CustomId into an instance field. */
25
+ function CustomIdInjection(name) {
26
+ return (0, InjectionMetadata_1.injectionDecorator)({ kind: "custom_id", name });
27
+ }
28
+ /** Registers a method that returns autocomplete choices for the named option. */
29
+ function Autocomplete(optionName) {
30
+ return (_value, context) => {
31
+ (0, Metadata_1.assertHandlerMethod)(context);
32
+ const metadata = (0, Metadata_1.requireMetadata)(context);
33
+ const own = ownAutocompleteHandlers.get(metadata) ?? new Set();
34
+ if (own.has(optionName))
35
+ throw new TypeError("Duplicate autocomplete handler for " + optionName);
36
+ own.add(optionName);
37
+ ownAutocompleteHandlers.set(metadata, own);
38
+ const methods = { ...(metadata[Constants_1.AUTOCOMPLETE_METHODS_KEY] ?? {}) };
39
+ methods[optionName] = context.name;
40
+ metadata[Constants_1.AUTOCOMPLETE_METHODS_KEY] = methods;
41
+ };
42
+ }
43
+ /** Registers the instance method invoked after property injection. */
44
+ function Run(_value, context) {
45
+ (0, Metadata_1.assertHandlerMethod)(context);
46
+ const metadata = (0, Metadata_1.requireMetadata)(context);
47
+ if (Object.hasOwn(metadata, Constants_1.INTERACTION_RUN_METHOD_KEY))
48
+ throw new TypeError("Duplicate @Run method.");
49
+ metadata[Constants_1.INTERACTION_RUN_METHOD_KEY] = context.name;
50
+ }
51
+ /** Injects the raw Discord interaction into an instance field. */
52
+ function Interaction(_value, context) {
53
+ (0, InjectionMetadata_1.registerInjection)(context, { kind: "interaction" });
54
+ }
55
+ //# sourceMappingURL=InteractionHandlerDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InteractionHandlerDecorator.js","sourceRoot":"","sources":["../../../src/structures/decorators/InteractionHandlerDecorator.ts"],"names":[],"mappings":";;AAUA,0BAEC;AAGD,4BAEC;AAGD,8CAEC;AAGD,oCAYC;AAGD,kBAKC;AAGD,kCAEC;AAlDD,2CAA0G;AAC1G,2DAAgG;AAChG,yCAA0G;AAE1G,MAAM,uBAAuB,GAAG,IAAI,OAAO,EAAwC,CAAC;AAEpF;;;GAGG;AACH,SAAgB,OAAO,CAAc,MAAiB,EAAE,OAAgD;IACpG,IAAA,qCAAiB,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,iGAAiG;AACjG,SAAgB,QAAQ,CAAC,OAAe;IACpC,OAAO,IAAA,yBAAc,EAAC,QAAQ,CAAC,EAAE,GAAG,QAAQ,CAAC,iCAAqB,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,8EAA8E;AAC9E,SAAgB,iBAAiB,CAAC,IAAY;IAC1C,OAAO,IAAA,sCAAkB,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;AAC3D,CAAC;AAED,iFAAiF;AACjF,SAAgB,YAAY,CAAC,UAAkB;IAC3C,OAAO,CAA0D,MAAa,EAAE,OAAiD,EAAQ,EAAE;QACvI,IAAA,8BAAmB,EAAC,OAAO,CAAC,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,uBAAuB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,GAAG,EAAU,CAAC;QACvE,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC;YAAE,MAAM,IAAI,SAAS,CAAC,qCAAqC,GAAG,UAAU,CAAC,CAAC;QACjG,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpB,uBAAuB,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC3C,MAAM,OAAO,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,oCAAwB,CAAoC,IAAI,EAAE,CAAC,EAAE,CAAC;QACrG,OAAO,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;QACnC,QAAQ,CAAC,oCAAwB,CAAC,GAAG,OAAO,CAAC;IACjD,CAAC,CAAC;AACN,CAAC;AAED,sEAAsE;AACtE,SAAgB,GAAG,CAA0D,MAAa,EAAE,OAAiD;IACzI,IAAA,8BAAmB,EAAC,OAAO,CAAC,CAAC;IAC7B,MAAM,QAAQ,GAAG,IAAA,0BAAe,EAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,sCAA0B,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;IACvG,QAAQ,CAAC,sCAA0B,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;AACxD,CAAC;AAED,kEAAkE;AAClE,SAAgB,WAAW,CAAc,MAAiB,EAAE,OAAgD;IACxG,IAAA,qCAAiB,EAAC,OAAO,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;AACxD,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { StandardClassDecorator } from "./Metadata";
1
2
  import { ComponentEmojiResolvable, LabelBuilder, TextDisplayBuilder } from "discord.js";
2
3
  import { ButtonStyle, ChannelType, TextInputStyle } from "discord-api-types/v10";
4
+ import { InjectionDecorator } from "./InjectionMetadata";
3
5
  type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
4
6
  export type ButtonOptions = InteractionButtonOptions | LinkButtonOptions | PremiumButtonOptions;
5
7
  export type MessageComponentModuleOptions = {
@@ -146,44 +148,27 @@ export type ModalLabelComponent = DistributiveOmit<ModalComponentBase & {
146
148
  required?: boolean;
147
149
  disabled?: never;
148
150
  }, "disabled">;
149
- export type FieldIndex = {
150
- index: number;
151
- customId: string;
152
- };
153
- export type TextInputFieldIndex = FieldIndex & {
154
- type: "text_input";
155
- };
156
- export type SelectMenuFieldIndex = FieldIndex & {
157
- type: "select_menu";
158
- };
159
- export type FileUploadFieldIndex = FieldIndex & {
160
- type: "file_upload";
161
- };
162
- export type RadioGroupFieldIndex = FieldIndex & {
163
- type: "radio_group";
164
- };
165
- export type CheckboxFieldIndex = FieldIndex & {
166
- type: "checkbox";
167
- };
168
- export type CheckboxGroupFieldIndex = FieldIndex & {
169
- type: "checkbox_group";
170
- };
171
- export type ModalFieldIndex = TextInputFieldIndex | SelectMenuFieldIndex | FileUploadFieldIndex | RadioGroupFieldIndex | CheckboxFieldIndex | CheckboxGroupFieldIndex;
172
- export declare function MessageComponentModule(options: MessageComponentModuleOptions): <T extends Function>(constructor: T) => void;
173
- export declare function Button(options: InteractionButtonOptions | LinkButtonOptions): <T extends Function>(constructor: T) => void;
174
- export declare function StringSelectMenu(options: StringSelectMenuOptions): <T extends Function>(constructor: T) => void;
175
- export declare function UserSelectMenu(options: UserSelectMenuOptions): <T extends Function>(constructor: T) => void;
176
- export declare function ChannelSelectMenu(options: ChannelSelectMenuOptions): <T extends Function>(constructor: T) => void;
177
- export declare function RoleSelectMenu(options: RoleSelectMenuOptions): <T extends Function>(constructor: T) => void;
178
- export declare function MentionableSelectMenu(options: MentionableSelectMenuOptions): <T extends Function>(constructor: T) => void;
179
- export declare function Modal(options: ModalOptions): <T extends Function>(constructor: T) => void;
180
- export declare function ModalLabel(options: ModalLabelOptions): <T extends Function>(constructor: T) => void;
181
- export declare function ModalTextDisplay(options: ModalTextDisplay): <T extends Function>(constructor: T) => void;
182
- export declare function TextInputFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
183
- export declare function SelectMenuFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
184
- export declare function FileUploadFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
185
- export declare function RadioGroupFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
186
- export declare function CheckboxFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
187
- export declare function CheckboxGroupFieldInjection(customId: string): (target: Object, _propertyKey: string | symbol | undefined, parameterIndex: number) => void;
151
+ export declare function MessageComponentModule(options: MessageComponentModuleOptions): StandardClassDecorator;
152
+ export declare function Button(options: ButtonOptions): StandardClassDecorator;
153
+ export declare function StringSelectMenu(options: StringSelectMenuOptions): StandardClassDecorator;
154
+ export declare function UserSelectMenu(options: UserSelectMenuOptions): StandardClassDecorator;
155
+ export declare function ChannelSelectMenu(options: ChannelSelectMenuOptions): StandardClassDecorator;
156
+ export declare function RoleSelectMenu(options: RoleSelectMenuOptions): StandardClassDecorator;
157
+ export declare function MentionableSelectMenu(options: MentionableSelectMenuOptions): StandardClassDecorator;
158
+ export declare function Modal(options: ModalOptions): StandardClassDecorator;
159
+ export declare function ModalLabel(options: ModalLabelOptions): StandardClassDecorator;
160
+ export declare function ModalTextDisplay(options: ModalTextDisplay): StandardClassDecorator;
161
+ /** Injects a submitted text input into an instance field. */
162
+ export declare function TextInputFieldInjection(customId: string): InjectionDecorator;
163
+ /** Injects a submitted select menu's values into an instance field. */
164
+ export declare function SelectMenuFieldInjection(customId: string): InjectionDecorator;
165
+ /** Injects submitted files into an instance field. */
166
+ export declare function FileUploadFieldInjection(customId: string): InjectionDecorator;
167
+ /** Injects a submitted radio group's value into an instance field. */
168
+ export declare function RadioGroupFieldInjection(customId: string): InjectionDecorator;
169
+ /** Injects a submitted checkbox's value into an instance field. */
170
+ export declare function CheckboxFieldInjection(customId: string): InjectionDecorator;
171
+ /** Injects a submitted checkbox group's values into an instance field. */
172
+ export declare function CheckboxGroupFieldInjection(customId: string): InjectionDecorator;
188
173
  export {};
189
174
  //# sourceMappingURL=MessageComponentDecorator.d.ts.map