mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 02:53:31 +01:00
feat: add missing v13 component methods (#7466)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com> Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com> Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import type { JSONEncodable } from '../util/jsonEncodable';
|
||||
import type { APIBaseComponent, APIMessageComponent, ComponentType } from 'discord-api-types/v9';
|
||||
import type {
|
||||
APIActionRowComponentTypes,
|
||||
APIBaseComponent,
|
||||
APIMessageComponent,
|
||||
ComponentType,
|
||||
} from 'discord-api-types/v9';
|
||||
import type { Equatable } from '../util/equatable';
|
||||
|
||||
/**
|
||||
* Represents a discord component
|
||||
@@ -8,18 +14,17 @@ export abstract class Component<
|
||||
DataType extends Partial<APIBaseComponent<ComponentType>> & {
|
||||
type: ComponentType;
|
||||
} = APIBaseComponent<ComponentType>,
|
||||
> implements JSONEncodable<APIMessageComponent>
|
||||
> implements JSONEncodable<APIMessageComponent>, Equatable<Component | APIActionRowComponentTypes>
|
||||
{
|
||||
/**
|
||||
* The API data associated with this component
|
||||
*/
|
||||
protected readonly data: DataType;
|
||||
|
||||
/**
|
||||
* Converts this component to an API-compatible JSON object
|
||||
*/
|
||||
public abstract toJSON(): APIMessageComponent;
|
||||
|
||||
public abstract equals(other: Component | APIActionRowComponentTypes): boolean;
|
||||
|
||||
public constructor(data: DataType) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user