File tree Expand file tree Collapse file tree 4 files changed +92
-20
lines changed Expand file tree Collapse file tree 4 files changed +92
-20
lines changed Original file line number Diff line number Diff line change 1
- import type { APIBaseComponent , APIComponentInModalLabel } from '../channel' ;
1
+ import type { APIBaseComponent } from '../channel' ;
2
2
import type {
3
3
APIBaseInteraction ,
4
4
APIDMInteractionWrapper ,
@@ -7,18 +7,36 @@ import type {
7
7
InteractionType ,
8
8
} from '../index' ;
9
9
10
- export interface ModalSubmitComponent {
11
- type : ComponentType ;
10
+ export interface APIBaseModalSubmitComponent < T extends ComponentType > extends APIBaseComponent < T > {
11
+ type : T ;
12
12
custom_id : string ;
13
+ }
14
+
15
+ export interface APIModalSubmitTextInputComponent extends APIBaseModalSubmitComponent < ComponentType . TextInput > {
13
16
value : string ;
14
17
}
15
18
19
+ export interface APIModalSubmitStringSelectComponentInLabelComponent
20
+ extends APIBaseModalSubmitComponent < ComponentType . StringSelect > {
21
+ values : string [ ] ;
22
+ }
23
+
24
+ export type ModalSubmitComponent =
25
+ | APIModalSubmitStringSelectComponentInLabelComponent
26
+ | APIModalSubmitTextInputComponent ;
27
+
16
28
export interface ModalSubmitActionRowComponent extends APIBaseComponent < ComponentType . ActionRow > {
17
- components : ModalSubmitComponent [ ] ;
29
+ components : APIModalSubmitTextInputComponent [ ] ;
18
30
}
19
31
20
32
export interface ModalSubmitLabelComponent extends APIBaseComponent < ComponentType . Label > {
21
- component : APIComponentInModalLabel ;
33
+ component : ModalSubmitComponent ;
34
+ }
35
+
36
+ export interface APIModalSubmitStringSelectComponentInLabelComponent {
37
+ type : ComponentType . StringSelect ;
38
+ values : string [ ] ;
39
+ custom_id : string ;
22
40
}
23
41
24
42
/**
Original file line number Diff line number Diff line change 1
- import type { APIBaseComponent , APIComponentInModalLabel } from '../channel' ;
1
+ import type { APIBaseComponent } from '../channel' ;
2
2
import type {
3
3
APIBaseInteraction ,
4
4
APIDMInteractionWrapper ,
@@ -7,18 +7,36 @@ import type {
7
7
InteractionType ,
8
8
} from '../index' ;
9
9
10
- export interface ModalSubmitComponent {
11
- type : ComponentType ;
10
+ export interface APIBaseModalSubmitComponent < T extends ComponentType > extends APIBaseComponent < T > {
11
+ type : T ;
12
12
custom_id : string ;
13
+ }
14
+
15
+ export interface APIModalSubmitTextInputComponent extends APIBaseModalSubmitComponent < ComponentType . TextInput > {
13
16
value : string ;
14
17
}
15
18
19
+ export interface APIModalSubmitStringSelectComponentInLabelComponent
20
+ extends APIBaseModalSubmitComponent < ComponentType . StringSelect > {
21
+ values : string [ ] ;
22
+ }
23
+
24
+ export type ModalSubmitComponent =
25
+ | APIModalSubmitStringSelectComponentInLabelComponent
26
+ | APIModalSubmitTextInputComponent ;
27
+
16
28
export interface ModalSubmitActionRowComponent extends APIBaseComponent < ComponentType . ActionRow > {
17
- components : ModalSubmitComponent [ ] ;
29
+ components : APIModalSubmitTextInputComponent [ ] ;
18
30
}
19
31
20
32
export interface ModalSubmitLabelComponent extends APIBaseComponent < ComponentType . Label > {
21
- component : APIComponentInModalLabel ;
33
+ component : ModalSubmitComponent ;
34
+ }
35
+
36
+ export interface APIModalSubmitStringSelectComponentInLabelComponent {
37
+ type : ComponentType . StringSelect ;
38
+ values : string [ ] ;
39
+ custom_id : string ;
22
40
}
23
41
24
42
/**
You can’t perform that action at this time.
0 commit comments