Validates that the string is a well-formed email address.
Uses the pattern ^[^\s@]+@[^\s@]+\.[^\s@]+$ for validation.
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the email validator applied
Validates that the string is a valid IP address (IPv4 or IPv6).
Pass opts.version to restrict validation to a specific IP version.
Optionalopts: { version?: "v4" | "v6" }optional configuration
Optionalversion?: "v4" | "v6"restrict to 'v4' or 'v6' (default: accept both)
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the IP validator applied
Validates that the string is not empty (length > 0).
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the nonempty validator applied
Constrains the string to one of the specified literal values.
Narrows the inferred type from string to the union of the
provided literals.
a new schema builder restricted to the given values
Constrains the string to one of the specified literal values, with a custom error message or factory as the last argument.
Constrains the string to one of the specified literal values, with an optional custom error message or factory.
the allowed string literals as an array
OptionalerrorMessage: ValidationErrorMessageProvider<optional custom error message or factory function
a new schema builder restricted to the given values
Preprocessor that converts the string to lowercase before validation.
a new schema builder with the toLowerCase preprocessor applied
Preprocessor that trims leading and trailing whitespace before validation.
a new schema builder with the trim preprocessor applied
Validates that the string is a well-formed URL.
By default only http and https protocols are accepted.
Pass opts.protocols to restrict or expand the allowed set.
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the URL validator applied
Optionalopts: { protocols?: string[] }OptionalerrorMessage: ValidationErrorMessageProvider<Validates that the string is a valid UUID (versions 1–5).
OptionalerrorMessage: ValidationErrorMessageProvider<custom error message or function to generate one
a new schema builder with the UUID validator applied
Methods added to
StringSchemaBuilderby the built-in string extension pack.WORKAROUND: This interface duplicates the method signatures from
stringExtensionsso that JSDoc survives into the published.d.tsfiles. TypeScript strips JSDoc when method signatures are reconstructed through theFixedMethodsmapped type (conditionalinferloses comments). Remove this interface once TypeScript preserves JSDoc through mapped types / conditional type inference.See
https://github.com/microsoft/TypeScript/issues/50715