seyfert 3.2.7-dev-17598595685.0 → 3.2.7-dev-17656890690.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
1
  import { type APILabelComponent } from '../types';
2
2
  import { BaseComponentBuilder } from './Base';
3
3
  import type { TextInput } from './Modal';
4
- import type { StringSelectMenu } from './SelectMenu';
4
+ import type { BuilderSelectMenus } from './SelectMenu';
5
+ export type LabelBuilderComponents = TextInput | BuilderSelectMenus;
5
6
  export declare class Label extends BaseComponentBuilder<APILabelComponent> {
6
7
  constructor({ component, ...data }?: Partial<APILabelComponent>);
7
- component?: TextInput | StringSelectMenu;
8
+ component?: LabelBuilderComponents;
8
9
  setLabel(label: string): this;
9
10
  setDescription(description: string): this;
10
- setComponent(component: TextInput | StringSelectMenu): this;
11
+ setComponent(component: LabelBuilderComponents): this;
11
12
  toJSON(): APILabelComponent;
12
13
  }
@@ -1,8 +1,7 @@
1
1
  import type { RestOrArray } from '../common';
2
2
  import { type APIModalInteractionResponseCallbackData, type APITextInputComponent, type TextInputStyle } from '../types';
3
3
  import { BaseComponentBuilder, type OptionValuesLength } from './Base';
4
- import { Label } from './Label';
5
- import type { ModalSubmitCallback } from './types';
4
+ import type { ModalBuilderComponents, ModalSubmitCallback } from './types';
6
5
  /**
7
6
  * Represents a modal for user interactions.
8
7
  * @template T - The type of components allowed in the modal.
@@ -20,7 +19,7 @@ import type { ModalSubmitCallback } from './types';
20
19
  */
21
20
  export declare class Modal {
22
21
  data: Partial<APIModalInteractionResponseCallbackData>;
23
- components: Label[];
22
+ components: ModalBuilderComponents[];
24
23
  /**
25
24
  * Creates a new Modal instance.
26
25
  * @param data - Optional data for the modal.
@@ -31,13 +30,13 @@ export declare class Modal {
31
30
  * @param components - Components to be added to the modal.
32
31
  * @returns The current Modal instance.
33
32
  */
34
- addComponents(...components: RestOrArray<Label>): this;
33
+ addComponents(...components: RestOrArray<ModalBuilderComponents>): this;
35
34
  /**
36
35
  * Set the components to the modal.
37
36
  * @param component - The components to set into the modal.
38
37
  * @returns The current Modal instance.
39
38
  */
40
- setComponents(component: Label[]): this;
39
+ setComponents(component: ModalBuilderComponents[]): this;
41
40
  /**
42
41
  * Sets the title of the modal.
43
42
  * @param title - The title of the modal.
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TextInput = exports.Modal = void 0;
4
4
  const types_1 = require("../types");
5
+ const _1 = require(".");
5
6
  const Base_1 = require("./Base");
6
- const index_1 = require("./index");
7
7
  /**
8
8
  * Represents a modal for user interactions.
9
9
  * @template T - The type of components allowed in the modal.
@@ -30,7 +30,7 @@ class Modal {
30
30
  */
31
31
  constructor(data = {}) {
32
32
  this.data = data;
33
- this.components = this.components.concat(data.components?.map(index_1.fromComponent) ?? []);
33
+ this.components = this.components.concat(data.components?.map(_1.fromComponent) ?? []);
34
34
  }
35
35
  /**
36
36
  * Adds components to the modal.
@@ -20,7 +20,7 @@ export type ModalSubmitCallback<T = ModalSubmitInteraction> = (interaction: T) =
20
20
  export type ButtonLink = Omit<Button, 'setCustomId'>;
21
21
  export type ButtonID = Omit<Button, 'setURL'>;
22
22
  export type MessageBuilderComponents = Exclude<TopLevelBuilders, Label>;
23
- export type ModalBuilderComponents = Label;
23
+ export type ModalBuilderComponents = Label | TextDisplay;
24
24
  export type ActionBuilderComponents = Button | BuilderSelectMenus;
25
25
  export type BuilderComponents = ActionRow | BuilderSelectMenus | Button | Section<Button | Thumbnail> | Thumbnail | TextDisplay | Container | Separator | MediaGallery | File | TextInput | Label;
26
26
  export type TopLevelBuilders = Exclude<BuilderComponents, Thumbnail | TextInput | Button | BuilderSelectMenus>;
@@ -1,6 +1,6 @@
1
1
  import type { MakeRequired } from '../../../common';
2
2
  import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../index';
3
- import type { APILabelComponent, MessageFlags } from '../index';
3
+ import type { APILabelComponent, APITextDisplayComponent, MessageFlags } from '../index';
4
4
  import type { APIApplicationCommandOptionChoice } from './applicationCommands';
5
5
  /**
6
6
  * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
@@ -104,7 +104,7 @@ export interface APIModalInteractionResponseCallbackData {
104
104
  /**
105
105
  * Between 1 and 5 (inclusive) components that make up the modal
106
106
  */
107
- components: APILabelComponent[];
107
+ components: (APILabelComponent | APITextDisplayComponent)[];
108
108
  }
109
109
  /**
110
110
  * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object
@@ -500,7 +500,7 @@ export interface APILabelComponent {
500
500
  /** An optional description textfor the label */
501
501
  description?: string;
502
502
  /** The component within the label */
503
- component: APITextInputComponent | APIStringSelectComponent;
503
+ component: APITextInputComponent | APISelectMenuComponent;
504
504
  }
505
505
  /**
506
506
  * https://discord.com/developers/docs/components/reference#unfurled-media-item-structure
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "3.2.7-dev-17598595685.0",
3
+ "version": "3.2.7-dev-17656890690.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",