import { Locator, Page } from "@playwright/test";
import { JSONSchema7 } from "json-schema";
import { MapPageObject } from "@luomus/laji-map/test-export/test-utils";
export declare const emptyForm: (page: Page, params?: string) => Promise<import("playwright-core").Response | null>;
export declare const navigateToForm: (page: Page, formID: string, params?: string) => Promise<import("playwright-core").Response | null>;
export declare const lajiFormLocator: (path: string) => string;
export declare const lajiFormLocate: (page: Page, str: string) => Locator;
export declare const getFocusedElement: (page: Page) => Locator;
export declare const getFocusedId: (page: Page) => Promise<string | null>;
export interface Mock {
    resolve: (response?: any, raw?: boolean) => Promise<void>;
    reject: (response?: any, raw?: boolean) => Promise<void>;
    remove: () => Promise<void>;
}
export interface DateWidgetPO {
    $container: Locator;
    $input: Locator;
    buttons: {
        $today: Locator;
        $yesterday: Locator;
        $same: Locator;
        $date: Locator;
        $time: Locator;
        $plusSixMonths: Locator;
        $plusYear: Locator;
    };
    calendar: {
        $today: Locator;
    };
    clock: {
        "$00:00": Locator;
        "$01:00": Locator;
    };
}
export interface BooleanWidgetPO {
    $container: Locator;
    $true: Locator;
    $false: Locator;
    $undefined: Locator;
    $active: Locator;
    $nonactive: Locator;
}
export type EnumWidgetPOI = ReturnType<typeof getEnumWidgetForContainer>;
declare function getEnumWidgetForContainer($container: Locator): {
    $container: Locator;
    openEnums: () => Promise<void>;
    $enumContainer: Locator;
    $$enums: Locator;
    $input: Locator;
};
interface DemoPageProps {
    schema?: JSONSchema7;
    uiSchema?: any;
    formData?: any;
    uiSchemaContext?: any;
    isAdmin?: boolean;
    isEdit?: boolean;
    id?: string;
    localFormData?: boolean | string;
}
export declare class Form {
    protected page: Page;
    protected $locator: Locator;
    constructor(page: Page, $locator?: Locator);
    $form: Locator;
    $locate(path: string): Locator;
    $locateButton(path: string, selector: string, locateFromBody?: boolean): Locator;
    $locateAddition(path: string, selector: string, locateFromBody?: boolean): Locator;
    getMockStr: (path: string, query: any) => string;
    setMockResponse(path: string, query?: any): Promise<Mock>;
    createMockResponseQueue(path: string, query?: any): Promise<{
        create: () => Promise<{
            resolve: (response: any, raw?: boolean) => Promise<unknown>;
            reject: (response: any, raw?: boolean) => Promise<unknown>;
        }>;
        remove: () => Promise<unknown>;
    }>;
    createValidatorPO: (type: "error" | "warning") => {
        $$all: Locator;
        $panel: Locator;
    };
    errors: {
        $$all: Locator;
        $panel: Locator;
    };
    warnings: {
        $$all: Locator;
        $panel: Locator;
    };
    failedJobs: {
        $container: Locator;
        $$errors: Locator;
    };
    $runningJobs: Locator;
    $acknowledgeWarnings: Locator;
    $blocker: Locator;
    $mapFieldFullscreenMap: Locator;
    getBooleanWidget(str: string): {
        $container: Locator;
        $true: Locator;
        $false: Locator;
        $undefined: Locator;
        $active: Locator;
        $nonactive: Locator;
    };
    $getInputWidget(str: string): Locator;
    $getTextareaWidget(str: string): Locator;
    $getEnumWidget(str: string): {
        $container: Locator;
        openEnums: () => Promise<void>;
        $enumContainer: Locator;
        $$enums: Locator;
        $input: Locator;
    };
    getDateWidget(str: string): {
        $container: Locator;
        $input: Locator;
        buttons: {
            $today: Locator;
            $yesterday: Locator;
            $same: Locator;
            $date: Locator;
            $time: Locator;
            $plusSixMonths: Locator;
            $plusYear: Locator;
        };
        calendar: {
            $today: Locator;
        };
        clock: {
            "$00:00": Locator;
            "$01:00": Locator;
        };
    };
    $getFieldErrors(str: string): Locator;
    getImageArrayField: (lajiFormLocator: string) => {
        $container: Locator;
        $imgContainers: Locator;
        $$imgs: Locator;
        $$imgLoading: Locator;
        $$imgRemoves: Locator;
        $imgRemoveConfirmButton: (id: string) => Locator;
        $dropzone: Locator;
        $modal: Locator;
        $addModal: Locator;
        $modalClose: Locator;
        $addModalCancel: Locator;
    };
    getAutosuggestWidget: (lajiFormLocator: string) => {
        $input: Locator;
        $suggestionsContainer: Locator;
        $suggestions: Locator;
        $loadingSpinner: Locator;
    };
    getTaxonAutosuggestWidget: (lajiFormLocator: string) => {
        $powerUserButton: Locator;
        $suggestedGlyph: Locator;
        $nonsuggestedGlyph: Locator;
        $input: Locator;
        $suggestionsContainer: Locator;
        $suggestions: Locator;
        $loadingSpinner: Locator;
    };
    getPersonAutosuggestWidget: (lajiFormLocator: string) => {
        $suggestedGlyph: Locator;
        $input: Locator;
        $suggestionsContainer: Locator;
        $suggestions: Locator;
        $loadingSpinner: Locator;
    };
    getScopeField: (lajiFormLocator: string) => {
        $button: Locator;
        $$listItems: Locator;
        modal: {
            $container: Locator;
            $close: Locator;
            $$loadingGroups: Locator;
            $$groupTitles: Locator;
            $$listItems: Locator;
        };
    };
    getLocationChooser: (lajiFormLocator: string) => {
        $button: Locator;
        modal: {
            $container: Locator;
            map: MapPageObject;
        };
        peeker: {
            $popover: Locator;
            $map: Locator;
            $$markers: Locator;
        };
    };
    getUnitListShorthandArrayField: (lajiFormLocator: string) => {
        $button: Locator;
        modal: {
            $input: Locator;
            $addButton: Locator;
        };
    };
    $getShortHandWidget: (lajiFormLocator: string) => Locator;
    getGeocoder: (lajiFormLocator?: string) => {
        $btn: Locator;
        $spinner: Locator;
    };
    getNamedPlaceChooser: () => {
        select: {
            $container: Locator;
            openEnums: () => Promise<void>;
            $enumContainer: Locator;
            $$enums: Locator;
            $input: Locator;
        };
        mapPopup: {
            $container: Locator;
            $useBtn: Locator;
        };
        $alert: Locator;
        $close: Locator;
    };
    /** Draws a marker to the center of a laji-map rendered to the given locator. The locator defaults to "gatherings" */
    putMarkerToMap(lajiFormLocator?: string): Promise<void>;
}
export type ImageArrayFieldPOI = ReturnType<Form["getImageArrayField"]>;
export type TaxonAutosuggestWidgetPOI = ReturnType<Form["getTaxonAutosuggestWidget"]>;
export type UnitListShorthandArrayFieldPOI = ReturnType<Form["getUnitListShorthandArrayField"]>;
export type NamedPlaceChooserPO = ReturnType<Form["getNamedPlaceChooser"]>;
export declare class DemoPageForm extends Form {
    private props?;
    constructor(page: Page, props?: DemoPageProps | undefined);
    initialize(beforeInit?: (form: Form) => Promise<void>): Promise<void>;
    e(path: string): Promise<any>;
    setState(state: any): Promise<any>;
    getState(): Promise<{
        formData: any;
    }>;
    getProps(): Promise<{
        schema: any;
        uiSchema: any;
    }>;
    submit(): Promise<void>;
    startSubmit(): void;
    submitOnlySchemaValidations(): Promise<any>;
    getSubmittedData(): Promise<any>;
    getChangedData(): Promise<any>;
    getPropsData(): Promise<any>;
    mockImageUpload: (lajiFormLocator: string) => Promise<{
        resolve: () => Promise<void>;
        remove: () => Promise<void>;
    }>;
}
export declare function createForm(page: Page, props?: DemoPageProps, beforeInit?: (form: Form) => Promise<void>): Promise<DemoPageForm>;
export declare const mockImageMetadata: {
    id: string;
    capturerVerbatim: string[];
    intellectualOwner: string;
    intellectualRights: string;
    fullURL: string;
    largeURL: string;
    squareThumbnailURL: string;
    thumbnailURL: string;
    originalURL: string;
    uploadedBy: string;
    "@context": string;
};
export declare const filterUUIDs: (any: any) => any;
export declare const maybeJSONPointerToLocator: (pointer: string) => string;
/** Fills value into given input and presses tab to unfocus it. Useful for inputs with debounce */
export declare const updateValue: ($input: Locator, value: string) => Promise<void>;
export declare const getRemoveUnit: (page: Page) => (gatheringIdx: number, unitIdx: number) => Promise<void>;
export {};
