commandkit 0.1.11-dev.20240202064607 → 0.1.11-dev.20240203230231

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 (321) hide show
  1. package/dist/CommandKit--SA9LcIq.d.mts +452 -0
  2. package/dist/CommandKit-GIHMEeqf.d.ts +452 -0
  3. package/dist/CommandKit.d.mts +5 -0
  4. package/dist/CommandKit.d.ts +5 -0
  5. package/dist/CommandKit.js +11 -0
  6. package/dist/CommandKit.js.map +1 -0
  7. package/dist/CommandKit.mjs +2 -0
  8. package/dist/CommandKit.mjs.map +1 -0
  9. package/dist/bootstrap/client.d.mts +13 -0
  10. package/dist/bootstrap/client.d.ts +13 -0
  11. package/dist/bootstrap/client.js +2 -0
  12. package/dist/bootstrap/client.js.map +1 -0
  13. package/dist/bootstrap/client.mjs +2 -0
  14. package/dist/bootstrap/client.mjs.map +1 -0
  15. package/dist/bootstrap/loadEnv.d.mts +3 -0
  16. package/dist/bootstrap/loadEnv.d.ts +3 -0
  17. package/dist/bootstrap/loadEnv.js +2 -0
  18. package/dist/bootstrap/loadEnv.js.map +1 -0
  19. package/dist/bootstrap/loadEnv.mjs +2 -0
  20. package/dist/bootstrap/loadEnv.mjs.map +1 -0
  21. package/dist/chunk-5AIBE2QR.mjs +2 -0
  22. package/dist/chunk-5AIBE2QR.mjs.map +1 -0
  23. package/dist/chunk-6CLMSPNA.mjs +2 -0
  24. package/dist/chunk-6CLMSPNA.mjs.map +1 -0
  25. package/dist/chunk-77LPS2WP.mjs +2 -0
  26. package/dist/chunk-77LPS2WP.mjs.map +1 -0
  27. package/dist/chunk-7KD7ZCH6.mjs +2 -0
  28. package/dist/chunk-7KD7ZCH6.mjs.map +1 -0
  29. package/dist/chunk-BCQP4DZP.mjs +2 -0
  30. package/dist/chunk-BCQP4DZP.mjs.map +1 -0
  31. package/dist/chunk-BJCWVCAY.mjs +2 -0
  32. package/dist/chunk-BJCWVCAY.mjs.map +1 -0
  33. package/dist/chunk-BXBLPEWT.mjs +7 -0
  34. package/dist/chunk-BXBLPEWT.mjs.map +1 -0
  35. package/dist/chunk-CHI4NRSH.mjs +2 -0
  36. package/dist/chunk-CHI4NRSH.mjs.map +1 -0
  37. package/dist/chunk-DEB7FLUS.mjs +2 -0
  38. package/dist/chunk-DEB7FLUS.mjs.map +1 -0
  39. package/dist/chunk-FQGSVSCT.mjs +2 -0
  40. package/dist/chunk-FQGSVSCT.mjs.map +1 -0
  41. package/dist/chunk-IFTUM7TS.mjs +2 -0
  42. package/dist/chunk-IFTUM7TS.mjs.map +1 -0
  43. package/dist/chunk-KATLDJ7Z.mjs +2 -0
  44. package/dist/chunk-KATLDJ7Z.mjs.map +1 -0
  45. package/dist/chunk-KUU3KDAE.mjs +2 -0
  46. package/dist/chunk-KUU3KDAE.mjs.map +1 -0
  47. package/dist/chunk-M5FMJETI.mjs +1 -0
  48. package/dist/chunk-M5FMJETI.mjs.map +1 -0
  49. package/dist/chunk-PFU3PH6M.mjs +1 -0
  50. package/dist/chunk-PFU3PH6M.mjs.map +1 -0
  51. package/dist/chunk-Q7UFCVZL.mjs +2 -0
  52. package/dist/chunk-Q7UFCVZL.mjs.map +1 -0
  53. package/dist/chunk-QC2F7O3S.mjs +2 -0
  54. package/dist/chunk-QC2F7O3S.mjs.map +1 -0
  55. package/dist/chunk-QYJ4DE3N.mjs +2 -0
  56. package/dist/chunk-QYJ4DE3N.mjs.map +1 -0
  57. package/dist/chunk-R6PIHRXD.mjs +2 -0
  58. package/dist/chunk-R6PIHRXD.mjs.map +1 -0
  59. package/dist/chunk-RQQKHSL6.mjs +4 -0
  60. package/dist/chunk-RQQKHSL6.mjs.map +1 -0
  61. package/dist/chunk-SB3FAFCD.mjs +2 -0
  62. package/dist/chunk-SB3FAFCD.mjs.map +1 -0
  63. package/dist/chunk-SXUJOOQY.mjs +4 -0
  64. package/dist/chunk-SXUJOOQY.mjs.map +1 -0
  65. package/dist/chunk-SYOEMO4R.mjs +2 -0
  66. package/dist/chunk-SYOEMO4R.mjs.map +1 -0
  67. package/dist/chunk-TZXZ3UZS.mjs +2 -0
  68. package/dist/chunk-TZXZ3UZS.mjs.map +1 -0
  69. package/dist/chunk-UV2LVAQV.mjs +2 -0
  70. package/dist/chunk-UV2LVAQV.mjs.map +1 -0
  71. package/dist/chunk-VURGPMLB.mjs +2 -0
  72. package/dist/chunk-VURGPMLB.mjs.map +1 -0
  73. package/dist/chunk-ZJRAI4W5.mjs +2 -0
  74. package/dist/chunk-ZJRAI4W5.mjs.map +1 -0
  75. package/dist/components/ButtonKit.d.mts +55 -0
  76. package/dist/components/ButtonKit.d.ts +55 -0
  77. package/dist/components/ButtonKit.js +2 -0
  78. package/dist/components/ButtonKit.js.map +1 -0
  79. package/dist/components/ButtonKit.mjs +2 -0
  80. package/dist/components/ButtonKit.mjs.map +1 -0
  81. package/dist/components/index.d.mts +2 -0
  82. package/dist/components/index.d.ts +2 -0
  83. package/dist/components/index.js +2 -0
  84. package/dist/components/index.js.map +1 -0
  85. package/dist/components/index.mjs +2 -0
  86. package/dist/components/index.mjs.map +1 -0
  87. package/dist/config.d.mts +55 -0
  88. package/dist/config.d.ts +55 -0
  89. package/dist/config.js +2 -0
  90. package/dist/config.js.map +1 -0
  91. package/dist/config.mjs +2 -0
  92. package/dist/config.mjs.map +1 -0
  93. package/dist/environment/actions/development.d.mts +8 -0
  94. package/dist/environment/actions/development.d.ts +8 -0
  95. package/dist/environment/actions/development.js +2 -0
  96. package/dist/environment/actions/development.js.map +1 -0
  97. package/dist/environment/actions/development.mjs +2 -0
  98. package/dist/environment/actions/development.mjs.map +1 -0
  99. package/dist/environment/bundler/bundle.d.mts +3 -0
  100. package/dist/environment/bundler/bundle.d.ts +3 -0
  101. package/dist/environment/bundler/bundle.js +2 -0
  102. package/dist/environment/bundler/bundle.js.map +1 -0
  103. package/dist/environment/bundler/bundle.mjs +2 -0
  104. package/dist/environment/bundler/bundle.mjs.map +1 -0
  105. package/dist/environment/bundler/shims.d.mts +3 -0
  106. package/dist/environment/bundler/shims.d.ts +3 -0
  107. package/dist/environment/bundler/shims.js +11 -0
  108. package/dist/environment/bundler/shims.js.map +1 -0
  109. package/dist/environment/bundler/shims.mjs +11 -0
  110. package/dist/environment/bundler/shims.mjs.map +1 -0
  111. package/dist/environment/cli.d.mts +2 -0
  112. package/dist/environment/cli.d.ts +2 -0
  113. package/dist/environment/cli.js +2 -0
  114. package/dist/environment/cli.js.map +1 -0
  115. package/dist/environment/cli.mjs +2 -0
  116. package/dist/environment/cli.mjs.map +1 -0
  117. package/dist/environment/common/config.d.mts +7 -0
  118. package/dist/environment/common/config.d.ts +7 -0
  119. package/dist/environment/common/config.js +2 -0
  120. package/dist/environment/common/config.js.map +1 -0
  121. package/dist/environment/common/config.mjs +2 -0
  122. package/dist/environment/common/config.mjs.map +1 -0
  123. package/dist/environment/common/logger.d.mts +9 -0
  124. package/dist/environment/common/logger.d.ts +9 -0
  125. package/dist/environment/common/logger.js +2 -0
  126. package/dist/environment/common/logger.js.map +1 -0
  127. package/dist/environment/common/logger.mjs +2 -0
  128. package/dist/environment/common/logger.mjs.map +1 -0
  129. package/dist/handlers/command-handler/CommandHandler.d.mts +5 -0
  130. package/dist/handlers/command-handler/CommandHandler.d.ts +5 -0
  131. package/dist/handlers/command-handler/CommandHandler.js +11 -0
  132. package/dist/handlers/command-handler/CommandHandler.js.map +1 -0
  133. package/dist/handlers/command-handler/CommandHandler.mjs +2 -0
  134. package/dist/handlers/command-handler/CommandHandler.mjs.map +1 -0
  135. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.mts +35 -0
  136. package/dist/handlers/command-handler/functions/loadCommandsWithRest.d.ts +35 -0
  137. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js +4 -0
  138. package/dist/handlers/command-handler/functions/loadCommandsWithRest.js.map +1 -0
  139. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs +2 -0
  140. package/dist/handlers/command-handler/functions/loadCommandsWithRest.mjs.map +1 -0
  141. package/dist/handlers/command-handler/functions/registerCommands.d.mts +20 -0
  142. package/dist/handlers/command-handler/functions/registerCommands.d.ts +20 -0
  143. package/dist/handlers/command-handler/functions/registerCommands.js +7 -0
  144. package/dist/handlers/command-handler/functions/registerCommands.js.map +1 -0
  145. package/dist/handlers/command-handler/functions/registerCommands.mjs +2 -0
  146. package/dist/handlers/command-handler/functions/registerCommands.mjs.map +1 -0
  147. package/dist/handlers/command-handler/typings.d.mts +5 -0
  148. package/dist/handlers/command-handler/typings.d.ts +5 -0
  149. package/dist/handlers/command-handler/typings.js +2 -0
  150. package/dist/handlers/command-handler/typings.js.map +1 -0
  151. package/dist/handlers/command-handler/typings.mjs +1 -0
  152. package/dist/handlers/command-handler/typings.mjs.map +1 -0
  153. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.mts +9 -0
  154. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.d.ts +9 -0
  155. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js +2 -0
  156. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.js.map +1 -0
  157. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs +2 -0
  158. package/dist/handlers/command-handler/utils/areSlashCommandsDifferent.mjs.map +1 -0
  159. package/dist/handlers/command-handler/validations/devOnly.d.mts +9 -0
  160. package/dist/handlers/command-handler/validations/devOnly.d.ts +9 -0
  161. package/dist/handlers/command-handler/validations/devOnly.js +2 -0
  162. package/dist/handlers/command-handler/validations/devOnly.js.map +1 -0
  163. package/dist/handlers/command-handler/validations/devOnly.mjs +2 -0
  164. package/dist/handlers/command-handler/validations/devOnly.mjs.map +1 -0
  165. package/dist/handlers/command-handler/validations/index.d.mts +10 -0
  166. package/dist/handlers/command-handler/validations/index.d.ts +10 -0
  167. package/dist/handlers/command-handler/validations/index.js +4 -0
  168. package/dist/handlers/command-handler/validations/index.js.map +1 -0
  169. package/dist/handlers/command-handler/validations/index.mjs +2 -0
  170. package/dist/handlers/command-handler/validations/index.mjs.map +1 -0
  171. package/dist/handlers/command-handler/validations/permissions.d.mts +9 -0
  172. package/dist/handlers/command-handler/validations/permissions.d.ts +9 -0
  173. package/dist/handlers/command-handler/validations/permissions.js +4 -0
  174. package/dist/handlers/command-handler/validations/permissions.js.map +1 -0
  175. package/dist/handlers/command-handler/validations/permissions.mjs +2 -0
  176. package/dist/handlers/command-handler/validations/permissions.mjs.map +1 -0
  177. package/dist/handlers/event-handler/EventHandler.d.mts +5 -0
  178. package/dist/handlers/event-handler/EventHandler.d.ts +5 -0
  179. package/dist/handlers/event-handler/EventHandler.js +2 -0
  180. package/dist/handlers/event-handler/EventHandler.js.map +1 -0
  181. package/dist/handlers/event-handler/EventHandler.mjs +2 -0
  182. package/dist/handlers/event-handler/EventHandler.mjs.map +1 -0
  183. package/dist/handlers/event-handler/typings.d.mts +5 -0
  184. package/dist/handlers/event-handler/typings.d.ts +5 -0
  185. package/dist/handlers/event-handler/typings.js +2 -0
  186. package/dist/handlers/event-handler/typings.js.map +1 -0
  187. package/dist/handlers/event-handler/typings.mjs +1 -0
  188. package/dist/handlers/event-handler/typings.mjs.map +1 -0
  189. package/dist/handlers/index.d.mts +5 -0
  190. package/dist/handlers/index.d.ts +5 -0
  191. package/dist/handlers/index.js +11 -0
  192. package/dist/handlers/index.js.map +1 -0
  193. package/dist/handlers/index.mjs +2 -0
  194. package/dist/handlers/index.mjs.map +1 -0
  195. package/dist/handlers/validation-handler/ValidationHandler.d.mts +14 -0
  196. package/dist/handlers/validation-handler/ValidationHandler.d.ts +14 -0
  197. package/dist/handlers/validation-handler/ValidationHandler.js +2 -0
  198. package/dist/handlers/validation-handler/ValidationHandler.js.map +1 -0
  199. package/dist/handlers/validation-handler/ValidationHandler.mjs +2 -0
  200. package/dist/handlers/validation-handler/ValidationHandler.mjs.map +1 -0
  201. package/dist/handlers/validation-handler/typings.d.mts +14 -0
  202. package/dist/handlers/validation-handler/typings.d.ts +14 -0
  203. package/dist/handlers/validation-handler/typings.js +2 -0
  204. package/dist/handlers/validation-handler/typings.js.map +1 -0
  205. package/dist/handlers/validation-handler/typings.mjs +1 -0
  206. package/dist/handlers/validation-handler/typings.mjs.map +1 -0
  207. package/dist/hooks/common.d.mts +12 -0
  208. package/dist/hooks/common.d.ts +12 -0
  209. package/dist/hooks/common.js +11 -0
  210. package/dist/hooks/common.js.map +1 -0
  211. package/dist/hooks/common.mjs +2 -0
  212. package/dist/hooks/common.mjs.map +1 -0
  213. package/dist/hooks/index.d.mts +14 -0
  214. package/dist/hooks/index.d.ts +14 -0
  215. package/dist/hooks/index.js +11 -0
  216. package/dist/hooks/index.js.map +1 -0
  217. package/dist/hooks/index.mjs +2 -0
  218. package/dist/hooks/index.mjs.map +1 -0
  219. package/dist/hooks/response.d.mts +7 -0
  220. package/dist/hooks/response.d.ts +7 -0
  221. package/dist/hooks/response.js +11 -0
  222. package/dist/hooks/response.js.map +1 -0
  223. package/dist/hooks/response.mjs +2 -0
  224. package/dist/hooks/response.mjs.map +1 -0
  225. package/dist/hooks/useChannel.d.mts +5 -0
  226. package/dist/hooks/useChannel.d.ts +5 -0
  227. package/dist/hooks/useChannel.js +11 -0
  228. package/dist/hooks/useChannel.js.map +1 -0
  229. package/dist/hooks/useChannel.mjs +2 -0
  230. package/dist/hooks/useChannel.mjs.map +1 -0
  231. package/dist/hooks/useClient.d.mts +5 -0
  232. package/dist/hooks/useClient.d.ts +5 -0
  233. package/dist/hooks/useClient.js +11 -0
  234. package/dist/hooks/useClient.js.map +1 -0
  235. package/dist/hooks/useClient.mjs +2 -0
  236. package/dist/hooks/useClient.mjs.map +1 -0
  237. package/dist/hooks/useCommandData.d.mts +5 -0
  238. package/dist/hooks/useCommandData.d.ts +5 -0
  239. package/dist/hooks/useCommandData.js +11 -0
  240. package/dist/hooks/useCommandData.js.map +1 -0
  241. package/dist/hooks/useCommandData.mjs +2 -0
  242. package/dist/hooks/useCommandData.mjs.map +1 -0
  243. package/dist/hooks/useCommandKit.d.mts +9 -0
  244. package/dist/hooks/useCommandKit.d.ts +9 -0
  245. package/dist/hooks/useCommandKit.js +11 -0
  246. package/dist/hooks/useCommandKit.js.map +1 -0
  247. package/dist/hooks/useCommandKit.mjs +2 -0
  248. package/dist/hooks/useCommandKit.mjs.map +1 -0
  249. package/dist/hooks/useGuild.d.mts +5 -0
  250. package/dist/hooks/useGuild.d.ts +5 -0
  251. package/dist/hooks/useGuild.js +11 -0
  252. package/dist/hooks/useGuild.js.map +1 -0
  253. package/dist/hooks/useGuild.mjs +2 -0
  254. package/dist/hooks/useGuild.mjs.map +1 -0
  255. package/dist/hooks/useInteraction.d.mts +9 -0
  256. package/dist/hooks/useInteraction.d.ts +9 -0
  257. package/dist/hooks/useInteraction.js +11 -0
  258. package/dist/hooks/useInteraction.js.map +1 -0
  259. package/dist/hooks/useInteraction.mjs +2 -0
  260. package/dist/hooks/useInteraction.mjs.map +1 -0
  261. package/dist/hooks/useMember.d.mts +5 -0
  262. package/dist/hooks/useMember.d.ts +5 -0
  263. package/dist/hooks/useMember.js +11 -0
  264. package/dist/hooks/useMember.js.map +1 -0
  265. package/dist/hooks/useMember.mjs +2 -0
  266. package/dist/hooks/useMember.mjs.map +1 -0
  267. package/dist/hooks/useUser.d.mts +5 -0
  268. package/dist/hooks/useUser.d.ts +5 -0
  269. package/dist/hooks/useUser.js +11 -0
  270. package/dist/hooks/useUser.js.map +1 -0
  271. package/dist/hooks/useUser.mjs +2 -0
  272. package/dist/hooks/useUser.mjs.map +1 -0
  273. package/dist/index.d.mts +25 -0
  274. package/dist/index.d.ts +25 -0
  275. package/dist/index.js +11 -0
  276. package/dist/index.js.map +1 -0
  277. package/dist/index.mjs +2 -0
  278. package/dist/index.mjs.map +1 -0
  279. package/dist/types/index.d.mts +5 -0
  280. package/dist/types/index.d.ts +5 -0
  281. package/dist/types/index.js +2 -0
  282. package/dist/types/index.js.map +1 -0
  283. package/dist/types/index.mjs +2 -0
  284. package/dist/types/index.mjs.map +1 -0
  285. package/dist/typings.d.mts +5 -0
  286. package/dist/typings.d.ts +5 -0
  287. package/dist/typings.js +2 -0
  288. package/dist/typings.js.map +1 -0
  289. package/dist/typings.mjs +1 -0
  290. package/dist/typings.mjs.map +1 -0
  291. package/dist/utils/clone.d.mts +3 -0
  292. package/dist/utils/clone.d.ts +3 -0
  293. package/dist/utils/clone.js +2 -0
  294. package/dist/utils/clone.js.map +1 -0
  295. package/dist/utils/clone.mjs +2 -0
  296. package/dist/utils/clone.mjs.map +1 -0
  297. package/dist/utils/colors.d.mts +27 -0
  298. package/dist/utils/colors.d.ts +27 -0
  299. package/dist/utils/colors.js +2 -0
  300. package/dist/utils/colors.js.map +1 -0
  301. package/dist/utils/colors.mjs +2 -0
  302. package/dist/utils/colors.mjs.map +1 -0
  303. package/dist/utils/get-paths.d.mts +4 -0
  304. package/dist/utils/get-paths.d.ts +4 -0
  305. package/dist/utils/get-paths.js +2 -0
  306. package/dist/utils/get-paths.js.map +1 -0
  307. package/dist/utils/get-paths.mjs +2 -0
  308. package/dist/utils/get-paths.mjs.map +1 -0
  309. package/dist/utils/resolve-file-url.d.mts +8 -0
  310. package/dist/utils/resolve-file-url.d.ts +8 -0
  311. package/dist/utils/resolve-file-url.js +2 -0
  312. package/dist/utils/resolve-file-url.js.map +1 -0
  313. package/dist/utils/resolve-file-url.mjs +2 -0
  314. package/dist/utils/resolve-file-url.mjs.map +1 -0
  315. package/dist/utils/signal.d.mts +21 -0
  316. package/dist/utils/signal.d.ts +21 -0
  317. package/dist/utils/signal.js +2 -0
  318. package/dist/utils/signal.js.map +1 -0
  319. package/dist/utils/signal.mjs +2 -0
  320. package/dist/utils/signal.mjs.map +1 -0
  321. package/package.json +2 -2
