Skip to main content

@sapphire/shapeshift

Enumerations

Classes

Interfaces

Type Aliases

ArrayConstraintName

Ƭ ArrayConstraintName: `s.array(T).${"unique" | `length${"LessThan" | "LessThanOrEqual" | "GreaterThan" | "GreaterThanOrEqual" | "Equal" | "NotEqual" | "Range" | "RangeInclusive" | "RangeExclusive"}`}`

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:7


BigIntConstraintName

Ƭ BigIntConstraintName: `s.bigint.${"lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "equal" | "notEqual" | "divisibleBy"}`

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:6


BooleanConstraintName

Ƭ BooleanConstraintName: `s.boolean.${boolean}`

Defined in

projects/shapeshift/src/constraints/BooleanConstraints.ts:5


ConstraintErrorNames

Ƭ ConstraintErrorNames: TypedArrayConstraintName | ArrayConstraintName | BigIntConstraintName | BooleanConstraintName | DateConstraintName | NumberConstraintName | ObjectConstraintName | StringConstraintName

Defined in

projects/shapeshift/src/lib/errors/BaseConstraintError.ts:13


Constructor

Ƭ Constructor<T>: (...args: readonly any[]) => T | (...args: readonly any[]) => T

Type parameters

Name
T

Defined in

projects/shapeshift/src/lib/util-types.ts:5


DateConstraintName

Ƭ DateConstraintName: `s.date.${"lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "equal" | "notEqual" | "valid" | "invalid"}`

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:6


ExpandSmallerTuples

Ƭ ExpandSmallerTuples<T>: T extends [T[0], ...(infer Tail)] ? T | ExpandSmallerTuples<Tail> : []

Type parameters

NameType
Textends [...any[]]

Defined in

projects/shapeshift/src/lib/util-types.ts:129


GrowExp

Ƭ GrowExp<A, N, P>: [...A, ...A][N] extends undefined ? GrowExp<[...A, ...A], N, [A, ...P]> : GrowExpRev<A, N, P>

Type parameters

NameType
Aextends any[]
Nextends number
Pextends any[][]

Defined in

projects/shapeshift/src/lib/util-types.ts:138


GrowExpRev

Ƭ GrowExpRev<A, N, P>: A["length"] extends N ? A : GrowExpRev<[...A, ...P[0]][N] extends undefined ? [...A, ...P[0]] : A, N, Shift<P>>

Type parameters

NameType
Aextends any[]
Nextends number
Pextends any[][]

Defined in

projects/shapeshift/src/lib/util-types.ts:134


InferResultType

Ƭ InferResultType<T>: T extends Result<infer U> ? U : never

Type parameters

NameType
Textends Result<any>

Defined in

projects/shapeshift/src/lib/util-types.ts:123


InferType

Ƭ InferType<T>: T extends ObjectValidator<any, infer U> ? U : never

Infers the type of a schema object given typeof schema. The schema has to extend ObjectValidator.

Example

import { InferType, s } from '@sapphire/shapeshift';

const schema = s.object({
foo: s.string,
bar: s.number,
baz: s.boolean,
qux: s.bigint,
quux: s.date
});

type Inferredtype = InferType<typeof schema>;
// Expected type:
// type Inferredtype = {
// foo: string;
// bar: number;
// baz: boolean;
// qux: bigint;
// quux: Date;
// };

Type parameters

NameType
Textends ObjectValidator<any>

Defined in

projects/shapeshift/src/lib/util-types.ts:121


MappedObjectValidator

Ƭ MappedObjectValidator<T>: { [key in keyof T]: BaseValidator<T[key]> }

Type parameters

Name
T

Defined in

projects/shapeshift/src/lib/util-types.ts:38


NonNullObject

Ƭ NonNullObject: & object

Deprecated

Use object instead.

Defined in

projects/shapeshift/src/lib/util-types.ts:13


NumberConstraintName

Ƭ NumberConstraintName: `s.number.${"lessThan" | "lessThanOrEqual" | "greaterThan" | "greaterThanOrEqual" | "equal" | "equal(NaN)" | "notEqual" | "notEqual(NaN)" | "int" | "safeInt" | "finite" | "divisibleBy"}`

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:6


PickDefined

Ƭ PickDefined<T>: { [K in keyof T as undefined extends T[K] ? never : K]: T[K] }

Deprecated

