@seedcord/http 0.10.2 → 0.11.0-next.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.
@@ -1,485 +0,0 @@
1
- import { AutocompletableNames, AutocompleteRouteBrand, ChoiceValueOf, ComponentDefsBrand, ComponentKindBrand, EntryFor, FocusedField, HasComponentDefs, MatchArms, MiddlewareKindsBrand, SingleParams, StoredSubscriberCtor } from "@seedcord/core/internal";
2
- import { REST, RESTOptions } from "@discordjs/rest";
3
- import { AutocompleteOptions, BaseHandler, BaseReplySender, Bus, CoreBase, DispatchContext, DispatchResult, InteractionKind, MiddlewareKind, ModalLike, RepliableHandler, SlashRegistry } from "@seedcord/core";
4
- import { APIApplicationCommandAutocompleteInteraction, APIApplicationCommandOptionChoice, APIChatInputApplicationCommandInteraction, APIContextMenuInteraction, APIInteractionDataResolvedChannel, APIInteractionDataResolvedGuildMember, APIMessage, APIMessageApplicationCommandInteraction, APIMessageChannelSelectInteractionData, APIMessageComponentButtonInteraction, APIMessageComponentInteraction, APIMessageComponentSelectMenuInteraction, APIMessageMentionableSelectInteractionData, APIMessageRoleSelectInteractionData, APIMessageStringSelectInteractionData, APIMessageUserSelectInteractionData, APIModalInteractionResponseCallbackData, APIModalSubmitInteraction, APIRole, APIUser, APIUserApplicationCommandInteraction } from "discord-api-types/v10";
5
- import { API } from "@discordjs/core/http-only";
6
- import { AnyCustomId } from "@seedcord/custom-id";
7
- import { Collection } from "@discordjs/collection";
8
- import { CoordinatedShutdown, CoordinatedStartup } from "@seedcord/core/node";
9
- import { BotConfig, Config, DeferOpts, ReplyResponse, SendOpts, TypedConstructor, TypedOmit } from "@seedcord/types";
10
- import { Constructor, Promisable } from "type-fest";
11
- //#region src/interfaces/Config.d.ts
12
- type EdgeSweeperKey = 'hashSweepInterval' | 'handlerSweepInterval';
13
- interface HttpBotConfig<Options> extends BotConfig {
14
- /**
15
- * Passed to the `REST` client from `@discordjs/rest`.
16
- */
17
- restOptions?: Options;
18
- }
19
- /**
20
- * Config for a long-running node server. Pass to `new Seedcord(config).start()`.
21
- */
22
- interface HttpServerConfig extends Config {
23
- bot: HttpBotConfig<Partial<RESTOptions>>;
24
- runtime?: 'server';
25
- /**
26
- * Port the interactions server uses.
27
- *
28
- * @defaultValue `3000`
29
- */
30
- port?: number;
31
- }
32
- /**
33
- * Config for a bundled isolate deployment. `seedcord build` generates a worker entry that calls
34
- * `createSeedcord`.
35
- */
36
- interface HttpEdgeConfig extends Config {
37
- bot: HttpBotConfig<Partial<TypedOmit<RESTOptions, EdgeSweeperKey>>>;
38
- runtime: 'edge';
39
- port?: never;
40
- lifecycle?: never;
41
- }
42
- /**
43
- * The http transport's configuration, discriminated on `runtime`.
44
- */
45
- type HttpConfig = HttpServerConfig | HttpEdgeConfig;
46
- //#endregion
47
- //#region src/interfaces/Core.d.ts
48
- /**
49
- * Main interface for Seedcord core functionality on the HTTP transport.
50
- *
51
- * This interface can be augmented via declaration merging to add type-safe plugin definitions when
52
- * using `this.core` in handlers.
53
- *
54
- * @example
55
- * ```typescript
56
- * declare module '@seedcord/http' {
57
- * interface Core {
58
- * db: Mongoose;
59
- * }
60
- * }
61
- * ```
62
- */
63
- interface Core extends CoreBase {
64
- readonly shutdown: Pick<CoordinatedShutdown, 'addTask'>;
65
- readonly startup: Pick<CoordinatedStartup, 'addTask'>;
66
- readonly config: HttpConfig;
67
- }
68
- //#endregion
69
- //#region src/handlers/interaction/AutocompleteHandler.d.ts
70
- type FocusedArms<Route extends keyof SlashRegistry, Ret> = { [Name in AutocompletableNames<Route>]: (value: string, respond: (choices: readonly APIApplicationCommandOptionChoice<ChoiceValueOf<EntryFor<Route, Name>>>[]) => Promise<void>) => Promisable<Ret>; };
71
- /**
72
- * Base class for an autocomplete handler on the HTTP transport.
73
- *
74
- * Pass the command route(s) from the generated registry as the generic. Branch on the focused field with
75
- * `this.match`, read already-entered sibling options with `this.options`, and find which command fired
76
- * with `this.route`.
77
- *
78
- * @typeParam Route - One or more route keys from {@link SlashRegistry}, e.g. `'search'`.
79
- */
80
- declare abstract class AutocompleteHandler<Route extends keyof SlashRegistry> extends BaseHandler<APIApplicationCommandAutocompleteInteraction, Core> {
81
- constructor(event: APIApplicationCommandAutocompleteInteraction, core: Core, dispatch: DispatchContext);
82
- /** @internal */
83
- readonly [AutocompleteRouteBrand]?: Route;
84
- /**
85
- * Typed Discord REST API (`@discordjs/core/http-only`) over `core.rest`, one instance per core.
86
- */
87
- protected get api(): API;
88
- private resolver?;
89
- private get reader();
90
- /**
91
- * The focused option for this interaction. `value` is always the raw partial string the user is typing,
92
- * even for an integer or number option, so coerce it yourself when you need a number.
93
- */
94
- protected get focused(): FocusedField<Route>;
95
- /**
96
- * Run the arm for the focused field. An autocomplete always dispatches by which field is focused.
97
- * Match is how you read it.
98
- *
99
- * Provide one arm per autocompletable field across the registered commands, keyed by field name. Each
100
- * arm receives the focused partial value and a `respond` typed to that field's choice value. The
101
- * arms must cover every autocompletable field, a missing field or an unknown key is a compile error. A
102
- * focused field with no arm, only reachable from a stale-deployed command, throws at runtime.
103
- *
104
- * @param arms - One handler per autocompletable field, keyed by field name.
105
- * @returns The result of the arm that ran.
106
- */
107
- protected match<Ret>(arms: FocusedArms<Route, Ret>): Promise<Ret>;
108
- /** Send autocomplete suggestions, callback type 8. Prefer {@link match}, which restricts each field's choices to its declared type. */
109
- protected respond(choices: readonly APIApplicationCommandOptionChoice[]): Promise<void>;
110
- /** The firing command route, for a field whose completion differs per registered command. */
111
- protected get route(): Route;
112
- /**
113
- * The already-entered options on this command, restricted to the kinds Discord resolves during autocomplete
114
- * (string, integer, number, boolean) with every read nullable, since a sibling is partial while the user
115
- * types the focused field. The focused field is on `this.focused`.
116
- */
117
- protected get options(): AutocompleteOptions<Route>;
118
- }
119
- //#endregion
120
- //#region src/reply/ReplySender.d.ts
121
- /** The interaction payload fields the sender writes its wire from. */
122
- interface InteractionRef {
123
- readonly application_id: string;
124
- readonly id: string;
125
- readonly token: string;
126
- }
127
- /** The created message an http reply resolves to (the http `SentMessage` lens). */
128
- type SentMessage = APIMessage;
129
- /**
130
- * Writes interaction responses over the Discord REST callback and webhook endpoints. Construction is
131
- * internal to the repliable handler bases and the dispatcher.
132
- */
133
- declare class ReplySender extends BaseReplySender<SentMessage> {
134
- private readonly ref;
135
- private readonly rest;
136
- constructor(ref: InteractionRef, rest: REST, dispatch: DispatchContext, bus: Bus);
137
- protected writeReply(response: ReplyResponse | string, opts?: SendOpts): Promise<SentMessage | undefined>;
138
- protected writeDefer(opts?: DeferOpts): Promise<void>;
139
- protected writeDeferUpdate(): Promise<void>;
140
- protected writeUpdate(response: ReplyResponse | string): Promise<SentMessage | undefined>;
141
- protected writeFollowUp(response: ReplyResponse | string, opts?: SendOpts): Promise<SentMessage>;
142
- protected writeEditOriginal(response: ReplyResponse | string): Promise<SentMessage>;
143
- protected writeEditTarget(targetId: string, response: ReplyResponse | string): Promise<SentMessage>;
144
- protected writeDeleteOriginal(): Promise<void>;
145
- protected writeDeleteTarget(targetId: string): Promise<void>;
146
- protected writeModal(data: APIModalInteractionResponseCallbackData): Promise<void>;
147
- private callback;
148
- private editMessage;
149
- private rawFiles;
150
- private createdMessage;
151
- }
152
- //#endregion
153
- //#region src/handlers/interactionTypes.d.ts
154
- type ValidInteractionTypes = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction | APIMessageComponentInteraction | APIModalSubmitInteraction | APIApplicationCommandAutocompleteInteraction;
155
- type Repliables = Exclude<ValidInteractionTypes, APIApplicationCommandAutocompleteInteraction>;
156
- //#endregion
157
- //#region src/handlers/RepliableHandler.d.ts
158
- /**
159
- * Shared base the repliable HTTP interaction handlers extend.
160
- *
161
- * Not a public entry point. Extend {@link SlashHandler}, {@link ButtonHandler}, {@link ModalHandler},
162
- * {@link ContextMenuHandler}, or one of the select menu bases instead. This class binds the core
163
- * reply base to the http sender.
164
- *
165
- * @typeParam Event - The repliable interaction type this handler processes
166
- */
167
- declare abstract class RepliableHandler$1<Event extends Repliables> extends RepliableHandler<Event, Core, SentMessage, never, ReplySender> {
168
- /** @internal */
169
- getEvent(): Event;
170
- protected buildSender(event: Event, core: Core, dispatch: DispatchContext): ReplySender;
171
- /**
172
- * Typed Discord REST API (`@discordjs/core/http-only`) over `core.rest`, one instance per core.
173
- * The interaction callbacks on `api.interactions` bypass the reply surface. The
174
- * `no-raw-interaction-acks` rule flags them in handler classes.
175
- */
176
- protected get api(): API;
177
- }
178
- //#endregion
179
- //#region src/handlers/interaction/InteractionHandler.d.ts
180
- /**
181
- * Shared base the repliable interaction handlers extend.
182
- *
183
- * Not a public entry point. Extend {@link SlashHandler}, {@link ContextMenuHandler}, {@link ButtonHandler},
184
- * {@link ModalHandler}, or one of the select menu bases instead. This class adds `showModal` on top
185
- * of the reply members.
186
- *
187
- * @typeParam Event - The repliable interaction type this handler processes
188
- */
189
- declare abstract class InteractionHandler<Event extends Repliables> extends RepliableHandler$1<Event> {
190
- constructor(event: Event, core: Core, dispatch: DispatchContext);
191
- /**
192
- * Open a modal. Must be the initial response to this interaction. The modal kind rejects this call at
193
- * compile time (Discord forbids a modal in response to a modal).
194
- */
195
- protected showModal(this: InteractionHandler<Exclude<Repliables, APIModalSubmitInteraction>>, modal: ModalLike): Promise<void>;
196
- }
197
- //#endregion
198
- //#region src/handlers/interaction/components/ComponentHandler.d.ts
199
- /**
200
- * Shared base the customId-routed component handlers extend on the HTTP transport.
201
- *
202
- * Not a public entry point. Extend {@link ButtonHandler}, {@link ModalHandler}, or one of the select menu
203
- * bases instead. This class defines the customId decode, the route matching, and the source-message
204
- * verbs `update` and `deferUpdate`.
205
- *
206
- * @typeParam Event - The component or modal interaction type this handler processes
207
- * @typeParam Defs - The customId route definitions registered on the concrete handler
208
- */
209
- declare abstract class ComponentHandler<Event extends APIMessageComponentInteraction | APIModalSubmitInteraction, Defs extends readonly AnyCustomId[]> extends InteractionHandler<Event> implements HasComponentDefs<Defs> {
210
- /** @internal */
211
- readonly [ComponentDefsBrand]?: Defs;
212
- /** Rewrite the source message this component interaction came from. */
213
- protected update(response: ReplyResponse | string): Promise<SentMessage>;
214
- /** Acknowledge the component without changing the source message. */
215
- protected deferUpdate(): Promise<void>;
216
- private decoded?;
217
- private get route();
218
- /**
219
- * The decoded params of the single route this handler is registered for.
220
- *
221
- * Reading this decodes `this.event.data.custom_id` once (cached after the first read) and throws
222
- * `StaleCustomId` or `InvalidCustomId` when the wire no longer matches the current shape, which the
223
- * dispatcher boundary turns into a reply. On a handler registered for several routes this is
224
- * `never`, so use {@link match} instead.
225
- */
226
- protected get params(): SingleParams<Defs>;
227
- /**
228
- * Run the arm for whichever route the component was minted from. Use this only when the handler is
229
- * registered for several routes. A single-route handler reads `this.params` directly. On a multi-route
230
- * handler `this.params` is `never`, so match is the only way to read the decoded params.
231
- *
232
- * Provide one arm per registered route, keyed by its prefix, and each arm receives that route's own
233
- * decoded params. The arms cover every registered route prefix, checked at compile time, and a prefix
234
- * unmatched at runtime throws `CustomIdMatchArmMissing`. Decoding runs before any arm, so a stale or
235
- * corrupt wire throws before an arm body executes.
236
- *
237
- * @param arms - One callback per registered route, keyed by prefix.
238
- * @returns The result of the arm that ran.
239
- *
240
- * @example
241
- * ```ts
242
- * \@ButtonRoute(Approve, Reject)
243
- * class ReviewButtons extends ButtonHandler<[typeof Approve, typeof Reject]> {
244
- * async execute() {
245
- * await this.match({
246
- * approve: ({ userId }) => this.reply(`approved <@${userId}>`),
247
- * reject: ({ userId }) => this.reply(`rejected <@${userId}>`)
248
- * });
249
- * }
250
- * }
251
- * ```
252
- */
253
- protected match<Ret>(arms: MatchArms<Defs, Ret>): Promise<Ret>;
254
- }
255
- //#endregion
256
- //#region src/handlers/interaction/components/SelectMenuHandler.d.ts
257
- /** @internal */
258
- type SelectInteraction<Data> = APIMessageComponentSelectMenuInteraction & {
259
- data: Data;
260
- };
261
- /**
262
- * Shared base the select menu handlers extend on the HTTP transport.
263
- *
264
- * Not a public entry point. Extend {@link StringMenuHandler}, {@link UserMenuHandler},
265
- * {@link RoleMenuHandler}, {@link ChannelMenuHandler}, or {@link MentionableMenuHandler} instead. This
266
- * class defines the `values` getter those bases share.
267
- *
268
- * @typeParam Event - The select menu interaction type this handler processes
269
- * @typeParam Defs - The customId route definitions registered on the concrete handler
270
- */
271
- declare abstract class SelectMenuHandler<Event extends APIMessageComponentSelectMenuInteraction, Defs extends readonly AnyCustomId[]> extends ComponentHandler<Event, Defs> {
272
- /** The values this select picked. On every kind but the string menu they are snowflake ids. */
273
- protected get values(): string[];
274
- }
275
- /**
276
- * Base class for a string select menu handler on the HTTP transport.
277
- *
278
- * Register the customId definitions with `@StringMenuRoute`, list the same ones in the generic, then read
279
- * the chosen option values from `this.values`. Read `this.params` for a single route or `this.match` for
280
- * several. Reply through the handler members, or rewrite the source message with `this.update`.
281
- *
282
- * @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof TopicsId]`.
283
- *
284
- * @example
285
- * ```ts
286
- * \@StringMenuRoute(TopicsId)
287
- * class Topics extends StringMenuHandler<[typeof TopicsId]> {
288
- * async execute() {
289
- * const { userId } = this.params;
290
- * await this.update(`<@${userId}> now follows ${this.values.join(', ')}`);
291
- * }
292
- * }
293
- * ```
294
- */
295
- declare abstract class StringMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageStringSelectInteractionData>, Defs> {
296
- /** @internal */
297
- readonly [ComponentKindBrand]?: InteractionKind.StringMenu;
298
- }
299
- /**
300
- * Base class for a user select menu handler on the HTTP transport.
301
- *
302
- * Beside `this.values` this handler declares `this.users` and `this.members`. Register the customId
303
- * definitions with `@UserMenuRoute` and list the same ones in the generic.
304
- *
305
- * @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof AssignId]`.
306
- *
307
- * @example
308
- * ```ts
309
- * \@UserMenuRoute(AssignId)
310
- * class Assign extends UserMenuHandler<[typeof AssignId]> {
311
- * async execute() {
312
- * const { roleId } = this.params;
313
- * await this.reply(`assigning ${this.users.size} member(s) to <@&${roleId}>`);
314
- * }
315
- * }
316
- * ```
317
- */
318
- declare abstract class UserMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageUserSelectInteractionData>, Defs> {
319
- /** @internal */
320
- readonly [ComponentKindBrand]?: InteractionKind.UserMenu;
321
- /** The users this select picked. */
322
- protected get users(): Collection<string, APIUser>;
323
- /** The guild members behind the picked users. Discord resolves these only inside a guild. */
324
- protected get members(): Collection<string, APIInteractionDataResolvedGuildMember>;
325
- }
326
- /**
327
- * Base class for a role select menu handler on the HTTP transport.
328
- *
329
- * Beside `this.values` this handler declares `this.roles`. Register the customId definitions with
330
- * `@RoleMenuRoute` and list the same ones in the generic.
331
- *
332
- * @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof GrantId]`.
333
- *
334
- * @example
335
- * ```ts
336
- * \@RoleMenuRoute(GrantId)
337
- * class Grant extends RoleMenuHandler<[typeof GrantId]> {
338
- * async execute() {
339
- * await this.update(`granting ${this.roles.size} role(s)`);
340
- * }
341
- * }
342
- * ```
343
- */
344
- declare abstract class RoleMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageRoleSelectInteractionData>, Defs> {
345
- /** @internal */
346
- readonly [ComponentKindBrand]?: InteractionKind.RoleMenu;
347
- /** The roles this select picked. */
348
- protected get roles(): Collection<string, APIRole>;
349
- }
350
- /**
351
- * Base class for a channel select menu handler on the HTTP transport.
352
- *
353
- * Beside `this.values` this handler declares `this.channels`. Register the customId definitions with
354
- * `@ChannelMenuRoute` and list the same ones in the generic.
355
- *
356
- * @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof LogTargetId]`.
357
- *
358
- * @example
359
- * ```ts
360
- * \@ChannelMenuRoute(LogTargetId)
361
- * class LogTarget extends ChannelMenuHandler<[typeof LogTargetId]> {
362
- * async execute() {
363
- * await this.update(`logging to ${this.channels.size} channel(s)`);
364
- * }
365
- * }
366
- * ```
367
- */
368
- declare abstract class ChannelMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageChannelSelectInteractionData>, Defs> {
369
- /** @internal */
370
- readonly [ComponentKindBrand]?: InteractionKind.ChannelMenu;
371
- /** The channels this select picked. */
372
- protected get channels(): Collection<string, APIInteractionDataResolvedChannel>;
373
- }
374
- /**
375
- * Base class for a mentionable select menu handler on the HTTP transport.
376
- *
377
- * A mentionable menu accepts users and roles together. `this.users`, `this.members`, and `this.roles`
378
- * can each come back empty.
379
- *
380
- * @typeParam Defs - The customId definitions this handler decodes, e.g. `[typeof InviteId]`.
381
- *
382
- * @example
383
- * ```ts
384
- * \@MentionableMenuRoute(InviteId)
385
- * class Invite extends MentionableMenuHandler<[typeof InviteId]> {
386
- * async execute() {
387
- * await this.update(`inviting ${this.users.size} user(s) and ${this.roles.size} role(s)`);
388
- * }
389
- * }
390
- * ```
391
- */
392
- declare abstract class MentionableMenuHandler<Defs extends readonly AnyCustomId[]> extends SelectMenuHandler<SelectInteraction<APIMessageMentionableSelectInteractionData>, Defs> {
393
- /** @internal */
394
- readonly [ComponentKindBrand]?: InteractionKind.MentionableMenu;
395
- /** The users this select picked. */
396
- protected get users(): Collection<string, APIUser>;
397
- /** The guild members behind the picked users. Discord resolves these only inside a guild. */
398
- protected get members(): Collection<string, APIInteractionDataResolvedGuildMember>;
399
- /** The roles this select picked. */
400
- protected get roles(): Collection<string, APIRole>;
401
- }
402
- //#endregion
403
- //#region src/handlers/interaction/middlewareKinds.d.ts
404
- interface Payloads {
405
- [InteractionKind.Slash]: APIChatInputApplicationCommandInteraction;
406
- [InteractionKind.Button]: APIMessageComponentButtonInteraction;
407
- [InteractionKind.Modal]: APIModalSubmitInteraction;
408
- [InteractionKind.StringMenu]: SelectInteraction<APIMessageStringSelectInteractionData>;
409
- [InteractionKind.UserMenu]: SelectInteraction<APIMessageUserSelectInteractionData>;
410
- [InteractionKind.RoleMenu]: SelectInteraction<APIMessageRoleSelectInteractionData>;
411
- [InteractionKind.ChannelMenu]: SelectInteraction<APIMessageChannelSelectInteractionData>;
412
- [InteractionKind.MentionableMenu]: SelectInteraction<APIMessageMentionableSelectInteractionData>;
413
- [InteractionKind.MessageContextMenu]: APIMessageApplicationCommandInteraction;
414
- [InteractionKind.UserContextMenu]: APIUserApplicationCommandInteraction;
415
- }
416
- type InteractionForKind = { [Kind in MiddlewareKind]: Payloads[Kind]; };
417
- /** @internal */
418
- type InteractionOf<Kind extends MiddlewareKind> = InteractionForKind[Kind];
419
- //#endregion
420
- //#region src/handlers/interaction/InteractionMiddleware.d.ts
421
- /**
422
- * Base class for interaction middleware on the HTTP transport.
423
- *
424
- * Middleware runs after the dispatcher builds the handler and before the gates, over the handler's own
425
- * reply surface. Name the kinds in the generic and list the same ones in `{ kinds }`. Several kinds give
426
- * `this.event` a union. Narrow it on `type` and `data.component_type`. A catchall reads every repliable
427
- * kind.
428
- *
429
- * @typeParam Kind - One or more {@link InteractionKind} members. Defaults to every repliable kind.
430
- *
431
- * @example
432
- * ```ts
433
- * \@RegisterInteractionMiddleware({ kinds: [InteractionKind.Button] })
434
- * class Audit extends InteractionMiddleware<InteractionKind.Button> {
435
- * async execute() {
436
- * this.logger.info(this.event.data.custom_id);
437
- * }
438
- * }
439
- * ```
440
- */
441
- declare abstract class InteractionMiddleware<in out Kind extends MiddlewareKind = MiddlewareKind> extends RepliableHandler$1<InteractionOf<Kind>> {
442
- /** @internal */
443
- readonly [MiddlewareKindsBrand]?: Kind;
444
- constructor(event: InteractionOf<Kind>, core: Core, dispatch: DispatchContext, sender: ReplySender);
445
- /**
446
- * Runs once the handler settles, newest middleware first. A refusal or a throw still reaches it,
447
- * since seedcord calls it on every middleware whose `execute()` started. Implement it to release
448
- * something this middleware took in `execute()`, such as a lock or an open span. A throw in here
449
- * is logged and goes no further.
450
- *
451
- * @param result - How the dispatch ended. Either failure state carries the thrown value on `caught`.
452
- *
453
- * @example
454
- * ```ts
455
- * // the base declares it. an implementation carries `override`.
456
- * override async after(result: DispatchResult) {
457
- * this.lock.release();
458
- * }
459
- * ```
460
- */
461
- after?(result: DispatchResult): Promise<void>;
462
- }
463
- //#endregion
464
- //#region src/handlers/constructors.d.ts
465
- type AnyHandler = BaseHandler<unknown, Core> & {
466
- readonly [MiddlewareKindsBrand]?: undefined;
467
- };
468
- /** @internal Typed parameters would exclude every handler that narrows `event`. */
469
- type HandlerConstructor = Constructor<AnyHandler, never[]>;
470
- /** @internal */
471
- type InteractionMiddlewareConstructor = TypedConstructor<typeof InteractionMiddleware>;
472
- //#endregion
473
- //#region src/manifest/Manifest.d.ts
474
- /**
475
- * The classes a bundled isolate registers at startup, standing in for the filesystem scan an isolate
476
- * cannot run. `seedcord build` emits it for an edge bot. A hand-mounted host writes it.
477
- */
478
- interface Manifest {
479
- readonly handlers: readonly HandlerConstructor[];
480
- readonly middleware: readonly InteractionMiddlewareConstructor[];
481
- readonly subscribers: readonly StoredSubscriberCtor[];
482
- }
483
- //#endregion
484
- export { Core as _, RoleMenuHandler as a, HttpServerConfig as b, UserMenuHandler as c, RepliableHandler$1 as d, Repliables as f, AutocompleteHandler as g, SentMessage as h, MentionableMenuHandler as i, ComponentHandler as l, ReplySender as m, InteractionMiddleware as n, SelectMenuHandler as o, InteractionRef as p, ChannelMenuHandler as r, StringMenuHandler as s, Manifest as t, InteractionHandler as u, HttpConfig as v, HttpEdgeConfig as y };
485
- //# sourceMappingURL=Manifest-D5MEsTmH.d.mts.map