@@ -0,0 +1,452 @@
1
+ import { ValidationHandler } from './handlers/validation-handler/ValidationHandler.mjs';
2
+ import * as discord_js from 'discord.js';
3
+ import { Client, ChatInputCommandInteraction, ContextMenuCommandInteraction, AutocompleteInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, PermissionsString, RESTPostAPIApplicationCommandsJSONBody, Interaction, CacheType } from 'discord.js';
4
+ import { AsyncLocalStorage } from 'async_hooks';
5
+
6
+ /**
7
+ * Command handler options.
8
+ * Similar to CommandKit options in structure.
9
+ */
10
+ interface CommandHandlerOptions {
11
+ /**
12
+ * The client created by the user.
13
+ */
14
+ client: Client;
15
+ /**
16
+ * Path to the user's commands.
17
+ */
18
+ commandsPath: string;
19
+ /**
20
+ * An array of developer guild IDs.
21
+ */
22
+ devGuildIds: string[];
23
+ /**
24
+ * An array of developer user IDs.
25
+ */
26
+ devUserIds: string[];
27
+ /**
28
+ * An array of developer role IDs.
29
+ */
30
+ devRoleIds: string[];
31
+ /**
32
+ * A validation handler instance to run validations before commands.
33
+ */
34
+ validationHandler?: ValidationHandler;
35
+ /**
36
+ * A boolean indicating whether to skip CommandKit's built-in validations (permission checking, etc.)
37
+ */
38
+ skipBuiltInValidations: boolean;
39
+ /**
40
+ * The CommandKit handler that instantiated this.
41
+ */
42
+ commandkitInstance: CommandKit;
43
+ /**
44
+ * A boolean indicating whether to register all commands in bulk.
45
+ */
46
+ bulkRegister: boolean;
47
+ /**
48
+ * Whether to enable hooks context.
49
+ */
50
+ enableHooks: boolean;
51
+ }
52
+ /**
53
+ * Private command handler data.
54
+ */
55
+ interface CommandHandlerData extends CommandHandlerOptions {
56
+ /**
57
+ * An array of command file objects.
58
+ */
59
+ commands: CommandFileObject[];
60
+ /**
61
+ * An array of built-in validations.
62
+ */
63
+ builtInValidations: BuiltInValidation[];
64
+ /**
65
+ * A validation handler instance to run validations before commands.
66
+ */
67
+ validationHandler?: ValidationHandler;
68
+ }
69
+ /**
70
+ * Parameters for CommandKit's built-in validations.
71
+ */
72
+ interface BuiltInValidationParams {
73
+ /**
74
+ * The target command to validate.
75
+ */
76
+ targetCommand: CommandFileObject;
77
+ /**
78
+ * The interaction of the target command.
79
+ */
80
+ interaction: CommandKitInteraction;
81
+ /**
82
+ * The command handler's data.
83
+ */
84
+ handlerData: CommandHandlerData;
85
+ }
86
+ /**
87
+ * Represents a command interaction.
88
+ */
89
+ type CommandKitInteraction = ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
90
+ /**
91
+ * A built in validation. Returns a boolean or void.
92
+ */
93
+ type BuiltInValidation = ({}: BuiltInValidationParams) => boolean | void;
94
+
95
+ /**
96
+ * Props for command run functions.
97
+ */
98
+ interface CommandProps {
99
+ /**
100
+ * The current command interaction object.
101
+ */
102
+ interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | UserContextMenuCommandInteraction | MessageContextMenuCommandInteraction | AutocompleteInteraction;
103
+ /**
104
+ * The Discord.js client object that CommandKit is handling.
105
+ */
106
+ client: Client<true>;
107
+ /**
108
+ * The current CommandKit handler instance.
109
+ */
110
+ handler: CommandKit;
111
+ }
112
+ /**
113
+ * Props for autocomplete command run functions.
114
+ */
115
+ interface AutocompleteProps extends CommandProps {
116
+ /**
117
+ * The current autocomplete command interaction object.
118
+ */
119
+ interaction: AutocompleteInteraction;
120
+ }
121
+ /**
122
+ * Props for slash (chat input) command run functions.
123
+ */
124
+ interface SlashCommandProps extends CommandProps {
125
+ /**
126
+ * The current slash (chat input) command interaction object.
127
+ */
128
+ interaction: ChatInputCommandInteraction;
129
+ }
130
+ /**
131
+ * Props for context menu command run functions.
132
+ */
133
+ interface ContextMenuCommandProps extends CommandProps {
134
+ /**
135
+ * The current context menu command interaction object.
136
+ */
137
+ interaction: ContextMenuCommandInteraction;
138
+ }
139
+ /**
140
+ * Props for user context menu command run functions.
141
+ */
142
+ interface UserContextMenuCommandProps extends CommandProps {
143
+ interaction: UserContextMenuCommandInteraction;
144
+ }
145
+ /**
146
+ * Props for message context menu command run functions.
147
+ */
148
+ interface MessageContextMenuCommandProps extends CommandProps {
149
+ interaction: MessageContextMenuCommandInteraction;
150
+ }
151
+ /**
152
+ * Props for command validation functions.
153
+ */
154
+ interface ValidationProps {
155
+ /**
156
+ * The current command interaction object.
157
+ */
158
+ interaction: ChatInputCommandInteraction | ContextMenuCommandInteraction | AutocompleteInteraction;
159
+ /**
160
+ * The Discord.js client object that CommandKit is handling.
161
+ */
162
+ client: Client<true>;
163
+ /**
164
+ * The current (local) target command object.
165
+ */
166
+ commandObj: CommandObject;
167
+ /**
168
+ * The current CommandKit handler instance.
169
+ */
170
+ handler: CommandKit;
171
+ }
172
+ /**
173
+ * Additional command configuration options.
174
+ */
175
+ interface CommandOptions {
176
+ /**
177
+ * A boolean indicating whether the command is guild-only.
178
+ * Used for built-in validation.
179
+ *
180
+ * @deprecated Use `dm_permission` in the command's `data` object instead.
181
+ */
182
+ guildOnly?: boolean;
183
+ /**
184
+ * A boolean indicating whether the command is developer-only.
185
+ * Used for registration and built-in validation.
186
+ */
187
+ devOnly?: boolean;
188
+ /**
189
+ * A boolean indicating whether the command is deleted/ignored on restart/reload.
190
+ */
191
+ deleted?: boolean;
192
+ /**
193
+ * A string or array of permissions that a user needs for the current command to be executed.
194
+ * Used for built-in validation.
195
+ *
196
+ * @example
197
+ * userPermissions: 'BanMembers'
198
+ * or
199
+ * userPermissions: ['BanMembers', 'KickMembers']
200
+ */
201
+ userPermissions?: PermissionsString | PermissionsString[];
202
+ /**
203
+ * A string or array of permissions that the bot needs to execute the current command.
204
+ * Used for built-in validation.
205
+ *
206
+ * @example
207
+ * botPermissions: 'BanMembers'
208
+ * or
209
+ * botPermissions: ['BanMembers', 'KickMembers']
210
+ */
211
+ botPermissions?: PermissionsString | PermissionsString[];
212
+ [key: string]: any;
213
+ }
214
+ type CommandData = RESTPostAPIApplicationCommandsJSONBody;
215
+ type CommandObject = {
216
+ /**
217
+ * An object which defines the structure of the application command.
218
+ */
219
+ data: CommandData;
220
+ /**
221
+ * Additional command configuration options.
222
+ */
223
+ options?: CommandOptions;
224
+ /**
225
+ * The path to the command file.
226
+ */
227
+ filePath: string;
228
+ /**
229
+ * The command's category. Determined based on the command folder.
230
+ *
231
+ * @example
232
+ * ```txt
233
+ * "/src/commands/ping.js" -> null
234
+ * "/src/commands/Misc/ping.js" -> "Misc"
235
+ * ```
236
+ */
237
+ category: string | null;
238
+ [key: string]: any;
239
+ };
240
+ declare enum ReloadType {
241
+ /**
242
+ * Reload developer/guild commands.
243
+ */
244
+ Developer = "dev",
245
+ /**
246
+ * Reload global commands.
247
+ */
248
+ Global = "global"
249
+ }
250
+
251
+ interface hCommandContext {
252
+ interaction: CommandKitInteraction;
253
+ command: CommandData;
254
+ }
255
+ /**
256
+ * A handler for client application commands.
257
+ */
258
+ declare class CommandHandler {
259
+ #private;
260
+ context: AsyncLocalStorage<hCommandContext> | null;
261
+ constructor({ ...options }: CommandHandlerOptions);
262
+ init(): Promise<void>;
263
+ handleCommands(): void;
264
+ get commands(): CommandFileObject[];
265
+ reloadCommands(type?: ReloadOptions): Promise<void>;
266
+ }
267
+
268
+ /**
269
+ * Event handler options.
270
+ */
271
+ interface EventHandlerOptions {
272
+ client: Client;
273
+ eventsPath: string;
274
+ commandKitInstance: CommandKit;
275
+ }
276
+ /**
277
+ * Private event handler data.
278
+ */
279
+ interface EventHandlerData extends EventHandlerOptions {
280
+ events: {
281
+ name: string;
282
+ functions: Function[];
283
+ }[];
284
+ }
285
+
286
+ /**
287
+ * A handler for client events.
288
+ */
289
+ declare class EventHandler {
290
+ #private;
291
+ constructor({ ...options }: EventHandlerOptions);
292
+ init(): Promise<void>;
293
+ get events(): {
294
+ name: string;
295
+ functions: Function[];
296
+ }[];
297
+ reloadEvents(commandHandler?: CommandHandler): Promise<void>;
298
+ }
299
+
300
+ /**
301
+ * Options for instantiating a CommandKit handler.
302
+ */
303
+ interface CommandKitOptions {
304
+ /**
305
+ * The Discord.js client object to use with CommandKit.
306
+ */
307
+ client: Client;
308
+ /**
309
+ * The path to your commands directory.
310
+ */
311
+ commandsPath?: string;
312
+ /**
313
+ * The path to your events directory.
314
+ */
315
+ eventsPath?: string;
316
+ /**
317
+ * The path to the validations directory.
318
+ */
319
+ validationsPath?: string;
320
+ /**
321
+ * List of development guild IDs to restrict devOnly commands to.
322
+ */
323
+ devGuildIds?: string[];
324
+ /**
325
+ * List of developer user IDs to restrict devOnly commands to.
326
+ */
327
+ devUserIds?: string[];
328
+ /**
329
+ * List of developer role IDs to restrict devOnly commands to.
330
+ */
331
+ devRoleIds?: string[];
332
+ /**
333
+ * Skip CommandKit's built-in validations (for devOnly commands).
334
+ */
335
+ skipBuiltInValidations?: boolean;
336
+ /**
337
+ * Bulk register application commands instead of one-by-one.
338
+ */
339
+ bulkRegister?: boolean;
340
+ /**
341
+ * Options for experimental features.
342
+ */
343
+ experimental?: {
344
+ /**
345
+ * Enable hooks. This allows you to utilize hooks such as `useInteraction()` to access the interaction object anywhere inside the command.
346
+ */
347
+ hooks?: boolean;
348
+ };
349
+ }
350
+ /**
351
+ * Private data for the CommandKit class.
352
+ */
353
+ interface CommandKitData extends CommandKitOptions {
354
+ commandHandler?: CommandHandler;
355
+ eventHandler?: EventHandler;
356
+ validationHandler?: ValidationHandler;
357
+ }
358
+ /**
359
+ * Represents a command context.
360
+ */
361
+ interface CommandContext<T extends Interaction, Cached extends CacheType> {
362
+ /**
363
+ * The interaction that triggered this command.
364
+ */
365
+ interaction: Interaction<CacheType>;
366
+ /**
367
+ * The client that instantiated this command.
368
+ */
369
+ client: Client;
370
+ /**
371
+ * The command data.
372
+ */
373
+ handler: CommandKit;
374
+ }
375
+ /**
376
+ * Represents a command file.
377
+ */
378
+ interface CommandFileObject {
379
+ data: CommandData;
380
+ options?: CommandOptions;
381
+ run: <Cached extends CacheType = CacheType>(ctx: CommandContext<Interaction, Cached>) => Awaited<void>;
382
+ autocomplete?: <Cached extends CacheType = CacheType>(ctx: CommandContext<Interaction, Cached>) => Awaited<void>;
383
+ filePath: string;
384
+ category: string | null;
385
+ [key: string]: any;
386
+ }
387
+ /**
388
+ * A reload type for commands.
389
+ */
390
+ type ReloadOptions = 'dev' | 'global' | ReloadType;
391
+
392
+ declare class CommandKit {
393
+ #private;
394
+ static _instance: CommandKit | null;
395
+ /**
396
+ * Create a new command and event handler with CommandKit.
397
+ *
398
+ * @param options - The default CommandKit configuration.
399
+ * @see {@link https://commandkit.js.org/docs/commandkit-setup}
400
+ */
401
+ constructor(options: CommandKitOptions);
402
+ /**
403
+ * Get the client attached to this CommandKit instance.
404
+ */
405
+ get client(): discord_js.Client<boolean>;
406
+ /**
407
+ * Get command handler instance.
408
+ */
409
+ get commandHandler(): CommandHandler | undefined;
410
+ /**
411
+ * Updates application commands with the latest from "commandsPath".
412
+ */
413
+ reloadCommands(type?: ReloadOptions): Promise<void>;
414
+ /**
415
+ * Updates application events with the latest from "eventsPath".
416
+ */
417
+ reloadEvents(): Promise<void>;
418
+ /**
419
+ * Updates application command validations with the latest from "validationsPath".
420
+ */
421
+ reloadValidations(): Promise<void>;
422
+ /**
423
+ * @returns An array of objects of all the commands that CommandKit is handling.
424
+ */
425
+ get commands(): CommandObject[];
426
+ /**
427
+ * @returns The path to the commands folder which was set when instantiating CommandKit.
428
+ */
429
+ get commandsPath(): string | undefined;
430
+ /**
431
+ * @returns The path to the events folder which was set when instantiating CommandKit.
432
+ */
433
+ get eventsPath(): string | undefined;
434
+ /**
435
+ * @returns The path to the validations folder which was set when instantiating CommandKit.
436
+ */
437
+ get validationsPath(): string | undefined;
438
+ /**
439
+ * @returns An array of all the developer user IDs which was set when instantiating CommandKit.
440
+ */
441
+ get devUserIds(): string[];
442
+ /**
443
+ * @returns An array of all the developer guild IDs which was set when instantiating CommandKit.
444
+ */
445
+ get devGuildIds(): string[];
446
+ /**
447
+ * @returns An array of all the developer role IDs which was set when instantiating CommandKit.
448
+ */
449
+ get devRoleIds(): string[];
450
+ }
451
+
452
+ export { type AutocompleteProps as A, type BuiltInValidationParams as B, CommandKit as C, type EventHandlerOptions as E, type MessageContextMenuCommandProps as M, ReloadType as R, type SlashCommandProps as S, type UserContextMenuCommandProps as U, type ValidationProps as V, type CommandProps as a, type ContextMenuCommandProps as b, type CommandOptions as c, type CommandData as d, type CommandObject as e, CommandHandler as f, type CommandKitInteraction as g, type hCommandContext as h, type CommandFileObject as i, type ReloadOptions as j, type CommandHandlerOptions as k, type CommandHandlerData as l, type BuiltInValidation as m, type EventHandlerData as n, EventHandler as o, type CommandKitOptions as p, type CommandKitData as q, type CommandContext as r };