@mostfeatured/dbi 0.1.47 → 0.2.1
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/src/DBI.d.ts.map +1 -0
- package/dist/src/DBI.js.map +1 -0
- package/dist/src/Events.d.ts.map +1 -0
- package/dist/src/Events.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/methods/handleMessageCommands.d.ts.map +1 -0
- package/dist/src/methods/handleMessageCommands.js.map +1 -0
- package/dist/src/methods/hookEventListeners.d.ts.map +1 -0
- package/dist/src/methods/hookEventListeners.js.map +1 -0
- package/dist/src/methods/hookInteractionListeners.d.ts.map +1 -0
- package/dist/{methods → src/methods}/hookInteractionListeners.js +22 -12
- package/dist/src/methods/hookInteractionListeners.js.map +1 -0
- package/dist/src/methods/publishInteractions.d.ts.map +1 -0
- package/dist/src/methods/publishInteractions.js.map +1 -0
- package/dist/src/types/ApplicationRoleConnectionMetadata.d.ts.map +1 -0
- package/dist/src/types/ApplicationRoleConnectionMetadata.js.map +1 -0
- package/dist/src/types/Builders/ButtonBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ButtonBuilder.js.map +1 -0
- package/dist/src/types/Builders/ChannelSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ChannelSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/MentionableSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/MentionableSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/ModalBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/ModalBuilder.js.map +1 -0
- package/dist/src/types/Builders/RoleSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/RoleSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/StringSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/StringSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/Builders/UserSelectMenuBuilder.d.ts.map +1 -0
- package/dist/src/types/Builders/UserSelectMenuBuilder.js.map +1 -0
- package/dist/src/types/ChatInput/ChatInput.d.ts.map +1 -0
- package/dist/src/types/ChatInput/ChatInput.js.map +1 -0
- package/dist/{types → src/types}/ChatInput/ChatInputOptions.d.ts +2 -2
- package/dist/src/types/ChatInput/ChatInputOptions.d.ts.map +1 -0
- package/dist/src/types/ChatInput/ChatInputOptions.js.map +1 -0
- package/dist/src/types/Components/Button.d.ts.map +1 -0
- package/dist/src/types/Components/Button.js.map +1 -0
- package/dist/src/types/Components/ChannelSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/ChannelSelectMenu.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.d.ts +91 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.js +300 -0
- package/dist/src/types/Components/HTMLComponentsV2/index.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/parser.d.ts.map +1 -0
- package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.js +11 -4
- package/dist/src/types/Components/HTMLComponentsV2/parser.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts +35 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js +822 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteParser.js.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts +24 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.d.ts.map +1 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js +294 -0
- package/dist/src/types/Components/HTMLComponentsV2/svelteRenderer.js.map +1 -0
- package/dist/src/types/Components/MentionableSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/MentionableSelectMenu.js.map +1 -0
- package/dist/src/types/Components/Modal.d.ts.map +1 -0
- package/dist/src/types/Components/Modal.js.map +1 -0
- package/dist/src/types/Components/RoleSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/RoleSelectMenu.js.map +1 -0
- package/dist/src/types/Components/StringSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/StringSelectMenu.js.map +1 -0
- package/dist/src/types/Components/UserSelectMenu.d.ts.map +1 -0
- package/dist/src/types/Components/UserSelectMenu.js.map +1 -0
- package/dist/src/types/Event.d.ts.map +1 -0
- package/dist/src/types/Event.js.map +1 -0
- package/dist/src/types/Interaction.d.ts.map +1 -0
- package/dist/src/types/Interaction.js.map +1 -0
- package/dist/src/types/other/CustomEvent.d.ts.map +1 -0
- package/dist/src/types/other/CustomEvent.js.map +1 -0
- package/dist/src/types/other/FakeMessageInteraction.d.ts.map +1 -0
- package/dist/src/types/other/FakeMessageInteraction.js.map +1 -0
- package/dist/src/types/other/InteractionLocale.d.ts.map +1 -0
- package/dist/src/types/other/InteractionLocale.js.map +1 -0
- package/dist/src/types/other/Locale.d.ts.map +1 -0
- package/dist/src/types/other/Locale.js.map +1 -0
- package/dist/src/types/other/MessageContextMenu.d.ts.map +1 -0
- package/dist/src/types/other/MessageContextMenu.js.map +1 -0
- package/dist/src/types/other/UserContextMenu.d.ts.map +1 -0
- package/dist/src/types/other/UserContextMenu.js.map +1 -0
- package/dist/src/utils/MemoryStore.d.ts.map +1 -0
- package/dist/src/utils/MemoryStore.js.map +1 -0
- package/dist/src/utils/UtilTypes.d.ts.map +1 -0
- package/dist/src/utils/UtilTypes.js.map +1 -0
- package/dist/src/utils/customId.d.ts.map +1 -0
- package/dist/src/utils/customId.js.map +1 -0
- package/dist/src/utils/permissions.d.ts.map +1 -0
- package/dist/src/utils/permissions.js.map +1 -0
- package/dist/src/utils/recursiveImport.d.ts.map +1 -0
- package/dist/src/utils/recursiveImport.js.map +1 -0
- package/dist/src/utils/recursiveUnload.d.ts.map +1 -0
- package/dist/src/utils/recursiveUnload.js.map +1 -0
- package/dist/src/utils/unloadModule.d.ts.map +1 -0
- package/dist/src/utils/unloadModule.js.map +1 -0
- package/dist/test/index.d.ts +2 -0
- package/dist/test/index.d.ts.map +1 -0
- package/dist/test/index.js +103 -0
- package/dist/test/index.js.map +1 -0
- package/docs/ADVANCED_FEATURES.md +836 -0
- package/docs/API_REFERENCE.md +925 -0
- package/docs/CHAT_INPUT.md +807 -0
- package/docs/COMPONENTS.md +1035 -0
- package/docs/EVENTS.md +564 -0
- package/docs/GETTING_STARTED.md +394 -0
- package/docs/LOCALIZATION.md +773 -0
- package/docs/README.md +341 -0
- package/docs/SVELTE_COMPONENTS.md +955 -0
- package/generated/globals.d.ts +1 -0
- package/generated/index.d.ts +30 -0
- package/generated/svelte-dbi.d.ts +588 -0
- package/package.json +57 -47
- package/readme.md +168 -491
- package/src/methods/hookInteractionListeners.ts +23 -12
- package/src/types/Components/HTMLComponentsV2/index.ts +353 -12
- package/src/types/Components/HTMLComponentsV2/parser.ts +14 -4
- package/src/types/Components/HTMLComponentsV2/svelteParser.ts +904 -0
- package/src/types/Components/HTMLComponentsV2/svelteRenderer.ts +332 -0
- package/test/index.ts +105 -0
- package/test/product-showcase.svelte +199 -0
- package/tsconfig.json +13 -3
- package/dist/DBI.d.ts.map +0 -1
- package/dist/DBI.js.map +0 -1
- package/dist/Events.d.ts.map +0 -1
- package/dist/Events.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/methods/handleMessageCommands.d.ts.map +0 -1
- package/dist/methods/handleMessageCommands.js.map +0 -1
- package/dist/methods/hookEventListeners.d.ts.map +0 -1
- package/dist/methods/hookEventListeners.js.map +0 -1
- package/dist/methods/hookInteractionListeners.d.ts.map +0 -1
- package/dist/methods/hookInteractionListeners.js.map +0 -1
- package/dist/methods/publishInteractions.d.ts.map +0 -1
- package/dist/methods/publishInteractions.js.map +0 -1
- package/dist/types/ApplicationRoleConnectionMetadata.d.ts.map +0 -1
- package/dist/types/ApplicationRoleConnectionMetadata.js.map +0 -1
- package/dist/types/Builders/ButtonBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ButtonBuilder.js.map +0 -1
- package/dist/types/Builders/ChannelSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ChannelSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/MentionableSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/MentionableSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/ModalBuilder.d.ts.map +0 -1
- package/dist/types/Builders/ModalBuilder.js.map +0 -1
- package/dist/types/Builders/RoleSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/RoleSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/StringSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/StringSelectMenuBuilder.js.map +0 -1
- package/dist/types/Builders/UserSelectMenuBuilder.d.ts.map +0 -1
- package/dist/types/Builders/UserSelectMenuBuilder.js.map +0 -1
- package/dist/types/ChatInput/ChatInput.d.ts.map +0 -1
- package/dist/types/ChatInput/ChatInput.js.map +0 -1
- package/dist/types/ChatInput/ChatInputOptions.d.ts.map +0 -1
- package/dist/types/ChatInput/ChatInputOptions.js.map +0 -1
- package/dist/types/Components/Button.d.ts.map +0 -1
- package/dist/types/Components/Button.js.map +0 -1
- package/dist/types/Components/ChannelSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/ChannelSelectMenu.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/index.d.ts +0 -19
- package/dist/types/Components/HTMLComponentsV2/index.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/index.js +0 -31
- package/dist/types/Components/HTMLComponentsV2/index.js.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/parser.d.ts.map +0 -1
- package/dist/types/Components/HTMLComponentsV2/parser.js.map +0 -1
- package/dist/types/Components/MentionableSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/MentionableSelectMenu.js.map +0 -1
- package/dist/types/Components/Modal.d.ts.map +0 -1
- package/dist/types/Components/Modal.js.map +0 -1
- package/dist/types/Components/RoleSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/RoleSelectMenu.js.map +0 -1
- package/dist/types/Components/StringSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/StringSelectMenu.js.map +0 -1
- package/dist/types/Components/UserSelectMenu.d.ts.map +0 -1
- package/dist/types/Components/UserSelectMenu.js.map +0 -1
- package/dist/types/Event.d.ts.map +0 -1
- package/dist/types/Event.js.map +0 -1
- package/dist/types/Interaction.d.ts.map +0 -1
- package/dist/types/Interaction.js.map +0 -1
- package/dist/types/other/CustomEvent.d.ts.map +0 -1
- package/dist/types/other/CustomEvent.js.map +0 -1
- package/dist/types/other/FakeMessageInteraction.d.ts.map +0 -1
- package/dist/types/other/FakeMessageInteraction.js.map +0 -1
- package/dist/types/other/InteractionLocale.d.ts.map +0 -1
- package/dist/types/other/InteractionLocale.js.map +0 -1
- package/dist/types/other/Locale.d.ts.map +0 -1
- package/dist/types/other/Locale.js.map +0 -1
- package/dist/types/other/MessageContextMenu.d.ts.map +0 -1
- package/dist/types/other/MessageContextMenu.js.map +0 -1
- package/dist/types/other/UserContextMenu.d.ts.map +0 -1
- package/dist/types/other/UserContextMenu.js.map +0 -1
- package/dist/utils/MemoryStore.d.ts.map +0 -1
- package/dist/utils/MemoryStore.js.map +0 -1
- package/dist/utils/UtilTypes.d.ts.map +0 -1
- package/dist/utils/UtilTypes.js.map +0 -1
- package/dist/utils/customId.d.ts.map +0 -1
- package/dist/utils/customId.js.map +0 -1
- package/dist/utils/permissions.d.ts.map +0 -1
- package/dist/utils/permissions.js.map +0 -1
- package/dist/utils/recursiveImport.d.ts.map +0 -1
- package/dist/utils/recursiveImport.js.map +0 -1
- package/dist/utils/recursiveUnload.d.ts.map +0 -1
- package/dist/utils/recursiveUnload.js.map +0 -1
- package/dist/utils/unloadModule.d.ts.map +0 -1
- package/dist/utils/unloadModule.js.map +0 -1
- package/examples/modal/dbi.js +0 -30
- package/examples/modal/login.js +0 -15
- package/examples/modal/package.json +0 -15
- package/examples/modal/publish.js +0 -13
- package/examples/modal/src/chatInput.js +0 -38
- package/examples/modal/src/components.js +0 -33
- package/examples/modal/src/event.js +0 -20
- package/examples/modal/src/interactionlocales.js +0 -24
- package/examples/modal/src/locales.js +0 -38
- package/examples/modal/src/modal.js +0 -28
- /package/dist/{DBI.d.ts → src/DBI.d.ts} +0 -0
- /package/dist/{DBI.js → src/DBI.js} +0 -0
- /package/dist/{Events.d.ts → src/Events.d.ts} +0 -0
- /package/dist/{Events.js → src/Events.js} +0 -0
- /package/dist/{data → src/data}/eventMap.json +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{index.js → src/index.js} +0 -0
- /package/dist/{methods → src/methods}/handleMessageCommands.d.ts +0 -0
- /package/dist/{methods → src/methods}/handleMessageCommands.js +0 -0
- /package/dist/{methods → src/methods}/hookEventListeners.d.ts +0 -0
- /package/dist/{methods → src/methods}/hookEventListeners.js +0 -0
- /package/dist/{methods → src/methods}/hookInteractionListeners.d.ts +0 -0
- /package/dist/{methods → src/methods}/publishInteractions.d.ts +0 -0
- /package/dist/{methods → src/methods}/publishInteractions.js +0 -0
- /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.d.ts +0 -0
- /package/dist/{types → src/types}/ApplicationRoleConnectionMetadata.js +0 -0
- /package/dist/{types → src/types}/Builders/ButtonBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ButtonBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ChannelSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/MentionableSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/ModalBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/ModalBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/RoleSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/StringSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.d.ts +0 -0
- /package/dist/{types → src/types}/Builders/UserSelectMenuBuilder.js +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInput.d.ts +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInput.js +0 -0
- /package/dist/{types → src/types}/ChatInput/ChatInputOptions.js +0 -0
- /package/dist/{types → src/types}/Components/Button.d.ts +0 -0
- /package/dist/{types → src/types}/Components/Button.js +0 -0
- /package/dist/{types → src/types}/Components/ChannelSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/ChannelSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.d.ts +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.js +0 -0
- /package/dist/{types → src/types}/Components/HTMLComponentsV2/parser.d.ts +0 -0
- /package/dist/{types → src/types}/Components/MentionableSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/MentionableSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/Modal.d.ts +0 -0
- /package/dist/{types → src/types}/Components/Modal.js +0 -0
- /package/dist/{types → src/types}/Components/RoleSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/RoleSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/StringSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/StringSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Components/UserSelectMenu.d.ts +0 -0
- /package/dist/{types → src/types}/Components/UserSelectMenu.js +0 -0
- /package/dist/{types → src/types}/Event.d.ts +0 -0
- /package/dist/{types → src/types}/Event.js +0 -0
- /package/dist/{types → src/types}/Interaction.d.ts +0 -0
- /package/dist/{types → src/types}/Interaction.js +0 -0
- /package/dist/{types → src/types}/other/CustomEvent.d.ts +0 -0
- /package/dist/{types → src/types}/other/CustomEvent.js +0 -0
- /package/dist/{types → src/types}/other/FakeMessageInteraction.d.ts +0 -0
- /package/dist/{types → src/types}/other/FakeMessageInteraction.js +0 -0
- /package/dist/{types → src/types}/other/InteractionLocale.d.ts +0 -0
- /package/dist/{types → src/types}/other/InteractionLocale.js +0 -0
- /package/dist/{types → src/types}/other/Locale.d.ts +0 -0
- /package/dist/{types → src/types}/other/Locale.js +0 -0
- /package/dist/{types → src/types}/other/MessageContextMenu.d.ts +0 -0
- /package/dist/{types → src/types}/other/MessageContextMenu.js +0 -0
- /package/dist/{types → src/types}/other/UserContextMenu.d.ts +0 -0
- /package/dist/{types → src/types}/other/UserContextMenu.js +0 -0
- /package/dist/{utils → src/utils}/MemoryStore.d.ts +0 -0
- /package/dist/{utils → src/utils}/MemoryStore.js +0 -0
- /package/dist/{utils → src/utils}/UtilTypes.d.ts +0 -0
- /package/dist/{utils → src/utils}/UtilTypes.js +0 -0
- /package/dist/{utils → src/utils}/customId.d.ts +0 -0
- /package/dist/{utils → src/utils}/customId.js +0 -0
- /package/dist/{utils → src/utils}/permissions.d.ts +0 -0
- /package/dist/{utils → src/utils}/permissions.js +0 -0
- /package/dist/{utils → src/utils}/recursiveImport.d.ts +0 -0
- /package/dist/{utils → src/utils}/recursiveImport.js +0 -0
- /package/dist/{utils → src/utils}/recursiveUnload.d.ts +0 -0
- /package/dist/{utils → src/utils}/recursiveUnload.js +0 -0
- /package/dist/{utils → src/utils}/unloadModule.d.ts +0 -0
- /package/dist/{utils → src/utils}/unloadModule.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RoleSelectMenuBuilder.js","sourceRoot":"","sources":["../../../../src/types/Builders/RoleSelectMenuBuilder.ts"],"names":[],"mappings":";;;AACA,mCAAoC;AAOpC,MAAa,wBAAwB;IACnC,SAAS,CAA+B;IACxC,SAAS,CAAsC;IAC/C,SAAS,CAAoF;IAC7F,YAAY,GAAwL;QAClM,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACjD,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,IAAI,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAA+D;QACxE,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAA+D;QACxE,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAqC;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAqC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAA,mBAAU,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAChG,CAAC;CAEF;AA5CD,4DA4CC","sourcesContent":["import { BaseSelectMenuComponentData, RoleSelectMenuComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport { DBIRoleSelectMenu } from \"../Components/RoleSelectMenu\";\r\nimport { RecursivePartial } from \"../../utils/UtilTypes\";\r\n\r\nexport type DBIRoleSelectMenuOverrides = RecursivePartial<Omit<RoleSelectMenuComponentData, \"customId\" | \"type\">>\r\n\r\nexport class DBIRoleSelectMenuBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBIRoleSelectMenu<TNamespace>\r\n overrides: Partial<DBIRoleSelectMenuOverrides>;\r\n reference: { data: (string | number | object | boolean | null | undefined)[], ttl?: number };\r\n constructor(arg: { component: DBIRoleSelectMenu<TNamespace>, overrides?: DBIRoleSelectMenuOverrides, reference?: { data: (string | number | object | boolean | null | undefined)[], ttl?: number } }) {\r\n this.component = arg.component;\r\n this.overrides = arg.overrides ?? {};\r\n this.reference = arg.reference ?? { data: [] };\r\n }\r\n\r\n setTTL(ttl: number): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = (this.reference.ttl ?? 0) + ttl;\r\n return this;\r\n }\r\n\r\n setData(...data: (string | number | object | boolean | null | undefined)[]): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object | boolean | null | undefined)[]): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBIRoleSelectMenuOverrides): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBIRoleSelectMenuOverrides): DBIRoleSelectMenuBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): BaseSelectMenuComponentData {\r\n return this.component.toJSON({ overrides: this.overrides as any, reference: this.reference });\r\n }\r\n\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringSelectMenuBuilder.d.ts","sourceRoot":"","sources":["../../../../src/types/Builders/StringSelectMenuBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AAExF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,CAAC,IAAI,CAAC,6BAA6B,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAA;AAErH,qBAAa,0BAA0B,CAAC,UAAU,SAAS,cAAc;IACvE,SAAS,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAA;IAC1C,SAAS,EAAE,4BAA4B,CAAC;IACxC,SAAS,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAA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5CD,gEA4CC","sourcesContent":["import { BaseSelectMenuComponentData, StringSelectMenuComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport { DBIStringSelectMenu } from \"../Components/StringSelectMenu\";\r\nimport { RecursivePartial } from \"../../utils/UtilTypes\";\r\n\r\nexport type DBIStringSelectMenuOverrides = RecursivePartial<Omit<StringSelectMenuComponentData, \"customId\" | \"type\">>\r\n\r\nexport class DBIStringSelectMenuBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBIStringSelectMenu<TNamespace>\r\n overrides: DBIStringSelectMenuOverrides;\r\n reference: { data: (string | number | object | boolean | null | undefined)[], ttl?: number };\r\n constructor(arg: { component: DBIStringSelectMenu<TNamespace>, overrides?: DBIStringSelectMenuOverrides, reference?: { data: (string | number | object | boolean | null | undefined)[], ttl?: number } }) {\r\n this.component = arg.component;\r\n this.overrides = arg.overrides ?? {};\r\n this.reference = arg.reference ?? { data: [] };\r\n }\r\n\r\n setTTL(ttl: number): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = (this.reference.ttl ?? 0) + ttl;\r\n return this;\r\n }\r\n\r\n setData(...data: (string | number | object | boolean | null | undefined)[]): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object | boolean | null | undefined)[]): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBIStringSelectMenuOverrides): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBIStringSelectMenuOverrides): DBIStringSelectMenuBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): BaseSelectMenuComponentData {\r\n return this.component.toJSON({ overrides: this.overrides as any, reference: this.reference });\r\n }\r\n\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserSelectMenuBuilder.d.ts","sourceRoot":"","sources":["../../../../src/types/Builders/UserSelectMenuBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAEtF,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,MAAM,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,IAAI,CAAC,2BAA2B,EAAE,UAAU,GAAG,MAAM,CAAC,CAAC,CAAA;AAEjH,qBAAa,wBAAwB,CAAC,UAAU,SAAS,cAAc;IACrE,SAAS,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;IACxC,SAAS,EAAE,0BAA0B,CAAC;IACtC,SAAS,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;gBACjF,GAAG,EAAE;QAAE,SAAS,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAAC,SAAS,CAAC,EAAE,0BAA0B,CAAC;QAAC,SAAS,CAAC,EAAE;YAAE,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,CAAC;YAAC,GAAG,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE;IAMpM,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,CAAC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AC,SAAS,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAA+D;QACxE,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CAAC,GAAG,IAA+D;QACxE,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAqC;QAChD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY,CAAC,SAAqC;QAChD,IAAI,CAAC,SAAS,GAAG,IAAA,mBAAU,EAAC,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,SAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;IAChG,CAAC;CAEF;AA5CD,4DA4CC","sourcesContent":["import { BaseSelectMenuComponentData, UserSelectMenuComponentData } from \"discord.js\";\r\nimport { defaultify } from \"stuffs\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport { DBIUserSelectMenu } from \"../Components/UserSelectMenu\";\r\nimport { RecursivePartial } from \"../../utils/UtilTypes\";\r\n\r\nexport type DBIUserSelectMenuOverrides = RecursivePartial<Omit<UserSelectMenuComponentData, \"customId\" | \"type\">>\r\n\r\nexport class DBIUserSelectMenuBuilder<TNamespace extends NamespaceEnums> {\r\n component: DBIUserSelectMenu<TNamespace>\r\n overrides: DBIUserSelectMenuOverrides;\r\n reference: { data: (string | number | object | boolean | null | undefined)[], ttl?: number };\r\n constructor(arg: { component: DBIUserSelectMenu<TNamespace>, overrides?: DBIUserSelectMenuOverrides, reference?: { data: (string | number | object | boolean | null | undefined)[], ttl?: number } }) {\r\n this.component = arg.component;\r\n this.overrides = arg.overrides ?? {};\r\n this.reference = arg.reference ?? { data: [] };\r\n }\r\n\r\n setTTL(ttl: number): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = ttl;\r\n return this;\r\n }\r\n\r\n addTTL(ttl: number): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.reference.ttl = (this.reference.ttl ?? 0) + ttl;\r\n return this;\r\n }\r\n\r\n setData(...data: (string | number | object | boolean | null | undefined)[]): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.reference.data = data;\r\n return this;\r\n }\r\n\r\n addData(...data: (string | number | object | boolean | null | undefined)[]): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.reference.data = [...this.reference.data, ...data];\r\n return this;\r\n }\r\n\r\n setOverrides(overrides: DBIUserSelectMenuOverrides): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.overrides = overrides;\r\n return this;\r\n }\r\n\r\n addOverrides(overrides: DBIUserSelectMenuOverrides): DBIUserSelectMenuBuilder<TNamespace> {\r\n this.overrides = defaultify(overrides, this.overrides, true);\r\n return this;\r\n }\r\n\r\n toJSON(): BaseSelectMenuComponentData {\r\n return this.component.toJSON({ overrides: this.overrides as any, reference: this.reference });\r\n }\r\n\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatInput.d.ts","sourceRoot":"","sources":["../../../../src/types/ChatInput/ChatInput.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB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AAc,GAAG,GAAG,CAAC,cAAc,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC/E,IAAI,CAAC,wBAAwB,GAAG,GAAG,CAAC,wBAAwB,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAC;IAC/G,CAAC;IACD,cAAc,CAAW;IACzB,wBAAwB,CAA+B;IAE9C,SAAS,CAAC,GAAwC,IAAG,CAAC;CAChE;AAhBD,oCAgBC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport { DBI } from \"../../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx } from \"../Interaction\";\r\n\r\nexport interface IDBIChatInputExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ChatInputCommandInteraction<\"cached\">;\r\n}\r\n\r\nexport type TDBIChatInputOmitted<TNamespace extends NamespaceEnums> = Omit<DBIChatInput<TNamespace>, \"type\" | \"dbi\" | \"ttl\" | \"at\" | \"toJSON\">;\r\n\r\nexport class DBIChatInput<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace, {}>, cfg: TDBIChatInputOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(cfg as any),\r\n type: \"ChatInput\",\r\n name: cfg.name.toLowerCase(),\r\n options: Array.isArray(cfg.options) ? cfg.options : []\r\n });\r\n\r\n this.directMessages = cfg.directMessages ?? dbi.config.defaults.directMessages;\r\n this.defaultMemberPermissions = cfg.defaultMemberPermissions ?? dbi.config.defaults.defaultMemberPermissions;\r\n }\r\n directMessages?: boolean;\r\n defaultMemberPermissions?: Discord.PermissionsString[];\r\n declare options?: any[];\r\n override onExecute(ctx: IDBIChatInputExecuteCtx<TNamespace>) {}\r\n}"]}
|
|
@@ -233,8 +233,8 @@ export declare class DBIChatInputOptions<TNamespace extends NamespaceEnums> {
|
|
|
233
233
|
name: string;
|
|
234
234
|
description: string;
|
|
235
235
|
required: boolean;
|
|
236
|
-
validate: (cfg: TDBIValidateCtx<TNamespace, Discord.
|
|
237
|
-
value: Discord.
|
|
236
|
+
validate: (cfg: TDBIValidateCtx<TNamespace, Discord.Channel | Discord.Role | Discord.User> & {
|
|
237
|
+
value: Discord.Channel | Discord.Role | Discord.User;
|
|
238
238
|
step: "Result";
|
|
239
239
|
}) => Promise<boolean> | boolean;
|
|
240
240
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChatInputOptions.d.ts","sourceRoot":"","sources":["../../../../src/types/ChatInput/ChatInputOptions.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEpD,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,aAAa,CACvB,QAAQ,EACR,MAAM,EACN,KAAK,SAAS,MAAM,EACpB,iBAAiB,GAAG,OAAO,IACzB;IACF,QAAQ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AAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC;IACJ,CAAC;IAED,IAAI,CACF,GAMG;QAEH,OAAO;YACL,IAAI,EAAE,oBAAO,CAAC,4BAA4B,CAAC,IAAI;YAC/C,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC;IACJ,CAAC;IAED,WAAW,CACT,GASG;QAEH,OAAO;YACL,IAAI,EAAE,oBAAO,CAAC,4BAA4B,CAAC,WAAW;YACtD,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC;IACJ,CAAC;IAED,IAAI,CACF,GAMG;QAEH,OAAO;YACL,IAAI,EAAE,oBAAO,CAAC,4BAA4B,CAAC,IAAI;YAC/C,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,WAAW,EAAE,GAAG,CAAC,WAAW;YAC5B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,GAAG,CAAC,QAAQ;SACvB,CAAC;IACJ,CAAC;CACF;AAzUD,kDAyUC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport { DBI } from \"../../DBI\";\r\nimport { IDBIBaseExecuteCtx } from \"../Interaction\";\r\n\r\nexport type TDBIValueName<T> = { value: T; name: string };\r\nexport type TDBIBaseOption = {\r\n name: string;\r\n description: string;\r\n required?: boolean;\r\n};\r\n\r\nexport type TDBIMinMaxLength = { maxLength?: number; minLength?: number };\r\nexport type TDBIMinMaxValue = { maxValue?: number; minValue?: number };\r\n\r\nexport type TDBIValidator<\r\n TExtends,\r\n TValue,\r\n TStep extends string,\r\n TExpectedResponse = boolean\r\n> = {\r\n validate?(\r\n cfg: TExtends & { value: TValue; step: TStep }\r\n ): Promise<TExpectedResponse> | TExpectedResponse;\r\n};\r\n\r\nexport interface IDBIValuedInteraction<\r\n TNamespace extends NamespaceEnums,\r\n TInteractionType extends Discord.Interaction,\r\n TValueType = string | number\r\n> extends Omit<IDBIBaseExecuteCtx<TNamespace>, 'interaction'> {\r\n value: TValueType;\r\n interaction: TInteractionType;\r\n}\r\n\r\nexport type TDBICompleteCtx<\r\n TNamespace extends NamespaceEnums,\r\n TValueType = string | number\r\n> = IDBIValuedInteraction<\r\n TNamespace,\r\n Discord.AutocompleteInteraction,\r\n TValueType\r\n>;\r\n\r\nexport type TDBIValidateCtx<\r\n TNamespace extends NamespaceEnums,\r\n TValueType = string | number\r\n> = IDBIValuedInteraction<TNamespace, Discord.Interaction, TValueType>;\r\n\r\nexport type TDBICompleter<\r\n TNamespace extends NamespaceEnums,\r\n TValueType extends number | string\r\n> = {\r\n onComplete(\r\n ctx: TDBICompleteCtx<TNamespace, string>\r\n ): Promise<TDBIValueName<TValueType>[]> | TDBIValueName<TValueType>[];\r\n};\r\n\r\nexport class DBIChatInputOptions<TNamespace extends NamespaceEnums> {\r\n dbi: DBI<TNamespace>;\r\n constructor(dbi: DBI<TNamespace>) {\r\n this.dbi = dbi;\r\n }\r\n stringAutocomplete(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxLength & {\r\n messageCommands?: { rest?: boolean };\r\n } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, string>,\r\n string,\r\n \"Autocomplete\" | \"Result\",\r\n boolean | TDBIValueName<string>\r\n > &\r\n TDBICompleter<TNamespace, string>\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.String,\r\n name: cfg.name,\r\n autocomplete: true,\r\n onComplete: cfg.onComplete,\r\n description: cfg.description,\r\n maxLength: cfg.maxLength,\r\n max_length: cfg.maxLength,\r\n minLength: cfg.minLength,\r\n min_length: cfg.minLength,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n stringChoices(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxLength & {\r\n choices: TDBIValueName<string>[];\r\n messageCommands?: { rest?: boolean };\r\n } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, string>,\r\n string,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.String,\r\n name: cfg.name,\r\n choices: cfg.choices,\r\n description: cfg.description,\r\n maxLength: cfg.maxLength,\r\n max_length: cfg.maxLength,\r\n minLength: cfg.minLength,\r\n min_length: cfg.minLength,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n string(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxLength & {\r\n messageCommands?: { rest?: boolean };\r\n } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, string>,\r\n string,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.String,\r\n name: cfg.name,\r\n description: cfg.description,\r\n maxLength: cfg.maxLength,\r\n max_length: cfg.maxLength,\r\n minLength: cfg.minLength,\r\n min_length: cfg.minLength,\r\n required: cfg.required,\r\n messageCommands: cfg.messageCommands,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n numberAutocomplete(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Autocomplete\" | \"Result\",\r\n boolean | TDBIValueName<number>\r\n > &\r\n TDBICompleter<TNamespace, number>\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Number,\r\n name: cfg.name,\r\n autocomplete: true,\r\n onComplete: cfg.onComplete,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n numberChoices(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue & { choices: TDBIValueName<number>[] } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Number,\r\n name: cfg.name,\r\n choices: cfg.choices,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n number(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Number,\r\n name: cfg.name,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n integerAutocomplete(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Autocomplete\" | \"Result\",\r\n boolean | TDBIValueName<number>\r\n > &\r\n TDBICompleter<TNamespace, number>\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Integer,\r\n name: cfg.name,\r\n autocomplete: true,\r\n onComplete: cfg.onComplete,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n integerChoices(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue & { choices: TDBIValueName<number>[] } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Integer,\r\n name: cfg.name,\r\n choices: cfg.choices,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n integer(\r\n cfg: TDBIBaseOption &\r\n TDBIMinMaxValue &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, number>,\r\n number,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Integer,\r\n name: cfg.name,\r\n description: cfg.description,\r\n maxValue: cfg.maxValue,\r\n max_value: cfg.maxValue,\r\n minValue: cfg.minValue,\r\n min_value: cfg.minValue,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n boolean(cfg: TDBIBaseOption) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Boolean,\r\n name: cfg.name,\r\n description: cfg.description,\r\n required: cfg.required,\r\n };\r\n }\r\n\r\n attachment(\r\n cfg: TDBIBaseOption &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, Discord.Attachment>,\r\n Discord.Attachment,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Attachment,\r\n name: cfg.name,\r\n description: cfg.description,\r\n required: cfg.required,\r\n };\r\n }\r\n\r\n channel(\r\n cfg: TDBIBaseOption & {\r\n channelTypes: Discord.ChannelType[];\r\n } & TDBIValidator<\r\n TDBIValidateCtx<TNamespace, Discord.Channel>,\r\n Discord.Channel,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Channel,\r\n name: cfg.name,\r\n description: cfg.description,\r\n channelTypes: cfg.channelTypes,\r\n channel_types: cfg.channelTypes,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n role(\r\n cfg: TDBIBaseOption &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, Discord.Role>,\r\n Discord.Role,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Role,\r\n name: cfg.name,\r\n description: cfg.description,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n mentionable(\r\n cfg: TDBIBaseOption &\r\n TDBIValidator<\r\n TDBIValidateCtx<\r\n TNamespace,\r\n Discord.Role | Discord.Channel | Discord.User\r\n >,\r\n Discord.Role | Discord.Channel | Discord.User,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.Mentionable,\r\n name: cfg.name,\r\n description: cfg.description,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n\r\n user(\r\n cfg: TDBIBaseOption &\r\n TDBIValidator<\r\n TDBIValidateCtx<TNamespace, Discord.User>,\r\n Discord.User,\r\n \"Result\",\r\n boolean\r\n >\r\n ) {\r\n return {\r\n type: Discord.ApplicationCommandOptionType.User,\r\n name: cfg.name,\r\n description: cfg.description,\r\n required: cfg.required,\r\n validate: cfg.validate,\r\n };\r\n }\r\n}\r\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../src/types/Components/Button.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAA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AmC;QACnE,KAAK,CAAC,GAAG,EAAE;YACT,GAAI,IAAY;YAChB,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAqC,IAAI,CAAC;IAAA,CAAC;IACrD,MAAM,CAAC,MAA0C,EAAE;QAC1D,OAAO;YACL,GAAG,gBAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;YACtE,QAAQ,EAAE,IAAA,wBAAa,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;YACpG,IAAI,EAAE,oBAAO,CAAC,aAAa,CAAC,MAAM;SAC5B,CAAC;IACX,CAAC;IAAA,CAAC;IACF,aAAa,CAAC,MAA0C,EAAE;QACxD,OAAO,IAAI,gCAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;IAC1D,CAAC;CAEF;AAtBD,8BAsBC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { DBI } from \"../../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"../Interaction\";\r\nimport { buildCustomId } from \"../../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\nimport { DBIButtonBuilder, DBIButtonOverrides } from \"../Builders/ButtonBuilder\";\r\n\r\nexport interface IDBIButtonExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ButtonInteraction<\"cached\">;\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport type TDBIButtonOmitted<TNamespace extends NamespaceEnums> = Omit<DBIButton<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\" | \"createBuilder\" | \"at\">;\r\n\r\nexport class DBIButton<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBIButtonOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"Button\",\r\n });\r\n }\r\n\r\n declare options?: Omit<Discord.ButtonComponentData, \"customId\" | \"type\">;\r\n\r\n override onExecute(ctx: IDBIButtonExecuteCtx<TNamespace>) { };\r\n override toJSON(arg: IDBIToJSONArgs<DBIButtonOverrides> = {}): Discord.ButtonComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),\r\n type: Discord.ComponentType.Button,\r\n } as any;\r\n };\r\n createBuilder(arg: IDBIToJSONArgs<DBIButtonOverrides> = {}): DBIButtonBuilder<TNamespace> {\r\n return new DBIButtonBuilder({ component: this, ...arg })\r\n }\r\n\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelSelectMenu.d.ts","sourceRoot":"","sources":["../../../../src/types/Components/ChannelSelectMenu.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE5F,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAElH,MAAM,WAAW,+BAA+B,CAAC,UAAU,SAAS,cAAc,CAAE,SAAQ,kBAAkB,CAA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AC,CAAC;IACL,CAAC;IAIQ,SAAS,CAAC,GAAgD,IAAI,CAAC;IAAA,CAAC;IAEhE,MAAM,CAAC,MAAqD,EAAE;QACrE,OAAO;YACL,GAAG,gBAAM,CAAC,UAAU,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,IAAI,CAAC;YACtE,QAAQ,EAAE,IAAA,wBAAa,EAAC,IAAI,CAAC,GAAU,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,CAAC;YACpG,IAAI,EAAE,oBAAO,CAAC,aAAa,CAAC,aAAa;SACnC,CAAC;IACX,CAAC;IAAA,CAAC;IAEF,aAAa,CAAC,MAAqD,EAAE;QACnE,OAAO,IAAI,sDAA2B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,GAAG,EAAE,CAAC,CAAA;IACrE,CAAC;CAEF;AAxBD,oDAwBC","sourcesContent":["import Discord from \"discord.js\";\r\nimport { DBI } from \"../../DBI\";\r\nimport { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from \"../Interaction\";\r\nimport { buildCustomId } from \"../../utils/customId\";\r\nimport { IDBIToJSONArgs } from \"../../utils/UtilTypes\";\r\nimport { NamespaceEnums } from \"../../../generated/namespaceData\";\r\nimport stuffs from \"stuffs\";\r\nimport { DBIChannelSelectMenuBuilder, DBIChannelSelectMenuOverrides } from \"../Builders/ChannelSelectMenuBuilder\";\r\n\r\nexport interface IDBIChannelSelectMenuExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {\r\n interaction: Discord.ChannelSelectMenuInteraction<\"cached\">;\r\n data: TDBIReferencedData[];\r\n}\r\n\r\nexport type TDBIChannelSelectMenuOmitted<TNamespace extends NamespaceEnums> = Omit<DBIChannelSelectMenu<TNamespace>, \"type\" | \"description\" | \"dbi\" | \"toJSON\" | \"createBuilder\" | \"at\">;\r\n\r\nexport type SelectMenuDefaultOptions = Omit<Discord.ChannelSelectMenuComponentData, \"customId\" | \"type\" | \"options\">;\r\n\r\nexport class DBIChannelSelectMenu<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {\r\n constructor(dbi: DBI<TNamespace>, args: TDBIChannelSelectMenuOmitted<TNamespace>) {\r\n super(dbi, {\r\n ...(args as any),\r\n type: \"ChannelSelectMenu\",\r\n });\r\n }\r\n\r\n declare options?: SelectMenuDefaultOptions;\r\n\r\n override onExecute(ctx: IDBIChannelSelectMenuExecuteCtx<TNamespace>) { };\r\n\r\n override toJSON(arg: IDBIToJSONArgs<DBIChannelSelectMenuOverrides> = {}): Discord.ChannelSelectMenuComponentData {\r\n return {\r\n ...stuffs.defaultify((arg?.overrides || {}), this.options || {}, true),\r\n customId: buildCustomId(this.dbi as any, this.name, arg?.reference?.data || [], arg?.reference?.ttl),\r\n type: Discord.ComponentType.ChannelSelect,\r\n } as any;\r\n };\r\n\r\n createBuilder(arg: IDBIToJSONArgs<DBIChannelSelectMenuOverrides> = {}): DBIChannelSelectMenuBuilder<TNamespace> {\r\n return new DBIChannelSelectMenuBuilder({ component: this, ...arg })\r\n }\r\n\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HTMLComponentsV2Handlers.d.ts","sourceRoot":"","sources":["../../../../../src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,mCAAmC,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAAE,m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;sEA1DnD,IAAI;;;CAiEvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HTMLComponentsV2Handlers.js","sourceRoot":"","sources":["../../../../../src/types/Components/HTMLComponentsV2/HTMLComponentsV2Handlers.ts"],"names":[],"mappings":";;;AAeA,MAAa,2BAA2B;IACtC,GAAG,CAAkB;IAErB,YAAY,GAAoB;QAC9B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,GAA8D;QACnE,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,QAAQ;SACf,CAAA;IACH,CAAC;IAED,iBAAiB,CAAC,GAAyE;QACzF,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,mBAAmB;SAC1B,CAAA;IACH,CAAC;IAED,qBAAqB,CAAC,GAA6E;QACjG,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,uBAAuB;SAC9B,CAAA;IACH,CAAC;IAED,KAAK,CAAC,GAA6D;QACjE,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,OAAO;SACd,CAAA;IACH,CAAC;IAED,cAAc,CAAC,GAAsE;QACnF,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,gBAAgB;SACvB,CAAA;IACH,CAAC;IAED,gBAAgB,CAAC,GAAwE;QACvF,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,kBAAkB;SACzB,CAAA;IACH,CAAC;IAED,cAAc,CAAC,GAAsE;QACnF,OAAO;YACL,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,IAAI,EAAE,gBAAgB;SACvB,CAAA;IACH,CAAC;CACF;AA9DD,kEA8DC","sourcesContent":["import { NamespaceEnums } from \"../../../../generated/namespaceData\";\r\nimport { DBI } from \"../../../DBI\";\r\nimport { IDBIButtonExecuteCtx } from \"../Button\";\r\nimport { IDBIChannelSelectMenuExecuteCtx } from \"../ChannelSelectMenu\";\r\nimport { IDBIMentionableSelectMenuExecuteCtx } from \"../MentionableSelectMenu\";\r\nimport { IDBIModalExecuteCtx } from \"../Modal\";\r\nimport { IDBIRoleSelectMenuExecuteCtx } from \"../RoleSelectMenu\";\r\nimport { IDBIStringSelectMenuExecuteCtx } from \"../StringSelectMenu\";\r\nimport { IDBIUserSelectMenuExecuteCtx } from \"../UserSelectMenu\";\r\n\r\nexport interface IDBIHanlder<TNamespace extends NamespaceEnums, TExecuteCtx> {\r\n name: string;\r\n onExecute?: (ctx: TExecuteCtx) => void;\r\n}\r\n\r\nexport class DBIHTMLComponentsV2Handlers<TNamespace extends NamespaceEnums> {\r\n dbi: DBI<TNamespace>;\r\n\r\n constructor(dbi: DBI<TNamespace>) {\r\n this.dbi = dbi;\r\n }\r\n\r\n button(cfg: IDBIHanlder<TNamespace, IDBIButtonExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"Button\",\r\n }\r\n }\r\n\r\n channelSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIChannelSelectMenuExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"ChannelSelectMenu\",\r\n }\r\n }\r\n\r\n mentionableSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIMentionableSelectMenuExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"MentionableSelectMenu\",\r\n }\r\n }\r\n\r\n modal(cfg: IDBIHanlder<TNamespace, IDBIModalExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"Modal\",\r\n }\r\n }\r\n\r\n roleSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIRoleSelectMenuExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"RoleSelectMenu\",\r\n }\r\n }\r\n\r\n stringSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIStringSelectMenuExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"StringSelectMenu\",\r\n }\r\n }\r\n\r\n userSelectMenu(cfg: IDBIHanlder<TNamespace, IDBIUserSelectMenuExecuteCtx<TNamespace>>) {\r\n return {\r\n name: cfg.name,\r\n onExecute: cfg.onExecute,\r\n type: \"UserSelectMenu\",\r\n }\r\n }\r\n}"]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { NamespaceEnums } from "../../../../generated/namespaceData";
|
|
2
|
+
import { DBI } from "../../../DBI";
|
|
3
|
+
import { DBIBaseInteraction, IDBIBaseExecuteCtx, TDBIReferencedData } from "../../Interaction";
|
|
4
|
+
export type TDBIHTMLComponentsV2Omitted<TNamespace extends NamespaceEnums> = Omit<DBIHTMLComponentsV2<TNamespace>, "type" | "dbi" | "toJSON" | "description" | "send" | "destroy" | "destroyAll"> & {
|
|
5
|
+
/**
|
|
6
|
+
* Use 'svelte' for Svelte 5 components, 'eta' for Eta templates (default)
|
|
7
|
+
*/
|
|
8
|
+
mode?: 'svelte' | 'eta';
|
|
9
|
+
/**
|
|
10
|
+
* Callback executed when the component interaction is triggered
|
|
11
|
+
*/
|
|
12
|
+
onExecute?: (ctx: IDBIHTMLComponentsV2ExecuteCtx<TNamespace>) => void;
|
|
13
|
+
};
|
|
14
|
+
export type TDBIHTMLComponentsV2ToJSONArgs = {
|
|
15
|
+
data?: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
export interface TDBIHTMLComponentsV2SendOptions {
|
|
18
|
+
data?: Record<string, any>;
|
|
19
|
+
flags?: string[];
|
|
20
|
+
content?: string;
|
|
21
|
+
ephemeral?: boolean;
|
|
22
|
+
/** If true, uses interaction.reply(). If false or unset, auto-detects based on target type */
|
|
23
|
+
reply?: boolean;
|
|
24
|
+
/** If true, uses interaction.followUp() instead of reply() */
|
|
25
|
+
followUp?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface IDBIHTMLComponentsV2ExecuteCtx<TNamespace extends NamespaceEnums> extends IDBIBaseExecuteCtx<TNamespace> {
|
|
28
|
+
data: TDBIReferencedData[];
|
|
29
|
+
}
|
|
30
|
+
export declare class DBIHTMLComponentsV2<TNamespace extends NamespaceEnums> extends DBIBaseInteraction<TNamespace> {
|
|
31
|
+
template?: string;
|
|
32
|
+
file?: string;
|
|
33
|
+
mode: 'svelte' | 'eta';
|
|
34
|
+
private svelteComponentInfo;
|
|
35
|
+
private _userOnExecute?;
|
|
36
|
+
private _activeContexts;
|
|
37
|
+
constructor(dbi: DBI<TNamespace>, args: TDBIHTMLComponentsV2Omitted<TNamespace>);
|
|
38
|
+
private _handleExecute;
|
|
39
|
+
toJSON(arg?: TDBIHTMLComponentsV2ToJSONArgs): any;
|
|
40
|
+
/**
|
|
41
|
+
* Send the component to an interaction or channel and initialize lifecycle hooks (onMount)
|
|
42
|
+
* This is the recommended way to send Svelte components with intervals/timers
|
|
43
|
+
*
|
|
44
|
+
* @param target - Discord interaction or channel to send to
|
|
45
|
+
* @param options - Send options including data, flags, content
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const showcase = dbi.interaction("product-showcase");
|
|
50
|
+
*
|
|
51
|
+
* // Send as interaction reply
|
|
52
|
+
* await showcase.send(interaction, { data: { count: 0 } });
|
|
53
|
+
*
|
|
54
|
+
* // Send to a channel directly
|
|
55
|
+
* await showcase.send(channel, { data: { count: 0 } });
|
|
56
|
+
*
|
|
57
|
+
* // Send as followUp (if already replied)
|
|
58
|
+
* await showcase.send(interaction, { data: { count: 0 }, followUp: true });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
send(target: any, options?: TDBIHTMLComponentsV2SendOptions): Promise<any>;
|
|
62
|
+
/**
|
|
63
|
+
* Destroy a component instance by ref ID or data object
|
|
64
|
+
* This runs onDestroy callbacks (clears intervals/timers) and removes the ref
|
|
65
|
+
*
|
|
66
|
+
* @param refOrData - Either a ref ID string or the data object with $ref
|
|
67
|
+
* @returns true if destroyed, false if not found
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* // Destroy by data object
|
|
72
|
+
* showcase.destroy(data);
|
|
73
|
+
*
|
|
74
|
+
* // Destroy by ref ID
|
|
75
|
+
* showcase.destroy(data.$ref);
|
|
76
|
+
*
|
|
77
|
+
* // Destroy all active instances of this component
|
|
78
|
+
* showcase.destroyAll();
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
destroy(refOrData: string | Record<string, any>): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Destroy all active instances of this component
|
|
84
|
+
* Useful for cleanup when the bot shuts down or component is unloaded
|
|
85
|
+
*
|
|
86
|
+
* @returns Number of instances destroyed
|
|
87
|
+
*/
|
|
88
|
+
destroyAll(): number;
|
|
89
|
+
handlers?: any[];
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/Components/HTMLComponentsV2/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,kBAAk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AAO,CAAC,cAAc,CAAC,CAA4D;IAInF,OAAO,CAAC,eAAe,CAA+B;gBAE1C,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,2BAA2B,CAAC,UAAU,CAAC;IAqC/E,OAAO,CAAC,cAAc;IAoHb,MAAM,CAAC,GAAG,GAAE,8BAAmC,GAAG,GAAG;IA4B9D;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,GAAE,+BAAoC,GAAG,OAAO,CAAC,GAAG,CAAC;IAyEpF;;;;;;;;;;;;;;;;;;OAkBG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO;IAuBzD;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAapB,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAM;CACvB"}
|
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DBIHTMLComponentsV2 = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Interaction_1 = require("../../Interaction");
|
|
6
|
+
const parser_1 = require("./parser");
|
|
7
|
+
const svelteRenderer_1 = require("./svelteRenderer");
|
|
8
|
+
const svelteParser_1 = require("./svelteParser");
|
|
9
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
10
|
+
class DBIHTMLComponentsV2 extends Interaction_1.DBIBaseInteraction {
|
|
11
|
+
template;
|
|
12
|
+
file;
|
|
13
|
+
mode = 'eta';
|
|
14
|
+
svelteComponentInfo = null;
|
|
15
|
+
_userOnExecute;
|
|
16
|
+
// Store handler contexts per ref for lifecycle management
|
|
17
|
+
// Key: ref id, Value: handlerContext with lifecycle hooks
|
|
18
|
+
_activeContexts = new Map();
|
|
19
|
+
constructor(dbi, args) {
|
|
20
|
+
// Store user's onExecute callback before passing to super
|
|
21
|
+
const userOnExecute = args.onExecute;
|
|
22
|
+
// Remove onExecute from args so it doesn't override the class method
|
|
23
|
+
const argsWithoutOnExecute = { ...args };
|
|
24
|
+
delete argsWithoutOnExecute.onExecute;
|
|
25
|
+
super(dbi, {
|
|
26
|
+
...argsWithoutOnExecute,
|
|
27
|
+
type: "HTMLComponentsV2",
|
|
28
|
+
});
|
|
29
|
+
this.template = args.template || (args.file ? fs_1.default.readFileSync(args.file, "utf-8") : undefined);
|
|
30
|
+
this.file = args.file;
|
|
31
|
+
this.name = args.name;
|
|
32
|
+
this.handlers = args.handlers || [];
|
|
33
|
+
this.mode = args.mode || 'eta';
|
|
34
|
+
// Store user's onExecute callback if provided
|
|
35
|
+
if (userOnExecute) {
|
|
36
|
+
this._userOnExecute = userOnExecute;
|
|
37
|
+
}
|
|
38
|
+
// Pre-extract Svelte handlers at registration time
|
|
39
|
+
if (this.mode === 'svelte' && this.template) {
|
|
40
|
+
this.svelteComponentInfo = (0, svelteParser_1.parseSvelteComponent)(this.template);
|
|
41
|
+
// Debug log
|
|
42
|
+
console.log(`[Svelte] Component "${this.name}" registered with handlers:`, Array.from(this.svelteComponentInfo.handlers.entries()));
|
|
43
|
+
}
|
|
44
|
+
// Re-assign onExecute method after super() call because parent class sets it to undefined
|
|
45
|
+
this.onExecute = this._handleExecute.bind(this);
|
|
46
|
+
}
|
|
47
|
+
_handleExecute(ctx) {
|
|
48
|
+
console.log("[Svelte] onExecute called with data:", ctx.data);
|
|
49
|
+
// Call user's onExecute callback first if provided
|
|
50
|
+
if (this._userOnExecute) {
|
|
51
|
+
this._userOnExecute(ctx);
|
|
52
|
+
}
|
|
53
|
+
// If using Svelte mode, find and execute the handler
|
|
54
|
+
if (this.mode === 'svelte' && this.svelteComponentInfo) {
|
|
55
|
+
const [elementName, ...handlerData] = ctx.data;
|
|
56
|
+
console.log("[Svelte] Element name:", elementName, "Handler data:", handlerData);
|
|
57
|
+
if (typeof elementName === 'string') {
|
|
58
|
+
// Find the handler info for this element
|
|
59
|
+
const handlerInfo = this.svelteComponentInfo.handlers.get(elementName);
|
|
60
|
+
console.log("[Svelte] Handler info:", handlerInfo);
|
|
61
|
+
if (handlerInfo) {
|
|
62
|
+
// Extract current state from handlerData (refs that were passed)
|
|
63
|
+
// The second element in data array contains the current state
|
|
64
|
+
const currentState = handlerData[0] || {};
|
|
65
|
+
console.log("[Svelte] Current state:", currentState);
|
|
66
|
+
// Get ref id for lifecycle tracking (if available)
|
|
67
|
+
const refId = currentState?.$ref || null;
|
|
68
|
+
// Check if this is first execution for this ref
|
|
69
|
+
const isFirstExecution = refId && !this._activeContexts.has(refId);
|
|
70
|
+
// Get existing context if any (to preserve lifecycle callbacks like intervals)
|
|
71
|
+
const existingContext = refId ? this._activeContexts.get(refId) : null;
|
|
72
|
+
// Create a NEW handler context for each execution with the current state
|
|
73
|
+
// This ensures each interaction has its own isolated state
|
|
74
|
+
// Pass 'this' so handlers can access component methods like toJSON()
|
|
75
|
+
// Pass ctx so handlers can access ctx.interaction, ctx.data, ctx.locale, etc.
|
|
76
|
+
const handlerContext = (0, svelteParser_1.createHandlerContext)(this.svelteComponentInfo.scriptContent, typeof currentState === 'object' ? currentState : {}, this, ctx);
|
|
77
|
+
const handlerFn = handlerContext.handlers[handlerInfo.handlerName];
|
|
78
|
+
console.log("[Svelte] Handler function:", handlerFn ? "found" : "not found", handlerInfo.handlerName);
|
|
79
|
+
if (handlerFn && typeof handlerFn === 'function') {
|
|
80
|
+
try {
|
|
81
|
+
// Store context for lifecycle management
|
|
82
|
+
if (refId) {
|
|
83
|
+
// If there's an existing context, transfer its destroy callbacks to the new context
|
|
84
|
+
// This preserves intervals/timers created in onMount
|
|
85
|
+
if (existingContext && existingContext.destroyCallbacks) {
|
|
86
|
+
// Merge existing destroy callbacks (don't run them!)
|
|
87
|
+
handlerContext.destroyCallbacks.push(...existingContext.destroyCallbacks);
|
|
88
|
+
}
|
|
89
|
+
this._activeContexts.set(refId, handlerContext);
|
|
90
|
+
// Wrap $unRef to call onDestroy when ref is deleted (only wrap once)
|
|
91
|
+
const stateObj = currentState;
|
|
92
|
+
if (stateObj.$unRef && !stateObj.__unRefWrapped__) {
|
|
93
|
+
const originalUnRef = stateObj.$unRef.bind(stateObj);
|
|
94
|
+
stateObj.$unRef = () => {
|
|
95
|
+
// Run destroy callbacks before unref
|
|
96
|
+
const ctx = this._activeContexts.get(refId);
|
|
97
|
+
if (ctx && ctx.runDestroy) {
|
|
98
|
+
ctx.runDestroy();
|
|
99
|
+
}
|
|
100
|
+
this._activeContexts.delete(refId);
|
|
101
|
+
return originalUnRef();
|
|
102
|
+
};
|
|
103
|
+
stateObj.__unRefWrapped__ = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
// Run onMount callbacks only on first execution
|
|
107
|
+
if (isFirstExecution && handlerContext.runMount) {
|
|
108
|
+
handlerContext.runMount();
|
|
109
|
+
}
|
|
110
|
+
// Mark that we're inside handler execution (prevents auto-render during handler)
|
|
111
|
+
handlerContext.setInHandler(true);
|
|
112
|
+
try {
|
|
113
|
+
// Bind 'this' to the DBIHTMLComponentsV2 instance so handlers can use this.toJSON()
|
|
114
|
+
// Pass wrappedCtx so handlers use the proxy-wrapped ctx that tracks interaction calls
|
|
115
|
+
// This ensures __asyncInteractionCalled__ flag is set when handler calls ctx.interaction.reply() etc.
|
|
116
|
+
handlerFn.call(this, handlerContext.wrappedCtx, ...handlerData.slice(1));
|
|
117
|
+
}
|
|
118
|
+
finally {
|
|
119
|
+
// Always reset handler execution flag
|
|
120
|
+
handlerContext.setInHandler(false);
|
|
121
|
+
}
|
|
122
|
+
// Run effects after handler execution (state may have changed)
|
|
123
|
+
handlerContext.runEffects();
|
|
124
|
+
// If there are pending data changes and no interaction method was called,
|
|
125
|
+
// flush the render now (synchronously uses interaction.update)
|
|
126
|
+
if (handlerContext.hasPendingRender()) {
|
|
127
|
+
handlerContext.flushRender();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
console.error(`Error executing Svelte handler '${handlerInfo.handlerName}':`, error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
console.warn(`Handler function '${handlerInfo.handlerName}' not found for element '${elementName}'`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
console.warn(`No handler info found for element '${elementName}'`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
toJSON(arg = {}) {
|
|
145
|
+
if (this.mode === 'svelte' && this.template) {
|
|
146
|
+
// Render Svelte component
|
|
147
|
+
const result = (0, svelteRenderer_1.renderSvelteComponent)(this.dbi, this.template, this.name, {
|
|
148
|
+
data: arg.data,
|
|
149
|
+
ttl: this.ttl
|
|
150
|
+
});
|
|
151
|
+
return result.components;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// Use Eta template parsing (default)
|
|
155
|
+
return (0, parser_1.parseHTMLComponentsV2)(this.dbi, this.template, this.name, {
|
|
156
|
+
data: arg.data,
|
|
157
|
+
ttl: this.ttl
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Send the component to an interaction or channel and initialize lifecycle hooks (onMount)
|
|
163
|
+
* This is the recommended way to send Svelte components with intervals/timers
|
|
164
|
+
*
|
|
165
|
+
* @param target - Discord interaction or channel to send to
|
|
166
|
+
* @param options - Send options including data, flags, content
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* ```ts
|
|
170
|
+
* const showcase = dbi.interaction("product-showcase");
|
|
171
|
+
*
|
|
172
|
+
* // Send as interaction reply
|
|
173
|
+
* await showcase.send(interaction, { data: { count: 0 } });
|
|
174
|
+
*
|
|
175
|
+
* // Send to a channel directly
|
|
176
|
+
* await showcase.send(channel, { data: { count: 0 } });
|
|
177
|
+
*
|
|
178
|
+
* // Send as followUp (if already replied)
|
|
179
|
+
* await showcase.send(interaction, { data: { count: 0 }, followUp: true });
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
async send(target, options = {}) {
|
|
183
|
+
const { data = {}, flags = ["IsComponentsV2"], content, ephemeral, reply, followUp } = options;
|
|
184
|
+
// Render components
|
|
185
|
+
const components = this.toJSON({ data });
|
|
186
|
+
// Build message options
|
|
187
|
+
const messageOptions = { components, flags };
|
|
188
|
+
if (content)
|
|
189
|
+
messageOptions.content = content;
|
|
190
|
+
if (ephemeral)
|
|
191
|
+
messageOptions.flags = [...flags, "Ephemeral"];
|
|
192
|
+
// Detect target type and send accordingly
|
|
193
|
+
let message;
|
|
194
|
+
const isInteraction = target.reply && target.user; // Interactions have both reply method and user property
|
|
195
|
+
const isChannel = target.send && !target.user; // Channels have send but no user
|
|
196
|
+
if (isInteraction) {
|
|
197
|
+
if (followUp) {
|
|
198
|
+
message = await target.followUp(messageOptions);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
message = await target.reply(messageOptions);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else if (isChannel) {
|
|
205
|
+
message = await target.send(messageOptions);
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
throw new Error("Invalid target: must be an interaction or channel");
|
|
209
|
+
}
|
|
210
|
+
// If Svelte mode, create initial handler context and run onMount
|
|
211
|
+
if (this.mode === 'svelte' && this.svelteComponentInfo && data.$ref) {
|
|
212
|
+
const refId = data.$ref;
|
|
213
|
+
// Create handler context with a fake ctx that has the message
|
|
214
|
+
const fakeCtx = {
|
|
215
|
+
interaction: {
|
|
216
|
+
replied: true,
|
|
217
|
+
deferred: false,
|
|
218
|
+
message: message,
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
const handlerContext = (0, svelteParser_1.createHandlerContext)(this.svelteComponentInfo.scriptContent, data, this, fakeCtx);
|
|
222
|
+
// Store the context for lifecycle management
|
|
223
|
+
this._activeContexts.set(refId, handlerContext);
|
|
224
|
+
// Wrap $unRef to call onDestroy when ref is deleted
|
|
225
|
+
if (data.$unRef) {
|
|
226
|
+
const originalUnRef = data.$unRef.bind(data);
|
|
227
|
+
data.$unRef = () => {
|
|
228
|
+
if (handlerContext.runDestroy) {
|
|
229
|
+
handlerContext.runDestroy();
|
|
230
|
+
}
|
|
231
|
+
this._activeContexts.delete(refId);
|
|
232
|
+
return originalUnRef();
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
// Run onMount callbacks
|
|
236
|
+
handlerContext.runMount();
|
|
237
|
+
// Run initial effects
|
|
238
|
+
handlerContext.runEffects();
|
|
239
|
+
}
|
|
240
|
+
return message;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Destroy a component instance by ref ID or data object
|
|
244
|
+
* This runs onDestroy callbacks (clears intervals/timers) and removes the ref
|
|
245
|
+
*
|
|
246
|
+
* @param refOrData - Either a ref ID string or the data object with $ref
|
|
247
|
+
* @returns true if destroyed, false if not found
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```ts
|
|
251
|
+
* // Destroy by data object
|
|
252
|
+
* showcase.destroy(data);
|
|
253
|
+
*
|
|
254
|
+
* // Destroy by ref ID
|
|
255
|
+
* showcase.destroy(data.$ref);
|
|
256
|
+
*
|
|
257
|
+
* // Destroy all active instances of this component
|
|
258
|
+
* showcase.destroyAll();
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
destroy(refOrData) {
|
|
262
|
+
const refId = typeof refOrData === 'string' ? refOrData : refOrData?.$ref;
|
|
263
|
+
if (!refId) {
|
|
264
|
+
console.warn("[Svelte] Cannot destroy: no ref ID provided");
|
|
265
|
+
return false;
|
|
266
|
+
}
|
|
267
|
+
const context = this._activeContexts.get(refId);
|
|
268
|
+
if (context) {
|
|
269
|
+
// Run destroy callbacks (clears intervals, timers, etc.)
|
|
270
|
+
if (context.runDestroy) {
|
|
271
|
+
context.runDestroy();
|
|
272
|
+
}
|
|
273
|
+
this._activeContexts.delete(refId);
|
|
274
|
+
}
|
|
275
|
+
// Also delete from DBI refs store
|
|
276
|
+
this.dbi.data.refs.delete(refId);
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Destroy all active instances of this component
|
|
281
|
+
* Useful for cleanup when the bot shuts down or component is unloaded
|
|
282
|
+
*
|
|
283
|
+
* @returns Number of instances destroyed
|
|
284
|
+
*/
|
|
285
|
+
destroyAll() {
|
|
286
|
+
let count = 0;
|
|
287
|
+
for (const [refId, context] of this._activeContexts) {
|
|
288
|
+
if (context.runDestroy) {
|
|
289
|
+
context.runDestroy();
|
|
290
|
+
}
|
|
291
|
+
this.dbi.data.refs.delete(refId);
|
|
292
|
+
count++;
|
|
293
|
+
}
|
|
294
|
+
this._activeContexts.clear();
|
|
295
|
+
return count;
|
|
296
|
+
}
|
|
297
|
+
handlers = [];
|
|
298
|
+
}
|
|
299
|
+
exports.DBIHTMLComponentsV2 = DBIHTMLComponentsV2;
|
|
300
|
+
//# sourceMappingURL=index.js.map
|