import { SchemaVersion, type ComponentDef, type ConditionWrapper, type ConditionWrapperV2, type ConditionsModelData, type Engine, type FormDefinition, type List, type Page, type Section } from '@defra/forms-model';
import { Parser, type Value } from 'expr-eval-fork';
import joi from 'joi';
import { type Component } from '../../../../server/plugins/engine/components/helpers/components.js';
import { type ExecutableCondition } from '../../../../server/plugins/engine/models/types.js';
import { type PageController } from '../../../../server/plugins/engine/pageControllers/PageController.js';
import { type PageControllerClass } from '../../../../server/plugins/engine/pageControllers/helpers/pages.js';
import { type FormContext, type FormContextRequest, type FormState, type FormSubmissionError, type FormSubmissionState } from '../../../../server/plugins/engine/types.js';
import { type Services } from '../../../../server/types.js';
export declare class FormModel {
    /** The runtime engine that should be used */
    engine?: Engine;
    schemaVersion: SchemaVersion;
    /** the entire form JSON as an object */
    def: FormDefinition;
    lists: FormDefinition['lists'];
    sections: FormDefinition['sections'];
    name: string;
    formId: string;
    values: FormDefinition;
    basePath: string;
    ordnanceSurveyApiKey?: string;
    conditions: Partial<Record<string, ExecutableCondition>>;
    pages: PageControllerClass[];
    services: Services;
    controllers?: Record<string, typeof PageController>;
    pageDefMap: Map<string, Page>;
    listDefMap: Map<string, List>;
    listDefIdMap: Map<string, List>;
    componentDefMap: Map<string, ComponentDef>;
    componentDefIdMap: Map<string, ComponentDef>;
    pageMap: Map<string, PageControllerClass>;
    componentMap: Map<string, Component>;
    constructor(def: typeof this.def, options: {
        basePath: string;
        ordnanceSurveyApiKey?: string;
        formId?: string;
    }, services?: Services, controllers?: Record<string, typeof PageController>);
    /**
     * build the entire model schema from individual pages/sections and filter out answers
     * for pages which are no longer accessible due to an answer that has been changed
     */
    makeFilteredSchema(relevantPages: PageControllerClass[]): joi.ObjectSchema<FormSubmissionState>;
    /**
     * Instantiates a Condition based on {@link ConditionWrapper}
     * @param condition
     */
    makeCondition(condition: ConditionWrapper): ExecutableCondition;
    toConditionContext(evaluationState: FormState, conditions: Partial<Record<string, ExecutableCondition>>): Extract<Value, Record<string, Value>>;
    toConditionExpression(value: ConditionsModelData, parser: Parser): import("expr-eval-fork").Expression;
    getList(nameOrId: string): List | undefined;
    getSection(nameOrId: string): Section | undefined;
    /**
     * Form context for the current page
     */
    getFormContext(request: FormContextRequest, state: FormSubmissionState, errors?: FormSubmissionError[]): FormContext;
    private initialiseContext;
    private assignEvaluationState;
    private assignRelevantState;
    private pageStateIsInvalid;
    private fieldStateIsInvalid;
    private assignPaths;
    getComponentById(componentId: string): ComponentDef | undefined;
    getListById(listId: string): List | undefined;
    /**
     * Returns a condition by its ID. O(n) lookup time.
     * @param conditionId
     * @returns
     */
    getConditionById(conditionId: string): ConditionWrapperV2 | undefined;
    /**
     * Checks that only one payment field exists (if any payments fields exist)
     */
    moreThanOnePaymentQuestion(): boolean;
}