This type is no longer used and will be removed in the next major version.

Type parameters

Name
T

Defined in

projects/shapeshift/src/lib/util-types.ts:18


PickUndefinedMakeOptional

Ƭ PickUndefinedMakeOptional<T>: { [K in keyof T as undefined extends T[K] ? K : never]?: Exclude<T[K], undefined> }

Deprecated

This type is no longer used and will be removed in the next major version.

Type parameters

Name
T

Defined in

projects/shapeshift/src/lib/util-types.ts:23


SchemaOf

Ƭ SchemaOf<T>: ObjectValidator<T>

An alias of ObjectValidator with a name more common among object validation libraries. This is the type of a schema after using s.object({ ... })

Example

import { s, SchemaOf } from '@sapphire/shapeshift';

interface IIngredient {
ingredientId: string | undefined;
name: string | undefined;
}

interface IInstruction {
instructionId: string | undefined;
message: string | undefined;
}

interface IRecipe {
recipeId: string | undefined;
title: string;
description: string;
instructions: IInstruction[];
ingredients: IIngredient[];
}

type InstructionSchemaType = SchemaOf<IInstruction>;
// Expected Type: ObjectValidator<IInstruction>

type IngredientSchemaType = SchemaOf<IIngredient>;
// Expected Type: ObjectValidator<IIngredient>

type RecipeSchemaType = SchemaOf<IRecipe>;
// Expected Type: ObjectValidator<IRecipe>

const instructionSchema: InstructionSchemaType = s.object({
instructionId: s.string.optional,
message: s.string
});

const ingredientSchema: IngredientSchemaType = s.object({
ingredientId: s.string.optional,
name: s.string
});

const recipeSchema: RecipeSchemaType = s.object({
recipeId: s.string.optional,
title: s.string,
description: s.string,
instructions: s.array(instructionSchema),
ingredients: s.array(ingredientSchema)
});

Type parameters

NameType
Textends object

Defined in

projects/shapeshift/src/lib/util-types.ts:93


Shift

Ƭ Shift<A>: (...args: A) => void extends (...args: [A[0], ...(infer R)]) => void ? R : never

Type parameters

NameType
Aextends any[]

Defined in

projects/shapeshift/src/lib/util-types.ts:132


StringConstraintName

Ƭ StringConstraintName: `s.string.${`length${"LessThan" | "LessThanOrEqual" | "GreaterThan" | "GreaterThanOrEqual" | "Equal" | "NotEqual"}` | "regex" | "url" | "uuid" | "email" | `ip${"v4" | "v6" | ""}` | "date" | "phone"}`

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:10


StringDomain

Ƭ StringDomain: `${string}.${string}`

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:22


StringProtocol

Ƭ StringProtocol: `${string}:`

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:20


Tuple

Ƭ Tuple<T, N>: N extends number ? number extends N ? T[] : N extends 0 ? [] : N extends 1 ? [T] : GrowExp<[T], N, [[]]> : never

Type parameters

NameType
TT
Nextends number

Defined in

projects/shapeshift/src/lib/util-types.ts:142


Type

Ƭ Type<V>: V extends BaseValidator<infer T> ? T : never

Type parameters

Name
V

Defined in

projects/shapeshift/src/lib/util-types.ts:7


TypedArrayConstraintName

Ƭ TypedArrayConstraintName: `s.typedArray(T).${"byteLength" | "length"}${"LessThan" | "LessThanOrEqual" | "GreaterThan" | "GreaterThanOrEqual" | "Equal" | "NotEqual" | "Range" | "RangeInclusive" | "RangeExclusive"}`

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:7


UUIDVersion

Ƭ UUIDVersion: 1 | 3 | 4 | 5

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:29


UndefinedToOptional

Ƭ UndefinedToOptional<T>: Pick<T, FilterDefinedKeys<T>> & { [k in keyof Omit<T, FilterDefinedKeys<T>>]?: Exclude<T[k], undefined> }

Type parameters

NameType
Textends object

Defined in

projects/shapeshift/src/lib/util-types.ts:34


UnshiftTuple

Ƭ UnshiftTuple<T>: T extends [T[0], ...(infer Tail)] ? Tail : never

Type parameters

NameType
Textends [...any[]]

Defined in

projects/shapeshift/src/lib/util-types.ts:128


Unwrap

Ƭ Unwrap<T>: T extends BaseValidator<infer V> ? V : never

