ci: api-extractor support for docs

This commit is contained in:
iCrawl
2022-06-30 15:46:14 +02:00
parent 525bf031a5
commit b2776c22d4
54 changed files with 2608 additions and 343 deletions

View File

@@ -36,8 +36,8 @@ export class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentBu
/**
* Adds components to this action row.
* @param components The components to add to this action row.
* @returns
*
* @param components - The components to add to this action row.
*/
public addComponents(...components: RestOrArray<T>) {
this.components.push(...normalizeArray(components));
@@ -46,7 +46,8 @@ export class ActionRowBuilder<T extends AnyComponentBuilder> extends ComponentBu
/**
* Sets the components in this action row
* @param components The components to set this row to
*
* @param components - The components to set this row to
*/
public setComponents(...components: RestOrArray<T>) {
this.components.splice(0, this.components.length, ...normalizeArray(components));

View File

@@ -11,7 +11,8 @@ export interface MappedComponentTypes {
/**
* Factory for creating components from API data
* @param data The api data to transform to a component class
*
* @param data - The api data to transform to a component class
*/
export function createComponentBuilder<T extends keyof MappedComponentTypes>(
data: (APIMessageComponent | APIModalComponent) & { type: T },

View File

@@ -18,7 +18,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets the style of this button
* @param style The style of the button
*
* @param style - The style of the button
*/
public setStyle(style: ButtonStyle) {
this.data.style = style;
@@ -27,7 +28,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets the URL for this button
* @param url The URL to open when this button is clicked
*
* @param url - The URL to open when this button is clicked
*/
public setURL(url: string) {
(this.data as APIButtonComponentWithURL).url = url;
@@ -36,7 +38,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets the custom Id for this button
* @param customId The custom id to use for this button
*
* @param customId - The custom id to use for this button
*/
public setCustomId(customId: string) {
(this.data as APIButtonComponentWithCustomId).custom_id = customId;
@@ -45,7 +48,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets the emoji to display on this button
* @param emoji The emoji to display on this button
*
* @param emoji - The emoji to display on this button
*/
public setEmoji(emoji: APIMessageComponentEmoji) {
this.data.emoji = emoji;
@@ -54,7 +58,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets whether this button is disable or not
* @param disabled Whether or not to disable this button or not
*
* @param disabled - Whether or not to disable this button or not
*/
public setDisabled(disabled = true) {
this.data.disabled = disabled;
@@ -63,7 +68,8 @@ export class UnsafeButtonBuilder extends ComponentBuilder<APIButtonComponent> {
/**
* Sets the label for this button
* @param label The label to display on this button
*
* @param label - The label to display on this button
*/
public setLabel(label: string) {
this.data.label = label;

View File

@@ -20,7 +20,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets the placeholder for this select menu
* @param placeholder The placeholder to use for this select menu
*
* @param placeholder - The placeholder to use for this select menu
*/
public setPlaceholder(placeholder: string) {
this.data.placeholder = placeholder;
@@ -29,7 +30,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets the minimum values that must be selected in the select menu
* @param minValues The minimum values that must be selected
*
* @param minValues - The minimum values that must be selected
*/
public setMinValues(minValues: number) {
this.data.min_values = minValues;
@@ -38,7 +40,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets the maximum values that must be selected in the select menu
* @param minValues The maximum values that must be selected
*
* @param minValues - The maximum values that must be selected
*/
public setMaxValues(maxValues: number) {
this.data.max_values = maxValues;
@@ -47,7 +50,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets the custom Id for this select menu
* @param customId The custom id to use for this select menu
*
* @param customId - The custom id to use for this select menu
*/
public setCustomId(customId: string) {
this.data.custom_id = customId;
@@ -56,7 +60,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets whether or not this select menu is disabled
* @param disabled Whether or not this select menu is disabled
*
* @param disabled - Whether or not this select menu is disabled
*/
public setDisabled(disabled = true) {
this.data.disabled = disabled;
@@ -65,8 +70,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Adds options to this select menu
* @param options The options to add to this select menu
* @returns
*
* @param options - The options to add to this select menu
*/
public addOptions(...options: RestOrArray<UnsafeSelectMenuOptionBuilder | APISelectMenuOption>) {
this.options.push(
@@ -79,7 +84,8 @@ export class UnsafeSelectMenuBuilder extends ComponentBuilder<APISelectMenuCompo
/**
* Sets the options on this select menu
* @param options The options to set on this select menu
*
* @param options - The options to set on this select menu
*/
public setOptions(...options: RestOrArray<UnsafeSelectMenuOptionBuilder | APISelectMenuOption>) {
this.options.splice(

View File

@@ -8,7 +8,8 @@ export class UnsafeSelectMenuOptionBuilder {
/**
* Sets the label of this option
* @param label The label to show on this option
*
* @param label - The label to show on this option
*/
public setLabel(label: string) {
this.data.label = label;
@@ -17,7 +18,8 @@ export class UnsafeSelectMenuOptionBuilder {
/**
* Sets the value of this option
* @param value The value of this option
*
* @param value - The value of this option
*/
public setValue(value: string) {
this.data.value = value;
@@ -26,7 +28,8 @@ export class UnsafeSelectMenuOptionBuilder {
/**
* Sets the description of this option.
* @param description The description of this option
*
* @param description - The description of this option
*/
public setDescription(description: string) {
this.data.description = description;
@@ -35,7 +38,8 @@ export class UnsafeSelectMenuOptionBuilder {
/**
* Sets whether this option is selected by default
* @param isDefault Whether this option is selected by default
*
* @param isDefault - Whether this option is selected by default
*/
public setDefault(isDefault = true) {
this.data.default = isDefault;
@@ -44,7 +48,8 @@ export class UnsafeSelectMenuOptionBuilder {
/**
* Sets the emoji to display on this option
* @param emoji The emoji to display on this option
*
* @param emoji - The emoji to display on this option
*/
public setEmoji(emoji: APIMessageComponentEmoji) {
this.data.emoji = emoji;

View File

@@ -9,7 +9,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the custom id for this text input
* @param customId The custom id of this text input
*
* @param customId - The custom id of this text input
*/
public setCustomId(customId: string) {
this.data.custom_id = customId;
@@ -18,7 +19,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the label for this text input
* @param label The label for this text input
*
* @param label - The label for this text input
*/
public setLabel(label: string) {
this.data.label = label;
@@ -27,7 +29,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the style for this text input
* @param style The style for this text input
*
* @param style - The style for this text input
*/
public setStyle(style: TextInputStyle) {
this.data.style = style;
@@ -36,7 +39,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the minimum length of text for this text input
* @param minLength The minimum length of text for this text input
*
* @param minLength - The minimum length of text for this text input
*/
public setMinLength(minLength: number) {
this.data.min_length = minLength;
@@ -45,7 +49,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the maximum length of text for this text input
* @param maxLength The maximum length of text for this text input
*
* @param maxLength - The maximum length of text for this text input
*/
public setMaxLength(maxLength: number) {
this.data.max_length = maxLength;
@@ -54,7 +59,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the placeholder of this text input
* @param placeholder The placeholder of this text input
*
* @param placeholder - The placeholder of this text input
*/
public setPlaceholder(placeholder: string) {
this.data.placeholder = placeholder;
@@ -63,7 +69,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets the value of this text input
* @param value The value for this text input
*
* @param value - The value for this text input
*/
public setValue(value: string) {
this.data.value = value;
@@ -72,7 +79,8 @@ export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputCompone
/**
* Sets whether this text input is required or not
* @param required Whether this text input is required or not
*
* @param required - Whether this text input is required or not
*/
public setRequired(required = true) {
this.data.required = required;