Component

export class Component<RawComponentData extends AnyComponent = AnyComponent>
export class Component<RawComponentData extends AnyComponent = AnyComponent>
Represents a component
NameConstraintsOptionalDefaultDescription
RawComponentDataAnyComponentYesAnyComponentNone
Readonly
data:Readonly<RawComponentData>
The API data associated with this component
Readonly
type:RawComponentData['type']
The type of the component
equals(other):boolean
Whether or not the given components are equal
NameTypeOptionalDescription
otherthis | RawComponentDataNoThe component to compare against
toJSON():RawComponentData
Returns the API-compatible JSON for this component