Skip to main content
Version: Next

Variable: constraint

const constraint: object

Defined in: core/schema.ts:379

Helper namespace for declaring runtime constraints.

Type Declaration

equality()

equality: (...dims) => EqualityConstraint

Declares that all given dimensions must be equal at runtime.

Parameters

dims

...DimRef[]

Dimensions that must share the same concrete value.

Returns

EqualityConstraint

An EqualityConstraint across the given dimensions.

linear()

linear: (dimLhs, dimRhs, a, b) => LinearConstraint

Declares a linear relation between two dimensions: dimLhs = a * dimRhs + b.

Parameters

dimLhs

DimRef

The left-hand-side dimension.

dimRhs

DimRef

The right-hand-side dimension.

a

number

Slope coefficient.

b?

number = 0

Intercept coefficient (defaults to 0).

Returns

LinearConstraint

A LinearConstraint relating the two dimensions.