Type parameters

Name
T

Defined in

projects/shapeshift/src/lib/util-types.ts:126


UnwrapTuple

Ƭ UnwrapTuple<T>: T extends [infer Head, ...(infer Tail)] ? [Unwrap<Head>, ...UnwrapTuple<Tail>] : []

Type parameters

NameType
Textends [...any[]]

Defined in

projects/shapeshift/src/lib/util-types.ts:125


ValidatorError

Ƭ ValidatorError: ValidationError | CombinedError | CombinedPropertyError | UnknownEnumValueError

Defined in

projects/shapeshift/src/validators/BaseValidator.ts:139

Variables

booleanFalse

Const booleanFalse: IConstraint<boolean, false>

Defined in

projects/shapeshift/src/constraints/BooleanConstraints.ts:15


booleanTrue

Const booleanTrue: IConstraint<boolean, true>

Defined in

projects/shapeshift/src/constraints/BooleanConstraints.ts:7


customInspectSymbol

Const customInspectSymbol: typeof customInspectSymbol

Defined in

projects/shapeshift/src/lib/errors/BaseError.ts:3


customInspectSymbolStackLess

Const customInspectSymbolStackLess: typeof customInspectSymbolStackLess

Defined in

projects/shapeshift/src/lib/errors/BaseError.ts:4


dateInvalid

Const dateInvalid: IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:56


dateValid

Const dateValid: IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:64


numberFinite

Const numberFinite: IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:85


numberInt

Const numberInt: IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:60


numberNaN

Const numberNaN: IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:93


numberNotNaN

Const numberNotNaN: IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:101


numberSafeInt

Const numberSafeInt: IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:70


s

Const s: Shapes

Defined in

projects/shapeshift/src/index.ts:3

Functions

arrayLengthEqual

arrayLengthEqual<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:50


arrayLengthGreaterThan

arrayLengthGreaterThan<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:40


arrayLengthGreaterThanOrEqual

arrayLengthGreaterThanOrEqual<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:45


arrayLengthLessThan

arrayLengthLessThan<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:30


arrayLengthLessThanOrEqual

arrayLengthLessThanOrEqual<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:35


arrayLengthNotEqual

arrayLengthNotEqual<T>(value): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
valuenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:55


arrayLengthRange

arrayLengthRange<T>(start, endBefore): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
startnumber
endBeforenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:60


arrayLengthRangeExclusive

arrayLengthRangeExclusive<T>(startAfter, endBefore): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
startAfternumber
endBeforenumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:82


arrayLengthRangeInclusive

arrayLengthRangeInclusive<T>(start, end): IConstraint<T[]>

Type parameters

Name
T

Parameters

NameType
startnumber
endnumber

Returns

IConstraint<T[]>

Defined in

projects/shapeshift/src/constraints/ArrayConstraints.ts:71


bigintDivisibleBy

bigintDivisibleBy(divider): IConstraint<bigint>

Parameters

NameType
dividerbigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:55


bigintEqual

