lilybird
Version:
A bun-first discord api wrapper written in TS
139 lines • 4.87 kB
TypeScript
import type { ButtonStyle, ChannelType, ComponentType, TextInputStyle } from "#enums";
import type { Emoji } from "./emoji.js";
export declare namespace Component {
type Structure = ActionRowStructure | ButtonStructure | StringSelectStructure | TextInputStructure | UserSelectStructure | RoleSelectStructure | MentionableSelectStructure | ChannelSelectStructure | SectionStructure | TextDisplayStructure | ThumbnailStructure | MediaGalleryStructure | FileStructure | SeparatorStructure | ContainerStructure;
interface Base {
type: ComponentType;
id?: number;
}
interface ActionRowStructure extends Base {
type: ComponentType.ActionRow;
components: Array<Structure>;
}
interface ButtonStructure extends Base {
type: ComponentType.Button;
style: ButtonStyle;
label?: string;
emoji?: Pick<Emoji.Structure, "name" | "id" | "animated">;
custom_id?: string;
sku_id?: string;
url?: string;
disabled?: boolean;
}
interface StringSelectStructure extends Base {
type: ComponentType.StringSelect;
custom_id: string;
options?: Array<SelectOptionStructure>;
placeholder?: string;
min_values?: number;
max_values?: number;
disabled?: boolean;
}
interface SelectOptionStructure {
label: string;
value: string;
description?: string;
emoji?: Pick<Emoji.Structure, "id" | "name" | "animated">;
default?: boolean;
}
interface TextInputStructure {
type: ComponentType.TextInput;
custom_id: string;
style: TextInputStyle;
label: string;
min_length?: number;
max_length?: number;
required?: boolean;
value?: string;
placeholder?: string;
}
interface UserSelectStructure extends Base {
type: ComponentType.UserSelect;
custom_id: string;
placeholder?: string;
default_values?: Array<SelectDefaultValueStructure>;
min_values?: number;
max_values?: number;
disabled?: boolean;
}
interface SelectDefaultValueStructure {
id: string;
type: "user" | "role" | "channel";
}
interface RoleSelectStructure extends Base {
type: ComponentType.RoleSelect;
custom_id: string;
placeholder?: string;
default_values?: Array<SelectDefaultValueStructure>;
min_values?: number;
max_values?: number;
disabled?: boolean;
}
interface MentionableSelectStructure extends Base {
type: ComponentType.MentionableSelect;
custom_id: string;
placeholder?: string;
default_values?: Array<SelectDefaultValueStructure>;
min_values?: number;
max_values?: number;
disabled?: boolean;
}
interface ChannelSelectStructure extends Base {
type: ComponentType.ChannelSelect;
custom_id: string;
channel_types?: Array<ChannelType>;
placeholder?: string;
default_values?: Array<SelectDefaultValueStructure>;
min_values?: number;
max_values?: number;
disabled?: boolean;
}
interface SectionStructure extends Base {
type: ComponentType.Section;
components: Array<TextDisplayStructure>;
accessory: ThumbnailStructure | ButtonStructure;
}
interface TextDisplayStructure extends Base {
type: ComponentType.TextDisplay;
content: string;
}
interface ThumbnailStructure extends Base {
type: ComponentType.Thumbnail;
media: UnfurledMediaItemStructure;
description?: string;
spoiler?: boolean;
}
interface UnfurledMediaItemStructure {
url: string;
proxy_url?: string;
height?: number | null;
width?: number | null;
content_type?: string;
}
interface MediaGalleryStructure extends Base {
type: ComponentType.MediaGallery;
items: Array<MediaGalleryItemStructure>;
}
interface MediaGalleryItemStructure extends Base {
media: UnfurledMediaItemStructure;
description?: string;
spoiler?: boolean;
}
interface FileStructure extends Base {
type: ComponentType.File;
file: UnfurledMediaItemStructure;
spoiler?: boolean;
}
interface SeparatorStructure extends Base {
type: ComponentType.Separator;
divider?: boolean;
spacing?: number;
}
interface ContainerStructure extends Base {
type: ComponentType.Container;
components: Array<ActionRowStructure | TextDisplayStructure | SectionStructure | MediaGalleryStructure | SeparatorStructure | FileStructure>;
accent_color?: number | null;
spoiler?: boolean;
}
}
//# sourceMappingURL=message-components.d.ts.map