@fallencodes/seyfert-utils 1.2.1 → 1.2.3
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.
|
@@ -6,7 +6,7 @@ interface ModalData {
|
|
|
6
6
|
components: Label[];
|
|
7
7
|
}
|
|
8
8
|
export declare function createModal(data: ModalData): Modal;
|
|
9
|
-
interface
|
|
9
|
+
interface TextInputData {
|
|
10
10
|
label?: string;
|
|
11
11
|
value?: string;
|
|
12
12
|
customId: string;
|
|
@@ -17,8 +17,8 @@ interface ModalTextInputData {
|
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
style: TextInputStyle;
|
|
19
19
|
}
|
|
20
|
-
export declare function
|
|
21
|
-
interface
|
|
20
|
+
export declare function createTextInput(data: TextInputData): Label;
|
|
21
|
+
interface StringSelectMenuData {
|
|
22
22
|
label?: string;
|
|
23
23
|
customId: string;
|
|
24
24
|
required?: boolean;
|
|
@@ -28,6 +28,15 @@ interface ModalStringSelectMenuData {
|
|
|
28
28
|
placeholder?: string;
|
|
29
29
|
options: APISelectMenuOption[];
|
|
30
30
|
}
|
|
31
|
-
export declare function
|
|
31
|
+
export declare function createStringSelectMenu(data: StringSelectMenuData): Label;
|
|
32
|
+
interface FileUploadData {
|
|
33
|
+
label?: string;
|
|
34
|
+
customId: string;
|
|
35
|
+
required?: boolean;
|
|
36
|
+
minValues?: number;
|
|
37
|
+
maxValues?: number;
|
|
38
|
+
description?: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function createFileUpload(data: FileUploadData): Label;
|
|
32
41
|
export {};
|
|
33
42
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/components/modal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/components/modal.ts"],"names":[],"mappings":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MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,SAUpD"}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { Label, Modal, StringSelectMenu, TextInput } from 'seyfert';
|
|
1
|
+
import { Label, Modal, StringSelectMenu, TextInput, FileUpload } from 'seyfert';
|
|
2
|
+
import { truncateString } from '../utilities.js';
|
|
2
3
|
export function createModal(data) {
|
|
3
|
-
return new Modal({
|
|
4
|
+
return new Modal({
|
|
5
|
+
title: truncateString(data.title, 45),
|
|
6
|
+
custom_id: data.customId
|
|
7
|
+
}).setComponents(data.components);
|
|
4
8
|
}
|
|
5
9
|
;
|
|
6
10
|
;
|
|
7
|
-
export function
|
|
11
|
+
export function createTextInput(data) {
|
|
8
12
|
return new Label({
|
|
9
13
|
label: data.label,
|
|
10
14
|
description: data.description
|
|
@@ -19,7 +23,7 @@ export function createModalTextInput(data) {
|
|
|
19
23
|
}));
|
|
20
24
|
}
|
|
21
25
|
;
|
|
22
|
-
export function
|
|
26
|
+
export function createStringSelectMenu(data) {
|
|
23
27
|
return new Label({
|
|
24
28
|
label: data.label,
|
|
25
29
|
description: data.description,
|
|
@@ -33,3 +37,15 @@ export function createModalStringSelectMenu(data) {
|
|
|
33
37
|
}));
|
|
34
38
|
}
|
|
35
39
|
;
|
|
40
|
+
export function createFileUpload(data) {
|
|
41
|
+
return new Label({
|
|
42
|
+
label: data.label,
|
|
43
|
+
description: data.description
|
|
44
|
+
}).setComponent(new FileUpload({
|
|
45
|
+
required: data.required,
|
|
46
|
+
custom_id: data.customId,
|
|
47
|
+
min_values: data.minValues,
|
|
48
|
+
max_values: data.maxValues
|
|
49
|
+
}));
|
|
50
|
+
}
|
|
51
|
+
;
|
package/package.json
CHANGED