import { HttpStep } from '../../HttpStep.js';
export const NotToBeAssertionKind = 'HttpAction#NotToBeAssertion';
/**
 * An assertion that makes sure the input is not of a specific type (string, number, boolean, object, array).
 */
export class NotToBeAssertion extends HttpStep {
    kind = NotToBeAssertionKind;
    /**
     * The type to expect.
     */
    value;
    constructor(valueOrInit) {
        super();
        if (typeof valueOrInit === 'object') {
            const typed = valueOrInit;
            this.new(typed);
        }
        else if (typeof valueOrInit === 'string') {
            this.new({
                kind: NotToBeAssertionKind,
                value: valueOrInit,
                enabled: true,
            });
        }
    }
    new(init) {
        super.new(init);
        this.kind = NotToBeAssertionKind;
        this.value = init.value;
    }
    checkValidity() {
        return !!this.value;
    }
    toJSON() {
        const result = {
            ...super.toJSON(),
            kind: NotToBeAssertionKind,
        };
        if (this.value) {
            result.value = this.value;
        }
        return result;
    }
}
//# sourceMappingURL=NotToBeAssertion.js.map