/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */
import _ from 'lodash';
import type { FlowSurfaceApplyBlueprintPopupDefaultsMetadata } from './blueprint/defaults';
export declare const OPEN_VIEW_MODE_ALIASES: {
    readonly modal: "dialog";
    readonly page: "embed";
};
export declare const HIDDEN_POPUP_TEMPLATE_TARGET_KEYS: readonly ["template", "tryTemplate", "popupTemplateUid", "popupTemplateContext", "popupTemplateMode", "popupTemplateHasFilterByTk", "popupTemplateHasSourceId", "associationName", "filterByTk", "sourceId"];
export declare const HIDDEN_POPUP_DISPLAY_KEYS: readonly ["mode", "size", "pageModelClass", "title"];
export declare function normalizeHiddenPopupScalarSettings(popupSettings: Record<string, any>): void;
export declare function attachHiddenPopupDefaults(popup: any, defaultsMetadata: FlowSurfaceApplyBlueprintPopupDefaultsMetadata | undefined): any;
export declare function normalizeBlockHiddenPopupSettings(settings: Record<string, any>, blockContext: string, keys: readonly string[], defaultsMetadata?: FlowSurfaceApplyBlueprintPopupDefaultsMetadata, assertPopupObject?: (message: string) => void): Record<string, any>;
export declare function normalizeHiddenPopupSettings(popupSettings?: Record<string, any>, options?: {
    collectionOnly?: boolean;
    invalidUids?: any[];
    preserveApplyBlueprintDefaults?: boolean;
}): Record<string, any>;
export declare function stripHiddenPopupTargetSettings(popupSettings?: Record<string, any>, options?: {
    disableTemplateAutoBind?: boolean;
}): Record<string, any>;
export declare function hiddenPopupOpenViewResourceDiffers(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): boolean;
export declare function buildHiddenPopupOpenView(input: {
    actionUid: string;
    resourceInit?: Record<string, any>;
    popupSettings?: Record<string, any>;
    normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>;
}): _.Dictionary<any>;
export declare function hasExplicitHiddenPopupTargetSettings(popupSettings?: Record<string, any>, defaultUid?: string): boolean;
export declare function hasExplicitHiddenPopupResourceTargetSettings(popupSettings?: Record<string, any>, defaultUid?: string): boolean;
export declare function shouldPreserveExplicitHiddenPopupTemplateOpenView(openView: any, popupSettings?: Record<string, any>): boolean;
export declare function shouldPreserveHiddenPopupOpenView(openView: any, expectedHostUid?: string, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null): boolean;
export declare function getHiddenPopupDisplaySettings(popupSettings?: Record<string, any>, normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>): _.Omit<Record<string, any>, "dataSourceKey" | "collectionName" | "uid" | "filterByTk" | "sourceId" | "template" | "associationName" | "tryTemplate" | "popupTemplateUid" | "popupTemplateMode" | "popupTemplateContext" | "popupTemplateHasFilterByTk" | "popupTemplateHasSourceId">;
export declare function getHiddenPopupOpenViewDisplayFallback(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): _.Dictionary<any>;
export declare function mergeHiddenPopupDisplaySettings(input: {
    openView: Record<string, any>;
    popupSettings?: Record<string, any>;
    fallbackOpenView?: Record<string, any> | null;
    normalizePopupSettings?: (popupSettings?: Record<string, any>) => Record<string, any>;
    preserveOpenViewDisplay?: boolean;
    preserveOpenViewDisplayFallback?: Record<string, any> | null;
}): _.Dictionary<any>;
export declare function getHiddenPopupOpenViewDisplayOverrides(openView?: Record<string, any> | null, fallbackOpenView?: Record<string, any> | null): _.Dictionary<any>;
export declare function mergeHiddenPopupOpenViewDisplayOverrides(input: {
    openView: Record<string, any>;
    displayOpenView?: Record<string, any> | null;
    fallbackOpenView?: Record<string, any> | null;
    displayFallbackOpenView?: Record<string, any> | null;
}): _.Dictionary<any>;
export declare function resolveHiddenPopupOpenViewTransition(input: {
    existing?: any;
    expectedUid: string;
    expectedUse: string;
    popupSettings?: Record<string, any>;
    seedOpenView: Record<string, any>;
    candidateOpenView?: Record<string, any>;
    currentOpenView?: Record<string, any> | null;
    normalizedCurrentOpenView?: Record<string, any> | null;
    preservedOpenView?: Record<string, any> | null;
    displayFallbackOpenView?: Record<string, any> | null;
    resourceMismatchDisplayFallbackOpenView?: Record<string, any> | null;
    allowResourceMismatchRebuild?: boolean;
    mergeDisplaySettings: (openView: Record<string, any>, popupSettings?: Record<string, any>, fallbackOpenView?: Record<string, any> | null, options?: {
        preserveOpenViewDisplay?: boolean;
        preserveOpenViewDisplayFallback?: Record<string, any> | null;
    }) => Record<string, any>;
}): {
    openView: Record<string, any>;
    shouldRebuildForResourceMismatch: boolean;
    shouldPreservePersistedOpenView: boolean;
    currentOpenView: Record<string, any>;
    normalizedCurrentOpenView: Record<string, any>;
};
export declare function resolveHiddenPopupOpenViewTransitionWithCandidate(input: Parameters<typeof resolveHiddenPopupOpenViewTransition>[0] & {
    resolveCandidateOpenView: () => Promise<Record<string, any>> | Record<string, any>;
}): Promise<{
    openView: Record<string, any>;
    shouldRebuildForResourceMismatch: boolean;
    shouldPreservePersistedOpenView: boolean;
    currentOpenView: Record<string, any>;
    normalizedCurrentOpenView: Record<string, any>;
}>;
export declare function buildHiddenPopupResourceMismatchDisplayFallbackOpenView(input: {
    normalizedCurrentOpenView?: Record<string, any> | null;
    resourceInit?: Record<string, any>;
    popupSettings?: Record<string, any>;
    stripPopupTargetSettingsForResourceChange: (popupSettings?: Record<string, any>) => Record<string, any>;
    buildOpenView: (input: {
        resourceInit?: Record<string, any>;
        popupSettings?: Record<string, any>;
    }) => Record<string, any>;
}): Record<string, any>;
export declare function buildHiddenPopupActionStepParams(existingStepParams: any, openView: Record<string, any>): any;
export declare function buildPersistedHiddenPopupSettingsFromOpenView(input: {
    openView?: Record<string, any> | null;
    popupSettings?: Record<string, any>;
    expectedHostUid?: string;
    normalizePopupSettings: (popupSettings?: Record<string, any>) => Record<string, any>;
}): Record<string, any>;
export declare function unsetHiddenPopupPayloadPathAndPruneEmptyParents(payload: Record<string, any>, path: Array<string>): void;
export declare function buildImplicitHiddenPopupDefaultContent(popupSettings?: Record<string, any>): {
    tryTemplate: boolean;
    __flowSurfaceAutoSaveDefaultPopupTemplate: boolean;
};
export declare function hiddenPopupHostHasLocalContent(actionNode: any): boolean;
export declare function shouldAutoBindHiddenPopupTemplate(openView: Record<string, any>, popupSettings?: Record<string, any>, expectedHostUid?: string, options?: {
    hostHasLocalContent?: boolean;
}): boolean;
export declare function resolveHiddenPopupHostOpenView(node: any): any;
export declare function resolveHiddenPopupSettingsOverride<TActionKey extends string>(overrides: Partial<Record<TActionKey, Record<string, any> | undefined>> | undefined, actionKey: TActionKey): Partial<Record<TActionKey, Record<string, any>>>[TActionKey];
