detritus-client
Version:
A Typescript NodeJS library to interact with Discord's API, both Rest and Gateway.
54 lines (53 loc) • 2 kB
TypeScript
import { RequestTypes } from 'detritus-client-rest';
import { BaseSet } from '../../collections/baseset';
import { MessageComponentTypes } from '../../constants';
import { Structure } from '../../structures/basestructure';
import { ComponentActionBase, ComponentActionData, ComponentEmojiData } from './actionbase';
export interface ComponentSelectMenuOptionData {
default?: boolean;
description?: string;
emoji?: ComponentEmojiData;
label?: string;
value?: string;
}
/**
* Utils Component Select Menu Structure
* @category Utils
*/
export declare class ComponentSelectMenu extends ComponentActionBase {
readonly _keys: BaseSet<string>;
customId: string;
maxValues?: null | number;
minValues?: null | number;
options: Array<ComponentSelectMenuOption>;
placeholder?: null | string;
type: MessageComponentTypes;
constructor(data?: ComponentActionData);
addOption(option: ComponentSelectMenuOption): this;
createOption(data?: ComponentSelectMenuOptionData): ComponentSelectMenuOption;
setCustomId(customId: string): this;
setMaxValues(maxValues: null | number): this;
setMinValues(minValues: null | number): this;
setPlaceholder(placeholder: null | string): this;
mergeValue(key: string, value: any): void;
}
/**
* Utils Component Select Menu Option Structure
* @category Utils
*/
export declare class ComponentSelectMenuOption extends Structure {
readonly _keys: BaseSet<string>;
default?: boolean;
description?: null | string;
emoji?: null | ComponentEmojiData;
label: string;
value: string;
constructor(data?: ComponentSelectMenuOptionData);
setDefault(isDefault: boolean): this;
setDescription(description: null | string): this;
setEmoji(emoji: null | ComponentEmojiData): this;
setLabel(label: string): this;
setValue(value: string): this;
mergeValue(key: string, value: any): void;
toJSON(): RequestTypes.RawChannelMessageComponentSelectMenuOption;
}