Skip to content

Commit

Permalink
chore: update docgen
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Dec 14, 2024
1 parent 7b43fdc commit 0722bd1
Show file tree
Hide file tree
Showing 34 changed files with 319 additions and 485 deletions.
116 changes: 51 additions & 65 deletions apps/docs/content/docs/classes/ButtonKit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,26 @@ title: ButtonKit
description: No description provided
---


## ButtonKit extends ButtonBuilder


```typescript
ButtonKit(data);
ButtonKit(data)
```
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||

| Parameter | Type | Optional |
| --------- | ------------------------------------------------------------- | -------- |
| data | Partial\<ButtonComponentData> \| Partial\<APIButtonComponent> ||

## Properties

### public data: any

The API data associated with this component.

## Methods

### public dispose(): ButtonKit

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/components/ButtonKit.ts#L165)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L165)
### public onClick(handler, data?): this

Sets up an inline interaction collector for this button. This collector by default allows as many interactions as possible if it is actively used.
If unused, this expires after 24 hours or custom time if specified.

Expand All @@ -38,99 +34,89 @@ const button = new ButtonKit()

const row = new ActionRowBuilder().addComponents(button);

const message = await channel.send({
content: 'Click the button',
components: [row],
});
const message = await channel.send({ content: 'Click the button', components: [row] });

button.onClick(
async (interaction) => {
await interaction.reply('You clicked me!');
},
{ message },
);
button.onClick(async (interaction) => {
await interaction.reply('You clicked me!');
}, { message });

