/** * The extended Schemable typeclass * * **Warning: DO NOT EDIT, this module is autogenerated** * * @since 0.0.1 */ import { URIS, URIS2 } from 'fp-ts/HKT' import { Schemable1, Schemable2C } from 'io-ts/Schemable' import { Schemable2, SchemableHKT2 } from './internal/Schemable2' /** Generic */ import * as optionFromExclude from './generic/optionFromExclude' import * as optionFromNullable from './generic/optionFromNullable' import * as optionFromUndefined from './generic/optionFromUndefined' /** Number */ import * as Int from './number/Int' import * as Natural from './number/Natural' import * as NegativeFloat from './number/NegativeFloat' import * as NegativeInt from './number/NegativeInt' import * as NonNegativeFloat from './number/NonNegativeFloat' import * as NonPositiveFloat from './number/NonPositiveFloat' import * as NonPositiveInt from './number/NonPositiveInt' import * as PositiveFloat from './number/PositiveFloat' import * as PositiveInt from './number/PositiveInt' /** String */ import * as ASCII from './string/ASCII' import * as Base64 from './string/Base64' import * as Base64Url from './string/Base64Url' import * as BtcAddress from './string/BtcAddress' import * as CreditCard from './string/CreditCard' import * as EmailAddress from './string/EmailAddress' import * as HexColor from './string/HexColor' import * as Hexadecimal from './string/Hexadecimal' import * as HslColor from './string/HslColor' import * as ISODateString from './string/ISODateString' import * as IntString from './string/IntString' import * as JWT from './string/JWT' import * as NaturalString from './string/NaturalString' import * as NegativeFloatString from './string/NegativeFloatString' import * as NegativeIntString from './string/NegativeIntString' import * as NonNegativeFloatString from './string/NonNegativeFloatString' import * as NonPositiveFloatString from './string/NonPositiveFloatString' import * as NonPositiveIntString from './string/NonPositiveIntString' import * as NonemptyString from './string/NonemptyString' import * as PositiveFloatString from './string/PositiveFloatString' import * as PositiveIntString from './string/PositiveIntString' import * as RGB from './string/RGB' import * as UUID from './string/UUID' /** Date */ import * as SafeDate from './date/SafeDate' /** * @since 0.0.1 * @category Instances */ export interface SchemableExt extends SchemableHKT2 { /** * Represents an exclusion of a supplied value where the exclusion is mapped to `None`. * Requires an inner schemable, and an Eq instance which defaults to strict equality. * * @since 0.0.4 */ readonly optionFromExclude: optionFromExclude.SchemableParams /** * Represents a conversion from a nullable value to an Optional type * * @since 0.0.4 */ readonly optionFromNullable: optionFromNullable.SchemableParams /** * Represents a conversion from an value that can be undefined to an Optional type * * @since 0.0.4 */ readonly optionFromUndefined: optionFromUndefined.SchemableParams /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Int: Int.SchemableParams /** * Natural branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Natural: Natural.SchemableParams /** * Negative floating point branded newtype. * * Represents negative floating point numbers: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloat: NegativeFloat.SchemableParams /** * Negative integer branded newtype. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeInt: NegativeInt.SchemableParams /** * Non-negative floating point branded newtype. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloat: NonNegativeFloat.SchemableParams /** * Non-positive floating point branded newtype. * * Represents non-positive floating point numbers: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloat: NonPositiveFloat.SchemableParams /** * NonPositive integer branded newtype. * * Represents integers which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveInt: NonPositiveInt.SchemableParams /** * Positive Float branded newtype. * * Represents floating point numbers: * * ```math * { f | f ∈ R, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloat: PositiveFloat.SchemableParams /** * Positive integer branded newtype. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveInt: PositiveInt.SchemableParams /** * A string in which every character is valid ASCII. * * This is heavily inspired by the `validator.js` module * [`isAscii`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isAscii.js). * * @since 0.0.1 */ readonly ASCII: ASCII.SchemableParams /** * Representing a Base64-encoded string. * * For a URL-safe version, @see Base64UrlSafe module * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64: Base64.SchemableParams /** * Representing a URL-safe, Base64 encoded string. * * For a non-URL-safe alternative, @see Base64 * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64Url: Base64Url.SchemableParams /** * Represents strings which are valid Bitcoin addresses. * * This is heavily inspired by the `validator.js` module * [`isBtcAddress`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBtcAddress.js). * * @since 0.0.2 */ readonly BtcAddress: BtcAddress.SchemableParams /** * Represents (some) valid credit card numbers. * * At the moment, this mostly handles Visa, Mastercard, American Express, Diners Club, * Discover, and JCB. * * @since 0.0.3 */ readonly CreditCard: CreditCard.SchemableParams /** * Represents strings (email addresses) that conform to the RFC 5322 standard. * * See: https://emailregex.com/ * * **Note: Does not validate international addresses** * * @since 0.0.1 */ readonly EmailAddress: EmailAddress.SchemableParams /** * A valid hexadecimal color value. * * Inspired by * [isHexColor](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexColor.js) * * @since 0.0.3 */ readonly HexColor: HexColor.SchemableParams /** * A string of hexadecimal characters. * * Inspired by * [isHexadecimal](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexadecimal.js) * * @since 0.0.3 */ readonly Hexadecimal: Hexadecimal.SchemableParams /** * An HSL string. Commonly in CSS. * * @since 0.0.3 * @example * import { Guard } from 'schemable-ts-types/string/HslColor' * * const hue = 270 * const saturation = 60 * const lightness = 70 * const alpha = 0.7 * * const hslString = `hsl(${hue} ${saturation}% ${lightness}% / ${alpha})` * * assert.equal(Guard.is(hslString), true) */ readonly HslColor: HslColor.SchemableParams /** * Represents strings that conform to the ISO 8601 standard. * * @since 0.0.1 */ readonly ISODateString: ISODateString.SchemableParams /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly IntString: IntString.SchemableParams /** * A valid, Base64-encoded JWT. * * Inspired by validator.js' [JWT * module](https://github.com/validatorjs/validator.js/blob/master/src/lib/isJWT.js). * * @since 0.0.2 */ readonly JWT: JWT.SchemableParams /** * Natural branded newtype string. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly NaturalString: NaturalString.SchemableParams /** * Negative floating point branded newtype string. * * Represents negative floating point number strings: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloatString: NegativeFloatString.SchemableParams /** * Negative integer branded newtype string. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeIntString: NegativeIntString.SchemableParams /** * Non-negative floating point branded newtype string. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloatString: NonNegativeFloatString.SchemableParams /** * Non-positive floating point branded newtype string. * * Represents non-positive floating point number strings: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloatString: NonPositiveFloatString.SchemableParams /** * NonPositive integer branded newtype string. * * Represents integer strings which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveIntString: NonPositiveIntString.SchemableParams /** * Represents strings that are not empty strings. * * @since 0.0.1 */ readonly NonemptyString: NonemptyString.SchemableParams /** * Positive floating point branded newtype string. * * Represents positive floating point numbers: * * ```math * { f | f ∈ ℝ, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloatString: PositiveFloatString.SchemableParams /** * Positive integer branded newtype string. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveIntString: PositiveIntString.SchemableParams /** * Represents strings which are valid RGB colors. Permits both absolute and percentage * based values. * * @since 0.0.4 */ readonly RGB: RGB.SchemableParams /** * Represents strings that are UUIDs. * * This is heavily inspired by the `validator.js` module * [`isUUID`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isUUID.js). * * @since 0.0.1 */ readonly UUID: UUID.SchemableParams /** * Represents Date objects which are not invalid dates * * @since 0.0.1 */ readonly SafeDate: SafeDate.SchemableParams } /** * @since 0.0.1 * @category Instances */ export interface SchemableExt1 extends Schemable1 { /** * Represents an exclusion of a supplied value where the exclusion is mapped to `None`. * Requires an inner schemable, and an Eq instance which defaults to strict equality. * * @since 0.0.4 */ readonly optionFromExclude: optionFromExclude.SchemableParams1 /** * Represents a conversion from a nullable value to an Optional type * * @since 0.0.4 */ readonly optionFromNullable: optionFromNullable.SchemableParams1 /** * Represents a conversion from an value that can be undefined to an Optional type * * @since 0.0.4 */ readonly optionFromUndefined: optionFromUndefined.SchemableParams1 /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Int: Int.SchemableParams1 /** * Natural branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Natural: Natural.SchemableParams1 /** * Negative floating point branded newtype. * * Represents negative floating point numbers: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloat: NegativeFloat.SchemableParams1 /** * Negative integer branded newtype. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeInt: NegativeInt.SchemableParams1 /** * Non-negative floating point branded newtype. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloat: NonNegativeFloat.SchemableParams1 /** * Non-positive floating point branded newtype. * * Represents non-positive floating point numbers: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloat: NonPositiveFloat.SchemableParams1 /** * NonPositive integer branded newtype. * * Represents integers which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveInt: NonPositiveInt.SchemableParams1 /** * Positive Float branded newtype. * * Represents floating point numbers: * * ```math * { f | f ∈ R, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloat: PositiveFloat.SchemableParams1 /** * Positive integer branded newtype. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveInt: PositiveInt.SchemableParams1 /** * A string in which every character is valid ASCII. * * This is heavily inspired by the `validator.js` module * [`isAscii`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isAscii.js). * * @since 0.0.1 */ readonly ASCII: ASCII.SchemableParams1 /** * Representing a Base64-encoded string. * * For a URL-safe version, @see Base64UrlSafe module * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64: Base64.SchemableParams1 /** * Representing a URL-safe, Base64 encoded string. * * For a non-URL-safe alternative, @see Base64 * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64Url: Base64Url.SchemableParams1 /** * Represents strings which are valid Bitcoin addresses. * * This is heavily inspired by the `validator.js` module * [`isBtcAddress`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBtcAddress.js). * * @since 0.0.2 */ readonly BtcAddress: BtcAddress.SchemableParams1 /** * Represents (some) valid credit card numbers. * * At the moment, this mostly handles Visa, Mastercard, American Express, Diners Club, * Discover, and JCB. * * @since 0.0.3 */ readonly CreditCard: CreditCard.SchemableParams1 /** * Represents strings (email addresses) that conform to the RFC 5322 standard. * * See: https://emailregex.com/ * * **Note: Does not validate international addresses** * * @since 0.0.1 */ readonly EmailAddress: EmailAddress.SchemableParams1 /** * A valid hexadecimal color value. * * Inspired by * [isHexColor](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexColor.js) * * @since 0.0.3 */ readonly HexColor: HexColor.SchemableParams1 /** * A string of hexadecimal characters. * * Inspired by * [isHexadecimal](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexadecimal.js) * * @since 0.0.3 */ readonly Hexadecimal: Hexadecimal.SchemableParams1 /** * An HSL string. Commonly in CSS. * * @since 0.0.3 * @example * import { Guard } from 'schemable-ts-types/string/HslColor' * * const hue = 270 * const saturation = 60 * const lightness = 70 * const alpha = 0.7 * * const hslString = `hsl(${hue} ${saturation}% ${lightness}% / ${alpha})` * * assert.equal(Guard.is(hslString), true) */ readonly HslColor: HslColor.SchemableParams1 /** * Represents strings that conform to the ISO 8601 standard. * * @since 0.0.1 */ readonly ISODateString: ISODateString.SchemableParams1 /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly IntString: IntString.SchemableParams1 /** * A valid, Base64-encoded JWT. * * Inspired by validator.js' [JWT * module](https://github.com/validatorjs/validator.js/blob/master/src/lib/isJWT.js). * * @since 0.0.2 */ readonly JWT: JWT.SchemableParams1 /** * Natural branded newtype string. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly NaturalString: NaturalString.SchemableParams1 /** * Negative floating point branded newtype string. * * Represents negative floating point number strings: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloatString: NegativeFloatString.SchemableParams1 /** * Negative integer branded newtype string. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeIntString: NegativeIntString.SchemableParams1 /** * Non-negative floating point branded newtype string. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloatString: NonNegativeFloatString.SchemableParams1 /** * Non-positive floating point branded newtype string. * * Represents non-positive floating point number strings: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloatString: NonPositiveFloatString.SchemableParams1 /** * NonPositive integer branded newtype string. * * Represents integer strings which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveIntString: NonPositiveIntString.SchemableParams1 /** * Represents strings that are not empty strings. * * @since 0.0.1 */ readonly NonemptyString: NonemptyString.SchemableParams1 /** * Positive floating point branded newtype string. * * Represents positive floating point numbers: * * ```math * { f | f ∈ ℝ, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloatString: PositiveFloatString.SchemableParams1 /** * Positive integer branded newtype string. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveIntString: PositiveIntString.SchemableParams1 /** * Represents strings which are valid RGB colors. Permits both absolute and percentage * based values. * * @since 0.0.4 */ readonly RGB: RGB.SchemableParams1 /** * Represents strings that are UUIDs. * * This is heavily inspired by the `validator.js` module * [`isUUID`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isUUID.js). * * @since 0.0.1 */ readonly UUID: UUID.SchemableParams1 /** * Represents Date objects which are not invalid dates * * @since 0.0.1 */ readonly SafeDate: SafeDate.SchemableParams1 } /** * @since 0.0.1 * @category Instances */ export interface SchemableExt2 extends Schemable2 { /** * Represents an exclusion of a supplied value where the exclusion is mapped to `None`. * Requires an inner schemable, and an Eq instance which defaults to strict equality. * * @since 0.0.4 */ readonly optionFromExclude: optionFromExclude.SchemableParams2 /** * Represents a conversion from a nullable value to an Optional type * * @since 0.0.4 */ readonly optionFromNullable: optionFromNullable.SchemableParams2 /** * Represents a conversion from an value that can be undefined to an Optional type * * @since 0.0.4 */ readonly optionFromUndefined: optionFromUndefined.SchemableParams2 /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Int: Int.SchemableParams2 /** * Natural branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Natural: Natural.SchemableParams2 /** * Negative floating point branded newtype. * * Represents negative floating point numbers: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloat: NegativeFloat.SchemableParams2 /** * Negative integer branded newtype. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeInt: NegativeInt.SchemableParams2 /** * Non-negative floating point branded newtype. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloat: NonNegativeFloat.SchemableParams2 /** * Non-positive floating point branded newtype. * * Represents non-positive floating point numbers: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloat: NonPositiveFloat.SchemableParams2 /** * NonPositive integer branded newtype. * * Represents integers which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveInt: NonPositiveInt.SchemableParams2 /** * Positive Float branded newtype. * * Represents floating point numbers: * * ```math * { f | f ∈ R, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloat: PositiveFloat.SchemableParams2 /** * Positive integer branded newtype. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveInt: PositiveInt.SchemableParams2 /** * A string in which every character is valid ASCII. * * This is heavily inspired by the `validator.js` module * [`isAscii`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isAscii.js). * * @since 0.0.1 */ readonly ASCII: ASCII.SchemableParams2 /** * Representing a Base64-encoded string. * * For a URL-safe version, @see Base64UrlSafe module * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64: Base64.SchemableParams2 /** * Representing a URL-safe, Base64 encoded string. * * For a non-URL-safe alternative, @see Base64 * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64Url: Base64Url.SchemableParams2 /** * Represents strings which are valid Bitcoin addresses. * * This is heavily inspired by the `validator.js` module * [`isBtcAddress`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBtcAddress.js). * * @since 0.0.2 */ readonly BtcAddress: BtcAddress.SchemableParams2 /** * Represents (some) valid credit card numbers. * * At the moment, this mostly handles Visa, Mastercard, American Express, Diners Club, * Discover, and JCB. * * @since 0.0.3 */ readonly CreditCard: CreditCard.SchemableParams2 /** * Represents strings (email addresses) that conform to the RFC 5322 standard. * * See: https://emailregex.com/ * * **Note: Does not validate international addresses** * * @since 0.0.1 */ readonly EmailAddress: EmailAddress.SchemableParams2 /** * A valid hexadecimal color value. * * Inspired by * [isHexColor](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexColor.js) * * @since 0.0.3 */ readonly HexColor: HexColor.SchemableParams2 /** * A string of hexadecimal characters. * * Inspired by * [isHexadecimal](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexadecimal.js) * * @since 0.0.3 */ readonly Hexadecimal: Hexadecimal.SchemableParams2 /** * An HSL string. Commonly in CSS. * * @since 0.0.3 * @example * import { Guard } from 'schemable-ts-types/string/HslColor' * * const hue = 270 * const saturation = 60 * const lightness = 70 * const alpha = 0.7 * * const hslString = `hsl(${hue} ${saturation}% ${lightness}% / ${alpha})` * * assert.equal(Guard.is(hslString), true) */ readonly HslColor: HslColor.SchemableParams2 /** * Represents strings that conform to the ISO 8601 standard. * * @since 0.0.1 */ readonly ISODateString: ISODateString.SchemableParams2 /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly IntString: IntString.SchemableParams2 /** * A valid, Base64-encoded JWT. * * Inspired by validator.js' [JWT * module](https://github.com/validatorjs/validator.js/blob/master/src/lib/isJWT.js). * * @since 0.0.2 */ readonly JWT: JWT.SchemableParams2 /** * Natural branded newtype string. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly NaturalString: NaturalString.SchemableParams2 /** * Negative floating point branded newtype string. * * Represents negative floating point number strings: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloatString: NegativeFloatString.SchemableParams2 /** * Negative integer branded newtype string. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeIntString: NegativeIntString.SchemableParams2 /** * Non-negative floating point branded newtype string. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloatString: NonNegativeFloatString.SchemableParams2 /** * Non-positive floating point branded newtype string. * * Represents non-positive floating point number strings: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloatString: NonPositiveFloatString.SchemableParams2 /** * NonPositive integer branded newtype string. * * Represents integer strings which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveIntString: NonPositiveIntString.SchemableParams2 /** * Represents strings that are not empty strings. * * @since 0.0.1 */ readonly NonemptyString: NonemptyString.SchemableParams2 /** * Positive floating point branded newtype string. * * Represents positive floating point numbers: * * ```math * { f | f ∈ ℝ, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloatString: PositiveFloatString.SchemableParams2 /** * Positive integer branded newtype string. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveIntString: PositiveIntString.SchemableParams2 /** * Represents strings which are valid RGB colors. Permits both absolute and percentage * based values. * * @since 0.0.4 */ readonly RGB: RGB.SchemableParams2 /** * Represents strings that are UUIDs. * * This is heavily inspired by the `validator.js` module * [`isUUID`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isUUID.js). * * @since 0.0.1 */ readonly UUID: UUID.SchemableParams2 /** * Represents Date objects which are not invalid dates * * @since 0.0.1 */ readonly SafeDate: SafeDate.SchemableParams2 } /** * @since 0.0.1 * @category Instances */ export interface SchemableExt2C extends Schemable2C { /** * Represents an exclusion of a supplied value where the exclusion is mapped to `None`. * Requires an inner schemable, and an Eq instance which defaults to strict equality. * * @since 0.0.4 */ readonly optionFromExclude: optionFromExclude.SchemableParams2C /** * Represents a conversion from a nullable value to an Optional type * * @since 0.0.4 */ readonly optionFromNullable: optionFromNullable.SchemableParams2C /** * Represents a conversion from an value that can be undefined to an Optional type * * @since 0.0.4 */ readonly optionFromUndefined: optionFromUndefined.SchemableParams2C /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Int: Int.SchemableParams2C /** * Natural branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly Natural: Natural.SchemableParams2C /** * Negative floating point branded newtype. * * Represents negative floating point numbers: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloat: NegativeFloat.SchemableParams2C /** * Negative integer branded newtype. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeInt: NegativeInt.SchemableParams2C /** * Non-negative floating point branded newtype. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloat: NonNegativeFloat.SchemableParams2C /** * Non-positive floating point branded newtype. * * Represents non-positive floating point numbers: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloat: NonPositiveFloat.SchemableParams2C /** * NonPositive integer branded newtype. * * Represents integers which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveInt: NonPositiveInt.SchemableParams2C /** * Positive Float branded newtype. * * Represents floating point numbers: * * ```math * { f | f ∈ R, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloat: PositiveFloat.SchemableParams2C /** * Positive integer branded newtype. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveInt: PositiveInt.SchemableParams2C /** * A string in which every character is valid ASCII. * * This is heavily inspired by the `validator.js` module * [`isAscii`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isAscii.js). * * @since 0.0.1 */ readonly ASCII: ASCII.SchemableParams2C /** * Representing a Base64-encoded string. * * For a URL-safe version, @see Base64UrlSafe module * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64: Base64.SchemableParams2C /** * Representing a URL-safe, Base64 encoded string. * * For a non-URL-safe alternative, @see Base64 * * This module is heavily inspired by the `validator.js` module * [`isBase64`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBase64.js). * * @since 0.0.2 */ readonly Base64Url: Base64Url.SchemableParams2C /** * Represents strings which are valid Bitcoin addresses. * * This is heavily inspired by the `validator.js` module * [`isBtcAddress`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isBtcAddress.js). * * @since 0.0.2 */ readonly BtcAddress: BtcAddress.SchemableParams2C /** * Represents (some) valid credit card numbers. * * At the moment, this mostly handles Visa, Mastercard, American Express, Diners Club, * Discover, and JCB. * * @since 0.0.3 */ readonly CreditCard: CreditCard.SchemableParams2C /** * Represents strings (email addresses) that conform to the RFC 5322 standard. * * See: https://emailregex.com/ * * **Note: Does not validate international addresses** * * @since 0.0.1 */ readonly EmailAddress: EmailAddress.SchemableParams2C /** * A valid hexadecimal color value. * * Inspired by * [isHexColor](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexColor.js) * * @since 0.0.3 */ readonly HexColor: HexColor.SchemableParams2C /** * A string of hexadecimal characters. * * Inspired by * [isHexadecimal](https://github.com/validatorjs/validator.js/blob/master/src/lib/isHexadecimal.js) * * @since 0.0.3 */ readonly Hexadecimal: Hexadecimal.SchemableParams2C /** * An HSL string. Commonly in CSS. * * @since 0.0.3 * @example * import { Guard } from 'schemable-ts-types/string/HslColor' * * const hue = 270 * const saturation = 60 * const lightness = 70 * const alpha = 0.7 * * const hslString = `hsl(${hue} ${saturation}% ${lightness}% / ${alpha})` * * assert.equal(Guard.is(hslString), true) */ readonly HslColor: HslColor.SchemableParams2C /** * Represents strings that conform to the ISO 8601 standard. * * @since 0.0.1 */ readonly ISODateString: ISODateString.SchemableParams2C /** * Integer branded newtype. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly IntString: IntString.SchemableParams2C /** * A valid, Base64-encoded JWT. * * Inspired by validator.js' [JWT * module](https://github.com/validatorjs/validator.js/blob/master/src/lib/isJWT.js). * * @since 0.0.2 */ readonly JWT: JWT.SchemableParams2C /** * Natural branded newtype string. * * Represents integers: * * ```math * { z | z ∈ ℤ, z >= 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly NaturalString: NaturalString.SchemableParams2C /** * Negative floating point branded newtype string. * * Represents negative floating point number strings: * * ```math * { f | f ∈ ℝ, f < 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NegativeFloatString: NegativeFloatString.SchemableParams2C /** * Negative integer branded newtype string. * * Represents negative integers: * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z < 0 } * ``` * * @since 0.0.1 */ readonly NegativeIntString: NegativeIntString.SchemableParams2C /** * Non-negative floating point branded newtype string. * * Represents non-negative floating point numbers: * * ```math * { f | f ∈ ℝ, f >= 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly NonNegativeFloatString: NonNegativeFloatString.SchemableParams2C /** * Non-positive floating point branded newtype string. * * Represents non-positive floating point number strings: * * ```math * { f | f ∈ ℝ, f <= 0, f >= -Number.MAX_VALUE } * ``` * * @since 0.0.4 */ readonly NonPositiveFloatString: NonPositiveFloatString.SchemableParams2C /** * NonPositive integer branded newtype string. * * Represents integer strings which are negative or zero. * * ```math * { z | z ∈ ℤ, z >= -2 ** 53 + 1, z <= 0 } * ``` * * @since 0.0.4 */ readonly NonPositiveIntString: NonPositiveIntString.SchemableParams2C /** * Represents strings that are not empty strings. * * @since 0.0.1 */ readonly NonemptyString: NonemptyString.SchemableParams2C /** * Positive floating point branded newtype string. * * Represents positive floating point numbers: * * ```math * { f | f ∈ ℝ, f > 0, f <= Number.MAX_VALUE } * ``` * * @since 0.0.2 */ readonly PositiveFloatString: PositiveFloatString.SchemableParams2C /** * Positive integer branded newtype string. * * Represents positive integers: * * ```math * { z | z ∈ ℤ, z > 0, z <= 2 ** 53 - 1 } * ``` * * @since 0.0.1 */ readonly PositiveIntString: PositiveIntString.SchemableParams2C /** * Represents strings which are valid RGB colors. Permits both absolute and percentage * based values. * * @since 0.0.4 */ readonly RGB: RGB.SchemableParams2C /** * Represents strings that are UUIDs. * * This is heavily inspired by the `validator.js` module * [`isUUID`](https://github.com/validatorjs/validator.js/blob/master/src/lib/isUUID.js). * * @since 0.0.1 */ readonly UUID: UUID.SchemableParams2C /** * Represents Date objects which are not invalid dates * * @since 0.0.1 */ readonly SafeDate: SafeDate.SchemableParams2C }