From 9ba22e15208b1506b1e34a6d2954e886713ea86f Mon Sep 17 00:00:00 2001 From: joshunrau Date: Tue, 9 Jul 2024 15:07:41 -0400 Subject: [PATCH] feat: add calculateStrength option to password variant --- lib/index.d.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index 82dd88c..80dc45e 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,4 +1,4 @@ -import type { Simplify } from 'type-fest'; +import type { IntRange, Simplify } from 'type-fest'; // INTERNAL UTILITIES @@ -88,6 +88,11 @@ export type BaseFormField = { export type FormFieldMixin = Simplify; export type StringFormField = FormFieldMixin< + | { + calculateStrength?: (password: string) => IntRange<0, 5>; + kind: 'string'; + variant: 'password'; + } | { kind: 'string'; options: { [K in TValue]: string }; @@ -95,7 +100,7 @@ export type StringFormField = FormFieldMixin< } | { kind: 'string'; - variant: 'input' | 'password' | 'textarea'; + variant: 'input' | 'textarea'; } >;