// Remove onClick handler and destroy the interaction collector
button.onClick(null);
```

| Parameter | Type | Optional | Description |
| --------- | -------------------------------------------------------------- | -------- | ----------------------------------------------------- |
| handler | CommandKitButtonBuilderInteractionCollectorDispatch | | The handler to run when the button is clicked |
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData | | The context data to use for the interaction collector |
| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| handler | CommandKitButtonBuilderInteractionCollectorDispatch || The handler to run when the button is clicked |
| data | CommandKitButtonBuilderInteractionCollectorDispatchContextData || The context data to use for the interaction collector |

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/components/ButtonKit.ts#L74)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L74)
### public onEnd(handler): this
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| handler | CommandKitButtonBuilderOnEnd ||

| Parameter | Type | Optional |
| --------- | ---------------------------- | -------- |
| handler | CommandKitButtonBuilderOnEnd ||

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/components/ButtonKit.ts#L98)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/components/ButtonKit.ts#L98)
### public setCustomId(customId): this

Sets the custom id for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | -------------------- |
| customId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The custom id to use |

### public setDisabled(disabled?): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| customId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The custom id to use |
### public setDisabled(disabled?): this
Sets whether this button is disabled.

| Parameter | Type | Optional | Description |
| --------- | --------------------------------------------------------------------------------------------------- | -------- | ------------------------------ |
| disabled | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) || Whether to disable this button |

### public setEmoji(emoji): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| disabled | [boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean) || Whether to disable this button |
### public setEmoji(emoji): this
Sets the emoji to display on this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------ | -------- | ---------------- |
| emoji | ComponentEmojiResolvable || The emoji to use |

### public setLabel(label): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| emoji | ComponentEmojiResolvable || The emoji to use |
### public setLabel(label): this
Sets the label for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | ---------------- |
| label | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The label to use |

### public setSKUId(skuId): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| label | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The label to use |
### public setSKUId(skuId): this
Sets the SKU id that represents a purchasable SKU for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | ----------------- |
| skuId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The SKU id to use |

### public setStyle(style): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| skuId | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The SKU id to use |
### public setStyle(style): this
Sets the style of this button.

| Parameter | Type | Optional | Description |
| --------- | ----------- | -------- | ---------------- |
| style | ButtonStyle || The style to use |

### public setURL(url): this

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| style | ButtonStyle || The style to use |
### public setURL(url): this
Sets the URL for this button.

| Parameter | Type | Optional | Description |
| --------- | ------------------------------------------------------------------------------------------------- | -------- | -------------- |
| url | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The URL to use |

### public toJSON(): APIButtonComponent

| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| url | [string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) || The URL to use |
### public toJSON(): APIButtonComponent
ComponentBuilder.toJSON

### public static from(other): ButtonBuilder

| Parameter | Type | Optional |
| --------- | ------------------ | ---------------------------------- | --- |
| other | APIButtonComponent | JSONEncodable\<APIButtonComponent> ||
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| other | APIButtonComponent | JSONEncodable\<APIButtonComponent> ||
73 changes: 28 additions & 45 deletions apps/docs/content/docs/classes/CommandKit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,82 +3,65 @@ title: CommandKit
description: No description provided
---


## CommandKit


```typescript
CommandKit(options);
CommandKit(options)
```
| Parameter | Type | Optional | Description |
| ----------- | ----------- | ----------- | ----------- |
| options | CommandKitOptions || The default CommandKit configuration. |

| Parameter | Type | Optional | Description |
| --------- | ----------------- | -------- | ------------------------------------- |
| options | CommandKitOptions || The default CommandKit configuration. |

## Properties

### public static \_instance: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L8)

### public static _instance: any
- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L8)
### public client: any

Get the client attached to this CommandKit instance.

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L38)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L38)
### public commandHandler: any

Get command handler instance.

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L45)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L45)
### public commands: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L125)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L125)
### public commandsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L141)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L141)
### public devGuildIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L169)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L169)
### public devRoleIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L176)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L176)
### public devUserIds: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L162)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L162)
### public eventsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L148)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L148)
### public validationsPath: any

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L155)
- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L155)

## Methods

### public reloadCommands(type?): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>

Updates application commands with the latest from "commandsPath".

| Parameter | Type | Optional |
| --------- | ------------- | -------- |
| type | ReloadOptions ||

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L101)

### public reloadEvents(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| type | ReloadOptions ||


- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L101)
### public reloadEvents(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
Updates application events with the latest from "eventsPath".

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L109)

### public reloadValidations(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L109)
### public reloadValidations(): [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[void](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)>
Updates application command validations with the latest from "validationsPath".

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/CommandKit.ts#L117)


- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/CommandKit.ts#L117)
2 changes: 1 addition & 1 deletion apps/docs/content/docs/classes/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ description: Classes provided by CommandKit

<Cards><Card title="ButtonKit" description="No description available." href="/docs/classes/ButtonKit" />

<Card title="CommandKit" description="No description available." href="/docs/classes/CommandKit" /></Cards>
<Card title="CommandKit" description="No description available." href="/docs/classes/CommandKit" /></Cards>
11 changes: 6 additions & 5 deletions apps/docs/content/docs/enums/ReloadType.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ description: No description provided

## ReloadType

| Property | Type | Value | Description |
| --------- | -------- | ----- | -------------------------------- |
| Developer | 'dev' | N/A | Reload developer/guild commands. |
| Global | 'global' | N/A | Reload global commands. |
| Property | Type | Value | Description |
| ----------- | ----------- | ----------- | ----------- |
| Developer | 'dev' | N/A | Reload developer/guild commands. |
| Global | 'global' | N/A | Reload global commands. |

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/types.ts#L284)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/types.ts#L284)
8 changes: 1 addition & 7 deletions apps/docs/content/docs/enums/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,4 @@ description: Enums provided by CommandKit

# Enums

<Cards>
<Card
title="ReloadType"
description="No description available."
href="/docs/enums/ReloadType"
/>
</Cards>
<Cards><Card title="ReloadType" description="No description available." href="/docs/enums/ReloadType" /></Cards>
12 changes: 7 additions & 5 deletions apps/docs/content/docs/functions/defineConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ title: defineConfig
description: No description provided
---

### defineConfig(config): Partial\<[CommandKitConfig](/docs/types/CommandKitConfig.mdx)>

| Parameter | Type | Optional |
| --------- | -------------------------------------------------------------------- | -------- |
| config | PartialConfig\<[CommandKitConfig](/docs/types/CommandKitConfig.mdx)> ||
### defineConfig(config): Partial\<[CommandKitConfig](/docs/types/CommandKitConfig)>

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/config.ts#L71)
| Parameter | Type | Optional |
| ----------- | ----------- | ----------- |
| config | PartialConfig\<[CommandKitConfig](/docs/types/CommandKitConfig)> ||


- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/config.ts#L71)
5 changes: 3 additions & 2 deletions apps/docs/content/docs/functions/getConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: getConfig
description: No description provided
---

### getConfig(): [CommandKitConfig](/docs/types/CommandKitConfig.mdx)

- [Source](https://github.com/underctrl-io/commandkit/blob/c462cc3d6f765a7ee19e33a651f0f2f4666b111b/packages/commandkit/src/config.ts#L60)
### getConfig(): [CommandKitConfig](/docs/types/CommandKitConfig)

- [Source](https://github.com/underctrl-io/commandkit/blob/fe9b9d88f8541b4758cc813e8505d26748e6e5bd/packages/commandkit/src/config.ts#L60)
2 changes: 1 addition & 1 deletion apps/docs/content/docs/functions/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ description: Functions provided by CommandKit

<Cards><Card title="defineConfig" description="No description available." href="/docs/functions/defineConfig" />

<Card title="getConfig" description="No description available." href="/docs/functions/getConfig" /></Cards>
<Card title="getConfig" description="No description available." href="/docs/functions/getConfig" /></Cards>
Loading

0 comments on commit 0722bd1

Please sign in to comment.