@seedcord/core 0.9.2 → 0.9.4
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 +2 -2
- package/dist/{Bus-Djm6688b.mjs → Bus-BxPa-Uvp.mjs} +20 -24
- package/dist/Bus-BxPa-Uvp.mjs.map +1 -0
- package/dist/{HmrModuleHandler-9AUfKXRl.mjs → HmrModuleHandler-DOAtah3j.mjs} +3 -5
- package/dist/HmrModuleHandler-DOAtah3j.mjs.map +1 -0
- package/dist/{Pluggable-D-xWcaIv.mjs → Pluggable-CXyUZIvT.mjs} +2 -8
- package/dist/{Pluggable-D-xWcaIv.mjs.map → Pluggable-CXyUZIvT.mjs.map} +1 -1
- package/dist/{Pluggable-aRzcpx4e.d.mts → Pluggable-CwKbLui3.d.mts} +3 -3
- package/dist/{Plugin-D01bBIFo.d.mts → Plugin-Dhx_ivqj.d.mts} +2 -2
- package/dist/{cursor-BPaPFTic.d.mts → cursor-BTU5bGoo.d.mts} +4 -151
- package/dist/{cursor-CFNKLVlk.mjs → cursor-CgNBnJfu.mjs} +2 -2
- package/dist/cursor-CgNBnJfu.mjs.map +1 -0
- package/dist/hmr.index.d.mts +1 -2
- package/dist/hmr.index.mjs +1 -1
- package/dist/{index-BS1hH9Sh.d.mts → index-B_-EjyvS.d.mts} +6 -6
- package/dist/index.d.mts +41 -40
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal.index.d.mts +52 -51
- package/dist/internal.index.mjs +7 -8
- package/dist/internal.index.mjs.map +1 -1
- package/dist/node-internal.index.d.mts +14 -14
- package/dist/node-internal.index.mjs +8 -9
- package/dist/node-internal.index.mjs.map +1 -1
- package/dist/node.index.d.mts +1 -1
- package/dist/node.index.mjs +4 -5
- package/dist/node.index.mjs.map +1 -1
- package/dist/{phases-DJf12l5T.d.mts → phases-D_zQBXga.d.mts} +15 -25
- package/dist/plugin.index.d.mts +1 -1
- package/dist/{slashRouteLeaves-DTFHzCKN.mjs → slashRouteLeaves-k1hJnXDO.mjs} +2 -2
- package/dist/slashRouteLeaves-k1hJnXDO.mjs.map +1 -0
- package/dist/{subscribers-kAQQt_YP.mjs → subscribers-xGy7a7xR.mjs} +2 -2
- package/dist/{subscribers-kAQQt_YP.mjs.map → subscribers-xGy7a7xR.mjs.map} +1 -1
- package/dist/{basic-Dng__Ena.d.mts → types-BG0BimVr.d.mts} +2 -10
- package/package.json +12 -12
- package/dist/Bus-Djm6688b.mjs.map +0 -1
- package/dist/HmrModuleHandler-9AUfKXRl.mjs.map +0 -1
- package/dist/cursor-CFNKLVlk.mjs.map +0 -1
- package/dist/slashRouteLeaves-DTFHzCKN.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $ as
|
|
3
|
-
import
|
|
4
|
-
import { a as Subscribe, i as WebhookFile, n as WebhookLog, o as SubscribeOptions, r as WebhookReport, t as WebhookUrl } from "./index-
|
|
1
|
+
import { C as AckState, K as Notice, P as DispatchContext, U as MiddlewareKind, _ as ResponseSent, b as Subscriptions, f as DispatchOutcome, g as ResponseOutcome, h as ResponseFailed, i as Bus, l as Subscriber, m as ResponseAttempt, n as StartupPhase, p as FaultSource, r as CoreBase, t as ShutdownPhase, u as AttemptedWrite, v as SubscriptionData, x as ReplyTelemetry, y as SubscriptionKey, z as InteractionKind } from "./phases-D_zQBXga.mjs";
|
|
2
|
+
import { $ as RowType, B as AutocompleteRouteBrand, C as Gate, D as defineEffectGate, E as RequiredOf, H as ComponentKindBrand, J as GuildTarget, K as SlashRouteBrand, L as InteractionMiddlewareOptions, M as EventDispatchResult, N as HandlerOutcome, O as defineGate, P as HandlerResult, Q as BuilderType, R as RegisterInteractionMiddleware, S as EffectGate, T as GuildPermissionsContext, U as ContextMenuKindBrand, V as ComponentDefsBrand, W as ContextMenuNamesBrand, X as BuilderComponent, Y as RegisterCommand, Z as RowComponent, a as AutocompleteOptions, b as JoinNames, ct as MessageContextMenuRegistry, d as RequirePermissionsOptions, f as RequireRole, g as GateNoticeOptions, h as PermissionScope, it as SlashRegistry, j as DispatchResult, k as SerializedReply, l as RequireBotPermissions, lt as NamesFor, n as PageCursor, ot as ContextMenuKind, p as RequireRoleOptions, u as RequirePermissions, ut as UserContextMenuRegistry, w as GateContextBase, x as TwoOrMore, y as IntersectRequired } from "./cursor-BTU5bGoo.mjs";
|
|
3
|
+
import "./types-BG0BimVr.mjs";
|
|
4
|
+
import { a as Subscribe, i as WebhookFile, n as WebhookLog, o as SubscribeOptions, r as WebhookReport, t as WebhookUrl } from "./index-B_-EjyvS.mjs";
|
|
5
5
|
import "reflect-metadata";
|
|
6
6
|
import { AnyCustomId, AnyCustomId as AnyCustomId$1, CustomId, CustomIdField, CustomIdShape, DecodedParams, DecodedRoute, FieldOptions, decodeFor, prefixOf, setCustomIdErrors } from "@seedcord/custom-id";
|
|
7
7
|
import { ActionRowBuilder, ButtonBuilder } from "@discordjs/builders";
|
|
@@ -9,6 +9,7 @@ import { APIMessageComponentEmoji, APIModalInteractionResponseCallbackData, Appl
|
|
|
9
9
|
import { Logger } from "@seedcord/logger";
|
|
10
10
|
import { ValidDuration } from "@seedcord/utils";
|
|
11
11
|
import { DeferOpts, EpochMs, LoggerChannelId, RenderContext, ReplyResponse, SendOpts, TypedExtract, V2Component } from "@seedcord/types";
|
|
12
|
+
import { Constructor, Promisable } from "type-fest";
|
|
12
13
|
//#region src/commands/CommandInjector.d.ts
|
|
13
14
|
/** What {@link Commands} resolves to for one slash route. */
|
|
14
15
|
interface CommandInfo {
|
|
@@ -37,7 +38,7 @@ type InjectedCommandMap = { [K in keyof SlashRegistry]: CommandInfo; };
|
|
|
37
38
|
* const lines = Object.values(Commands).map((c) => `${c.mention} ${c.description}`);
|
|
38
39
|
* ```
|
|
39
40
|
*/
|
|
40
|
-
declare const Commands: InjectedCommandMap;
|
|
41
|
+
export declare const Commands: InjectedCommandMap;
|
|
41
42
|
/** What {@link ContextMenus} resolves to for one context-menu command. */
|
|
42
43
|
interface ContextMenuInfo {
|
|
43
44
|
/** The deployed command id. Absent when the command deployed to two or more guilds. */
|
|
@@ -62,11 +63,11 @@ interface InjectedContextMenuMap {
|
|
|
62
63
|
* const id = ContextMenus.user['View Profile'].id;
|
|
63
64
|
* ```
|
|
64
65
|
*/
|
|
65
|
-
declare const ContextMenus: InjectedContextMenuMap;
|
|
66
|
+
export declare const ContextMenus: InjectedContextMenuMap;
|
|
66
67
|
//#endregion
|
|
67
68
|
//#region src/decorators/routes.d.ts
|
|
68
69
|
type ComponentBrand = TypedExtract<InteractionKind, InteractionKind.Button | InteractionKind.Modal | InteractionKind.StringMenu | InteractionKind.UserMenu | InteractionKind.RoleMenu | InteractionKind.ChannelMenu | InteractionKind.MentionableMenu>;
|
|
69
|
-
type AnyHandlerCtor = new (...args:
|
|
70
|
+
type AnyHandlerCtor = new (...args: never[]) => unknown;
|
|
70
71
|
type SlashRouteOf<TCtor extends AnyHandlerCtor> = InstanceType<TCtor> extends {
|
|
71
72
|
[SlashRouteBrand]?: infer Route extends keyof SlashRegistry;
|
|
72
73
|
} ? Route : never;
|
|
@@ -108,7 +109,7 @@ type AssertComponentRoute<Brand extends ComponentBrand, Defs extends readonly An
|
|
|
108
109
|
* }
|
|
109
110
|
* ```
|
|
110
111
|
*/
|
|
111
|
-
declare function SlashRoute<const Route extends keyof SlashRegistry>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertSlashRoute<Route, TCtor>) => void;
|
|
112
|
+
export declare function SlashRoute<const Route extends keyof SlashRegistry>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertSlashRoute<Route, TCtor>) => void;
|
|
112
113
|
/**
|
|
113
114
|
* Routes one or more commands' autocomplete to an `AutocompleteHandler`.
|
|
114
115
|
*
|
|
@@ -129,7 +130,7 @@ declare function SlashRoute<const Route extends keyof SlashRegistry>(...routes:
|
|
|
129
130
|
* }
|
|
130
131
|
* ```
|
|
131
132
|
*/
|
|
132
|
-
declare function AutocompleteRoute<const Route extends keyof SlashRegistry>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertAutocompleteRoute<Route, TCtor>) => void;
|
|
133
|
+
export declare function AutocompleteRoute<const Route extends keyof SlashRegistry>(...routes: Route[]): <TCtor extends AnyHandlerCtor>(constructor: AssertAutocompleteRoute<Route, TCtor>) => void;
|
|
133
134
|
/**
|
|
134
135
|
* Routes one or more user context-menu commands to a `UserContextMenuHandler`.
|
|
135
136
|
*
|
|
@@ -148,7 +149,7 @@ declare function AutocompleteRoute<const Route extends keyof SlashRegistry>(...r
|
|
|
148
149
|
* }
|
|
149
150
|
* ```
|
|
150
151
|
*/
|
|
151
|
-
declare function UserContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.User>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.User, Names, TCtor>) => void;
|
|
152
|
+
export declare function UserContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.User>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.User, Names, TCtor>) => void;
|
|
152
153
|
/**
|
|
153
154
|
* Routes one or more message context-menu commands to a `MessageContextMenuHandler`.
|
|
154
155
|
*
|
|
@@ -167,7 +168,7 @@ declare function UserContextMenuRoute<const Names extends NamesFor<ApplicationCo
|
|
|
167
168
|
* }
|
|
168
169
|
* ```
|
|
169
170
|
*/
|
|
170
|
-
declare function MessageContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.Message>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.Message, Names, TCtor>) => void;
|
|
171
|
+
export declare function MessageContextMenuRoute<const Names extends NamesFor<ApplicationCommandType.Message>>(...names: Names[]): <TCtor extends AnyHandlerCtor>(constructor: AssertContextMenuRoute<ApplicationCommandType.Message, Names, TCtor>) => void;
|
|
171
172
|
/**
|
|
172
173
|
* Routes button interactions to handler classes.
|
|
173
174
|
*
|
|
@@ -179,7 +180,7 @@ declare function MessageContextMenuRoute<const Names extends NamesFor<Applicatio
|
|
|
179
180
|
* @param defs - The customId definition(s) this handler decodes, one per route.
|
|
180
181
|
* @decorator
|
|
181
182
|
*/
|
|
182
|
-
declare function ButtonRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Button, Defs, TCtor>) => void;
|
|
183
|
+
export declare function ButtonRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Button, Defs, TCtor>) => void;
|
|
183
184
|
/**
|
|
184
185
|
* Routes modal submissions to handler classes.
|
|
185
186
|
*
|
|
@@ -190,7 +191,7 @@ declare function ButtonRoute<const Defs extends readonly AnyCustomId$1[]>(...def
|
|
|
190
191
|
* @param defs - The customId definition(s) this handler decodes, one per route.
|
|
191
192
|
* @decorator
|
|
192
193
|
*/
|
|
193
|
-
declare function ModalRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Modal, Defs, TCtor>) => void;
|
|
194
|
+
export declare function ModalRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.Modal, Defs, TCtor>) => void;
|
|
194
195
|
/**
|
|
195
196
|
* Routes string select menu interactions to a `StringMenuHandler`.
|
|
196
197
|
*
|
|
@@ -209,7 +210,7 @@ declare function ModalRoute<const Defs extends readonly AnyCustomId$1[]>(...defs
|
|
|
209
210
|
* }
|
|
210
211
|
* ```
|
|
211
212
|
*/
|
|
212
|
-
declare function StringMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.StringMenu, Defs, TCtor>) => void;
|
|
213
|
+
export declare function StringMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.StringMenu, Defs, TCtor>) => void;
|
|
213
214
|
/**
|
|
214
215
|
* Routes user select menu interactions to a `UserMenuHandler`.
|
|
215
216
|
*
|
|
@@ -230,7 +231,7 @@ declare function StringMenuRoute<const Defs extends readonly AnyCustomId$1[]>(..
|
|
|
230
231
|
* }
|
|
231
232
|
* ```
|
|
232
233
|
*/
|
|
233
|
-
declare function UserMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.UserMenu, Defs, TCtor>) => void;
|
|
234
|
+
export declare function UserMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.UserMenu, Defs, TCtor>) => void;
|
|
234
235
|
/**
|
|
235
236
|
* Routes role select menu interactions to a `RoleMenuHandler`.
|
|
236
237
|
*
|
|
@@ -249,7 +250,7 @@ declare function UserMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...d
|
|
|
249
250
|
* }
|
|
250
251
|
* ```
|
|
251
252
|
*/
|
|
252
|
-
declare function RoleMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.RoleMenu, Defs, TCtor>) => void;
|
|
253
|
+
export declare function RoleMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.RoleMenu, Defs, TCtor>) => void;
|
|
253
254
|
/**
|
|
254
255
|
* Routes channel select menu interactions to a `ChannelMenuHandler`.
|
|
255
256
|
*
|
|
@@ -268,7 +269,7 @@ declare function RoleMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...d
|
|
|
268
269
|
* }
|
|
269
270
|
* ```
|
|
270
271
|
*/
|
|
271
|
-
declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.ChannelMenu, Defs, TCtor>) => void;
|
|
272
|
+
export declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.ChannelMenu, Defs, TCtor>) => void;
|
|
272
273
|
/**
|
|
273
274
|
* Routes mentionable select menu interactions to a `MentionableMenuHandler`.
|
|
274
275
|
*
|
|
@@ -288,7 +289,7 @@ declare function ChannelMenuRoute<const Defs extends readonly AnyCustomId$1[]>(.
|
|
|
288
289
|
* }
|
|
289
290
|
* ```
|
|
290
291
|
*/
|
|
291
|
-
declare function MentionableMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.MentionableMenu, Defs, TCtor>) => void;
|
|
292
|
+
export declare function MentionableMenuRoute<const Defs extends readonly AnyCustomId$1[]>(...defs: Defs): <TCtor extends AnyHandlerCtor>(constructor: AssertComponentRoute<InteractionKind.MentionableMenu, Defs, TCtor>) => void;
|
|
292
293
|
//#endregion
|
|
293
294
|
//#region src/handlers/BaseHandler.d.ts
|
|
294
295
|
/**
|
|
@@ -298,7 +299,7 @@ declare function MentionableMenuRoute<const Defs extends readonly AnyCustomId$1[
|
|
|
298
299
|
* @typeParam Event - The event or interaction this handler processes
|
|
299
300
|
* @typeParam TCore - The transport's Core
|
|
300
301
|
*/
|
|
301
|
-
declare abstract class BaseHandler<Event, TCore extends CoreBase> {
|
|
302
|
+
export declare abstract class BaseHandler<Event, TCore extends CoreBase> {
|
|
302
303
|
readonly core: TCore;
|
|
303
304
|
protected readonly event: Event;
|
|
304
305
|
protected readonly logger: Logger;
|
|
@@ -323,7 +324,7 @@ interface ModalLike {
|
|
|
323
324
|
* the state and the ack trace. Each transport binds `TMessage` to its own created-message type and
|
|
324
325
|
* supplies the writers.
|
|
325
326
|
*/
|
|
326
|
-
declare abstract class BaseReplySender<TMessage extends {
|
|
327
|
+
export declare abstract class BaseReplySender<TMessage extends {
|
|
327
328
|
id: string;
|
|
328
329
|
}, TNative = never> {
|
|
329
330
|
private readonly telemetry;
|
|
@@ -382,7 +383,7 @@ declare abstract class BaseReplySender<TMessage extends {
|
|
|
382
383
|
* @typeParam TNative - The transport's own file forms, beyond the portable `ReplyFile`
|
|
383
384
|
* @typeParam TSender - The transport's reply sender
|
|
384
385
|
*/
|
|
385
|
-
declare abstract class RepliableHandler<Event, TCore extends CoreBase, TMessage extends {
|
|
386
|
+
export declare abstract class RepliableHandler<Event, TCore extends CoreBase, TMessage extends {
|
|
386
387
|
id: string;
|
|
387
388
|
}, TNative, TSender extends BaseReplySender<TMessage, TNative>> extends BaseHandler<Event, TCore> {
|
|
388
389
|
/** The reply surface for this interaction. Pass the handler to reply from outside its class. */
|
|
@@ -429,7 +430,7 @@ declare abstract class RepliableHandler<Event, TCore extends CoreBase, TMessage
|
|
|
429
430
|
* }
|
|
430
431
|
* ```
|
|
431
432
|
*/
|
|
432
|
-
declare function and<Gates extends TwoOrMore<Gate<GateContextBase>>>(...gates: Gates): Gate<IntersectRequired<Gates> & GateContextBase, JoinNames<Gates, ' & '>>;
|
|
433
|
+
export declare function and<Gates extends TwoOrMore<Gate<GateContextBase>>>(...gates: Gates): Gate<IntersectRequired<Gates> & GateContextBase, JoinNames<Gates, ' & '>>;
|
|
433
434
|
interface OrOptions {
|
|
434
435
|
fail: Notice | ((ctx: GateContextBase) => Notice);
|
|
435
436
|
}
|
|
@@ -455,7 +456,7 @@ interface OrOptions {
|
|
|
455
456
|
* }
|
|
456
457
|
* ```
|
|
457
458
|
*/
|
|
458
|
-
declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...gates: Gates): Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>;
|
|
459
|
+
export declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...gates: Gates): Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>;
|
|
459
460
|
/**
|
|
460
461
|
* @example
|
|
461
462
|
* ```ts
|
|
@@ -463,7 +464,7 @@ declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...gates: Ga
|
|
|
463
464
|
* or(OwnerOnly(), RequireRole('123456789012345678'), { fail: new NotAllowedNotice() });
|
|
464
465
|
* ```
|
|
465
466
|
*/
|
|
466
|
-
declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...args: [...Gates, OrOptions]): Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>;
|
|
467
|
+
export declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...args: [...Gates, OrOptions]): Gate<RequiredOf<Gates[number]>, JoinNames<Gates, ' | '>>;
|
|
467
468
|
//#endregion
|
|
468
469
|
//#region src/gates/catalog/access.d.ts
|
|
469
470
|
/**
|
|
@@ -492,7 +493,7 @@ declare function or<Gates extends TwoOrMore<Gate<GateContextBase>>>(...args: [..
|
|
|
492
493
|
* OwnerOnly({ message: 'Owners only.' });
|
|
493
494
|
* ```
|
|
494
495
|
*/
|
|
495
|
-
declare function OwnerOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'OwnerOnly'>;
|
|
496
|
+
export declare function OwnerOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'OwnerOnly'>;
|
|
496
497
|
/**
|
|
497
498
|
* Passes inside a guild, else refuses.
|
|
498
499
|
*
|
|
@@ -515,7 +516,7 @@ declare function OwnerOnly(options?: GateNoticeOptions): Gate<GateContextBase, '
|
|
|
515
516
|
* }
|
|
516
517
|
* ```
|
|
517
518
|
*/
|
|
518
|
-
declare function GuildOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'GuildOnly'>;
|
|
519
|
+
export declare function GuildOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'GuildOnly'>;
|
|
519
520
|
/**
|
|
520
521
|
* Passes in a direct message, else refuses.
|
|
521
522
|
*
|
|
@@ -536,7 +537,7 @@ declare function GuildOnly(options?: GateNoticeOptions): Gate<GateContextBase, '
|
|
|
536
537
|
* }
|
|
537
538
|
* ```
|
|
538
539
|
*/
|
|
539
|
-
declare function DmOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'DmOnly'>;
|
|
540
|
+
export declare function DmOnly(options?: GateNoticeOptions): Gate<GateContextBase, 'DmOnly'>;
|
|
540
541
|
//#endregion
|
|
541
542
|
//#region src/gates/catalog/Cooldown.d.ts
|
|
542
543
|
/**
|
|
@@ -627,7 +628,7 @@ interface CooldownOptions {
|
|
|
627
628
|
* }
|
|
628
629
|
* ```
|
|
629
630
|
*/
|
|
630
|
-
declare function Cooldown(duration: number | ValidDuration, options?: CooldownOptions): EffectGate<GateContextBase, 'Cooldown'>;
|
|
631
|
+
export declare function Cooldown(duration: number | ValidDuration, options?: CooldownOptions): EffectGate<GateContextBase, 'Cooldown'>;
|
|
631
632
|
//#endregion
|
|
632
633
|
//#region src/permissions/assert.d.ts
|
|
633
634
|
/** Replacement notices for the two refusals {@link assertPermissions} raises. */
|
|
@@ -716,7 +717,7 @@ interface PermissionAssertion extends PermissionNoticeOverrides {
|
|
|
716
717
|
* });
|
|
717
718
|
* ```
|
|
718
719
|
*/
|
|
719
|
-
declare function assertPermissions(check: PermissionAssertion): void;
|
|
720
|
+
export declare function assertPermissions(check: PermissionAssertion): void;
|
|
720
721
|
//#endregion
|
|
721
722
|
//#region src/permissions/mergeRoles.d.ts
|
|
722
723
|
/**
|
|
@@ -738,7 +739,7 @@ declare function assertPermissions(check: PermissionAssertion): void;
|
|
|
738
739
|
* await member.roles.set(ids);
|
|
739
740
|
* ```
|
|
740
741
|
*/
|
|
741
|
-
declare function mergeRoles(current: readonly string[], add: readonly string[], remove: readonly string[]): string[];
|
|
742
|
+
export declare function mergeRoles(current: readonly string[], add: readonly string[], remove: readonly string[]): string[];
|
|
742
743
|
//#endregion
|
|
743
744
|
//#region src/stops/Fault.d.ts
|
|
744
745
|
/**
|
|
@@ -768,7 +769,7 @@ declare function mergeRoles(current: readonly string[], add: readonly string[],
|
|
|
768
769
|
* }
|
|
769
770
|
* ```
|
|
770
771
|
*/
|
|
771
|
-
declare class Fault extends Notice {
|
|
772
|
+
export declare class Fault extends Notice {
|
|
772
773
|
constructor(options?: {
|
|
773
774
|
cause?: unknown;
|
|
774
775
|
report?: boolean;
|
|
@@ -793,7 +794,7 @@ declare class Fault extends Notice {
|
|
|
793
794
|
* if (!template) throw new Silence('no welcome message set');
|
|
794
795
|
* ```
|
|
795
796
|
*/
|
|
796
|
-
declare class Silence extends Error {
|
|
797
|
+
export declare class Silence extends Error {
|
|
797
798
|
readonly reason?: string | undefined;
|
|
798
799
|
/**
|
|
799
800
|
* @param reason - Optional note written only to a debug log, never shown to the user or reported.
|
|
@@ -801,12 +802,12 @@ declare class Silence extends Error {
|
|
|
801
802
|
constructor(reason?: string | undefined);
|
|
802
803
|
}
|
|
803
804
|
//#endregion
|
|
804
|
-
//#region src/miscellaneous/
|
|
805
|
+
//#region src/miscellaneous/ResolvedEmoji.d.ts
|
|
805
806
|
/**
|
|
806
807
|
* A resolved custom emoji. Renders as `<:name:id>` in message content, or `<a:name:id>` when animated,
|
|
807
808
|
* and passes straight to a builder's `setEmoji`.
|
|
808
809
|
*/
|
|
809
|
-
declare class ResolvedEmoji implements APIMessageComponentEmoji {
|
|
810
|
+
export declare class ResolvedEmoji implements APIMessageComponentEmoji {
|
|
810
811
|
readonly name: string;
|
|
811
812
|
readonly id: string;
|
|
812
813
|
readonly animated: boolean;
|
|
@@ -839,7 +840,7 @@ interface PageView<Item> {
|
|
|
839
840
|
* @returns The sliced {@link PageView}, with `totalPages` always known.
|
|
840
841
|
* @throws SeedcordRangeError when `perPage` is not a positive integer.
|
|
841
842
|
*/
|
|
842
|
-
declare function paginate<Item>(items: readonly Item[], page: number, perPage: number): PageView<Item>;
|
|
843
|
+
export declare function paginate<Item>(items: readonly Item[], page: number, perPage: number): PageView<Item>;
|
|
843
844
|
//#endregion
|
|
844
845
|
//#region src/pagination/Controls.d.ts
|
|
845
846
|
/** The five built-in nav controls. */
|
|
@@ -890,7 +891,7 @@ interface PageSourceBase<Item, Ctx> {
|
|
|
890
891
|
* @typeParam Item - The item type, inferred from the loader's return.
|
|
891
892
|
* @typeParam Ctx - The transport's page context. Each transport exports a subclass that fixes it.
|
|
892
893
|
*/
|
|
893
|
-
declare class ArraySourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx> {
|
|
894
|
+
export declare class ArraySourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx> {
|
|
894
895
|
private readonly load;
|
|
895
896
|
private readonly perPage;
|
|
896
897
|
constructor(load: (ctx: Ctx) => Promisable<readonly Item[]>, opts?: {
|
|
@@ -907,7 +908,7 @@ declare class ArraySourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx> {
|
|
|
907
908
|
* @typeParam Item - The item type, inferred from the fetcher's slice.
|
|
908
909
|
* @typeParam Ctx - The transport's page context. Each transport exports a subclass that fixes it.
|
|
909
910
|
*/
|
|
910
|
-
declare class CursorSourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx> {
|
|
911
|
+
export declare class CursorSourceBase<Item, Ctx> implements PageSourceBase<Item, Ctx> {
|
|
911
912
|
private readonly fetch;
|
|
912
913
|
private readonly perPage;
|
|
913
914
|
constructor(fetch: (ctx: Ctx, page: number, perPage: number) => Promisable<{
|
|
@@ -950,7 +951,7 @@ interface PaginatorConfig<Item, Prefix extends string, Ctx> {
|
|
|
950
951
|
* @typeParam Prefix - The route prefix, inferred from `config.prefix`.
|
|
951
952
|
* @typeParam Ctx - The transport's page context.
|
|
952
953
|
*/
|
|
953
|
-
declare abstract class PaginatorBase<Item, Prefix extends string, Ctx> {
|
|
954
|
+
export declare abstract class PaginatorBase<Item, Prefix extends string, Ctx> {
|
|
954
955
|
/** The page cursor, pass it to your `@ButtonRoute`. */
|
|
955
956
|
readonly cursor: PageCursor<Prefix>;
|
|
956
957
|
protected readonly config: PaginatorConfig<Item, Prefix, Ctx>;
|
|
@@ -961,7 +962,7 @@ declare abstract class PaginatorBase<Item, Prefix extends string, Ctx> {
|
|
|
961
962
|
//#endregion
|
|
962
963
|
//#region src/index.d.ts
|
|
963
964
|
/** Package version */
|
|
964
|
-
declare const version: string;
|
|
965
|
+
export declare const version: string;
|
|
965
966
|
//#endregion
|
|
966
|
-
export { type AnyCustomId,
|
|
967
|
+
export { type AnyCustomId, type AttemptedWrite, type AutocompleteOptions, BuilderComponent, type BuilderType, Bus, type CommandInfo, type ContextMenuInfo, 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 PermissionNoticeOverrides, type PermissionScope, RegisterCommand, RegisterInteractionMiddleware, RequireBotPermissions, RequirePermissions, type RequirePermissionsOptions, RequireRole, type RequireRoleOptions, type RequiredOf, 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 };
|
|
967
968
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as translateSerializationError, B as contextMenuRouteOf, C as NotInDm, D as defineEffectGate, E as OnCooldown, F as checkAckLegality, H as storeComponentRoute, I as sendTarget, K as NoticeCard, L as RegisterInteractionMiddleware, M as publishResponse, O as defineGate, P as AckTrace, S as NotAllowed, T as NotOwner, U as storeInteractionRoute, a as RequirePermissions, c as hasAll, d as pickNotice, h as runCheck, i as RequireBotPermissions, j as attemptWrite, k as serializeReply, l as missingNames, m as rollbackCommits, n as pageCursor, o as RequireRole, p as markCommits, q as Notice, r as Silence, t as PAGE_MAX, u as presentNames, v as HasDangerousPermissions, w as NotInGuild, x as NeedsAny, y as MissingPermissions } from "./cursor-
|
|
2
|
-
import { A as BuilderComponent, b as InteractionKind, d as WebhookLog, f as Subscriber, j as RowComponent, l as WebhookUrl, t as Bus, u as Subscribe } from "./Bus-
|
|
3
|
-
import { a as ContextMenus, i as Commands, n as RegisterCommand } from "./subscribers-
|
|
1
|
+
import { A as translateSerializationError, B as contextMenuRouteOf, C as NotInDm, D as defineEffectGate, E as OnCooldown, F as checkAckLegality, H as storeComponentRoute, I as sendTarget, K as NoticeCard, L as RegisterInteractionMiddleware, M as publishResponse, O as defineGate, P as AckTrace, S as NotAllowed, T as NotOwner, U as storeInteractionRoute, a as RequirePermissions, c as hasAll, d as pickNotice, h as runCheck, i as RequireBotPermissions, j as attemptWrite, k as serializeReply, l as missingNames, m as rollbackCommits, n as pageCursor, o as RequireRole, p as markCommits, q as Notice, r as Silence, t as PAGE_MAX, u as presentNames, v as HasDangerousPermissions, w as NotInGuild, x as NeedsAny, y as MissingPermissions } from "./cursor-CgNBnJfu.mjs";
|
|
2
|
+
import { A as BuilderComponent, b as InteractionKind, d as WebhookLog, f as Subscriber, j as RowComponent, l as WebhookUrl, t as Bus, u as Subscribe } from "./Bus-BxPa-Uvp.mjs";
|
|
3
|
+
import { a as ContextMenus, i as Commands, n as RegisterCommand } from "./subscribers-xGy7a7xR.mjs";
|
|
4
4
|
import { n as StartupPhase, t as ShutdownPhase } from "./phases-BauKJOTT.mjs";
|
|
5
5
|
import "reflect-metadata";
|
|
6
6
|
import { CustomId, decodeFor, prefixOf, setCustomIdErrors, setCustomIdErrors as setCustomIdErrors$1 } from "@seedcord/custom-id";
|
|
@@ -918,7 +918,7 @@ function mergeRoles(current, add, remove) {
|
|
|
918
918
|
}
|
|
919
919
|
|
|
920
920
|
//#endregion
|
|
921
|
-
//#region src/miscellaneous/
|
|
921
|
+
//#region src/miscellaneous/ResolvedEmoji.ts
|
|
922
922
|
/**
|
|
923
923
|
* A resolved custom emoji. Renders as `<:name:id>` in message content, or `<a:name:id>` when animated,
|
|
924
924
|
* and passes straight to a builder's `setEmoji`.
|
|
@@ -1169,7 +1169,7 @@ var CursorSourceBase = class {
|
|
|
1169
1169
|
//#endregion
|
|
1170
1170
|
//#region src/index.ts
|
|
1171
1171
|
/** Package version */
|
|
1172
|
-
const version = "0.9.
|
|
1172
|
+
const version = "0.9.4";
|
|
1173
1173
|
|
|
1174
1174
|
//#endregion
|
|
1175
1175
|
export { ArraySourceBase, AutocompleteRoute, BaseHandler, BaseReplySender, BuilderComponent, Bus, ButtonRoute, ChannelMenuRoute, Commands, ContextMenus, Cooldown, CursorSourceBase, CustomId, DispatchContext, DmOnly, Fault, GuildOnly, InteractionKind, MentionableMenuRoute, MessageContextMenuRoute, ModalRoute, Notice, OwnerOnly, PaginatorBase, RegisterCommand, RegisterInteractionMiddleware, RepliableHandler, RequireBotPermissions, RequirePermissions, RequireRole, ResolvedEmoji, RoleMenuRoute, RowComponent, ShutdownPhase, Silence, SlashRoute, StartupPhase, StringMenuRoute, Subscribe, Subscriber, UserContextMenuRoute, UserMenuRoute, WebhookLog, WebhookUrl, and, assertPermissions, decodeFor, defineEffectGate, defineGate, mergeRoles, or, paginate, prefixOf, setCustomIdErrors, version };
|