seyfert/packages/biscuit/structures/components/TextInputComponent.ts
Marcos Susaña 89c43eb3a5
Top level declarations (#56)
* chore(): declarations

* fixes

* fix a jk

* fix components

* fix
2022-07-15 18:03:23 +00:00

38 lines
1.1 KiB
TypeScript

import type { Session } from "../../Session.ts";
import type { DiscordInputTextComponent } from "../../../discordeno/mod.ts";
import type { TextInputComponent } from "./Component.ts";
import { MessageComponentTypes, TextStyles } from "../../../discordeno/mod.ts";
import BaseComponent from "./Component.ts";
export class TextInput extends BaseComponent implements TextInputComponent {
constructor(session: Session, data: DiscordInputTextComponent) {
super(data.type);
this.session = session;
this.type = data.type as MessageComponentTypes.InputText;
this.customId = data.custom_id!;
this.label = data.label!;
this.style = data.style as TextStyles;
this.placeholder = data.placeholder;
this.value = data.value;
this.minLength = data.min_length;
this.maxLength = data.max_length;
}
readonly session: Session;
override type: MessageComponentTypes.InputText;
style: TextStyles;
customId: string;
label: string;
placeholder?: string;
value?: string;
minLength?: number;
maxLength?: number;
}
export default TextInput;