self-assert
Version:
A small TypeScript library for designing models with built-in validity.
39 lines • 1.59 kB
TypeScript
import type { Predicate } from "./Requirements";
export declare class LogicalRequirement {
/**
* Combines multiple conditions using logical AND
* @function @category Composition
*/
static and: <ValueType>(...conditions: Predicate<ValueType>[]) => Predicate<ValueType>;
/**
* Combines multiple conditions using logical OR
* @function @category Composition
*/
static or: <ValueType>(...conditions: Predicate<ValueType>[]) => Predicate<ValueType>;
/**
* Negates a condition
* @function @category Composition
*/
static not: <ValueType>(condition: Predicate<ValueType>) => Predicate<ValueType>;
/**
* Returns a predicate that checks if the value is equal to the expected value.
* @function @category Comparison
*/
static identical: <ValueType>(expected: ValueType) => Predicate<ValueType>;
/**
* Returns a predicate that checks if the value is not equal to the forbidden value.
* @function @category Comparison
*/
static differentFrom: <ValueType>(forbiddenValue: ValueType) => Predicate<ValueType>;
/**
* Returns a predicate that checks if the value is in the allowed set.
* @function @category Comparison
*/
static isIn: <ValueType>(...allowedSet: ValueType[]) => Predicate<ValueType>;
/**
* Returns a predicate that checks if the value is not in the forbidden set.
* @function @category Comparison
*/
static isNotIn: <ValueType>(...forbiddenSet: ValueType[]) => Predicate<ValueType>;
}
//# sourceMappingURL=LogicalRequirements.d.ts.map