/**
 * 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 { FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY, type FlowSurfaceApplyBlueprintPopupDefaultsMetadata } from './blueprint/defaults';
import type { FlowSurfaceNodeSpec, FlowSurfaceNodeSubModel } from './types';
import { type FlowSurfacePublicRelationFieldType } from './field-type-resolver';
export declare function buildDefinedPayload(payload: Record<string, any>): _.Dictionary<any>;
export declare function normalizeFlowSurfaceComposeKey(key: any, context: string): string;
export declare function assertFlowSurfaceComposeUniqueKeys(items: Array<{
    key?: string;
}>, context: string): void;
export declare function normalizeChartCardSettings(cardSettings: any): any;
export declare function normalizeBlockTitleDescriptionValue(value: any): any;
export declare function normalizeBlockTitleDescription(titleDescription: any): any;
export declare function buildBlockTitleDescriptionFromSemanticChanges(changes: Record<string, any>): {
    titleDescription: _.Dictionary<any>;
};
export declare function buildBlockCardSettingsFromSemanticChanges(changes: Record<string, any>): {};
export declare function buildChartCardSettingsFromSemanticChanges(currentCardSettings: any, changes: Record<string, any>): any;
export declare function buildPopupTabTree(options: {
    tabUid?: string;
    gridUid?: string;
    title?: string;
    icon?: string;
    documentTitle?: string;
    flowRegistry?: Record<string, any>;
}): {
    subModels: {
        grid: {
            uid: string;
            use: string;
        };
    };
    flowRegistry?: Record<string, any>;
    uid: string;
    use: string;
    props: _.Dictionary<any>;
    stepParams: {
        pageTabSettings: {
            tab: _.Dictionary<any>;
        };
    };
};
export declare function getSingleNodeSubModel(subModel?: FlowSurfaceNodeSubModel | null): FlowSurfaceNodeSpec | undefined;
export declare function getNodeSubModelList(subModel?: FlowSurfaceNodeSubModel | null): FlowSurfaceNodeSpec[];
export declare function flattenModel(node: any, carry?: Record<string, any>): Record<string, any>;
export declare function buildDefaultFieldState(containerUse: string, fieldUse: string, field: any): {
    wrapperProps: {};
    fieldProps: Record<string, any>;
};
export declare function hasOwnDefined(input: Record<string, any>, key: string): boolean;
export declare function hasMeaningfulChartSemanticPatch(input: Record<string, any>, key: string): boolean;
export declare function hasDefinedValue(input: Record<string, any>, keys: string[]): boolean;
export declare function ensureNoRawSimpleChangeKeys(changes: Record<string, any>): void;
export declare function ensureNoRawDirectAddKeys(actionName: string, values: Record<string, any>, rawKeys: string[]): void;
export declare function ensureNoDirectActionScopeKey(actionName: 'addAction' | 'addRecordAction', values: Record<string, any>): void;
export type NormalizedComposeFieldSpec = {
    index: number;
    key: string;
    fieldPath?: string;
    associationPathName?: string;
    renderer?: string;
    type?: string;
    fieldType?: FlowSurfacePublicRelationFieldType;
    fields?: string[];
    titleField?: string;
    openMode?: string;
    popupSize?: string;
    pageSize?: number;
    showIndex?: boolean;
    target?: string;
    defaultTargetUid?: string;
    targetBlockUid?: string;
    settings: Record<string, any>;
    popup?: Record<string, any>;
    __autoPopupForRelationField?: boolean;
    [FLOW_SURFACE_APPLY_BLUEPRINT_POPUP_DEFAULTS_KEY]?: FlowSurfaceApplyBlueprintPopupDefaultsMetadata;
};
export declare function normalizeComposeFieldSpec(input: any, index: number): NormalizedComposeFieldSpec;
export declare function resolveRequestedFieldComponent(values: Record<string, any> | undefined): any;
export declare function resolveRequestedFieldUse(values: Record<string, any> | undefined): any;
export declare function resolveRequestedFieldUseAlias(values: Record<string, any> | undefined): string;
export declare function normalizeComposeActionSpec(input: any, index: number): {
    popup?: any;
    key: string;
    type: string;
    settings: any;
};
export declare function normalizeSimpleResourceInit(input: any): _.Dictionary<any>;
export declare function isMissingRequiredResourceInitValue(value: any): boolean;
export declare function joinRequiredFieldPaths(paths: string[]): string;
export declare function normalizeSimpleLayoutValue(layout: any): any;
export declare function normalizeGridCardColumns(columns: any): _.Dictionary<any>;
export declare function normalizeSimpleConfirm(confirm: any): _.Dictionary<any>;
export declare function assertSupportedSimpleChanges(context: string, changes: Record<string, any>, allowedKeys: string[]): void;
export declare function hasLegacyLocatorFields(input: any, options?: {
    allowRootUid?: boolean;
}): boolean;
export declare function rethrowInlineConfigurationError(error: any, prefix: string): never;
export declare function toFlowSurfaceBatchItemError(error: any): {
    message: string;
    errorCount: number;
    details: {
        requiredBlockPolicy?: {
            requiredBlockTypes: string[];
            fixStrategy: string;
            doNotReplaceOrDrop: boolean;
        };
        errorCount: number;
        mustFixAllErrorsBeforeRetry: boolean;
        retryPolicy: string;
        sameWriteRetryRequired: boolean;
        agentInstruction: string;
    };
    errors: import("./errors").FlowSurfaceErrorItem[];
    code: string;
    status: number;
    type: import("./errors").FlowSurfaceErrorType;
} | {
    code: string;
    message: string;
    status: number;
    type: import("./errors").FlowSurfaceErrorType;
};
export declare function splitComposeFieldChanges(changes: Record<string, any>, wrapperUse?: string): {
    wrapperChanges: _.Dictionary<any>;
    fieldChanges: _.Dictionary<any>;
};
export declare function getCatalogRecordActionContainerUse(use?: string): "DetailsBlockModel" | "ListItemModel" | "GridCardItemModel" | "TableActionsColumnModel" | "CommentItemModel";
export declare function normalizeRowSpans(spans?: Array<number | undefined>): number[];
export declare function normalizePublicBlockHeightMode(input: any): string;
export declare function normalizeStoredChartCardHeightMode(input: any): string;
export declare function normalizeChartCardHeightModeForWrite(input: any): string;
export declare function isFieldNodeUse(use?: string): boolean;
export declare function getFieldBindingDefaultProps(containerUse: string, fieldUse: string, field: any): Record<string, any>;
