@seedcord/core 0.11.0 → 0.12.0-next.2
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/README.md +3 -3
- package/dist/Bus-VJw-QpoY.mjs +986 -0
- package/dist/Bus-VJw-QpoY.mjs.map +1 -0
- package/dist/{CoordinatedShutdown-H5YjZn8A.d.mts → CoordinatedShutdown-fPKLWjc5.d.mts} +13 -4
- package/dist/{CoordinatedStartup-CGnJrqcl.mjs → CoordinatedStartup-Zw_Lk7Zk.mjs} +22 -20
- package/dist/CoordinatedStartup-Zw_Lk7Zk.mjs.map +1 -0
- package/dist/Generated-ByC53_A2.d.mts +26 -0
- package/dist/HmrModuleHandler-Btgu8r96.mjs +165 -0
- package/dist/HmrModuleHandler-Btgu8r96.mjs.map +1 -0
- package/dist/{PluginHost-DB4j8unu.d.mts → PluginHost-DFnkIldj.d.mts} +43 -15
- package/dist/PluginHost-DTtxWRiL.mjs +552 -0
- package/dist/PluginHost-DTtxWRiL.mjs.map +1 -0
- package/dist/{PluginLifecycle-AhQ46NIr.mjs → PluginLifecycle-hx5zUc-P.mjs} +4 -4
- package/dist/PluginLifecycle-hx5zUc-P.mjs.map +1 -0
- package/dist/{ServerHost-DYeh0KTk.d.mts → ServerHost-B5o3ScCF.d.mts} +7 -6
- package/dist/{ServerHost-CtmAhEXn.mjs → ServerHost-CDaEDR4C.mjs} +17 -6
- package/dist/{ServerHost-CtmAhEXn.mjs.map → ServerHost-CDaEDR4C.mjs.map} +1 -1
- package/dist/bindViteEnv-NFzvdqlT.mjs +32 -0
- package/dist/{bindViteEnv-DWq5rftJ.mjs.map → bindViteEnv-NFzvdqlT.mjs.map} +1 -1
- package/dist/env-internal.index.mjs +1 -1
- package/dist/hmr.index.d.mts +20 -20
- package/dist/hmr.index.mjs +1 -1
- package/dist/{index-Du71Xx69.d.mts → index-DGHng1IN.d.mts} +115 -201
- package/dist/index.d.mts +321 -74
- package/dist/index.mjs +323 -102
- package/dist/index.mjs.map +1 -1
- package/dist/internal.index.d.mts +223 -83
- package/dist/internal.index.mjs +573 -74
- package/dist/internal.index.mjs.map +1 -1
- package/dist/node-internal.index.d.mts +8 -4
- package/dist/node-internal.index.mjs +19 -6
- package/dist/node-internal.index.mjs.map +1 -1
- package/dist/node.index.d.mts +3 -3
- package/dist/node.index.mjs +22 -28
- package/dist/node.index.mjs.map +1 -1
- package/dist/{phases-FTM69J3a.d.mts → phases-C2QCSqRu.d.mts} +164 -55
- package/dist/plugin.index.d.mts +3 -2
- package/dist/plugin.index.mjs +1 -1
- package/dist/subscribers-CGuVjbrg.mjs +982 -0
- package/dist/subscribers-CGuVjbrg.mjs.map +1 -0
- package/dist/{bindViteEnv-DWq5rftJ.mjs → usingCtx-Cf2cZi96.mjs} +1 -31
- package/package.json +14 -11
- package/dist/CoordinatedStartup-CGnJrqcl.mjs.map +0 -1
- package/dist/HmrModuleHandler-8ZC-UuZh.mjs +0 -162
- package/dist/HmrModuleHandler-8ZC-UuZh.mjs.map +0 -1
- package/dist/PluginHost-B8kxLOeb.mjs +0 -245
- package/dist/PluginHost-B8kxLOeb.mjs.map +0 -1
- package/dist/PluginLifecycle-AhQ46NIr.mjs.map +0 -1
- package/dist/phases-BauKJOTT.mjs +0 -31
- package/dist/phases-BauKJOTT.mjs.map +0 -1
- package/dist/publishDefault-D3dAyzZ9.mjs +0 -7
- package/dist/publishDefault-D3dAyzZ9.mjs.map +0 -1
- package/dist/subscribers-Ce3SWy23.mjs +0 -1913
- package/dist/subscribers-Ce3SWy23.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { C as AckState,
|
|
2
|
-
import { $ as
|
|
1
|
+
import { C as AckState, F as KvCollection, H as InteractionKind, I as DispatchContext, K as MiddlewareKind, P as Kv, X as NoticeConstructor, Y as Notice, _ as ResponseSent, a as Bus, b as Subscriptions, d as DispatchOutcome, f as FaultSource, g as ResponseOutcome, h as ResponseFailed, i as CoreBase, l as AttemptedWrite, m as ResponseAttempt, n as StartupPhase, t as ShutdownPhase, v as SubscriptionData, x as ReplyTelemetry, y as SubscriptionKey } from "./phases-C2QCSqRu.mjs";
|
|
2
|
+
import { $ as ContextMenuInfo, A as RequiredOf, C as JoinNames, Ct as BuilderComponent, D as Gate, E as EffectGate, Et as RowType, F as DispatchResult, Ft as MessageContextMenuRegistry, G as ComponentDefsBrand, H as RegisterInteractionMiddleware, I as EventDispatchResult, It as NamesFor, J as ContextMenuNamesBrand, K as ComponentKindBrand, L as HandlerOutcome, Lt as UserContextMenuRegistry, M as defineGate, N as SerializedReply, Nt as ContextMenuKind, O as GateContextBase, Q as Commands, R as HandlerResult, S as IntersectRequired, St as RegisterCommand, T as AppPermissionsContext, Tt as BuilderType, V as InteractionMiddlewareOptions, W as AutocompleteRouteBrand, X as SlashRouteBrand, Z as CommandInfo, a as Subscribe, b as ResolvedEmoji, et as ContextMenus, g as AutocompleteOptions, i as WebhookFile, j as defineEffectGate, jt as SlashRegistry, k as GuildPermissionsContext, n as WebhookLog, nt as InjectedContextMenuMap, o as SubscribeOptions, p as PageCursor, q as ContextMenuKindBrand, r as WebhookReport, s as Subscriber, t as WebhookUrl, tt as InjectedCommandMap, w as TwoOrMore, wt as RowComponent, xt as GuildTarget } from "./index-DGHng1IN.mjs";
|
|
3
|
+
import { n as PluginTypes, t as Generated } from "./Generated-ByC53_A2.mjs";
|
|
3
4
|
import "reflect-metadata";
|
|
4
5
|
import { AnyCustomId, AnyCustomId as AnyCustomId$1, CustomId, CustomIdField, CustomIdShape, DecodedParams, DecodedRoute, FieldOptions, decodeFor, prefixOf, setCustomIdErrors } from "@seedcord/custom-id";
|
|
5
6
|
import { ActionRowBuilder, ButtonBuilder } from "@discordjs/builders";
|
|
6
7
|
import { APIMessageComponentEmoji, APIModalInteractionResponseCallbackData, ApplicationCommandType, ButtonStyle } from "discord-api-types/v10";
|
|
7
8
|
import { Logger } from "@seedcord/logger";
|
|
8
9
|
import { ValidDuration } from "@seedcord/utils";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { REST } from "@discordjs/rest";
|
|
11
|
+
import { DeferOpts, EpochMs, KvDriver, KvEntry, LoggerChannelId, RenderContext, ReplyResponse, SendOpts, TypedExtract } from "@seedcord/types";
|
|
12
|
+
import { Constructor, LiteralUnion, Promisable } from "type-fest";
|
|
11
13
|
//#region src/decorators/routes.d.ts
|
|
12
14
|
type ComponentBrand = TypedExtract<InteractionKind, InteractionKind.Button | InteractionKind.Modal | InteractionKind.StringMenu | InteractionKind.UserMenu | InteractionKind.RoleMenu | InteractionKind.ChannelMenu | InteractionKind.MentionableMenu>;
|
|
13
15
|
type AnyHandlerCtor = new (...args: never[]) => unknown;
|
|
@@ -29,15 +31,21 @@ type ComponentOf<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends {
|
|
|
29
31
|
type DefsOf<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends {
|
|
30
32
|
[ComponentDefsBrand]?: infer Defs extends readonly AnyCustomId$1[];
|
|
31
33
|
} ? Defs : never;
|
|
32
|
-
type
|
|
33
|
-
type
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
type SameSet<Left, Right> = [Left] extends [Right] ? ([Right] extends [Left] ? true : false) : false;
|
|
35
|
+
type Mismatch<Message extends string, Decorator, Generic> = Constructor<[Message, {
|
|
36
|
+
decorator: Decorator;
|
|
37
|
+
generic: Generic;
|
|
38
|
+
}]>;
|
|
39
|
+
type AssertNames<Names extends string, Registered, Declared, Decorator extends string, Handler extends string, TCtor extends AnyHandlerCtor> = [Names] extends [Registered] ? SameSet<Names, Declared> extends true ? TCtor : Mismatch<`${Decorator} does not match the ${Handler} generic`, Names, Declared> : Constructor<[`${Decorator} lists a command that is not registered`, Exclude<Names, Registered>]>;
|
|
40
|
+
type AssertSlashRoute<Route extends string, TCtor extends AnyHandlerCtor> = AssertNames<Route, keyof SlashRegistry, SlashRouteOf<TCtor>, 'SlashRoute', 'SlashHandler', TCtor>;
|
|
41
|
+
type AssertAutocompleteRoute<Route extends string, TCtor extends AnyHandlerCtor> = AssertNames<Route, keyof SlashRegistry, AutocompleteRouteOf<TCtor>, 'AutocompleteRoute', 'AutocompleteHandler', TCtor>;
|
|
42
|
+
type AssertContextMenuRoute<Kind extends ContextMenuKind, Names extends string, TCtor extends AnyHandlerCtor> = SameSet<Kind, ContextMenuKindOf<TCtor>> extends true ? AssertNames<Names, NamesFor<Kind>, ContextMenuNamesOf<TCtor>, 'ContextMenuRoute', 'ContextMenuHandler', TCtor> : Mismatch<'ContextMenuRoute does not match the ContextMenuHandler kind', Kind, ContextMenuKindOf<TCtor>>;
|
|
43
|
+
type AssertComponentRoute<Brand extends ComponentBrand, Defs extends readonly AnyCustomId$1[], TCtor extends AnyHandlerCtor> = SameSet<Brand, ComponentOf<TCtor>> extends true ? [DefsOf<TCtor>] extends [Defs] ? TCtor : Mismatch<'the customId definitions do not match the handler generic', Defs, DefsOf<TCtor>> : Mismatch<'the decorator does not match the handler kind', Brand, ComponentOf<TCtor>>;
|
|
36
44
|
/**
|
|
37
45
|
* Routes one or more slash commands to a `SlashHandler`.
|
|
38
46
|
*
|
|
39
|
-
* Pass the same route string(s) as the handler's generic.
|
|
40
|
-
*
|
|
47
|
+
* Pass the same route string(s) as the handler's generic. On a handler for one command, read
|
|
48
|
+
* `this.options`. On a handler for several, branch with `this.match`. The decorator routes and the generic must match exactly. Listing
|
|
41
49
|
* fewer or more than the handler declares is a compile error. Subcommands use a slash path.
|
|
42
50
|
*
|
|
43
51
|
* @param routes - The route string(s) this handler serves, e.g. `'ban'`, `'ban', 'kick'`, or `'demo/setup'`.
|
|
@@ -52,12 +60,12 @@ type AssertComponentRoute<Brand extends ComponentBrand, Defs extends readonly An
|
|
|
52
60
|
* }
|
|
53
61
|
* ```
|
|
54
62
|
*/
|
|
55
|
-
export declare function SlashRoute<const Route extends keyof SlashRegistry
|
|
63
|
+
export declare function SlashRoute<const Route extends LiteralUnion<keyof SlashRegistry, string>>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertSlashRoute<Route, TCtor>) => void;
|
|
56
64
|
/**
|
|
57
65
|
* Routes one or more commands' autocomplete to an `AutocompleteHandler`.
|
|
58
66
|
*
|
|
59
67
|
* Pass the same command route string(s) as the handler's generic. One command branches with `this.match`
|
|
60
|
-
* over its autocompletable fields, several commands share one handler whose
|
|
68
|
+
* over its autocompletable fields, several commands share one handler whose cases span every command's
|
|
61
69
|
* fields. Listing fewer or more commands than the handler declares is a compile error, since the
|
|
62
70
|
* decorator routes and the generic must match exactly.
|
|
63
71
|
*
|
|
@@ -73,7 +81,7 @@ export declare function SlashRoute<const Route extends keyof SlashRegistry>(...r
|
|
|
73
81
|
* }
|
|
74
82
|
* ```
|
|
75
83
|
*/
|
|
76
|
-
export declare function AutocompleteRoute<const Route extends keyof SlashRegistry
|
|
84
|
+
export declare function AutocompleteRoute<const Route extends LiteralUnion<keyof SlashRegistry, string>>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertAutocompleteRoute<Route, TCtor>) => void;
|
|
77
85
|
/**
|
|
78
86
|
* Routes one or more user context-menu commands to a `UserContextMenuHandler`.
|
|
79
87
|
*
|
|
@@ -92,7 +100,7 @@ export declare function AutocompleteRoute<const Route extends keyof SlashRegistr
|
|
|
92
100
|
* }
|
|
93
101
|
* ```
|
|
94
102
|
*/
|
|
95
|
-
export declare function UserContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.User>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.User, Names, TCtor>) => void;
|
|
103
|
+
export declare function UserContextMenuRoute<const Names extends LiteralUnion<NamesFor<ApplicationCommandType.User>, string>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.User, Names, TCtor>) => void;
|
|
96
104
|
/**
|
|
97
105
|
* Routes one or more message context-menu commands to a `MessageContextMenuHandler`.
|
|
98
106
|
*
|
|
@@ -111,7 +119,7 @@ export declare function UserContextMenuRoute<const Names extends NamesFor<Applic
|
|
|
111
119
|
* }
|
|
112
120
|
* ```
|
|
113
121
|
*/
|
|
114
|
-
export declare function MessageContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.Message>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.Message, Names, TCtor>) => void;
|
|
122
|
+
export declare function MessageContextMenuRoute<const Names extends LiteralUnion<NamesFor<ApplicationCommandType.Message>, string>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.Message, Names, TCtor>) => void;
|
|
115
123
|
/**
|
|
116
124
|
* Routes button interactions to handler classes.
|
|
117
125
|
*
|
|
@@ -139,7 +147,7 @@ export declare function ModalRoute<const Defs extends readonly AnyCustomId$1[]>(
|
|
|
139
147
|
* Routes string select menu interactions to a `StringMenuHandler`.
|
|
140
148
|
*
|
|
141
149
|
* Pass the {@link CustomId} definition(s) this handler decodes and list the same ones in the handler's
|
|
142
|
-
* generic.
|
|
150
|
+
* generic. Read the chosen option values from `this.values`.
|
|
143
151
|
*
|
|
144
152
|
* @param defs - The customId definition(s) this handler decodes, one per route.
|
|
145
153
|
* @decorator
|
|
@@ -248,12 +256,14 @@ export declare abstract class BaseHandler<Event, TCore extends CoreBase> {
|
|
|
248
256
|
protected readonly logger: Logger;
|
|
249
257
|
/** The bag for this dispatch. Each interaction gets its own. Every handler for one event shares a single bag. */
|
|
250
258
|
protected readonly dispatch: DispatchContext;
|
|
259
|
+
/** The route that started this dispatch. Each handler base narrows it to its own routes. */
|
|
260
|
+
protected readonly route: string;
|
|
251
261
|
protected constructor(event: Event, core: TCore, dispatch: DispatchContext, channel?: LoggerChannelId);
|
|
252
262
|
/**
|
|
253
263
|
* Holds the main logic of your handler. The dispatcher calls it after the handler's gates pass, so a
|
|
254
264
|
* gate that refuses stops `execute()` from running.
|
|
255
265
|
*/
|
|
256
|
-
abstract execute():
|
|
266
|
+
abstract execute(): Promisable<void>;
|
|
257
267
|
}
|
|
258
268
|
//#endregion
|
|
259
269
|
//#region src/reply/BaseReplySender.d.ts
|
|
@@ -319,7 +329,7 @@ export declare abstract class BaseReplySender<TMessage extends {
|
|
|
319
329
|
//#region src/handlers/RepliableHandler.d.ts
|
|
320
330
|
/**
|
|
321
331
|
* Shared base the repliable handlers on both transports extend. Defines the reply members over one sender.
|
|
322
|
-
*
|
|
332
|
+
* The dispatch run builds that sender and passes it to the handler and each middleware.
|
|
323
333
|
*
|
|
324
334
|
* @typeParam Event - The repliable interaction type this handler processes
|
|
325
335
|
* @typeParam TCore - The transport's Core
|
|
@@ -332,9 +342,7 @@ export declare abstract class RepliableHandler<Event, TCore extends CoreBase, TM
|
|
|
332
342
|
}, TNative, TSender extends BaseReplySender<TMessage, TNative>> extends BaseHandler<Event, TCore> {
|
|
333
343
|
/** The reply surface for this interaction. Pass the handler to reply from outside its class. */
|
|
334
344
|
readonly sender: TSender;
|
|
335
|
-
protected
|
|
336
|
-
protected constructor(event: Event, core: TCore, dispatch: DispatchContext, sender?: TSender);
|
|
337
|
-
protected abstract buildSender(event: Event, core: TCore, dispatch: DispatchContext): TSender;
|
|
345
|
+
protected constructor(event: Event, core: TCore, dispatch: DispatchContext, sender: TSender);
|
|
338
346
|
/** Send the initial response, exactly once. */
|
|
339
347
|
protected reply(response: ReplyResponse<TNative> | string, opts?: SendOpts): Promise<TMessage>;
|
|
340
348
|
/** Show a "thinking" placeholder, then fill it later with {@link edit}. */
|
|
@@ -352,12 +360,12 @@ export declare abstract class RepliableHandler<Event, TCore extends CoreBase, TM
|
|
|
352
360
|
//#endregion
|
|
353
361
|
//#region src/gates/combinators.d.ts
|
|
354
362
|
/**
|
|
355
|
-
* Runs each gate in order and refuses on the first refusal. Takes two or more
|
|
356
|
-
* context is the intersection of
|
|
363
|
+
* Runs each gate in order and refuses on the first refusal. Takes two or more gates. The required
|
|
364
|
+
* context is the intersection of their contexts, so an event-only and an interaction-only gate cannot be
|
|
357
365
|
* combined.
|
|
358
366
|
*
|
|
359
|
-
* @typeParam Gates - The tuple of two or more
|
|
360
|
-
* @param gates - The
|
|
367
|
+
* @typeParam Gates - The tuple of two or more gates, run left to right.
|
|
368
|
+
* @param gates - The gates to run in order, all refused on the first refusal.
|
|
361
369
|
*
|
|
362
370
|
* @see {@link or}
|
|
363
371
|
*
|
|
@@ -379,13 +387,13 @@ interface OrOptions {
|
|
|
379
387
|
fail: Notice | ((ctx: GateContextBase) => Notice);
|
|
380
388
|
}
|
|
381
389
|
/**
|
|
382
|
-
* Runs each gate in order and passes on the first
|
|
383
|
-
* required context is the union of
|
|
384
|
-
*
|
|
385
|
-
* refusal's `summary`, else a default refusal. The trailing options object does not count as
|
|
390
|
+
* Runs each gate in order and passes on the first gate that passes. Takes two or more gates. The
|
|
391
|
+
* required context is the union of their contexts. A handler that matches any one gate fits. When every
|
|
392
|
+
* gate refuses it throws the trailing {@link OrOptions} `fail` if given, else a list built from each
|
|
393
|
+
* refusal's `summary`, else a default refusal. The trailing options object does not count as a gate.
|
|
386
394
|
*
|
|
387
|
-
* @typeParam Gates - The tuple of two or more
|
|
388
|
-
* @param gates - The
|
|
395
|
+
* @typeParam Gates - The tuple of two or more gates, tried left to right.
|
|
396
|
+
* @param gates - The gates to try in order, with an optional trailing {@link OrOptions} object.
|
|
389
397
|
*
|
|
390
398
|
* @see {@link and}
|
|
391
399
|
*
|
|
@@ -404,19 +412,26 @@ export declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...ga
|
|
|
404
412
|
/**
|
|
405
413
|
* @example
|
|
406
414
|
* ```ts
|
|
407
|
-
* // custom refusal when every
|
|
415
|
+
* // custom refusal when every gate refuses
|
|
408
416
|
* or(OwnerOnly(), RequireRole('123456789012345678'), { fail: new NotAllowedNotice() });
|
|
409
417
|
* ```
|
|
410
418
|
*/
|
|
411
419
|
export declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...args: [...Gates, OrOptions]): Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>;
|
|
412
420
|
//#endregion
|
|
421
|
+
//#region src/gates/catalog/options.d.ts
|
|
422
|
+
/** The override a gate with a single refusal accepts. */
|
|
423
|
+
interface GateNoticeOptions {
|
|
424
|
+
/** Your Notice class, constructed and thrown in place of the default refusal. */
|
|
425
|
+
notice?: NoticeConstructor;
|
|
426
|
+
}
|
|
427
|
+
//#endregion
|
|
413
428
|
//#region src/gates/catalog/access.d.ts
|
|
414
429
|
/**
|
|
415
430
|
* Passes only for a user id listed in `config.ownerIds`, else refuses.
|
|
416
431
|
*
|
|
417
|
-
* Agnostic, so it attaches to interaction and event handlers alike. With no `ownerIds` configured it refuses every caller. Pass
|
|
432
|
+
* Agnostic, so it attaches to interaction and event handlers alike. With no `ownerIds` configured it refuses every caller. Pass a Notice class as `notice` to replace the refusal.
|
|
418
433
|
*
|
|
419
|
-
* @param options -
|
|
434
|
+
* @param options - Replace the refusal with a Notice class as `notice`.
|
|
420
435
|
*
|
|
421
436
|
* @see the `@Gated` decorator from your transport package
|
|
422
437
|
*
|
|
@@ -433,8 +448,8 @@ export declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...ar
|
|
|
433
448
|
*
|
|
434
449
|
* @example
|
|
435
450
|
* ```ts
|
|
436
|
-
* //
|
|
437
|
-
* OwnerOnly({
|
|
451
|
+
* // OwnersOnly is your own Notice class
|
|
452
|
+
* OwnerOnly({ notice: OwnersOnly });
|
|
438
453
|
* ```
|
|
439
454
|
*/
|
|
440
455
|
export declare function OwnerOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'OwnerOnly'>;
|
|
@@ -443,7 +458,7 @@ export declare function OwnerOnly(options?: GateNoticeOptions): Gate<GateContext
|
|
|
443
458
|
*
|
|
444
459
|
* Agnostic. Attaches to any handler kind. Often paired with `RequirePermissions` in an {@link and}.
|
|
445
460
|
*
|
|
446
|
-
* @param options -
|
|
461
|
+
* @param options - Replace the refusal with a Notice class as `notice`.
|
|
447
462
|
*
|
|
448
463
|
* @see the `@Gated` decorator from your transport package
|
|
449
464
|
*
|
|
@@ -466,7 +481,7 @@ export declare function GuildOnly(options?: GateNoticeOptions): Gate<GateContext
|
|
|
466
481
|
*
|
|
467
482
|
* Agnostic, fitting any handler kind. The inverse of {@link GuildOnly}, so combining the two in an {@link and} can never pass.
|
|
468
483
|
*
|
|
469
|
-
* @param options -
|
|
484
|
+
* @param options - Replace the refusal with a Notice class as `notice`.
|
|
470
485
|
*
|
|
471
486
|
* @see the `@Gated` decorator from your transport package
|
|
472
487
|
*
|
|
@@ -486,16 +501,18 @@ export declare function DmOnly(options?: GateNoticeOptions): Gate<GateContextBas
|
|
|
486
501
|
//#region src/gates/catalog/Cooldown.d.ts
|
|
487
502
|
/**
|
|
488
503
|
* Options for {@link Cooldown}. `per` sets the bucket the window applies to and `limit` the uses allowed per
|
|
489
|
-
* window. `
|
|
490
|
-
* up so the refusal can show the retry time.
|
|
504
|
+
* window. `notice` replaces the refusal.
|
|
491
505
|
*
|
|
492
506
|
* @example
|
|
493
507
|
* ```ts
|
|
494
|
-
* // one use per channel,
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
508
|
+
* // one use per channel, refusing with your own Notice class
|
|
509
|
+
* class SlowDown extends Notice {
|
|
510
|
+
* public constructor(resetAt: EpochMs) {
|
|
511
|
+
* super(`Slow down. Try again <t:${toEpochSeconds(resetAt)}:R>.`);
|
|
512
|
+
* }
|
|
513
|
+
* }
|
|
514
|
+
*
|
|
515
|
+
* Cooldown('10s', { per: 'channel', notice: SlowDown });
|
|
499
516
|
* ```
|
|
500
517
|
*
|
|
501
518
|
* @example
|
|
@@ -517,16 +534,8 @@ interface CooldownOptions {
|
|
|
517
534
|
* @defaultValue `1`
|
|
518
535
|
*/
|
|
519
536
|
limit?: number;
|
|
520
|
-
/**
|
|
521
|
-
|
|
522
|
-
* show the retry time with `<t:${Math.round(resetAt / 1000)}:R>`.
|
|
523
|
-
*/
|
|
524
|
-
message?: (resetAt: EpochMs) => string;
|
|
525
|
-
/**
|
|
526
|
-
* Replace the refusal Notice entirely, for full control or a translated copy. Receives the epoch ms the
|
|
527
|
-
* key frees up.
|
|
528
|
-
*/
|
|
529
|
-
notice?: (resetAt: EpochMs) => Notice;
|
|
537
|
+
/** Your Notice class, constructed with the epoch ms the key frees up and thrown in place of the default refusal. */
|
|
538
|
+
notice?: NoticeConstructor<[resetAt: EpochMs]>;
|
|
530
539
|
}
|
|
531
540
|
/**
|
|
532
541
|
* Allows `limit` uses per window, scoped by `per`. A number `duration` is **seconds**, and a string is
|
|
@@ -534,10 +543,10 @@ interface CooldownOptions {
|
|
|
534
543
|
* so a later refusal never burns the cooldown.
|
|
535
544
|
* That split also means two requests racing the same key can both pass before either charges the slot.
|
|
536
545
|
* The key combines the handler's route with the window settings, keeping two different handlers on separate
|
|
537
|
-
* windows.
|
|
546
|
+
* windows. Replace the refusal with {@link CooldownOptions.notice}.
|
|
538
547
|
*
|
|
539
548
|
* @param duration - A number is seconds, and a string is a duration like `30m` or `24h`.
|
|
540
|
-
* @param options - Sets the scope with `per`, the uses per window with `limit`, and the refusal
|
|
549
|
+
* @param options - Sets the scope with `per`, the uses per window with `limit`, and the refusal with `notice`.
|
|
541
550
|
* @throws A **SeedcordTypeError** when `duration` is a string that doesn't parse.
|
|
542
551
|
* @throws A **SeedcordRangeError** when `duration` is zero or negative.
|
|
543
552
|
*
|
|
@@ -576,26 +585,35 @@ interface CooldownOptions {
|
|
|
576
585
|
*/
|
|
577
586
|
export declare function Cooldown(duration: number | ValidDuration, options?: CooldownOptions): EffectGate<GateContextBase, 'Cooldown'>;
|
|
578
587
|
//#endregion
|
|
588
|
+
//#region src/permissions/bits.d.ts
|
|
589
|
+
/**
|
|
590
|
+
* The permission flag bits a caller or the bot must hold. Pass the `PermissionFlagsBits` values from
|
|
591
|
+
* `discord-api-types/v10` (or `discord.js`).
|
|
592
|
+
*/
|
|
593
|
+
type PermissionScope = readonly bigint[];
|
|
594
|
+
//#endregion
|
|
579
595
|
//#region src/permissions/assert.d.ts
|
|
580
|
-
/**
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
596
|
+
/**
|
|
597
|
+
* A Notice class for a permission refusal. seedcord constructs it with the subject and the permission names
|
|
598
|
+
* the refusal lists. A null subject is the caller.
|
|
599
|
+
*/
|
|
600
|
+
type PermissionNoticeConstructor = NoticeConstructor<[subject: string | null, permissions: readonly string[]]>;
|
|
585
601
|
/** The check {@link assertPermissions} runs. */
|
|
586
|
-
interface PermissionAssertion
|
|
587
|
-
/** Mention string for who is checked, used as the refusal's subject. */
|
|
588
|
-
subject: string;
|
|
602
|
+
interface PermissionAssertion {
|
|
603
|
+
/** Mention string for who is checked, used as the refusal's subject. Null addresses the caller. */
|
|
604
|
+
subject: string | null;
|
|
589
605
|
/** The effective permission bitfield the subject holds, computed by the caller. */
|
|
590
606
|
permissions: bigint;
|
|
591
607
|
/** The permission flag bits to check. */
|
|
592
608
|
scope: PermissionScope;
|
|
593
609
|
/** Refuse when the subject holds a scope bit. */
|
|
594
610
|
inverse?: boolean;
|
|
611
|
+
/** Your Notice class, thrown in place of the default refusal. seedcord constructs it with the missing names, or the held ones under `inverse`. */
|
|
612
|
+
notice?: PermissionNoticeConstructor | undefined;
|
|
595
613
|
}
|
|
596
614
|
/**
|
|
597
615
|
* Refuses when the subject is missing a permission in `scope`, or with `inverse` when it holds one.
|
|
598
|
-
* The Administrator bit passes any scope, and
|
|
616
|
+
* The Administrator bit passes any scope, and with `inverse` it reports every bit in `scope`.
|
|
599
617
|
*
|
|
600
618
|
* The caller computes `permissions`, gateway off a discord.js role, member, or channel, and HTTP off the
|
|
601
619
|
* bitfield the interaction payload carries.
|
|
@@ -640,14 +658,12 @@ interface PermissionAssertion extends PermissionNoticeOverrides {
|
|
|
640
658
|
* ```ts
|
|
641
659
|
* import { Notice } from '@seedcord/core';
|
|
642
660
|
*
|
|
643
|
-
* // a replacement notice takes the same three arguments the default one does
|
|
644
661
|
* class CannotBan extends Notice {
|
|
645
662
|
* public constructor(
|
|
646
|
-
*
|
|
647
|
-
* private readonly subject: string,
|
|
663
|
+
* private readonly subject: string | null,
|
|
648
664
|
* private readonly missing: readonly string[]
|
|
649
665
|
* ) {
|
|
650
|
-
* super(
|
|
666
|
+
* super('You cannot ban here.');
|
|
651
667
|
* }
|
|
652
668
|
*
|
|
653
669
|
* public render(): ReplyResponse {
|
|
@@ -659,11 +675,140 @@ interface PermissionAssertion extends PermissionNoticeOverrides {
|
|
|
659
675
|
* subject: `<@${member.id}>`,
|
|
660
676
|
* permissions: member.permissions.bitfield,
|
|
661
677
|
* scope: [PermissionFlagsBits.BanMembers],
|
|
662
|
-
*
|
|
678
|
+
* notice: CannotBan
|
|
663
679
|
* });
|
|
664
680
|
* ```
|
|
665
681
|
*/
|
|
666
|
-
export declare function assertPermissions(
|
|
682
|
+
export declare function assertPermissions({ subject, permissions, scope, inverse, notice }: PermissionAssertion): void;
|
|
683
|
+
//#endregion
|
|
684
|
+
//#region src/gates/catalog/permissions.d.ts
|
|
685
|
+
/**
|
|
686
|
+
* Options for {@link RequireBotPermissions}.
|
|
687
|
+
*/
|
|
688
|
+
interface RequireBotPermissionsOptions {
|
|
689
|
+
/**
|
|
690
|
+
* The set the check reads. `'channel'` reads the effective channel set the payload carries, what
|
|
691
|
+
* Discord enforces in the invoked channel. `'guild'` reads the base set from roles, available on the
|
|
692
|
+
* gateway transport only.
|
|
693
|
+
*
|
|
694
|
+
* @defaultValue `'channel'`
|
|
695
|
+
*/
|
|
696
|
+
in?: 'channel' | 'guild';
|
|
697
|
+
/** Your Notice class, constructed and thrown in place of the refusal outside a guild. */
|
|
698
|
+
notInGuild?: NoticeConstructor;
|
|
699
|
+
/** Your Notice class, constructed and thrown in place of the refusal when a permission is missing. */
|
|
700
|
+
missing?: PermissionNoticeConstructor;
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Options for {@link RequirePermissions}.
|
|
704
|
+
*/
|
|
705
|
+
interface RequirePermissionsOptions extends RequireBotPermissionsOptions {
|
|
706
|
+
/** Your Notice class, constructed and thrown in place of the refusal when the member's permissions are unavailable inside a guild. */
|
|
707
|
+
unresolved?: NoticeConstructor;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Options for {@link RequireRole}.
|
|
711
|
+
*/
|
|
712
|
+
interface RequireRoleOptions {
|
|
713
|
+
/** Your Notice class, constructed and thrown in place of the refusal outside a guild. */
|
|
714
|
+
notInGuild?: NoticeConstructor;
|
|
715
|
+
/** Your Notice class, constructed with the role id and thrown in place of the refusal when the caller lacks the role. */
|
|
716
|
+
missingRole?: NoticeConstructor<[roleId: string]>;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Requires the caller to hold every permission in `scope`. Refuses outside a guild first, then when the
|
|
720
|
+
* member's permissions are unavailable, then when a permission is missing. The Administrator bit passes any
|
|
721
|
+
* scope.
|
|
722
|
+
*
|
|
723
|
+
* The default `'channel'` scope reads the effective channel set the payload carries, what Discord enforces
|
|
724
|
+
* in the invoked channel. The `'guild'` scope reads the base set from roles and requires a
|
|
725
|
+
* {@link GuildPermissionsContext}, so it fits a gateway handler only.
|
|
726
|
+
*
|
|
727
|
+
* @param scope - The permission flag bits the caller must all hold.
|
|
728
|
+
* @param options - Pick the scope with `in`. Replace a refusal with a Notice class as `notInGuild`, `unresolved`, or `missing`.
|
|
729
|
+
*
|
|
730
|
+
* @see the `@Gated` decorator from your transport package
|
|
731
|
+
*
|
|
732
|
+
* @example
|
|
733
|
+
* ```ts
|
|
734
|
+
* import { PermissionFlagsBits } from 'discord-api-types/v10';
|
|
735
|
+
*
|
|
736
|
+
* \@Gated(RequirePermissions([PermissionFlagsBits.BanMembers]))
|
|
737
|
+
* \@SlashRoute('ban')
|
|
738
|
+
* class BanHandler extends SlashHandler<'ban'> {
|
|
739
|
+
* async execute() {
|
|
740
|
+
* // ...
|
|
741
|
+
* }
|
|
742
|
+
* }
|
|
743
|
+
* ```
|
|
744
|
+
*
|
|
745
|
+
* @example
|
|
746
|
+
* ```ts
|
|
747
|
+
* // the base set from roles, on a gateway handler
|
|
748
|
+
* RequirePermissions([PermissionFlagsBits.BanMembers], { in: 'guild' });
|
|
749
|
+
* ```
|
|
750
|
+
*/
|
|
751
|
+
export declare function RequirePermissions(scope: PermissionScope, options: RequirePermissionsOptions & {
|
|
752
|
+
in: 'guild';
|
|
753
|
+
}): Gate<GuildPermissionsContext, 'RequirePermissions'>;
|
|
754
|
+
export declare function RequirePermissions(scope: PermissionScope, options?: RequirePermissionsOptions & {
|
|
755
|
+
in?: 'channel';
|
|
756
|
+
}): Gate<GateContextBase, 'RequirePermissions'>;
|
|
757
|
+
/**
|
|
758
|
+
* Requires the bot to hold every permission in `scope`. Refuses outside a guild first, then when a
|
|
759
|
+
* permission is missing. The Administrator bit passes any scope.
|
|
760
|
+
*
|
|
761
|
+
* The default `'channel'` scope reads the bot's effective channel set (wire `app_permissions`), what
|
|
762
|
+
* Discord enforces in the invoked channel. The `'guild'` scope reads the bot's base set from roles and
|
|
763
|
+
* requires a {@link GuildPermissionsContext}, fitting a gateway handler only. The channel scope requires an
|
|
764
|
+
* {@link AppPermissionsContext}. An event handler takes `in: 'guild'`.
|
|
765
|
+
*
|
|
766
|
+
* @param scope - The permission flag bits the bot must all hold.
|
|
767
|
+
* @param options - Pick the scope with `in`. Replace a refusal with a Notice class as `notInGuild` or `missing`.
|
|
768
|
+
* @throws A **SeedcordError** when the `'guild'` scope runs and the bot's own member isn't cached.
|
|
769
|
+
*
|
|
770
|
+
* @see the `@Gated` decorator from your transport package
|
|
771
|
+
*
|
|
772
|
+
* @example
|
|
773
|
+
* ```ts
|
|
774
|
+
* import { PermissionFlagsBits } from 'discord-api-types/v10';
|
|
775
|
+
*
|
|
776
|
+
* \@Gated(RequireBotPermissions([PermissionFlagsBits.ManageMessages]))
|
|
777
|
+
* \@SlashRoute('purge')
|
|
778
|
+
* class PurgeHandler extends SlashHandler<'purge'> {
|
|
779
|
+
* async execute() {
|
|
780
|
+
* // ...
|
|
781
|
+
* }
|
|
782
|
+
* }
|
|
783
|
+
* ```
|
|
784
|
+
*/
|
|
785
|
+
export declare function RequireBotPermissions(scope: PermissionScope, options: RequireBotPermissionsOptions & {
|
|
786
|
+
in: 'guild';
|
|
787
|
+
}): Gate<GuildPermissionsContext, 'RequireBotPermissions'>;
|
|
788
|
+
export declare function RequireBotPermissions(scope: PermissionScope, options?: RequireBotPermissionsOptions & {
|
|
789
|
+
in?: 'channel';
|
|
790
|
+
}): Gate<AppPermissionsContext, 'RequireBotPermissions'>;
|
|
791
|
+
/**
|
|
792
|
+
* Requires the caller to hold `roleId`, read from the member's role ids. Refuses outside a guild first,
|
|
793
|
+
* then when the role is missing. Roles are guild-global, so there is no scope dimension.
|
|
794
|
+
*
|
|
795
|
+
* @param roleId - The role snowflake the caller must hold.
|
|
796
|
+
* @param options - Replace a refusal with a Notice class as `notInGuild` or `missingRole`.
|
|
797
|
+
*
|
|
798
|
+
* @see the `@Gated` decorator from your transport package
|
|
799
|
+
*
|
|
800
|
+
* @example
|
|
801
|
+
* ```ts
|
|
802
|
+
* \@Gated(RequireRole('123456789012345678'))
|
|
803
|
+
* \@SlashRoute('vip')
|
|
804
|
+
* class VipHandler extends SlashHandler<'vip'> {
|
|
805
|
+
* async execute() {
|
|
806
|
+
* // ...
|
|
807
|
+
* }
|
|
808
|
+
* }
|
|
809
|
+
* ```
|
|
810
|
+
*/
|
|
811
|
+
export declare function RequireRole(roleId: string, options?: RequireRoleOptions): Gate<GateContextBase, 'RequireRole'>;
|
|
667
812
|
//#endregion
|
|
668
813
|
//#region src/permissions/mergeRoles.d.ts
|
|
669
814
|
/**
|
|
@@ -804,7 +949,7 @@ interface PaginatorControls {
|
|
|
804
949
|
//#region src/pagination/render.d.ts
|
|
805
950
|
/** What `renderItem` returns for one item, a text line or a section. */
|
|
806
951
|
type ItemRender<Item> = (item: Item, index: number) => string | BuilderComponent<'section'>;
|
|
807
|
-
type Renderable = string |
|
|
952
|
+
type Renderable = string | ReplyResponse['components'] | ReplyResponse;
|
|
808
953
|
/** A full-page render override. */
|
|
809
954
|
type PageRender<Item> = (view: PageView<Item>, controls: PaginatorControls) => Renderable;
|
|
810
955
|
//#endregion
|
|
@@ -895,9 +1040,111 @@ export declare abstract class PaginatorBase<Item, Prefix extends string, Ctx> {
|
|
|
895
1040
|
protected buildPage(ctx: Ctx, n: number): Promise<ReplyResponse>;
|
|
896
1041
|
}
|
|
897
1042
|
//#endregion
|
|
1043
|
+
//#region src/kv/KeyvDriver.d.ts
|
|
1044
|
+
interface KeyvLike {
|
|
1045
|
+
readonly store: {
|
|
1046
|
+
readonly capabilities?: {
|
|
1047
|
+
readonly store: string;
|
|
1048
|
+
readonly methods: {
|
|
1049
|
+
readonly iterator: {
|
|
1050
|
+
readonly exists: boolean;
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
};
|
|
1054
|
+
};
|
|
1055
|
+
get(key: string): Promise<unknown>;
|
|
1056
|
+
set(key: string, value: string, ttl?: number): Promise<boolean>;
|
|
1057
|
+
delete(key: string): Promise<boolean>;
|
|
1058
|
+
iterator(): AsyncGenerator<[string, unknown], void>;
|
|
1059
|
+
disconnect(): Promise<void>;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* Wraps a Keyv instance for `config.kv`.
|
|
1063
|
+
*
|
|
1064
|
+
* @example
|
|
1065
|
+
* ```ts
|
|
1066
|
+
* new Seedcord({ ...config, kv: new KeyvDriver(new Keyv(new KeyvSqlite('sqlite://./kv.sqlite'))) });
|
|
1067
|
+
* ```
|
|
1068
|
+
*/
|
|
1069
|
+
export declare class KeyvDriver<TKeyv extends KeyvLike> implements KvDriver, AsyncDisposable {
|
|
1070
|
+
#private;
|
|
1071
|
+
/** The Keyv instance you passed, with its full type. */
|
|
1072
|
+
readonly keyv: TKeyv;
|
|
1073
|
+
constructor(
|
|
1074
|
+
/** The Keyv instance you passed, with its full type. */
|
|
1075
|
+
keyv: TKeyv);
|
|
1076
|
+
get(key: string): Promise<string | undefined>;
|
|
1077
|
+
set(key: string, value: string, ttlMs?: number): Promise<void>;
|
|
1078
|
+
delete(key: string): Promise<void>;
|
|
1079
|
+
/** @throws A **SeedcordError** when the Keyv store can't list its keys, like `@keyv/memcache`. */
|
|
1080
|
+
entries(prefix: string): AsyncIterable<KvEntry>;
|
|
1081
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1082
|
+
}
|
|
1083
|
+
//#endregion
|
|
1084
|
+
//#region src/kv/MemoryDriver.d.ts
|
|
1085
|
+
/**
|
|
1086
|
+
* The default `config.kv`. It keeps every key in a `Map` and loses them on restart. On serverless,
|
|
1087
|
+
* each running copy keeps its own.
|
|
1088
|
+
*/
|
|
1089
|
+
export declare class MemoryDriver implements KvDriver, Disposable {
|
|
1090
|
+
#private;
|
|
1091
|
+
get(key: string): string | undefined;
|
|
1092
|
+
set(key: string, value: string, ttlMs?: number): void;
|
|
1093
|
+
delete(key: string): void;
|
|
1094
|
+
entries(prefix: string): Iterable<KvEntry>;
|
|
1095
|
+
[Symbol.dispose](): void;
|
|
1096
|
+
}
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/kv/UnstorageDriver.d.ts
|
|
1099
|
+
type Bytes = NonNullable<Parameters<TextDecoder['decode']>[0]>;
|
|
1100
|
+
interface StorageLike {
|
|
1101
|
+
getItemRaw(key: string): Promise<string | Bytes | null>;
|
|
1102
|
+
setItemRaw(key: string, value: string, opts?: {
|
|
1103
|
+
ttl?: number;
|
|
1104
|
+
}): Promise<void>;
|
|
1105
|
+
removeItem(key: string): Promise<void>;
|
|
1106
|
+
getKeys(): Promise<string[]>;
|
|
1107
|
+
dispose(): Promise<void>;
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Wraps an unstorage `Storage` for `config.kv`.
|
|
1111
|
+
*
|
|
1112
|
+
* @example
|
|
1113
|
+
* ```ts
|
|
1114
|
+
* new Seedcord({ ...config, kv: new UnstorageDriver(createStorage({ driver: fsDriver({ base: './.kv' }) })) });
|
|
1115
|
+
* ```
|
|
1116
|
+
*/
|
|
1117
|
+
export declare class UnstorageDriver<TStorage extends StorageLike> implements KvDriver, AsyncDisposable {
|
|
1118
|
+
/** The storage you passed, with its full type. */
|
|
1119
|
+
readonly storage: TStorage;
|
|
1120
|
+
constructor(
|
|
1121
|
+
/** The storage you passed, with its full type. */
|
|
1122
|
+
storage: TStorage);
|
|
1123
|
+
get(key: string): Promise<string | undefined>;
|
|
1124
|
+
set(key: string, value: string, ttlMs?: number): Promise<void>;
|
|
1125
|
+
delete(key: string): Promise<void>;
|
|
1126
|
+
entries(prefix: string): AsyncIterable<KvEntry>;
|
|
1127
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1128
|
+
}
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region src/rateLimiter/buildKey.d.ts
|
|
1131
|
+
/**
|
|
1132
|
+
* Builds a rate-limit key from a prefix and scope parts, joined with `:`. A null or undefined part
|
|
1133
|
+
* becomes `'global'`. A key built from a DM's guild id reads `<prefix>:global` for every DM caller.
|
|
1134
|
+
*
|
|
1135
|
+
* @param prefix - The bucket family, e.g. `'cooldown'`.
|
|
1136
|
+
* @param parts - Scope values, e.g. a user or guild id.
|
|
1137
|
+
*
|
|
1138
|
+
* @example
|
|
1139
|
+
* ```ts
|
|
1140
|
+
* buildKey('report', interaction.guildId); // 'report:1234...' or 'report:global' in a DM
|
|
1141
|
+
* ```
|
|
1142
|
+
*/
|
|
1143
|
+
export declare function buildKey(prefix: string, ...parts: readonly (string | null | undefined)[]): string;
|
|
1144
|
+
//#endregion
|
|
898
1145
|
//#region src/index.d.ts
|
|
899
1146
|
/** Package version */
|
|
900
1147
|
export declare const version: string;
|
|
901
1148
|
//#endregion
|
|
902
|
-
export { type AnyCustomId, type AttemptedWrite, type AutocompleteOptions, BuilderComponent, type BuilderType, Bus, type CommandInfo, Commands, type ContextMenuInfo, ContextMenus, type ControlCosmetics, type ControlKey, type CooldownOptions, type CoreBase, CustomId, type CustomIdField, type CustomIdShape, type DecodedParams, type DecodedRoute, DispatchContext, type DispatchOutcome, type DispatchResult, type EffectGate, type EventDispatchResult, type FaultSource, type FieldOptions, type Gate, type GateContextBase, type GateNoticeOptions, type GuildPermissionsContext, type GuildTarget, type HandlerOutcome, type HandlerResult, type InjectedCommandMap, type InjectedContextMenuMap, InteractionKind, type InteractionMiddlewareOptions, type ItemRender, type MessageContextMenuRegistry, type MiddlewareKind, type ModalLike, Notice, type PageRender, type PageSourceBase, type PageView, type PaginatorConfig, type PaginatorControls, type PermissionAssertion, type
|
|
1149
|
+
export { type AnyCustomId, type AppPermissionsContext, type AttemptedWrite, type AutocompleteOptions, BuilderComponent, type BuilderType, Bus, type CommandInfo, Commands, type ContextMenuInfo, ContextMenus, type ControlCosmetics, type ControlKey, type CooldownOptions, type CoreBase, CustomId, type CustomIdField, type CustomIdShape, type DecodedParams, type DecodedRoute, type DispatchContext, type DispatchOutcome, type DispatchResult, type EffectGate, type EventDispatchResult, type FaultSource, type FieldOptions, type Gate, type GateContextBase, type GateNoticeOptions, type Generated, type GuildPermissionsContext, type GuildTarget, type HandlerOutcome, type HandlerResult, type InjectedCommandMap, type InjectedContextMenuMap, InteractionKind, type InteractionMiddlewareOptions, type ItemRender, type Kv, type KvCollection, type MessageContextMenuRegistry, type MiddlewareKind, type ModalLike, Notice, type NoticeConstructor, type PageRender, type PageSourceBase, type PageView, type PaginatorConfig, type PaginatorControls, type PermissionAssertion, type PermissionNoticeConstructor, type PermissionScope, type PluginTypes, type REST, RegisterCommand, RegisterInteractionMiddleware, type RequireBotPermissionsOptions, type RequirePermissionsOptions, type RequireRoleOptions, type RequiredOf, ResolvedEmoji, type ResponseAttempt, type ResponseFailed, type ResponseOutcome, type ResponseSent, RowComponent, type RowType, ShutdownPhase, type SlashRegistry, StartupPhase, Subscribe, type SubscribeOptions, Subscriber, type SubscriptionData, type SubscriptionKey, type Subscriptions, type UserContextMenuRegistry, type WebhookFile, WebhookLog, type WebhookReport, WebhookUrl, decodeFor, defineEffectGate, defineGate, prefixOf, setCustomIdErrors };
|
|
903
1150
|
//# sourceMappingURL=index.d.mts.map
|