add channel renderer + try to simplify adapter generics

This commit is contained in:
MapleLeaf
2021-12-27 19:22:21 -06:00
parent 6bfb1ab6de
commit 3682f67bfe
13 changed files with 143 additions and 43 deletions

View File

@@ -1,9 +1,15 @@
import type { Channel } from "../../internal/channel"
import type {
CommandInteraction,
ComponentInteraction,
} from "../../internal/interaction"
export type Adapter<CommandReplyInit> = {
export type AdapterGenerics = {
commandReplyInit: unknown
channelInit: unknown
}
export type Adapter<Generics extends AdapterGenerics> = {
/**
* @internal
*/
@@ -14,5 +20,12 @@ export type Adapter<CommandReplyInit> = {
/**
* @internal
*/
createCommandInteraction(init: CommandReplyInit): CommandInteraction
createCommandInteraction(
init: Generics["commandReplyInit"],
): CommandInteraction
/**
* @internal
*/
createChannel(init: Generics["channelInit"]): Channel
}