import { ConstructorFor, Func1 } from '../Types'; /** * supported types */ export type AssertionType = T | undefined | null; /** * Interface for implementing your own builder. @see ArgumentAssertionBuilder */ export interface IArgumentAssertionBuilder { readonly argument: T; readonly argumentName: string; } /** * Instance of @see IArgumentAssertionBuilder */ export default class ArgumentAssertionBuilder implements IArgumentAssertionBuilder { readonly argument: T; readonly argumentName: string; constructor(argument: T, argumentName: string); /** Ensures the argument is not null or undefined */ isNotNullOrUndefined(): this; /** Ensures the argument is not null */ isNotNull(): this; /** Ensures the argument is not undefined */ isNotUndefined(): this; /** * Ensures the argument is of the type * @param type The type */ isTypeOf(type: ConstructorFor): this; /** * Asserts on the value of predicate to whether the assertion is valid. * @param predicate The predicate to test to see if the assertion is valid. * @param message The message to use if the assertion is invalid. */ matches(predicate: Func1, message?: string): this; /** * Determines whether the argument is one of the specified options. * @param options */ isOneOf(...options: T[]): this; }