seyfert 4.5.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/lib/api/Routes/cdn.d.ts +2 -2
  2. package/lib/api/Routes/guilds.d.ts +2 -2
  3. package/lib/api/Routes/invites.d.ts +2 -2
  4. package/lib/api/api.d.ts +20 -8
  5. package/lib/api/api.js +198 -44
  6. package/lib/api/shared.d.ts +30 -1
  7. package/lib/api/utils/constants.d.ts +1 -1
  8. package/lib/api/utils/constants.js +1 -1
  9. package/lib/api/utils/utils.d.ts +2 -1
  10. package/lib/api/utils/utils.js +1 -1
  11. package/lib/builders/Attachment.d.ts +1 -1
  12. package/lib/builders/Attachment.js +30 -8
  13. package/lib/builders/MediaGallery.d.ts +2 -2
  14. package/lib/builders/MediaGallery.js +10 -0
  15. package/lib/builders/Modal.d.ts +18 -8
  16. package/lib/builders/Modal.js +36 -7
  17. package/lib/builders/Poll.js +18 -0
  18. package/lib/builders/RadioGroup.d.ts +4 -3
  19. package/lib/builders/RadioGroup.js +24 -3
  20. package/lib/builders/SelectMenu.d.ts +8 -6
  21. package/lib/builders/SelectMenu.js +24 -3
  22. package/lib/builders/types.d.ts +3 -2
  23. package/lib/cache/adapters/default.d.ts +1 -1
  24. package/lib/cache/adapters/default.js +23 -26
  25. package/lib/cache/adapters/limited.d.ts +1 -0
  26. package/lib/cache/adapters/limited.js +47 -33
  27. package/lib/cache/index.d.ts +19 -25
  28. package/lib/cache/index.js +58 -6
  29. package/lib/cache/resources/bans.d.ts +1 -1
  30. package/lib/cache/resources/bans.js +4 -4
  31. package/lib/cache/resources/channels.d.ts +1 -1
  32. package/lib/cache/resources/channels.js +4 -4
  33. package/lib/cache/resources/default/base.d.ts +1 -1
  34. package/lib/cache/resources/default/base.js +8 -8
  35. package/lib/cache/resources/default/guild-based.d.ts +5 -5
  36. package/lib/cache/resources/default/guild-based.js +29 -16
  37. package/lib/cache/resources/default/guild-related.d.ts +5 -5
  38. package/lib/cache/resources/default/guild-related.js +14 -14
  39. package/lib/cache/resources/emojis.d.ts +1 -1
  40. package/lib/cache/resources/emojis.js +4 -4
  41. package/lib/cache/resources/guilds.js +28 -15
  42. package/lib/cache/resources/members.d.ts +1 -1
  43. package/lib/cache/resources/members.js +6 -6
  44. package/lib/cache/resources/messages.d.ts +7 -2
  45. package/lib/cache/resources/messages.js +43 -20
  46. package/lib/cache/resources/overwrites.d.ts +1 -1
  47. package/lib/cache/resources/overwrites.js +5 -8
  48. package/lib/cache/resources/roles.d.ts +1 -1
  49. package/lib/cache/resources/roles.js +4 -4
  50. package/lib/cache/resources/stickers.d.ts +1 -1
  51. package/lib/cache/resources/stickers.js +4 -4
  52. package/lib/cache/resources/users.js +4 -4
  53. package/lib/cache/resources/voice-states.d.ts +1 -1
  54. package/lib/cache/resources/voice-states.js +4 -4
  55. package/lib/client/base.d.ts +83 -24
  56. package/lib/client/base.js +594 -39
  57. package/lib/client/client.d.ts +28 -3
  58. package/lib/client/client.js +33 -9
  59. package/lib/client/collectors.d.ts +9 -8
  60. package/lib/client/collectors.js +19 -52
  61. package/lib/client/httpclient.d.ts +3 -0
  62. package/lib/client/index.d.ts +3 -1
  63. package/lib/client/index.js +4 -0
  64. package/lib/client/intents.d.ts +3 -0
  65. package/lib/client/intents.js +9 -0
  66. package/lib/client/plugins/api.d.ts +4 -0
  67. package/lib/client/plugins/api.js +550 -0
  68. package/lib/client/plugins/errors.d.ts +25 -0
  69. package/lib/client/plugins/errors.js +79 -0
  70. package/lib/client/plugins/order.d.ts +10 -0
  71. package/lib/client/plugins/order.js +32 -0
  72. package/lib/client/plugins/registry.d.ts +273 -0
  73. package/lib/client/plugins/registry.js +868 -0
  74. package/lib/client/plugins/shared.d.ts +23 -0
  75. package/lib/client/plugins/shared.js +193 -0
  76. package/lib/client/plugins/types.d.ts +398 -0
  77. package/lib/client/plugins/types.js +8 -0
  78. package/lib/client/plugins.d.ts +78 -0
  79. package/lib/client/plugins.js +558 -0
  80. package/lib/client/transformers.d.ts +33 -33
  81. package/lib/client/workerclient.d.ts +10 -1
  82. package/lib/client/workerclient.js +27 -17
  83. package/lib/collection.d.ts +10 -8
  84. package/lib/collection.js +19 -25
  85. package/lib/commands/applications/chat.d.ts +20 -18
  86. package/lib/commands/applications/chat.js +39 -14
  87. package/lib/commands/applications/chatcontext.d.ts +23 -15
  88. package/lib/commands/applications/chatcontext.js +23 -2
  89. package/lib/commands/applications/entryPoint.d.ts +4 -3
  90. package/lib/commands/applications/entryPoint.js +1 -1
  91. package/lib/commands/applications/entrycontext.d.ts +7 -9
  92. package/lib/commands/applications/entrycontext.js +3 -1
  93. package/lib/commands/applications/menu.d.ts +4 -3
  94. package/lib/commands/applications/menucontext.d.ts +7 -9
  95. package/lib/commands/applications/menucontext.js +3 -1
  96. package/lib/commands/applications/options.d.ts +23 -23
  97. package/lib/commands/applications/shared.d.ts +39 -17
  98. package/lib/commands/decorators.d.ts +50 -38
  99. package/lib/commands/decorators.js +15 -5
  100. package/lib/commands/handle.d.ts +19 -8
  101. package/lib/commands/handle.js +224 -143
  102. package/lib/commands/handler.d.ts +21 -8
  103. package/lib/commands/handler.js +157 -69
  104. package/lib/commands/index.d.ts +1 -0
  105. package/lib/commands/optionresolver.d.ts +2 -2
  106. package/lib/common/it/colors.js +12 -2
  107. package/lib/common/it/error.d.ts +9 -0
  108. package/lib/common/it/error.js +8 -0
  109. package/lib/common/it/fake-promise.d.ts +4 -0
  110. package/lib/common/it/fake-promise.js +10 -0
  111. package/lib/common/it/formatter.d.ts +14 -11
  112. package/lib/common/it/formatter.js +4 -3
  113. package/lib/common/it/logger.d.ts +7 -1
  114. package/lib/common/it/logger.js +24 -6
  115. package/lib/common/it/utils.d.ts +6 -8
  116. package/lib/common/it/utils.js +44 -42
  117. package/lib/common/shorters/application.d.ts +3 -3
  118. package/lib/common/shorters/application.js +3 -2
  119. package/lib/common/shorters/bans.d.ts +8 -4
  120. package/lib/common/shorters/bans.js +13 -5
  121. package/lib/common/shorters/channels.d.ts +4 -4
  122. package/lib/common/shorters/channels.js +4 -4
  123. package/lib/common/shorters/emojis.js +1 -0
  124. package/lib/common/shorters/guilds.d.ts +8 -8
  125. package/lib/common/shorters/guilds.js +14 -31
  126. package/lib/common/shorters/interaction.d.ts +1 -1
  127. package/lib/common/shorters/invites.d.ts +201 -201
  128. package/lib/common/shorters/members.d.ts +7 -7
  129. package/lib/common/shorters/members.js +13 -14
  130. package/lib/common/shorters/messages.d.ts +2 -2
  131. package/lib/common/shorters/soundboard.d.ts +5 -5
  132. package/lib/common/shorters/users.d.ts +1 -1
  133. package/lib/common/shorters/webhook.d.ts +3 -2
  134. package/lib/common/shorters/webhook.js +0 -7
  135. package/lib/common/types/options.d.ts +4 -0
  136. package/lib/common/types/util.d.ts +8 -0
  137. package/lib/common/types/write.d.ts +2 -1
  138. package/lib/components/BaseSelectMenuComponent.d.ts +1 -1
  139. package/lib/components/BaseSelectMenuComponent.js +1 -1
  140. package/lib/components/ButtonComponent.d.ts +3 -3
  141. package/lib/components/ChannelSelectMenuComponent.d.ts +2 -2
  142. package/lib/components/File.d.ts +1 -1
  143. package/lib/components/MediaGallery.d.ts +1 -1
  144. package/lib/components/MentionableSelectMenuComponent.d.ts +1 -1
  145. package/lib/components/RoleSelectMenuComponent.d.ts +1 -1
  146. package/lib/components/Separator.d.ts +1 -1
  147. package/lib/components/StringSelectMenuComponent.d.ts +1 -1
  148. package/lib/components/TextInputComponent.d.ts +1 -1
  149. package/lib/components/Thumbnail.d.ts +1 -1
  150. package/lib/components/UserSelectMenuComponent.d.ts +1 -1
  151. package/lib/components/componentcommand.d.ts +8 -7
  152. package/lib/components/componentcontext.d.ts +24 -36
  153. package/lib/components/componentcontext.js +7 -17
  154. package/lib/components/handler.d.ts +17 -7
  155. package/lib/components/handler.js +108 -49
  156. package/lib/components/index.d.ts +1 -0
  157. package/lib/components/index.js +1 -0
  158. package/lib/components/interactioncontext.d.ts +45 -0
  159. package/lib/components/interactioncontext.js +93 -0
  160. package/lib/components/modalcommand.d.ts +5 -4
  161. package/lib/components/modalcontext.d.ts +39 -20
  162. package/lib/components/modalcontext.js +59 -6
  163. package/lib/events/event.d.ts +9 -3
  164. package/lib/events/handler.d.ts +51 -6
  165. package/lib/events/handler.js +165 -36
  166. package/lib/events/hooks/application_command.d.ts +1 -1
  167. package/lib/events/hooks/auto_moderation.d.ts +2 -2
  168. package/lib/events/hooks/guild.d.ts +150 -150
  169. package/lib/events/hooks/interactions.d.ts +1 -1
  170. package/lib/events/hooks/invite.d.ts +20 -20
  171. package/lib/events/hooks/message.d.ts +27 -27
  172. package/lib/events/hooks/presence.d.ts +11 -11
  173. package/lib/events/hooks/soundboard.d.ts +6 -6
  174. package/lib/events/hooks/stage.d.ts +2 -2
  175. package/lib/events/hooks/subscriptions.d.ts +3 -3
  176. package/lib/events/hooks/thread.d.ts +30 -30
  177. package/lib/events/hooks/voice.d.ts +3 -4
  178. package/lib/events/hooks/voice.js +2 -1
  179. package/lib/events/utils.d.ts +4 -0
  180. package/lib/events/utils.js +59 -0
  181. package/lib/index.d.ts +9 -4
  182. package/lib/index.js +13 -8
  183. package/lib/langs/handler.d.ts +14 -11
  184. package/lib/langs/handler.js +46 -9
  185. package/lib/langs/router.d.ts +10 -3
  186. package/lib/structures/Application.d.ts +1 -1
  187. package/lib/structures/Emoji.d.ts +3 -3
  188. package/lib/structures/Emoji.js +2 -2
  189. package/lib/structures/Guild.d.ts +154 -154
  190. package/lib/structures/GuildBan.d.ts +4 -4
  191. package/lib/structures/GuildBan.js +3 -3
  192. package/lib/structures/GuildMember.d.ts +7 -7
  193. package/lib/structures/GuildMember.js +28 -7
  194. package/lib/structures/GuildRole.d.ts +1 -1
  195. package/lib/structures/GuildRole.js +2 -2
  196. package/lib/structures/Interaction.d.ts +11 -9
  197. package/lib/structures/Interaction.js +33 -12
  198. package/lib/structures/Message.d.ts +21 -14
  199. package/lib/structures/Message.js +29 -14
  200. package/lib/structures/User.d.ts +1 -1
  201. package/lib/structures/VoiceState.d.ts +4 -0
  202. package/lib/structures/VoiceState.js +13 -1
  203. package/lib/structures/Webhook.d.ts +9 -1
  204. package/lib/structures/Webhook.js +4 -1
  205. package/lib/structures/channels.d.ts +148 -134
  206. package/lib/structures/channels.js +27 -26
  207. package/lib/structures/extra/BitField.d.ts +4 -4
  208. package/lib/structures/extra/BitField.js +20 -4
  209. package/lib/structures/extra/DiscordBase.js +1 -1
  210. package/lib/structures/extra/Permissions.d.ts +2 -4
  211. package/lib/structures/extra/Permissions.js +1 -17
  212. package/lib/types/payloads/_interactions/responses.d.ts +2 -2
  213. package/lib/types/payloads/components.d.ts +4 -4
  214. package/lib/websocket/SharedTypes.d.ts +4 -4
  215. package/lib/websocket/constants/index.d.ts +1 -1
  216. package/lib/websocket/constants/index.js +3 -2
  217. package/lib/websocket/discord/events/memberUpdate.js +2 -2
  218. package/lib/websocket/discord/heartbeater.d.ts +1 -0
  219. package/lib/websocket/discord/heartbeater.js +7 -0
  220. package/lib/websocket/discord/shard.d.ts +2 -2
  221. package/lib/websocket/discord/shard.js +15 -13
  222. package/lib/websocket/discord/sharder.d.ts +8 -7
  223. package/lib/websocket/discord/sharder.js +25 -5
  224. package/lib/websocket/discord/shared.d.ts +19 -6
  225. package/lib/websocket/discord/socket/custom.js +5 -0
  226. package/lib/websocket/discord/worker.d.ts +1 -0
  227. package/lib/websocket/discord/worker.js +2 -0
  228. package/lib/websocket/discord/workermanager.d.ts +25 -11
  229. package/lib/websocket/discord/workermanager.js +41 -10
  230. package/package.json +12 -16
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nextPluginContributionSequence = nextPluginContributionSequence;
4
+ exports.orderedPluginContributions = orderedPluginContributions;
5
+ const types_1 = require("./types");
6
+ function nextPluginContributionSequence(sequence) {
7
+ return sequence.nextContributionSequence++;
8
+ }
9
+ function orderedPluginContributions(contributions) {
10
+ return [...contributions].sort(comparePluginOrder);
11
+ }
12
+ function comparePluginOrder(left, right) {
13
+ const leftBand = orderBand(left.order);
14
+ const rightBand = orderBand(right.order);
15
+ if (leftBand !== rightBand)
16
+ return leftBand - rightBand;
17
+ if (leftBand === 1 && typeof left.order === 'number' && typeof right.order === 'number') {
18
+ const numeric = left.order - right.order;
19
+ if (numeric !== 0)
20
+ return numeric;
21
+ }
22
+ return left.sequence - right.sequence;
23
+ }
24
+ function orderBand(order) {
25
+ if (order === types_1.PluginOrder.Before)
26
+ return 0;
27
+ if (typeof order === 'number')
28
+ return 1;
29
+ if (order === types_1.PluginOrder.After)
30
+ return 3;
31
+ return 2;
32
+ }
@@ -0,0 +1,273 @@
1
+ import type { MiddlewareContext } from '../../commands';
2
+ import type { Awaitable } from '../../common/types/util';
3
+ import type { BaseClient, BaseClientOptions } from '../base';
4
+ import { type PluginOrderedContribution, type PluginOrderSequence } from './order';
5
+ import type { AnySeyfertPlugin, PluginAutocompleteWrapper, PluginCacheResourceConstructor, PluginCommandLoadable, PluginCommandObserver, PluginComponentLoadable, PluginDiagnosticCode, PluginDiagnosticMessage, PluginDiagnosticSeverity, PluginEventErrorHandler, PluginGatewayDispatchInterceptor, PluginGatewaySendPayloadWrapper, PluginHandlerCreator, PluginHandlerKind, PluginHandlerTransformer, PluginIntentResolvable, PluginLifecycleStatus, PluginModalLoadable, PluginOrderOpt, PluginRequirement, PluginRequirementDiagnostic, PluginRestObserver, ResolvedPluginList, SeyfertPluginOptions } from './types';
6
+ export interface PluginRuntimeRecord {
7
+ plugin: AnySeyfertPlugin;
8
+ identity: string;
9
+ index: number;
10
+ imports: readonly AnySeyfertPlugin[];
11
+ clientKeys: readonly string[];
12
+ ctxKeys: readonly string[];
13
+ optionFragments: PluginOptionContribution[];
14
+ status: PluginLifecycleStatus;
15
+ }
16
+ export type PluginEventContributionScope = 'register' | 'setup' | 'teardown';
17
+ export interface PluginCommandContribution {
18
+ record: PluginRuntimeRecord;
19
+ commands: readonly PluginCommandLoadable[];
20
+ scope: PluginEventContributionScope;
21
+ override: boolean;
22
+ guilds?: readonly string[];
23
+ sequence: number;
24
+ }
25
+ export interface PluginCommandRemovalContribution extends PluginOrderedContribution {
26
+ record: PluginRuntimeRecord;
27
+ names: readonly string[];
28
+ scope: PluginEventContributionScope;
29
+ }
30
+ export interface PluginComponentContribution {
31
+ record: PluginRuntimeRecord;
32
+ components: readonly PluginComponentLoadable[];
33
+ scope: PluginEventContributionScope;
34
+ override: boolean;
35
+ sequence: number;
36
+ }
37
+ export interface PluginComponentRemovalContribution extends PluginOrderedContribution {
38
+ record: PluginRuntimeRecord;
39
+ customIds: readonly string[];
40
+ scope: PluginEventContributionScope;
41
+ }
42
+ export interface PluginModalContribution {
43
+ record: PluginRuntimeRecord;
44
+ modals: readonly PluginModalLoadable[];
45
+ scope: PluginEventContributionScope;
46
+ override: boolean;
47
+ sequence: number;
48
+ }
49
+ export interface PluginModalRemovalContribution extends PluginOrderedContribution {
50
+ record: PluginRuntimeRecord;
51
+ customIds: readonly string[];
52
+ scope: PluginEventContributionScope;
53
+ }
54
+ export interface PluginEventContribution {
55
+ record: PluginRuntimeRecord;
56
+ name: string;
57
+ handler: (...args: unknown[]) => unknown;
58
+ scope: PluginEventContributionScope;
59
+ active: boolean;
60
+ order?: PluginOrderOpt;
61
+ sequence: number;
62
+ once?: boolean;
63
+ fired?: boolean;
64
+ }
65
+ export interface PluginAnyEventContribution extends PluginOrderedContribution {
66
+ record: PluginRuntimeRecord;
67
+ handler: (name: string, ...args: unknown[]) => unknown;
68
+ scope: PluginEventContributionScope;
69
+ active: boolean;
70
+ }
71
+ export interface PluginEventErrorContribution extends PluginOrderedContribution {
72
+ record: PluginRuntimeRecord;
73
+ handler: PluginEventErrorHandler;
74
+ scope: PluginEventContributionScope;
75
+ active: boolean;
76
+ }
77
+ export interface PluginMiddlewareContribution extends PluginOrderedContribution {
78
+ record: PluginRuntimeRecord;
79
+ name: string;
80
+ middleware: MiddlewareContext;
81
+ global: boolean;
82
+ override: boolean;
83
+ scope: PluginEventContributionScope;
84
+ }
85
+ export interface PluginMiddlewareRemovalContribution extends PluginOrderedContribution {
86
+ record: PluginRuntimeRecord;
87
+ names: readonly string[];
88
+ scope: PluginEventContributionScope;
89
+ }
90
+ export interface PluginGlobalMiddlewareContribution extends PluginOrderedContribution {
91
+ record: PluginRuntimeRecord;
92
+ name: string;
93
+ }
94
+ export interface PluginInstalledMiddleware {
95
+ middleware: MiddlewareContext;
96
+ owner: PluginRuntimeRecord;
97
+ }
98
+ export interface PluginOptionContribution extends PluginOrderedContribution {
99
+ record: PluginRuntimeRecord;
100
+ fragment: SeyfertPluginOptions;
101
+ scope: PluginEventContributionScope;
102
+ }
103
+ export interface PluginGlobalMiddlewareOptionSources {
104
+ defaults: BaseClientOptions;
105
+ pluginOptions: PluginOptionContribution[];
106
+ userOptions: SeyfertPluginOptions;
107
+ }
108
+ export interface PluginSharedContribution {
109
+ record: PluginRuntimeRecord;
110
+ factory: (client: BaseClient) => unknown;
111
+ dispose?: (value: unknown) => Awaitable<void>;
112
+ scope: PluginEventContributionScope;
113
+ }
114
+ export interface PluginSharedMutation {
115
+ record: PluginRuntimeRecord;
116
+ name: string;
117
+ scope: PluginEventContributionScope;
118
+ previous?: PluginSharedContribution;
119
+ previousOwner?: PluginRuntimeRecord;
120
+ }
121
+ export interface PluginLangContribution {
122
+ record: PluginRuntimeRecord;
123
+ locale: string;
124
+ prefix: string;
125
+ values: Record<string, unknown>;
126
+ scope: PluginEventContributionScope;
127
+ sequence: number;
128
+ }
129
+ export interface PluginGatewayIntentContribution {
130
+ record: PluginRuntimeRecord;
131
+ intents: readonly number[];
132
+ scope: PluginEventContributionScope;
133
+ }
134
+ export interface PluginAutocompleteWrapperContribution extends PluginOrderedContribution {
135
+ record: PluginRuntimeRecord;
136
+ wrapper: PluginAutocompleteWrapper;
137
+ scope: PluginEventContributionScope;
138
+ }
139
+ export interface PluginGatewaySendPayloadWrapperContribution extends PluginOrderedContribution {
140
+ record: PluginRuntimeRecord;
141
+ wrapper: PluginGatewaySendPayloadWrapper;
142
+ scope: PluginEventContributionScope;
143
+ }
144
+ export interface PluginGatewayDispatchInterceptorContribution extends PluginOrderedContribution {
145
+ record: PluginRuntimeRecord;
146
+ interceptor: PluginGatewayDispatchInterceptor;
147
+ scope: PluginEventContributionScope;
148
+ }
149
+ export interface PluginRestObserverContribution extends PluginOrderedContribution {
150
+ record: PluginRuntimeRecord;
151
+ observer: PluginRestObserver;
152
+ scope: PluginEventContributionScope;
153
+ active: boolean;
154
+ }
155
+ export interface PluginHookContribution extends PluginOrderedContribution {
156
+ record: PluginRuntimeRecord;
157
+ name: string;
158
+ handler: (...args: unknown[]) => Awaitable<unknown>;
159
+ scope: PluginEventContributionScope;
160
+ active: boolean;
161
+ }
162
+ export interface PluginCacheResourceContribution {
163
+ record: PluginRuntimeRecord;
164
+ name: string;
165
+ resource: PluginCacheResourceConstructor;
166
+ scope: PluginEventContributionScope;
167
+ onPacket?: (event: import('../../types').GatewayDispatchPayload, cache: import('../../cache').Cache) => Awaitable<void>;
168
+ sequence: number;
169
+ }
170
+ export interface PluginCommandObserverContribution extends PluginOrderedContribution {
171
+ record: PluginRuntimeRecord;
172
+ observer: PluginCommandObserver;
173
+ scope: PluginEventContributionScope;
174
+ active: boolean;
175
+ }
176
+ export interface PluginDefaultsContribution extends PluginOrderedContribution {
177
+ record: PluginRuntimeRecord;
178
+ kind: 'commands' | 'components' | 'modals';
179
+ hooks: Record<string, unknown> | undefined;
180
+ suppressDefault?: boolean | readonly string[];
181
+ scope: PluginEventContributionScope;
182
+ }
183
+ export interface PluginHandlerCreatorContribution extends PluginOrderedContribution {
184
+ record: PluginRuntimeRecord;
185
+ creator: PluginHandlerCreator;
186
+ scope: PluginEventContributionScope;
187
+ kinds?: readonly PluginHandlerKind[];
188
+ }
189
+ export interface PluginHandlerTransformerContribution extends PluginOrderedContribution {
190
+ record: PluginRuntimeRecord;
191
+ transformer: PluginHandlerTransformer;
192
+ scope: PluginEventContributionScope;
193
+ kinds?: readonly PluginHandlerKind[];
194
+ }
195
+ export interface PluginRequirementContribution extends PluginRequirementDiagnostic {
196
+ record: PluginRuntimeRecord;
197
+ }
198
+ export interface PluginRuntimeRegistry extends PluginOrderSequence {
199
+ plugins: ResolvedPluginList;
200
+ records: readonly PluginRuntimeRecord[];
201
+ commands: PluginCommandContribution[];
202
+ commandRemovals: PluginCommandRemovalContribution[];
203
+ components: PluginComponentContribution[];
204
+ componentRemovals: PluginComponentRemovalContribution[];
205
+ modals: PluginModalContribution[];
206
+ modalRemovals: PluginModalRemovalContribution[];
207
+ events: PluginEventContribution[];
208
+ anyEvents: PluginAnyEventContribution[];
209
+ eventErrors: PluginEventErrorContribution[];
210
+ middlewares: PluginMiddlewareContribution[];
211
+ middlewareRemovals: PluginMiddlewareRemovalContribution[];
212
+ globalMiddlewares: PluginGlobalMiddlewareContribution[];
213
+ globalMiddlewareOptions?: PluginGlobalMiddlewareOptionSources;
214
+ installedMiddlewares: Map<string, PluginInstalledMiddleware>;
215
+ contributionMutationDiagnostics: Set<string>;
216
+ autocompleteWrappers: PluginAutocompleteWrapperContribution[];
217
+ gatewayIntents: PluginGatewayIntentContribution[];
218
+ gatewaySendPayloadWrappers: PluginGatewaySendPayloadWrapperContribution[];
219
+ gatewayDispatchInterceptors: PluginGatewayDispatchInterceptorContribution[];
220
+ restObservers: PluginRestObserverContribution[];
221
+ hooks: PluginHookContribution[];
222
+ cacheResources: PluginCacheResourceContribution[];
223
+ commandObservers: PluginCommandObserverContribution[];
224
+ pluginDefaults: PluginDefaultsContribution[];
225
+ handlerCreators: PluginHandlerCreatorContribution[];
226
+ handlerTransformers: PluginHandlerTransformerContribution[];
227
+ shared: Map<string, PluginSharedContribution>;
228
+ sharedOwners: Map<string, PluginRuntimeRecord>;
229
+ sharedMutations: PluginSharedMutation[];
230
+ sharedDisposals: Promise<unknown | undefined>[];
231
+ langs: PluginLangContribution[];
232
+ diagnostics: PluginDiagnosticMessage[];
233
+ requirements: PluginRequirementContribution[];
234
+ client?: BaseClient;
235
+ }
236
+ export declare function createPluginRuntimeRegistry(plugins?: readonly AnySeyfertPlugin[]): PluginRuntimeRegistry;
237
+ export declare function runPluginRegister(record: PluginRuntimeRecord, registry: PluginRuntimeRegistry): void;
238
+ export declare function bindPluginClient(registry: PluginRuntimeRegistry, client: BaseClient): void;
239
+ export declare function removePluginEventContribution(registry: PluginRuntimeRegistry, contribution: PluginEventContribution): void;
240
+ export declare function removePluginAnyEventContribution(registry: PluginRuntimeRegistry, contribution: PluginAnyEventContribution): void;
241
+ export declare function removePluginEventErrorContribution(registry: PluginRuntimeRegistry, contribution: PluginEventErrorContribution): void;
242
+ export declare function removePluginCommandObserverContribution(registry: PluginRuntimeRegistry, contribution: PluginCommandObserverContribution): void;
243
+ export declare function removePluginRestObserverContribution(registry: PluginRuntimeRegistry, contribution: PluginRestObserverContribution): void;
244
+ export declare function removePluginGatewayDispatchInterceptorContribution(registry: PluginRuntimeRegistry, contribution: PluginGatewayDispatchInterceptorContribution): void;
245
+ export declare function removePluginHookContribution(registry: PluginRuntimeRegistry, contribution: PluginHookContribution): void;
246
+ export declare function activatePluginEventListeners(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord): void;
247
+ export declare function cleanupPluginEventListeners(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord): void;
248
+ export declare function cleanupPluginDynamicContributionMutations(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord): void;
249
+ export declare function hasPluginRequirement(registry: PluginRuntimeRegistry, req: PluginRequirement): boolean;
250
+ export declare function pluginIdentity(plugin: Pick<AnySeyfertPlugin, 'name' | 'instanceId'>): string;
251
+ export declare function resolvePluginIntents(registry: PluginRuntimeRegistry, base: number): number;
252
+ export declare function addPluginGlobalMiddlewares(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord, names: readonly string[]): void;
253
+ export declare function addPluginOptionFragment(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord, fragment: SeyfertPluginOptions, scope: PluginEventContributionScope): void;
254
+ export declare function addPluginDiagnostic(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord, diagnostic: {
255
+ message: string;
256
+ phase: string;
257
+ severity: PluginDiagnosticSeverity;
258
+ code?: PluginDiagnosticCode;
259
+ data?: Record<string, unknown>;
260
+ }): void;
261
+ export declare function clonePluginOptions<T>(value: T): T;
262
+ export declare function readonlyPluginOptions<T extends object>(value: T): Readonly<T>;
263
+ export declare function assertSafePluginResourceName(record: PluginRuntimeRecord, phase: string, name: string, reserved: ReadonlySet<string>): void;
264
+ export declare function assertCanMutatePluginContribution(registry: PluginRuntimeRegistry, record: PluginRuntimeRecord, action: 'override' | 'remove', kind: string, name: string, owner: PluginRuntimeRecord | undefined, phase: string): void;
265
+ export declare function recordContributionMutationDiagnostic(registry: PluginRuntimeRegistry, contribution: PluginOrderedContribution & {
266
+ record: PluginRuntimeRecord;
267
+ }, action: 'override' | 'remove', kind: string, name: string, owner: PluginRuntimeRecord | undefined, phase: string): void;
268
+ export declare function createPluginContextFragment(record: PluginRuntimeRecord, registry: PluginRuntimeRegistry): SeyfertPluginOptions | undefined;
269
+ export declare function installPluginClientMaps(client: BaseClient, registry: PluginRuntimeRegistry): void;
270
+ export declare function installPluginMiddlewares(client: BaseClient, registry: PluginRuntimeRegistry): void;
271
+ export declare function resolveGatewayIntent(intent: PluginIntentResolvable): number | undefined;
272
+ export declare function unknownGatewayIntentBits(intent: PluginIntentResolvable): number;
273
+ export declare function validatePluginRequirements(registry: PluginRuntimeRegistry, kind?: 'plugin' | 'capability' | 'all'): void;