seyfert 3.2.7-dev-18363537028.0 → 3.2.7-dev-18544835853.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.
- package/lib/builders/FileUpload.d.ts +35 -0
- package/lib/builders/FileUpload.js +56 -0
- package/lib/builders/Label.d.ts +2 -1
- package/lib/builders/index.d.ts +1 -0
- package/lib/builders/index.js +4 -0
- package/lib/builders/types.d.ts +2 -1
- package/lib/common/shorters/members.d.ts +1 -1
- package/lib/components/BaseComponent.d.ts +4 -2
- package/lib/types/payloads/components.d.ts +24 -3
- package/lib/types/payloads/components.js +4 -0
- package/package.json +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type APIFileUploadComponent } from '../types';
|
|
2
|
+
import { BaseComponentBuilder } from './Base';
|
|
3
|
+
export declare class FileUpload extends BaseComponentBuilder<APIFileUploadComponent> {
|
|
4
|
+
constructor(data?: Partial<APIFileUploadComponent>);
|
|
5
|
+
/**
|
|
6
|
+
* Sets the ID for the file upload.
|
|
7
|
+
* @param id - The ID for the file upload.
|
|
8
|
+
* @returns The current FileUpload instance.
|
|
9
|
+
*/
|
|
10
|
+
setId(id: string): this;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the custom ID for the file upload.
|
|
13
|
+
* @param customId - The custom ID for the file upload.
|
|
14
|
+
* @returns The current FileUpload instance.
|
|
15
|
+
*/
|
|
16
|
+
setCustomId(customId: string): this;
|
|
17
|
+
/**
|
|
18
|
+
* Sets the minimum number of items that must be uploaded.
|
|
19
|
+
* @param minValues - The minimum number of items that must be uploaded.
|
|
20
|
+
* @returns The current FileUpload instance.
|
|
21
|
+
*/
|
|
22
|
+
setMinValues(minValues: number): this;
|
|
23
|
+
/**
|
|
24
|
+
* Sets the maximum number of items that can be uploaded.
|
|
25
|
+
* @param maxValues - The maximum number of items that can be uploaded.
|
|
26
|
+
* @returns The current FileUpload instance.
|
|
27
|
+
*/
|
|
28
|
+
setMaxValues(maxValues: number): this;
|
|
29
|
+
/**
|
|
30
|
+
* Sets whether the file upload is required.
|
|
31
|
+
* @param required - Whether the file upload is required.
|
|
32
|
+
* @returns The current FileUpload instance.
|
|
33
|
+
*/
|
|
34
|
+
setRequired(required: boolean): this;
|
|
35
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FileUpload = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const Base_1 = require("./Base");
|
|
6
|
+
class FileUpload extends Base_1.BaseComponentBuilder {
|
|
7
|
+
constructor(data = {}) {
|
|
8
|
+
super({ type: types_1.ComponentType.FileUpload, ...data });
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Sets the ID for the file upload.
|
|
12
|
+
* @param id - The ID for the file upload.
|
|
13
|
+
* @returns The current FileUpload instance.
|
|
14
|
+
*/
|
|
15
|
+
setId(id) {
|
|
16
|
+
this.data.id = id;
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Sets the custom ID for the file upload.
|
|
21
|
+
* @param customId - The custom ID for the file upload.
|
|
22
|
+
* @returns The current FileUpload instance.
|
|
23
|
+
*/
|
|
24
|
+
setCustomId(customId) {
|
|
25
|
+
this.data.custom_id = customId;
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sets the minimum number of items that must be uploaded.
|
|
30
|
+
* @param minValues - The minimum number of items that must be uploaded.
|
|
31
|
+
* @returns The current FileUpload instance.
|
|
32
|
+
*/
|
|
33
|
+
setMinValues(minValues) {
|
|
34
|
+
this.data.min_values = minValues;
|
|
35
|
+
return this;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Sets the maximum number of items that can be uploaded.
|
|
39
|
+
* @param maxValues - The maximum number of items that can be uploaded.
|
|
40
|
+
* @returns The current FileUpload instance.
|
|
41
|
+
*/
|
|
42
|
+
setMaxValues(maxValues) {
|
|
43
|
+
this.data.max_values = maxValues;
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Sets whether the file upload is required.
|
|
48
|
+
* @param required - Whether the file upload is required.
|
|
49
|
+
* @returns The current FileUpload instance.
|
|
50
|
+
*/
|
|
51
|
+
setRequired(required) {
|
|
52
|
+
this.data.required = required;
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.FileUpload = FileUpload;
|
package/lib/builders/Label.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type APILabelComponent } from '../types';
|
|
2
2
|
import { BaseComponentBuilder } from './Base';
|
|
3
|
+
import { FileUpload } from './FileUpload';
|
|
3
4
|
import type { TextInput } from './Modal';
|
|
4
5
|
import type { BuilderSelectMenus } from './SelectMenu';
|
|
5
|
-
export type LabelBuilderComponents = TextInput | BuilderSelectMenus;
|
|
6
|
+
export type LabelBuilderComponents = TextInput | BuilderSelectMenus | FileUpload;
|
|
6
7
|
export declare class Label extends BaseComponentBuilder<APILabelComponent> {
|
|
7
8
|
constructor({ component, ...data }?: Partial<APILabelComponent>);
|
|
8
9
|
component?: LabelBuilderComponents;
|
package/lib/builders/index.d.ts
CHANGED
package/lib/builders/index.js
CHANGED
|
@@ -20,6 +20,7 @@ const ActionRow_1 = require("./ActionRow");
|
|
|
20
20
|
const Button_1 = require("./Button");
|
|
21
21
|
const Container_1 = require("./Container");
|
|
22
22
|
const File_1 = require("./File");
|
|
23
|
+
const FileUpload_1 = require("./FileUpload");
|
|
23
24
|
const Label_1 = require("./Label");
|
|
24
25
|
const MediaGallery_1 = require("./MediaGallery");
|
|
25
26
|
const Modal_1 = require("./Modal");
|
|
@@ -35,6 +36,7 @@ __exportStar(require("./Button"), exports);
|
|
|
35
36
|
__exportStar(require("./Container"), exports);
|
|
36
37
|
__exportStar(require("./Embed"), exports);
|
|
37
38
|
__exportStar(require("./File"), exports);
|
|
39
|
+
__exportStar(require("./FileUpload"), exports);
|
|
38
40
|
__exportStar(require("./MediaGallery"), exports);
|
|
39
41
|
__exportStar(require("./Modal"), exports);
|
|
40
42
|
__exportStar(require("./Poll"), exports);
|
|
@@ -81,5 +83,7 @@ function fromComponent(data) {
|
|
|
81
83
|
return new File_1.File(data);
|
|
82
84
|
case types_1.ComponentType.Label:
|
|
83
85
|
return new Label_1.Label(data);
|
|
86
|
+
case types_1.ComponentType.FileUpload:
|
|
87
|
+
return new FileUpload_1.FileUpload(data);
|
|
84
88
|
}
|
|
85
89
|
}
|
package/lib/builders/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ActionRow } from './ActionRow';
|
|
|
3
3
|
import type { Button } from './Button';
|
|
4
4
|
import type { Container } from './Container';
|
|
5
5
|
import type { File } from './File';
|
|
6
|
+
import { FileUpload } from './FileUpload';
|
|
6
7
|
import { Label } from './Label';
|
|
7
8
|
import type { MediaGallery } from './MediaGallery';
|
|
8
9
|
import type { TextInput } from './Modal';
|
|
@@ -22,7 +23,7 @@ export type ButtonID = Omit<Button, 'setURL'>;
|
|
|
22
23
|
export type MessageBuilderComponents = Exclude<TopLevelBuilders, Label>;
|
|
23
24
|
export type ModalBuilderComponents = Label | TextDisplay;
|
|
24
25
|
export type ActionBuilderComponents = Button | BuilderSelectMenus;
|
|
25
|
-
export type BuilderComponents = ActionRow | BuilderSelectMenus | Button | Section<Button | Thumbnail> | Thumbnail | TextDisplay | Container | Separator | MediaGallery | File | TextInput | Label;
|
|
26
|
+
export type BuilderComponents = ActionRow | BuilderSelectMenus | Button | Section<Button | Thumbnail> | Thumbnail | TextDisplay | Container | Separator | MediaGallery | File | TextInput | Label | FileUpload;
|
|
26
27
|
export type TopLevelBuilders = Exclude<BuilderComponents, Thumbnail | TextInput | Button | BuilderSelectMenus>;
|
|
27
28
|
export type FixedComponents<T = Button> = T extends Button ? ButtonLink | ButtonID : T;
|
|
28
29
|
export interface ListenerOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type GuildMemberStructure, type GuildRoleStructure, type VoiceStateStructure } from '../../client/transformers';
|
|
2
2
|
import { PermissionsBitField } from '../../structures/extra/Permissions';
|
|
3
|
-
import { type APIGuildMember, type RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery, RESTPatchAPICurrentGuildMemberJSONBody, type RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildBanJSONBody, type RESTPutAPIGuildMemberJSONBody } from '../../types';
|
|
3
|
+
import { type APIGuildMember, type RESTGetAPIGuildMembersQuery, type RESTGetAPIGuildMembersSearchQuery, type RESTPatchAPICurrentGuildMemberJSONBody, type RESTPatchAPIGuildMemberJSONBody, type RESTPutAPIGuildBanJSONBody, type RESTPutAPIGuildMemberJSONBody } from '../../types';
|
|
4
4
|
import type { GuildMemberResolvable } from '../types/resolvables';
|
|
5
5
|
import { BaseShorter } from './base';
|
|
6
6
|
export declare class MemberShorter extends BaseShorter {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ActionRow, type Button, type ChannelSelectMenu, type Container, type File, type MediaGallery, type MentionableSelectMenu, type RoleSelectMenu, type Section, type Separator, type StringSelectMenu, type TextDisplay, type TextInput, type Thumbnail, type UserSelectMenu } from '../builders';
|
|
1
|
+
import { type ActionRow, type Button, type ChannelSelectMenu, type Container, type File, FileUpload, type MediaGallery, type MentionableSelectMenu, type RoleSelectMenu, type Section, type Separator, type StringSelectMenu, type TextDisplay, type TextInput, type Thumbnail, type UserSelectMenu } from '../builders';
|
|
2
2
|
import { Label } from '../builders/Label';
|
|
3
|
-
import { type APIActionRowComponent, type APIActionRowComponentTypes, type APIButtonComponent, type APIChannelSelectComponent, type APIContainerComponent, type APIFileComponent, type APILabelComponent, type APIMediaGalleryComponent, type APIMentionableSelectComponent, type APIRoleSelectComponent, type APISectionComponent, type APISeparatorComponent, type APIStringSelectComponent, type APITextDisplayComponent, type APITextInputComponent, type APIThumbnailComponent, type APIUserSelectComponent, ComponentType } from '../types';
|
|
3
|
+
import { type APIActionRowComponent, type APIActionRowComponentTypes, type APIButtonComponent, type APIChannelSelectComponent, type APIContainerComponent, type APIFileComponent, APIFileUploadComponent, type APILabelComponent, type APIMediaGalleryComponent, type APIMentionableSelectComponent, type APIRoleSelectComponent, type APISectionComponent, type APISeparatorComponent, type APIStringSelectComponent, type APITextDisplayComponent, type APITextInputComponent, type APIThumbnailComponent, type APIUserSelectComponent, ComponentType } from '../types';
|
|
4
4
|
export declare class BaseComponent<T extends ComponentType> {
|
|
5
5
|
data: APIComponentsMap[T];
|
|
6
6
|
constructor(data: APIComponentsMap[T]);
|
|
@@ -25,6 +25,7 @@ export interface APIComponentsMap {
|
|
|
25
25
|
[ComponentType.Separator]: APISeparatorComponent;
|
|
26
26
|
[ComponentType.TextDisplay]: APITextDisplayComponent;
|
|
27
27
|
[ComponentType.Label]: APILabelComponent;
|
|
28
|
+
[ComponentType.FileUpload]: APIFileUploadComponent;
|
|
28
29
|
}
|
|
29
30
|
export interface BuilderComponentsMap {
|
|
30
31
|
[ComponentType.ActionRow]: ActionRow;
|
|
@@ -43,4 +44,5 @@ export interface BuilderComponentsMap {
|
|
|
43
44
|
[ComponentType.Separator]: Separator;
|
|
44
45
|
[ComponentType.TextDisplay]: TextDisplay;
|
|
45
46
|
[ComponentType.Label]: Label;
|
|
47
|
+
[ComponentType.FileUpload]: FileUpload;
|
|
46
48
|
}
|
|
@@ -77,7 +77,11 @@ export declare enum ComponentType {
|
|
|
77
77
|
/**
|
|
78
78
|
* Label component
|
|
79
79
|
*/
|
|
80
|
-
Label = 18
|
|
80
|
+
Label = 18,
|
|
81
|
+
/**
|
|
82
|
+
* File upload component
|
|
83
|
+
*/
|
|
84
|
+
FileUpload = 19
|
|
81
85
|
}
|
|
82
86
|
/**
|
|
83
87
|
* https://discord.com/developers/docs/interactions/message-components#action-rows
|
|
@@ -363,7 +367,7 @@ export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModal
|
|
|
363
367
|
* https://discord.com/developers/docs/interactions/message-components#message-components
|
|
364
368
|
*/
|
|
365
369
|
export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
|
|
366
|
-
export type APIComponents = APIMessageActionRowComponent | APIModalActionRowComponent | APIContainerComponent | APIContainerComponents | APITopLevelComponent;
|
|
370
|
+
export type APIComponents = APIFileUploadComponent | APIMessageActionRowComponent | APIModalActionRowComponent | APIContainerComponent | APIContainerComponents | APITopLevelComponent;
|
|
367
371
|
export type APIModalActionRowComponent = APITextInputComponent;
|
|
368
372
|
/**
|
|
369
373
|
* https://discord.com/developers/docs/components/reference#section
|
|
@@ -500,7 +504,24 @@ export interface APILabelComponent {
|
|
|
500
504
|
/** An optional description textfor the label */
|
|
501
505
|
description?: string;
|
|
502
506
|
/** The component within the label */
|
|
503
|
-
component: APITextInputComponent | APISelectMenuComponent;
|
|
507
|
+
component: APITextInputComponent | APISelectMenuComponent | APIFileUploadComponent;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* https://discord.com/developers/docs/components/reference#file-upload
|
|
511
|
+
*/
|
|
512
|
+
export interface APIFileUploadComponent {
|
|
513
|
+
/** 19 for file upload */
|
|
514
|
+
type: ComponentType.FileUpload;
|
|
515
|
+
/** Optional identifier for component */
|
|
516
|
+
id?: string;
|
|
517
|
+
/** ID for the file upload; max 100 characters */
|
|
518
|
+
custom_id: string;
|
|
519
|
+
/** Minimum number of items that must be uploaded (defaults to 1); min 0, max 10 */
|
|
520
|
+
min_values?: number;
|
|
521
|
+
/** Maximum number of items that can be uploaded (defaults to 1); min 0, max 10 */
|
|
522
|
+
max_values?: number;
|
|
523
|
+
/** Whether the file upload is required (defaults to false) */
|
|
524
|
+
required?: boolean;
|
|
504
525
|
}
|
|
505
526
|
/**
|
|
506
527
|
* https://discord.com/developers/docs/components/reference#unfurled-media-item-structure
|
|
@@ -70,6 +70,10 @@ var ComponentType;
|
|
|
70
70
|
* Label component
|
|
71
71
|
*/
|
|
72
72
|
ComponentType[ComponentType["Label"] = 18] = "Label";
|
|
73
|
+
/**
|
|
74
|
+
* File upload component
|
|
75
|
+
*/
|
|
76
|
+
ComponentType[ComponentType["FileUpload"] = 19] = "FileUpload";
|
|
73
77
|
})(ComponentType || (exports.ComponentType = ComponentType = {}));
|
|
74
78
|
/**
|
|
75
79
|
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|