/** * 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 { FlowSurfaceWriteTarget } from './types'; export type FlowSurfaceTemplateRow = { uid: string; name?: string; description?: string; targetUid?: string; useModel?: string; type?: string; dataSourceKey?: string; collectionName?: string; associationName?: string; filterByTk?: string; sourceId?: string; usageCount?: number; available?: boolean; disabledReason?: string; }; export type FlowSurfaceTemplateListValues = { search?: string; filter?: Record; sort?: string | string[]; page?: number; pageSize?: number; target?: FlowSurfaceWriteTarget; type?: 'block' | 'popup'; usage?: 'block' | 'fields'; actionType?: string; actionScope?: 'block' | 'record'; }; export type FlowSurfaceTemplateListPopupActionContext = { hasCurrentRecord?: boolean; currentRecordFilterTargetKey?: string; }; export declare const FLOW_TEMPLATE_SUPPORTED_TYPES: Set; export declare const FLOW_TEMPLATE_SUPPORTED_MODES: Set; export declare const FLOW_TEMPLATE_BLOCK_USAGES: Set; export declare const FLOW_TEMPLATE_UNSUPPORTED_BLOCK_TEMPLATE_SOURCE_USES: Set; export declare const POPUP_HOST_STEP_PARAM_PATHS: readonly [readonly ["popupSettings", "openView"], readonly ["selectExitRecordSettings", "openView"], readonly ["openSelectRecordView", "openView"], readonly ["openAddRecordView", "openView"]]; export declare function normalizeTemplateUidValue(actionName: string, values: Record): string; export declare function normalizeRequiredTemplateString(actionName: string, value: any, field: string): string; export declare function normalizeTemplateSaveMode(actionName: string, value: any): "duplicate" | "convert"; export declare function buildTemplateListFilter(existingFilter: any, search: any, requestedType?: 'block' | 'popup'): any; export declare function findFlowTemplateOpenViewStep(node: any): { flowKey: "popupSettings" | "selectExitRecordSettings" | "openSelectRecordView" | "openAddRecordView"; stepKey: "openView"; openView: any; }; export declare function buildFlowTemplateReferenceBlockStepParams(template: FlowSurfaceTemplateRow, templateTargetUid: string, resourceInit?: Record): _.Dictionary; export declare function collectFlowTemplateUsageMapFromModelOptions(modelUid: string, options: any, carry?: Map>): Map>; export declare function collectFlowTemplateModelUids(node: any, carry?: Set): Set; export declare function replaceFlowModelTreeUids(node: any, uidMap: Record): any; export declare function stripTemplateInternalOpenViewFields(openView: any): any; export declare function stripTemplateInternalReferenceSettings(node: any): void; export declare function findFieldsTemplateReferenceGrid(node: any): import("./types").FlowSurfaceNodeSpec;