From 36bef1564c6cba0f0d26806da57ac2bd5a7655e0 Mon Sep 17 00:00:00 2001 From: Carlos Daniel Date: Thu, 10 Aug 2023 16:22:59 -0300 Subject: [PATCH 1/2] feat: add type support for multiline plain text inputs --- src/elements/index.ts | 4 +++- src/elements/text-input.ts | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/elements/index.ts b/src/elements/index.ts index ab6158a..c2ec550 100644 --- a/src/elements/index.ts +++ b/src/elements/index.ts @@ -297,6 +297,7 @@ export function StaticSelect(params?: StaticSelectParams): StaticSelectBuilder { * @param {string} [params.actionId] Sets a string to be an identifier for the source of an action in interaction payloads. * @param {string} [params.placeholder] Adds the text in place of the input before selected or interacted with. * @param {string} [params.initialValue] Sets the default text entered into the text input at modal render. + * @param {boolean} [params.multiline] Sets wether the input will be a single line or a larger text area. * @param {int} [params.minLength] Sets a minimum character count in order for the user to submit the form. * @param {int} [params.maxLength] Sets a maximum character count allowed to send the form. * @@ -304,7 +305,8 @@ export function StaticSelect(params?: StaticSelectParams): StaticSelectBuilder { */ export function TextInput(params?: TextInputParams): TextInputBuilder { - return new TextInputBuilder(params); + const input = new TextInputBuilder(params); + return input; } /** diff --git a/src/elements/text-input.ts b/src/elements/text-input.ts index ec20b1e..8ea2f54 100644 --- a/src/elements/text-input.ts +++ b/src/elements/text-input.ts @@ -18,6 +18,7 @@ import { export interface TextInputParams { actionId?: string; initialValue?: string; + multiline?: boolean; maxLength?: number; minLength?: number; placeholder?: string; From 3697b1caaf32a60db6750a31c11a445e74dad76a Mon Sep 17 00:00:00 2001 From: Carlos Daniel Date: Fri, 22 Dec 2023 00:28:57 -0300 Subject: [PATCH 2/2] chore: return class instance --- src/elements/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/elements/index.ts b/src/elements/index.ts index c2ec550..11c2aca 100644 --- a/src/elements/index.ts +++ b/src/elements/index.ts @@ -67,7 +67,7 @@ export type { UserMultiSelectBuilder, UserMultiSelectParams, UserSelectBuilder, - UserSelectParams, + UserSelectParams }; /** @@ -305,8 +305,7 @@ export function StaticSelect(params?: StaticSelectParams): StaticSelectBuilder { */ export function TextInput(params?: TextInputParams): TextInputBuilder { - const input = new TextInputBuilder(params); - return input; + return new TextInputBuilder(params); } /**