/** * @module Expectations/Implementation * @author Alan Rodas Bonjour */ import { AbstractFinishedExpectation } from './AbstractFinishedExpectation'; import { Shape } from '../../Functions'; import { ArrayExpectation, FinishedExpectation, NumberExpectation, ObjectExpectation, StringExpectation } from '../Interfaces'; import * as Matchers from '../Matchers'; /** * The expectation class is the class that is actually instantiated for * any expectation. It implements all interfaces for expectations, even * the finished expectation ones. * * @group Internal: Types */ export declare class FullExpectation extends AbstractFinishedExpectation { /** * The querying element of this expectation. */ protected element: unknown; /** * The current result of this expectation. Undefined until * the first matcher is run. */ protected result: boolean | undefined; /** * true if this expectation is a negated expectation, that is, * the `not` property was accessed. */ protected isNot: boolean; /** * An array of the matchers run in this expectation. */ protected states: Matchers.MatcherCall[]; /** * Create a new expectation for the given element. * * @param element - The element to query to. */ constructor(element: unknown); /** @inheritDoc {@link Expectation.not} */ get not(): this; /** @inheritDoc {@link Expectation.toBe} */ toBe(value: unknown): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeLike} */ toBeLike(value: unknown): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeNull} */ toBeNull(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeDefined} */ toBeDefined(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeUndefined} */ toBeUndefined(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeTruthy} */ toBeTruthy(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeFalsy} */ toBeFalsy(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toHaveType} */ toHaveType(typeName: string): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toHaveShape} */ toHaveShape(shape: Shape): this & FinishedExpectation; /** @inheritDoc {@link Expectation.asNumber} */ asNumber(): NumberExpectation; /** @inheritDoc {@link Expectation.asString} */ asString(): StringExpectation; /** @inheritDoc {@link Expectation.asObject} */ asObject(): ObjectExpectation; /** @inheritDoc {@link Expectation.asArray} */ asArray(): ArrayExpectation; /** @inheritDoc {@link Expectation.toBeTruthy} */ toBeTrue(): this & FinishedExpectation; /** @inheritDoc {@link Expectation.toBeFalsy} */ toBeFalse(): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeGreaterThan} */ toBeGreaterThan(value: number): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeGreaterThanOrEqual} */ toBeGreaterThanOrEqual(value: number): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeLowerThan} */ toBeLowerThan(value: number): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeLowerThanOrEqual} */ toBeLowerThanOrEqual(value: number): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeBetween} */ toBeBetween(from: number, to: number): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeInfinity} */ toBeInfinity(): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeNaN} */ toBeNaN(): this & FinishedExpectation; /** @inheritDoc {@link NumberExpectation.toBeCloseTo} */ toBeCloseTo(value: number, digits?: number): this & FinishedExpectation; /** @inheritDoc {@link StringExpectation.toHaveSubstring} */ toHaveSubstring(substring: string): this & FinishedExpectation; /** @inheritDoc {@link StringExpectation.toStartWith} */ toStartWith(start: string): this & FinishedExpectation; /** @inheritDoc {@link StringExpectation.toEndWith} */ toEndWith(end: string): this & FinishedExpectation; /** @inheritDoc {@link StringExpectation.toMatch} */ toMatch(regexp: RegExp): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.toBeEmptyArray} */ toBeEmptyArray(count: number): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.toHaveLength} */ toHaveLength(count: number): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.toContain} */ toContain(value: unknown): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.toHaveAtPosition} */ toHaveAtPosition(value: unknown, position: number): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.allToSatisfy} */ allToSatisfy(criteria: (item: unknown) => boolean): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.anyToSatisfy} */ anyToSatisfy(criteria: (item: unknown) => boolean): this & FinishedExpectation; /** @inheritDoc {@link ArrayExpectation.amountToSatisfy} */ amountToSatisfy(count: number, criteria: (item: unknown) => boolean): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toBeEmptyObject} */ toBeEmptyObject(count: number): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toHavePropertyCount} */ toHavePropertyCount(count: number): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toHaveAtLeast} */ toHaveAtLeast(keys: string[]): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toHaveNoOtherThan} */ toHaveNoOtherThan(keys: string[]): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toHaveProperty} */ toHaveProperty(propertyName: string): this & FinishedExpectation; /** @inheritDoc {@link ObjectExpectation.toBeInstanceOf} */ toBeInstanceOf(classConstructor: Function): this & FinishedExpectation; /** @inheritDoc {@link FinishedExpectation.getResult} */ getResult(): boolean; /** * Set the given value as the result of this * expectation. The result is directly set, when * no previous result existed, or joined with a * logic conjunction with the previous result if * a value already exists. * * @param value - The value to set. */ protected setResult(value: boolean): void; /** * Run a matcher with the given name, passing the * querying element as a first argument, and all additional * given arguments. The result of running the matcher is stores, * and a new state is pushed to this particular matcher. * * @param matcherName - The matcher name to run * @param args - The arguments to pass to the matcher */ protected runMatcher(matcherName: string, args: unknown[], sparse?: boolean): this; } //# sourceMappingURL=FullExpectation.d.ts.map