bigintEqual(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:45


bigintGreaterThan

bigintGreaterThan(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:35


bigintGreaterThanOrEqual

bigintGreaterThanOrEqual(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:40


bigintLessThan

bigintLessThan(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:25


bigintLessThanOrEqual

bigintLessThanOrEqual(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:30


bigintNotEqual

bigintNotEqual(value): IConstraint<bigint>

Parameters

NameType
valuebigint

Returns

IConstraint<bigint>

Defined in

projects/shapeshift/src/constraints/BigIntConstraints.ts:50


dateEqual

dateEqual(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:46


dateGreaterThan

dateGreaterThan(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:36


dateGreaterThanOrEqual

dateGreaterThanOrEqual(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:41


dateLessThan

dateLessThan(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:26


dateLessThanOrEqual

dateLessThanOrEqual(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:31


dateNotEqual

dateNotEqual(value): IConstraint<Date>

Parameters

NameType
valueDate

Returns

IConstraint<Date>

Defined in

projects/shapeshift/src/constraints/DateConstraints.ts:51


getGlobalValidationEnabled

getGlobalValidationEnabled(): boolean

Returns

boolean

Whether validation is enabled

Defined in

projects/shapeshift/src/lib/configs.ts:14


numberDivisibleBy

numberDivisibleBy(divider): IConstraint<number>

Parameters

NameType
dividernumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:109


numberEqual

numberEqual(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:50


numberGreaterThan

numberGreaterThan(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:40


numberGreaterThanOrEqual

numberGreaterThanOrEqual(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:45


numberLessThan

numberLessThan(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:30


numberLessThanOrEqual

numberLessThanOrEqual(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:35


numberNotEqual

numberNotEqual(value): IConstraint<number>

Parameters

NameType
valuenumber

Returns

IConstraint<number>

Defined in

projects/shapeshift/src/constraints/NumberConstraints.ts:55


setGlobalValidationEnabled

setGlobalValidationEnabled(enabled): void

Sets whether validators should run on the input, or if the input should be passed through.

Parameters

NameTypeDescription
enabledbooleanWhether validation should be done on inputs

Returns

void

Defined in

projects/shapeshift/src/lib/configs.ts:7


stringEmail

stringEmail(): IConstraint<string>

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:76


stringIp

stringIp(version?): IConstraint<string>

Parameters

NameType
version?4 | 6

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:114


stringLengthEqual

stringLengthEqual(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:66


stringLengthGreaterThan

stringLengthGreaterThan(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:56


stringLengthGreaterThanOrEqual

stringLengthGreaterThanOrEqual(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:61


stringLengthLessThan

stringLengthLessThan(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:46


stringLengthLessThanOrEqual

stringLengthLessThanOrEqual(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:51


stringLengthNotEqual

stringLengthNotEqual(length): IConstraint<string>

Parameters

NameType
lengthnumber

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:71


stringRegex

stringRegex(regex): IConstraint<string, string>

Parameters

NameType
regexRegExp

Returns

IConstraint<string, string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:128


stringUrl

stringUrl(options?): IConstraint<string>

Parameters

NameType
options?UrlOptions

Returns

IConstraint<string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:96


stringUuid

stringUuid(«destructured»?): IConstraint<string, string>

Parameters

NameType
«destructured»StringUuidOptions

Returns

IConstraint<string, string>

Defined in

projects/shapeshift/src/constraints/StringConstraints.ts:132


typedArrayByteLengthEqual

typedArrayByteLengthEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:53


typedArrayByteLengthGreaterThan

typedArrayByteLengthGreaterThan<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:43


typedArrayByteLengthGreaterThanOrEqual

typedArrayByteLengthGreaterThanOrEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:48


typedArrayByteLengthLessThan

typedArrayByteLengthLessThan<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:33


typedArrayByteLengthLessThanOrEqual

typedArrayByteLengthLessThanOrEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:38


typedArrayByteLengthNotEqual

typedArrayByteLengthNotEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:58


typedArrayByteLengthRange

typedArrayByteLengthRange<T>(start, endBefore): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startnumber
endBeforenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:63


typedArrayByteLengthRangeExclusive

typedArrayByteLengthRangeExclusive<T>(startAfter, endBefore): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startAfternumber
endBeforenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:87


typedArrayByteLengthRangeInclusive

typedArrayByteLengthRangeInclusive<T>(start, end): Object

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startnumber
endnumber

Returns

Object

NameType
run(input: T) => Result<T, Error> | Result<unknown, ExpectedConstraintError<T>>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:74


typedArrayLengthEqual

typedArrayLengthEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:135


typedArrayLengthGreaterThan

typedArrayLengthGreaterThan<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:125


typedArrayLengthGreaterThanOrEqual

typedArrayLengthGreaterThanOrEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:130


typedArrayLengthLessThan

typedArrayLengthLessThan<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:115


typedArrayLengthLessThanOrEqual

typedArrayLengthLessThanOrEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:120


typedArrayLengthNotEqual

typedArrayLengthNotEqual<T>(value): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
valuenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:140


typedArrayLengthRange

typedArrayLengthRange<T>(start, endBefore): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startnumber
endBeforenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:145


typedArrayLengthRangeExclusive

typedArrayLengthRangeExclusive<T>(startAfter, endBefore): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startAfternumber
endBeforenumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:167


typedArrayLengthRangeInclusive

typedArrayLengthRangeInclusive<T>(start, end): IConstraint<T>

Type parameters

NameType
Textends TypedArray

Parameters

NameType
startnumber
endnumber

Returns

IConstraint<T>

Defined in

projects/shapeshift/src/constraints/TypedArrayLengthConstraints.ts:156