@seedcord/http 0.0.1 → 0.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,60 @@
1
+ import { SelectMenuKind } from "@seedcord/core";
2
+ import { ApplicationCommandType } from "discord-api-types/v10";
3
+
4
+ //#region src/manifest/RouteManifest.d.ts
5
+ /** The command kinds a manifest row registers, the wire enum's other members have no handler base. */
6
+ type RegistrableCommandType = ApplicationCommandType.ChatInput | ApplicationCommandType.User | ApplicationCommandType.Message;
7
+ /**
8
+ * A slash or context-menu command row. `type` picks the per-kind map, `name` is the lookup key. For a
9
+ * chat-input command with subcommands, `name` is the full route path (`'config/set'`), the same key
10
+ * `@SlashRoute` registers.
11
+ */
12
+ interface CommandRoute {
13
+ readonly name: string;
14
+ readonly type: RegistrableCommandType;
15
+ /** Lazy import of the handler module, evaluated on first hit. */
16
+ readonly load: () => Promise<unknown>;
17
+ }
18
+ /**
19
+ * A button, select, or modal row. `kind` picks the per-kind map, `prefix` is the stable customId prefix
20
+ * the receiver routes by (the routeKey minus its layout hash).
21
+ */
22
+ interface ComponentRoute {
23
+ readonly kind: 'button' | `${SelectMenuKind}Select` | 'modal';
24
+ readonly prefix: string;
25
+ /** Lazy import of the handler module, evaluated on first hit. */
26
+ readonly load: () => Promise<unknown>;
27
+ }
28
+ /**
29
+ * An autocomplete row, its own route keyed by the command's route path, separate from the slash row.
30
+ */
31
+ interface AutocompleteRoute {
32
+ readonly name: string;
33
+ /** Lazy import of the handler module, evaluated on first hit. */
34
+ readonly load: () => Promise<unknown>;
35
+ }
36
+ /**
37
+ * A bus subscriber row. The Bus routes off it without importing the subscriber module. The HTTP engine
38
+ * ignores these rows until the Bus ships on this transport.
39
+ */
40
+ interface SubscriberRoute {
41
+ /** The subscription keys this subscriber registers for. */
42
+ readonly keys: readonly string[];
43
+ /** Mirrors the `@Subscribe` frequency metadata. */
44
+ readonly frequency: 'on' | 'once';
45
+ /** Lazy import of the subscriber module. */
46
+ readonly load: () => Promise<unknown>;
47
+ }
48
+ /**
49
+ * The static route table the HTTP engine dispatches through, replacing the filesystem handler scan that
50
+ * cannot run in a bundled isolate. `seedcord build` emits it, the mount path authors it by hand.
51
+ */
52
+ interface RouteManifest {
53
+ readonly commands: readonly CommandRoute[];
54
+ readonly components: readonly ComponentRoute[];
55
+ readonly autocomplete: readonly AutocompleteRoute[];
56
+ readonly subscribers: readonly SubscriberRoute[];
57
+ }
58
+ //#endregion
59
+ export { RouteManifest as t };
60
+ //# sourceMappingURL=RouteManifest-BHdAeyLG.d.mts.map