class ComponentBuilder

abstract
export declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>> implements JSONEncodable<AnyAPIActionRowComponent>

Represents a discord component

Constructors

constructor(
data: Partial<DataType>
)

Constructs a new instance of the ComponentBuilder class

Type Parameters

optional
DataType? extends Partial<APIBaseComponent<ComponentType>> = APIBaseComponent<ComponentType>

The type of internal API data that is stored within the component

readonly
data : Partial<DataType>

The API data associated with this component

abstract
toJSON() : AnyAPIActionRowComponent

Serializes this component to an API-compatible JSON object